From 28d525db7480269c0760cc1ec1ca4c18cf253e12 Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Sun, 25 Feb 2024 16:44:46 +0100 Subject: [PATCH 1/5] Handle type refinement properly --- spectec/spec/wasm-2.0/1-syntax.watsup | 14 +- spectec/spec/wasm-2.0/8-reduction.watsup | 3 +- spectec/spec/wasm-3.0/1-syntax.watsup | 23 +- spectec/spec/wasm-3.0/2-syntax-aux.watsup | 15 +- spectec/spec/wasm-3.0/6-typing.watsup | 2 +- spectec/spec/wasm-3.0/8-reduction.watsup | 14 +- spectec/src/backend-latex/render.ml | 30 +- spectec/src/backend-prose/render.ml | 4 +- spectec/src/el/ast.ml | 4 +- spectec/src/el/convert.ml | 7 +- spectec/src/el/eq.ml | 4 + spectec/src/el/free.ml | 3 + spectec/src/el/free.mli | 2 + spectec/src/el/iter.ml | 2 + spectec/src/el/print.ml | 5 + spectec/src/el/print.mli | 2 + spectec/src/el/subst.ml | 3 + spectec/src/exe-watsup/main.ml | 3 +- spectec/src/frontend/dim.ml | 6 + spectec/src/frontend/elab.ml | 353 +++++++++++++++------- spectec/src/frontend/eval.ml | 44 ++- spectec/src/frontend/eval.mli | 1 + spectec/src/frontend/parser.mly | 15 +- spectec/src/il/ast.ml | 10 +- spectec/src/il/eq.ml | 8 +- spectec/src/il/eval.ml | 56 +++- spectec/src/il/free.ml | 7 +- spectec/src/il/print.ml | 14 +- spectec/src/il/subst.ml | 7 +- spectec/src/il/valid.ml | 31 +- spectec/src/il2al/free.ml | 2 +- spectec/src/il2al/il2il.ml | 4 + spectec/src/il2al/translate.ml | 7 + spectec/src/middlend/sideconditions.ml | 1 + spectec/src/middlend/sub.ml | 5 +- spectec/src/middlend/totalize.ml | 5 +- spectec/src/middlend/unthe.ml | 3 +- spectec/src/middlend/wild.ml | 1 + spectec/src/util/debug_log.ml | 4 + 39 files changed, 520 insertions(+), 204 deletions(-) diff --git a/spectec/spec/wasm-2.0/1-syntax.watsup b/spectec/spec/wasm-2.0/1-syntax.watsup index 8e9e2a2732..2c56d89c51 100644 --- a/spectec/spec/wasm-2.0/1-syntax.watsup +++ b/spectec/spec/wasm-2.0/1-syntax.watsup @@ -268,13 +268,13 @@ syntax vbinop_(shape) syntax vbinop_(imm X N) = | ADD | SUB - | ADD_SAT sx -- if $lsize(imm) <= 16 - | SUB_SAT sx -- if $lsize(imm) <= 16 - | MUL -- if $lsize(imm) >= 16 - | AVGR_U -- if $lsize(imm) <= 16 - | Q15MULR_SAT_S -- if $lsize(imm) = 16 - | MIN sx -- if $lsize(imm) <= 32 - | MAX sx -- if $lsize(imm) <= 32 + | ADD_SAT sx hint(show ADD_SAT#_#sx) -- if $lsize(imm) <= 16 + | SUB_SAT sx hint(show SUB_SAT#_#sx) -- if $lsize(imm) <= 16 + | MUL -- if $lsize(imm) >= 16 + | AVGR_U -- if $lsize(imm) <= 16 + | Q15MULR_SAT_S -- if $lsize(imm) = 16 + | MIN sx hint(show MIN#_#sx) -- if $lsize(imm) <= 32 + | MAX sx hint(show MAX#_#sx) -- if $lsize(imm) <= 32 syntax vbinop_(fnn X N) = | ADD | SUB | MUL | DIV | MIN | MAX | PMIN | PMAX syntax vtestop_(shape) diff --git a/spectec/spec/wasm-2.0/8-reduction.watsup b/spectec/spec/wasm-2.0/8-reduction.watsup index b22cf945cd..a563b312c5 100644 --- a/spectec/spec/wasm-2.0/8-reduction.watsup +++ b/spectec/spec/wasm-2.0/8-reduction.watsup @@ -496,8 +496,7 @@ rule Step_read/vload-splat-val: -- if $ibytes(N, j) = $mem(z, 0).DATA[i + mo.OFFSET : N/8] -- if N = $lsize(imm) ;; TODO: relate implicitly -- if M = $(128/N) - -- if c = $invlanes_(imm X M, j*) - + -- if c = $invlanes_(imm X M, j^M) rule Step_read/vload-zero-oob: z; (CONST I32 i) (VLOAD (ZERO N) mo) ~> TRAP diff --git a/spectec/spec/wasm-3.0/1-syntax.watsup b/spectec/spec/wasm-3.0/1-syntax.watsup index b29b327b6d..6a481e91c0 100644 --- a/spectec/spec/wasm-3.0/1-syntax.watsup +++ b/spectec/spec/wasm-3.0/1-syntax.watsup @@ -252,14 +252,15 @@ var zt : storagetype ;; Constants -def $size(valtype) : nat hint(partial) hint(show |%|) +def $size(numtype) : nat hint(show |%|) +def $vsize(vectype) : nat hint(show |%|) def $psize(packtype) : nat hint(show |%|) def $lsize(lanetype) : nat hint(show |%|) def $zsize(storagetype) : nat hint(show |%|) def $lanetype(shape) : lanetype -def $sizenn(valtype) : nat hint(show n) -def $sizenn(t) = $size(t) +def $sizenn(numtype) : nat hint(show n) +def $sizenn(nt) = $size(nt) syntax num_(numtype) syntax num_(inn) = iN($sizenn(inn)) @@ -272,7 +273,7 @@ syntax lane_(numtype) = num_(numtype) syntax lane_(packtype) = pack_(packtype) syntax lane_(imm) = iN($lsize(imm)) ;; HACK -syntax vec_(vnn) = vN($size(vnn)) +syntax vec_(vnn) = vN($vsize(vnn)) syntax zval_(storagetype) syntax zval_(numtype) = num_(numtype) @@ -334,13 +335,13 @@ syntax vbinop_(shape) syntax vbinop_(imm X N) = | ADD | SUB - | ADD_SAT sx -- if $lsize(imm) <= 16 - | SUB_SAT sx -- if $lsize(imm) <= 16 - | MUL -- if $lsize(imm) >= 16 - | AVGR_U -- if $lsize(imm) <= 16 - | Q15MULR_SAT_S -- if $lsize(imm) = 16 - | MIN sx -- if $lsize(imm) <= 32 - | MAX sx -- if $lsize(imm) <= 32 + | ADD_SAT sx hint(show ADD_SAT#_#sx) -- if $lsize(imm) <= 16 + | SUB_SAT sx hint(show SUB_SAT#_#sx) -- if $lsize(imm) <= 16 + | MUL -- if $lsize(imm) >= 16 + | AVGR_U -- if $lsize(imm) <= 16 + | Q15MULR_SAT_S -- if $lsize(imm) = 16 + | MIN sx hint(show MIN#_#sx) -- if $lsize(imm) <= 32 + | MAX sx hint(show MAX#_#sx) -- if $lsize(imm) <= 32 syntax vbinop_(fnn X N) = | ADD | SUB | MUL | DIV | MIN | MAX | PMIN | PMAX syntax vtestop_(shape) diff --git a/spectec/spec/wasm-3.0/2-syntax-aux.watsup b/spectec/spec/wasm-3.0/2-syntax-aux.watsup index eb473ff7f6..8bd2cb3196 100644 --- a/spectec/spec/wasm-3.0/2-syntax-aux.watsup +++ b/spectec/spec/wasm-3.0/2-syntax-aux.watsup @@ -45,16 +45,18 @@ def $free_dataidx_funcs(func func'*) = $free_dataidx_func(func) $free_dataidx_fu ;; def |I n| = |F n| = |V n| = n ;; ???? -;;def $size(valtype) : nat hint(partial) hint(show |%|) +;;def $size(numtype) : nat hint(show |%|) +;;def $vsize(vectype) : nat hint(show |%|) ;;def $psize(packtype) : nat hint(show |%|) ;;def $lsize(lanetype) : nat hint(show |%|) -;;def $zsize(storagetype) : nat hint(show |%|) +;;def $zsize(storagetype) : nat hint(show |%|) hint(partial) def $size(I32) = 32 def $size(I64) = 64 def $size(F32) = 32 def $size(F64) = 64 -def $size(V128) = 128 + +def $vsize(V128) = 128 def $psize(I8) = 8 def $psize(I16) = 16 @@ -62,7 +64,8 @@ def $psize(I16) = 16 def $lsize(numtype) = $size(numtype) def $lsize(packtype) = $psize(packtype) -def $zsize(valtype) = $size(valtype) +def $zsize(numtype) = $size(numtype) +def $zsize(vectype) = $vsize(vectype) def $zsize(packtype) = $psize(packtype) @@ -196,8 +199,8 @@ def $subst_externtype((MEM mt), xx*, ht*) = MEM $subst_memtype(mt, xx*, ht*) def $subst_all_reftype(reftype, heaptype*) : reftype hint(show %#`[:=%]) def $subst_all_deftype(deftype, heaptype*) : deftype hint(show %#`[:=%]) -def $subst_all_reftype(rt, ht^n) = $subst_reftype(rt, $idx(x)^(x eps -- if C.MEM[x] = mt - -- if $(2^(n_A) <= $size(V128)/8) + -- if $(2^(n_A) <= $vsize(V128)/8) rule Instr_ok/vstore_lane: C |- VSTORE_LANE n x {ALIGN n_A, OFFSET n_O} laneidx : I32 V128 -> eps diff --git a/spectec/spec/wasm-3.0/8-reduction.watsup b/spectec/spec/wasm-3.0/8-reduction.watsup index 8e0ba53efa..3cf46fc3ca 100644 --- a/spectec/spec/wasm-3.0/8-reduction.watsup +++ b/spectec/spec/wasm-3.0/8-reduction.watsup @@ -572,7 +572,7 @@ rule Step_pure/vvternop: rule Step_pure/vvtestop: (VCONST V128 c_1) (VVTESTOP V128 ANY_TRUE) ~> (CONST I32 c) - -- if c = $ine($size(V128), c_1, 0) + -- if c = $ine($vsize(V128), c_1, 0) rule Step_pure/vswizzle: @@ -825,11 +825,11 @@ rule Step_read/load-pack-val: rule Step_read/vload-oob: z; (CONST I32 i) (VLOAD x mo) ~> TRAP - -- if $(i + mo.OFFSET + $size(V128)/8 > |$mem(z, x).DATA|) + -- if $(i + mo.OFFSET + $vsize(V128)/8 > |$mem(z, x).DATA|) rule Step_read/vload-val: z; (CONST I32 i) (VLOAD x mo) ~> (VCONST V128 c) - -- if $vbytes(V128, c) = $mem(z, x).DATA[i + mo.OFFSET : $size(V128)/8] + -- if $vbytes(V128, c) = $mem(z, x).DATA[i + mo.OFFSET : $vsize(V128)/8] rule Step_read/vload-shape-oob: @@ -852,7 +852,7 @@ rule Step_read/vload-splat-val: -- if $ibytes(N, j) = $mem(z, x).DATA[i + mo.OFFSET : N/8] -- if N = $lsize(imm) ;; TODO: relate implicitly -- if M = $(128/N) - -- if c = $invlanes_(imm X M, j*) + -- if c = $invlanes_(imm X M, j^M) rule Step_read/vload-zero-oob: @@ -873,7 +873,7 @@ rule Step_read/vload_lane-val: z; (CONST I32 i) (VCONST vt c_1) (VLOAD_LANE N x mo j) ~> (VCONST vt c) -- if $ibytes(N, k) = $mem(z, x).DATA[i + mo.OFFSET : N/8] -- if N = $lsize(imm) ;; TODO: relate implicitly - -- if M = $($size(vt)/N) + -- if M = $($vsize(vt)/N) -- if c = $invlanes_(imm X M, $lanes_(imm X M, c_1)[[j] = k]) @@ -895,10 +895,10 @@ rule Step/store-pack-val: rule Step/vstore-oob: z; (CONST I32 i) (VCONST V128 c) (VSTORE x mo) ~> z; TRAP - -- if $(i + mo.OFFSET + $size(V128)/8) > |$mem(z, x).DATA| + -- if $(i + mo.OFFSET + $vsize(V128)/8) > |$mem(z, x).DATA| rule Step/vstore-val: - z; (CONST I32 i) (VCONST V128 c) (VSTORE x mo) ~> $with_mem(z, x, $(i + mo.OFFSET), $($size(V128)/8), b*); eps + z; (CONST I32 i) (VCONST V128 c) (VSTORE x mo) ~> $with_mem(z, x, $(i + mo.OFFSET), $($vsize(V128)/8), b*); eps -- if b* = $vbytes(V128, c) diff --git a/spectec/src/backend-latex/render.ml b/spectec/src/backend-latex/render.ml index b00d008091..3a2e5c5561 100644 --- a/spectec/src/backend-latex/render.ml +++ b/spectec/src/backend-latex/render.ml @@ -25,6 +25,7 @@ type env = show_var : exp list Map.t ref; show_rel : exp list Map.t ref; show_def : exp list Map.t ref; + show_con : exp list Map.t ref; show_case : exp list Map.t ref; show_field : exp list Map.t ref; desc_typ : exp list Map.t ref; @@ -42,6 +43,7 @@ let new_env config = show_var = ref Map.empty; show_rel = ref Map.empty; show_def = ref Map.empty; + show_con = ref Map.empty; show_case = ref Map.empty; show_field = ref Map.empty; desc_typ = ref Map.empty; @@ -55,6 +57,8 @@ let with_syntax_decoration b env = {env with deco_typ = b} let with_rule_decoration b env = {env with deco_rule = b} +let typed_id id _id1 = id (* TODO ^ ":" ^ id1 *) + let env_hints name map id hints = List.iter (fun {hintid; hintexp} -> if hintid.it = name then @@ -62,20 +66,24 @@ let env_hints name map id hints = map := Map.add id (hintexp::exps) !map ) hints -let env_typfield env = function +let env_typfield env id1 = function | Elem ({it = Atom id; _}, _, hints) -> - env_hints "show" env.show_field id hints + env_hints "show" env.show_field (typed_id id id1) hints | _ -> () -let env_typcase env = function +let env_typcase env id1 = function | Elem ({it = Atom id; _}, _, hints) -> - env_hints "show" env.show_case id hints + env_hints "show" env.show_case (typed_id id id1) hints | _ -> () -let env_typ env t = +let env_typcon env id1 = function + | (_, hints) -> env_hints "show" env.show_con (typed_id "" id1) hints + +let env_typ env id1 t = match t.it with - | StrT tfs -> List.iter (env_typfield env) tfs - | CaseT (_, _, tcases, _) -> List.iter (env_typcase env) tcases + | StrT tfs -> List.iter (env_typfield env id1) tfs + | CaseT (_, _, tcases, _) -> List.iter (env_typcase env id1) tcases + | ConT tcon -> env_typcon env id1 tcon | _ -> () (* TODO: this assumes that types structs & variants aren't nested *) let env_hintdef env hd = @@ -106,7 +114,7 @@ let env_def env d = env.vars := Set.add id1.it !(env.vars); env_hintdef env (TypH (id1, id2, hints) $ d.at); env_hintdef env (VarH (id1, hints) $ d.at); - env_typ env t + env_typ env id1.it t | GramD (id1, id2, _ps, _t, _gram, hints) -> env_hintdef env (GramH (id1, id2, hints) $ d.at) | RelD (id, _t, hints) -> env_hintdef env (RelH (id, hints) $ d.at) @@ -541,6 +549,8 @@ and render_typ env t = altern_map_nl " ~|~ " " \\\\ &&|&\n" Fun.id (render_dots dots1 @ map_nl_list (render_typ env) ts @ map_nl_list (render_typcase env) tcases @ render_dots dots2) + | ConT tcon -> + render_typcon env tcon | RangeT tes -> altern_map_nl " ~|~ " "\\\\ &&|&\n" (render_typenum env) tes | _ -> @@ -555,6 +565,10 @@ and render_typcase env (_atom, (t, prems), _hints) = render_typ env t ^ if prems = [] then "" else render_conditions env "&&&&" prems +and render_typcon env ((t, prems), _hints) = + render_typ env t ^ + if prems = [] then "" else render_conditions env "&&&&" prems + and render_typenum env (e, eo) = render_exp env e ^ match eo with diff --git a/spectec/src/backend-prose/render.ml b/spectec/src/backend-prose/render.ml index a34fcf7832..c5efb469f3 100644 --- a/spectec/src/backend-prose/render.ml +++ b/spectec/src/backend-prose/render.ml @@ -328,7 +328,7 @@ and render_expr' env expr = let loop = Al.Al_util.iterE (ids, [], iter) in let sloop = render_expr env loop in sprintf "for all %s, %s" sloop se - | Al.Ast.ArityE e -> + | Al.Ast.ArityE e -> let se = render_expr env e in sprintf "the arity of %s" se | Al.Ast.GetCurLabelE -> "the current label" @@ -381,7 +381,7 @@ and render_expr' env expr = | _ -> let se = Al.Print.string_of_expr expr in let msg = sprintf "%s was not properly handled\n" se in - Util.Source.error expr.at "prose backend error: " msg + Util.Source.error expr.at "prose backend" msg and render_path env path = match path.it with diff --git a/spectec/src/el/ast.ml b/spectec/src/el/ast.ml index 6e7d042542..357681550f 100644 --- a/spectec/src/el/ast.ml +++ b/spectec/src/el/ast.ml @@ -88,6 +88,7 @@ and typ' = (* The forms below are only allowed in type definitions *) | StrT of typfield nl_list (* `{` list(typfield,`,`') `}` *) | CaseT of dots * typ nl_list * typcase nl_list * dots (* `|` list(`...`|typ|typcase, `|`) *) + | ConT of typcon (* typ prem* *) | RangeT of typenum nl_list (* exp `|` `...` `|` exp *) | AtomT of atom (* atom *) | SeqT of typ list (* `eps` / typ typ *) @@ -96,7 +97,8 @@ and typ' = and typfield = atom * (typ * prem nl_list) * hint list (* atom typ prem* hint* *) and typcase = atom * (typ * prem nl_list) * hint list (* atom typ* prem* hint* *) -and typenum = exp * exp option (* exp (`|` exp (`|` `...` `|` exp)?)* *) +and typcon = (typ * prem nl_list) * hint list (* typ prem* *) +and typenum = exp * exp option (* exp (`|` exp (`|` `...` `|` exp)?)* *) (* Expressions *) diff --git a/spectec/src/el/convert.ml b/spectec/src/el/convert.ml index 61e242803b..2730ffaeb4 100644 --- a/spectec/src/el/convert.ml +++ b/spectec/src/el/convert.ml @@ -40,15 +40,16 @@ let typ_of_varid id = | _ -> VarT (id, []) ) $ id.at -let varid_of_typ t = +let rec varid_of_typ t = (match t.it with - | VarT (id, _) | ParenT {it = VarT (id, _); _} -> id.it + | VarT (id, _) -> id.it | BoolT -> "bool" | NumT NatT -> "nat" | NumT IntT -> "int" | NumT RatT -> "rat" | NumT RealT -> "real" | TextT -> "text" + | ParenT t1 -> (varid_of_typ t1).it | _ -> "_" ) $ t.at @@ -84,7 +85,7 @@ let rec exp_of_typ t = | SeqT ts -> SeqE (List.map exp_of_typ ts) | InfixT (t1, atom, t2) -> InfixE (exp_of_typ t1, atom, exp_of_typ t2) | BrackT (l, t1, r) -> BrackE (l, exp_of_typ t1, r) - | CaseT _ | RangeT _ -> error t.at "malformed expression" + | CaseT _ | ConT _ | RangeT _ -> error t.at "malformed expression" ) $ t.at and expfield_of_typfield (atom, (t, _prems), _) = diff --git a/spectec/src/el/eq.ml b/spectec/src/el/eq.ml index 848bc92e89..6a7e6f69af 100644 --- a/spectec/src/el/eq.ml +++ b/spectec/src/el/eq.ml @@ -42,6 +42,7 @@ and eq_typ t1 t2 = | CaseT (dots11, ts1, tcs1, dots12), CaseT (dots21, ts2, tcs2, dots22) -> dots11 = dots21 && eq_nl_list eq_typ ts1 ts2 && eq_nl_list eq_typcase tcs1 tcs2 && dots12 = dots22 + | ConT tc1, ConT tc2 -> eq_typcon tc1 tc2 | RangeT tes1, RangeT tes2 -> eq_nl_list eq_typenum tes1 tes2 | AtomT atom1, AtomT atom2 -> atom1.it = atom2.it | SeqT ts1, SeqT ts2 -> eq_list eq_typ ts1 ts2 @@ -60,6 +61,9 @@ and eq_typcase (atom1, (t1, prems1), _) (atom2, (t2, prems2), _) = and eq_typenum (e1, eo1) (e2, eo2) = eq_exp e1 e2 && eq_opt eq_exp eo1 eo2 +and eq_typcon ((t1, prems1), _) ((t2, prems2), _) = + eq_typ t1 t2 && eq_nl_list eq_prem prems1 prems2 + (* Expressions *) diff --git a/spectec/src/el/free.ml b/spectec/src/el/free.ml index 19c8421a5d..ae52d2287c 100644 --- a/spectec/src/el/free.ml +++ b/spectec/src/el/free.ml @@ -97,6 +97,7 @@ and free_typ t = | CaseT (_, ts, tcs, _) -> free_nl_list free_typ ts + free_nl_list (fun tc -> free_typcase tc - det_typcase tc) tcs + | ConT tc -> free_typcon tc | RangeT tes -> free_nl_list free_typenum tes | AtomT _ -> empty | SeqT ts -> free_list free_typ ts @@ -105,6 +106,7 @@ and free_typ t = and free_typfield (_, (t, prems), _) = free_typ t + free_prems prems and free_typcase (_, (t, prems), _) = free_typ t + free_prems prems +and free_typcon ((t, prems), _) = free_typ t + free_prems prems and free_typenum (e, eo) = free_exp e + free_opt free_exp eo @@ -118,6 +120,7 @@ and det_typ t = and det_typfield (_, (t, prems), _) = det_typ t + det_prems prems and det_typcase (_, (t, prems), _) = det_typ t + det_prems prems +and det_typcon ((t, prems), _) = det_typ t + det_prems prems (* Expressions *) diff --git a/spectec/src/el/free.mli b/spectec/src/el/free.mli index e4200b6817..7d90d499b3 100644 --- a/spectec/src/el/free.mli +++ b/spectec/src/el/free.mli @@ -22,6 +22,7 @@ val free_iter : iter -> sets val free_typ : typ -> sets val free_typfield : typfield -> sets val free_typcase : typcase -> sets +val free_typcon : typcon -> sets val free_exp : exp -> sets val free_path : path -> sets val free_arg : arg -> sets @@ -43,6 +44,7 @@ val free_def : def -> sets *) val det_typfield : typfield -> sets val det_typcase : typcase -> sets +val det_typcon : typcon -> sets val det_prod : prod -> sets val det_def : def -> sets diff --git a/spectec/src/el/iter.ml b/spectec/src/el/iter.ml index df362380ba..8a3f6afc3f 100644 --- a/spectec/src/el/iter.ml +++ b/spectec/src/el/iter.ml @@ -102,6 +102,7 @@ and typ t = | StrT tfs -> nl_list typfield tfs | CaseT (dots1, ts, tcs, dots2) -> dots dots1; nl_list typ ts; nl_list typcase tcs; dots dots2 + | ConT tc -> typcon tc | RangeT tes -> nl_list typenum tes | AtomT at -> atom at | SeqT ts -> list typ ts @@ -110,6 +111,7 @@ and typ t = and typfield (at, (t, prs), hs) = atom at; typ t; prems prs; hints hs and typcase (at, (t, prs), hs) = atom at; typ t; prems prs; hints hs +and typcon ((t, prs), hs) = typ t; prems prs; hints hs and typenum (e, eo) = exp e; opt exp eo diff --git a/spectec/src/el/print.ml b/spectec/src/el/print.ml index 32809119bb..7d8b383099 100644 --- a/spectec/src/el/print.ml +++ b/spectec/src/el/print.ml @@ -131,6 +131,7 @@ and string_of_typ t = "| " ^ concat " | " (strings_of_dots dots1 @ map_filter_nl_list string_of_typ ts @ map_filter_nl_list string_of_typcase tcases @ strings_of_dots dots2) + | ConT tc -> string_of_typcon tc | RangeT tes -> concat " | " (map_filter_nl_list string_of_typenum tes) | AtomT atom -> string_of_atom atom | SeqT ts -> "{" ^ string_of_typs " " ts ^ "}" @@ -150,6 +151,10 @@ and string_of_typcase (_atom, (t, prems), _hints) = string_of_typ t ^ concat "" (map_filter_nl_list (prefix "\n -- " string_of_prem) prems) +and string_of_typcon ((t, prems), _hints) = + string_of_typ t ^ + concat "" (map_filter_nl_list (prefix "\n -- " string_of_prem) prems) + and string_of_typenum (e, eo) = string_of_exp e ^ match eo with diff --git a/spectec/src/el/print.mli b/spectec/src/el/print.mli index d27bf64688..eb8bfd80c5 100644 --- a/spectec/src/el/print.mli +++ b/spectec/src/el/print.mli @@ -11,6 +11,8 @@ val string_of_exps : string -> exp list -> string val string_of_sym : sym -> string val string_of_prem : prem -> string val string_of_param : param -> string +val string_of_params : param list -> string val string_of_arg : arg -> string +val string_of_args : arg list -> string val string_of_def : def -> string val string_of_script : script -> string diff --git a/spectec/src/el/subst.ml b/spectec/src/el/subst.ml index e7dfd4077d..6c85e9e248 100644 --- a/spectec/src/el/subst.ml +++ b/spectec/src/el/subst.ml @@ -88,6 +88,7 @@ and subst_typ s t = | CaseT (dots1, ts, tcs, dots2) -> CaseT (dots1, subst_nl_list subst_typ s ts, subst_nl_list subst_typcase s tcs, dots2) + | ConT tc -> ConT (subst_typcon s tc) | RangeT tes -> RangeT (subst_nl_list subst_typenum s tes) | SeqT ts -> SeqT (subst_list subst_typ s ts) | InfixT (t1, op, t2) -> InfixT (subst_typ s t1, op, subst_typ s t2) @@ -98,6 +99,8 @@ and subst_typfield s (atom, (t, prems), hints) = (atom, (subst_typ s t, subst_nl_list subst_prem s prems), hints) and subst_typcase s (atom, (t, prems), hints) = (atom, (subst_typ s t, subst_nl_list subst_prem s prems), hints) +and subst_typcon s ((t, prems), hints) = + ((subst_typ s t, subst_nl_list subst_prem s prems), hints) and subst_typenum s (e, eo) = (subst_exp s e, subst_opt subst_exp s eo) diff --git a/spectec/src/exe-watsup/main.ml b/spectec/src/exe-watsup/main.ml index b4c8d90927..065dc24963 100644 --- a/spectec/src/exe-watsup/main.ml +++ b/spectec/src/exe-watsup/main.ml @@ -266,7 +266,7 @@ let () = ); log "Complete." with - | Source.Error (at, msg) -> + | Source.Error (at, msg) as exn -> let msg' = if !last_pass <> "" && String.starts_with ~prefix:"validation" msg then "(after pass " ^ !last_pass ^ ") " ^ msg @@ -274,6 +274,7 @@ let () = msg in Source.print_error at msg'; + Debug_log.log_exn exn; exit 1 | exn -> flush_all (); diff --git a/spectec/src/frontend/dim.ml b/spectec/src/frontend/dim.ml index 81986e742d..baeab561ff 100644 --- a/spectec/src/frontend/dim.ml +++ b/spectec/src/frontend/dim.ml @@ -105,6 +105,9 @@ and check_typ env ctx t = check_typ env ctx tI; iter_nl_list (check_prem env ctx) prems ) tcs + | ConT ((t1, prems), _) -> + check_typ env ctx t1; + iter_nl_list (check_prem env ctx) prems | RangeT tes -> iter_nl_list (fun (eI1, eoI2) -> check_exp env ctx eI1; @@ -367,6 +370,9 @@ and annot_exp env e : Il.Ast.exp * occur = | ProjE (e1, i) -> let e1', occur1 = annot_exp env e1 in ProjE (e1', i), occur1 + | UnmixE (e1, op) -> + let e1', occur1 = annot_exp env e1 in + UnmixE (e1', op), occur1 | OptE None -> OptE None, Env.empty | OptE (Some e1) -> diff --git a/spectec/src/frontend/elab.ml b/spectec/src/frontend/elab.ml index a367bb6394..0432124a96 100644 --- a/spectec/src/frontend/elab.ml +++ b/spectec/src/frontend/elab.ml @@ -37,6 +37,11 @@ let unseq_exp e = | SeqE es -> es | _ -> [e] +let tup_typ ts at = + match ts with + | [t] -> t + | _ -> TupT ts $ at + let tup_typ' ts' at = match ts' with | [t'] -> t' @@ -54,12 +59,12 @@ let tup_exp' es' at = | [e'] -> e' | _ -> Il.TupE es' $$ (at, tup_typ' (List.map note es') at) -let tup_exp_bind' es' at = +let tup_exp_bind' ids es' at = match es' with (* | [e'] -> e' *) - | _ -> Il.TupE es' $$ (at, tup_typ_bind' (List.map (fun e' -> "_" $ e'.at) es') (List.map note es') at) + | _ -> Il.TupE es' $$ (at, tup_typ_bind' ids (List.map note es') at) let lift_exp' e' iter' = if iter' = Opt then @@ -223,6 +228,7 @@ let rec arg_subst s ps args = in arg_subst s' ps' as' | _, _ -> assert false +(* TODO: eliminate, replace expansion with reduction *) let aliased dt' = match dt'.it with | Il.AliasT _ -> `Alias @@ -231,6 +237,7 @@ let aliased_inst inst' = let Il.InstD (_, _, dt') = inst'.it in aliased dt' +(* TODO: replace with reduce_typ *) let as_defined_typid' env id args at : typ' * [`Alias | `NoAlias] = match find "syntax type" env.typs (strip_var_suffix id) with | ps, Defined (t, dt') -> @@ -241,23 +248,29 @@ let as_defined_typid' env id args at : typ' * [`Alias | `NoAlias] = | _ps, Transp -> error_id (id.it $ at) "invalid forward use of syntax type" | _ps, Family insts -> + let env' = to_eval_env env in + let args = List.map (Eval.reduce_arg env') args in let rec lookup = function | [] -> error_id (id.it $ at) "undefined case of syntax type family" | (args', t, inst')::insts' -> + Debug.(log "el.lookup" + (fun _ -> fmt "%s(%s) =: %s(%s)" id.it (el_args args) id.it (el_args args')) + (fun (r, _) -> fmt "%s" (el_typ (r $ no_region ))) + ) @@ fun _ -> if args' = [] && args = [] then t.it, aliased_inst inst' else (* optimisation *) - let env' = to_eval_env env in match Eval.(match_list match_arg env' Subst.empty args args') with | None -> lookup insts' | Some s -> (Subst.subst_typ s t).it, aliased_inst inst' - | exception _ -> (* TODO: replace with reduce_typ instead of leaking Irred *) - error at "cannot reduce type family application" + | exception _ -> lookup insts' (* assume coherent matches *) + (* error at "cannot reduce type family application" *) in lookup insts +(* Only expand aliases *) let rec expand' env = function | VarT (id, args) as t' -> (match as_defined_typid' env id args id.at with - | t1, `Alias -> expand' env t1 - | _ -> t' + | t1', `Alias -> expand' env t1' + | _, `NoAlias -> t' | exception Error _ -> t' ) | ParenT t -> expand' env t.it @@ -265,32 +278,46 @@ let rec expand' env = function let expand env t = expand' env t.it +(* Expand all but the last alias. TODO: remove *) exception Last -let rec expand_nondef env t = try expand_nondef' env t with Last -> t -and expand_nondef' env t = +let rec expand_nondef' env t = match t.it with | VarT (id, args) -> (match as_defined_typid' env id args id.at with - | t1, `Alias -> (try expand_nondef' env (t1 $ t.at) with Last -> t) - | _ -> t + | t1', `Alias -> (try expand_nondef' env (t1' $ t.at) with Last -> t) + | _, `NoAlias -> t | exception Error _ -> t ) - | ParenT t1 -> expand_nondef env t1 + | ParenT t1 -> expand_nondef' env t1 | _ -> raise Last +let expand_nondef env t = try expand_nondef' env t with Last -> t + +(* Expand definitions *) +let expand_def env t = + match expand' env t.it with + | VarT (id, args) as t' -> + (match as_defined_typid' env id args id.at with + | t1', _ -> t1' + | exception Error _ -> t' + ) + | t' -> t' + let rec expand_id env t = match (expand_nondef env t).it with | VarT (id, _) -> id | IterT (t1, _) -> expand_id env t1 (* TODO: this shouldn't be needed, but goes along with the as_*_typ functions unrolling iterations *) | _ -> "" $ no_region -let expand_iter_notation env t = +let rec expand_iter_notation env t = match expand env t with | VarT (id, args) as t' -> (match as_defined_typid' env id args t.at with | IterT _ as t'', _ -> t'' + | ConT ((t1, _), _), _ -> expand_iter_notation env t1 | _ -> t' ) + | ConT ((t1, _), _) -> expand_iter_notation env t1 | t' -> t' let expand_singular env t = @@ -299,35 +326,43 @@ let expand_singular env t = | t' -> t' -let as_iter_typ phrase env dir t at : typ * iter = - match expand env t with - | IterT (t1, iter) -> t1, iter - | _ -> error_dir_typ env at phrase dir t "(_)*" +let as_iter_typ_opt env t : (typ * iter) option = + match expand env t with IterT (t1, iter) -> Some (t1, iter) | _ -> None -let as_list_typ phrase env dir t at : typ = - match expand env t with - | IterT (t1, List) -> t1 - | _ -> error_dir_typ env at phrase dir t "(_)*" +let as_list_typ_opt env t : typ option = + match expand env t with IterT (t1, List) -> Some t1 | _ -> None -let as_iter_notation_typ phrase env dir t at : typ * iter = - match expand_iter_notation env t with - | IterT (t1, iter) -> t1, iter - | _ -> error_dir_typ env at phrase dir t "(_)*" +let as_iter_notation_typ_opt env t : (typ * iter) option = + match expand_iter_notation env t with IterT (t1, iter) -> Some (t1, iter) | _ -> None -let as_opt_notation_typ phrase env dir t at : typ = - match expand_iter_notation env t with - | IterT (t1, Opt) -> t1 - | _ -> error_dir_typ env at phrase dir t "(_)?" +let as_opt_notation_typ_opt env t : typ option = + match expand_iter_notation env t with IterT (t1, Opt) -> Some t1 | _ -> None -let as_tup_typ phrase env dir t at : typ list = - match expand_singular env t with - | TupT ts -> ts - | _ -> error_dir_typ env at phrase dir t "(_,...,_)" +let as_tup_typ_opt env t : typ list option = + match expand_singular env t with TupT ts -> Some ts | _ -> None + + +let as_x_typ as_t_opt phrase env dir t at shape = + match as_t_opt env t with + | Some x -> x + | None -> error_dir_typ env at phrase dir t shape + +let as_iter_typ phrase env dir t at = + as_x_typ as_iter_typ_opt phrase env dir t at "(_)*" +let as_list_typ phrase env dir t at = + as_x_typ as_list_typ_opt phrase env dir t at "(_)*" +let as_tup_typ phrase env dir t at = + as_x_typ as_tup_typ_opt phrase env dir t at "(_, ..., _)" +let as_iter_notation_typ phrase env dir t at = + as_x_typ as_iter_notation_typ_opt phrase env dir t at "(_)*" +let as_opt_notation_typ phrase env dir t at = + as_x_typ as_opt_notation_typ_opt phrase env dir t at "(_)?" let rec as_notation_typid' phrase env id args at : typ = match as_defined_typid' env id args at with | VarT (id', args'), `Alias -> as_notation_typid' phrase env id' args' at + | ConT ((t, _), _), _ -> t | (AtomT _ | SeqT _ | InfixT _ | BrackT _ | IterT _) as t, _ -> t $ at | _ -> error_dir_typ env at phrase Infer (VarT (id, args) $ id.at) "_ ... _" @@ -466,14 +501,14 @@ let elab_numtyp t : Il.numtyp = let infer_numop fop' ts = List.map (fun t -> fop' (elab_numtyp t), NumT t) ts -let infer_unop = function +let infer_unop' = function | NotOp -> [Il.NotOp, BoolT] | PlusOp -> infer_numop (fun t -> Il.PlusOp t) (List.tl numtyps) | MinusOp -> infer_numop (fun t -> Il.MinusOp t) (List.tl numtyps) | PlusMinusOp -> infer_numop (fun t -> Il.PlusMinusOp t) (List.tl numtyps) | MinusPlusOp -> infer_numop (fun t -> Il.MinusPlusOp t) (List.tl numtyps) -let infer_binop = function +let infer_binop' = function | AndOp -> [Il.AndOp, BoolT] | OrOp -> [Il.OrOp, BoolT] | ImplOp -> [Il.ImplOp, BoolT] @@ -484,7 +519,7 @@ let infer_binop = function | DivOp -> infer_numop (fun t -> Il.DivOp t) numtyps | ExpOp -> infer_numop (fun t -> Il.ExpOp t) numtyps -let infer_cmpop = function +let infer_cmpop' = function | EqOp -> `Poly Il.EqOp | NeOp -> `Poly Il.NeOp | LtOp -> `Over (infer_numop (fun t -> Il.LtOp t) numtyps) @@ -492,27 +527,29 @@ let infer_cmpop = function | LeOp -> `Over (infer_numop (fun t -> Il.LeOp t) numtyps) | GeOp -> `Over (infer_numop (fun t -> Il.GeOp t) numtyps) -let elab_unop env op t1 at : Il.unop * typ = - let ops = infer_unop op in +let infer_unop env op t1 at : Il.unop * typ = + let ops = infer_unop' op in match List.find_opt (fun (_, t) -> sub_typ env t1 (t $ at)) ops with | Some (op', t) -> op', t $ at | None -> - error at ("operator is not defined for type `" ^ string_of_typ t1 ^ "`") + error at ("unary operator `" ^ string_of_unop op ^ + "` is not defined for operand type `" ^ string_of_typ t1 ^ "`") -let elab_binop env op t1 t2 at : Il.binop * typ = - let ops = infer_binop op in +let infer_binop env op t1 t2 at : Il.binop * typ = + let ops = infer_binop' op in match List.find_opt (fun (_, t) -> sub_typ env t1 (t $ at) && sub_typ env t2 (t $ at)) ops with | Some (op', t) -> op', t $ at | None -> - error at ("operator " ^ string_of_binop op ^ " is not defined for types `" ^ + error at ("binary operator `" ^ string_of_binop op ^ + "` is not defined for operand types `" ^ string_of_typ t1 ^ "` and `" ^ string_of_typ t2 ^ "`") -let elab_cmpop env op +let infer_cmpop env op : [`Poly of Il.cmpop | `Over of typ -> typ -> region -> Il.cmpop * typ] = - match infer_cmpop op with + match infer_cmpop' op with | `Poly op' -> `Poly op' | `Over ops -> `Over (fun t1 t2 at -> match @@ -521,7 +558,8 @@ let elab_cmpop env op with | Some (op', t) -> op', t $ at | None -> - error at ("operator " ^ string_of_cmpop op ^ " is not defined for types `" ^ + error at ("comparison operator `" ^ string_of_cmpop op ^ + "` is not defined for operand types `" ^ string_of_typ t1 ^ "` and `" ^ string_of_typ t2 ^ "`") ) @@ -555,7 +593,11 @@ let rec elab_iter env iter : Il.iter = | List1 -> Il.List1 | ListN (e, id_opt) -> Option.iter (fun id -> - ignore (elab_exp env (VarE (id, []) $ id.at) (NumT NatT $ id.at)) + let e' = elab_exp env (VarE (id, []) $ id.at) (NumT NatT $ id.at) in + (* TODO: extend IL to allow arbitrary pattern exps *) + match e'.it with + | Il.VarE _ -> () + | _ -> error_typ env id.at "iteration variable" (NumT NatT $ id.at) ) id_opt; Il.ListN (elab_exp env e (NumT NatT $ e.at), id_opt) @@ -579,7 +621,7 @@ and elab_typ env t : Il.typ = | List1 | ListN _ -> error t.at "illegal iterator in syntax type" | _ -> Il.IterT (elab_typ env t1, elab_iter env iter) $ t.at ) - | StrT _ | CaseT _ | RangeT _ | AtomT _ | SeqT _ | InfixT _ | BrackT _ -> + | StrT _ | CaseT _ | ConT _ | RangeT _ | AtomT _ | SeqT _ | InfixT _ | BrackT _ -> error t.at "this type is only allowed in type definitions" and elab_typ_definition env tid t : Il.deftyp = @@ -598,21 +640,49 @@ and elab_typ_definition env tid t : Il.deftyp = let tcs' = List.map (elab_typcase env tid t.at) cases' in check_atoms "variant" "case" cases' t.at; Il.VariantT tcs' + | ConT tc -> + let tc' = elab_typcon env tid t.at tc in + Il.NotationT tc' | RangeT tes -> - (* TODO: for now, erase ranges to nat or int *) - let ts' = map_filter_nl_list (elab_typenum env tid) tes in - (* HACK: assume that left-most enumerator is the smallest *) - Il.AliasT (List.hd ts') + let ts_fes' = map_filter_nl_list (elab_typenum env tid) tes in + let t1, fe' = + List.fold_left (fun (t, fe') (tI, feI') -> + (if sub_typ env tI t then t else tI), + fun eid' nt -> + let e' = fe' eid' nt and eI' = feI' eid' nt in + let at = Source.over_region [e'.at; eI'.at] in + Il.(BinE (OrOp, e', eI') $$ at % (BoolT $ at)) + ) (List.hd ts_fes') (List.tl ts_fes') + in + let t' = elab_typ env t1 in + let nt = match t1.it with NumT nt -> nt | _ -> assert false in + let id' = "i" $ t.at in + let bs' = [Il.ExpB (id', t', []) $ t.at] in + let prems' = [Il.IfPr (fe' (Il.VarE id' $$ t.at % t') nt) $ t.at] in + Il.NotationT ([[]; []], (bs', Il.TupT [(id', t')] $ t.at, prems'), []) | _ -> - match elab_typ_notation env tid t with - | false, _mixop, _ids, ts' -> Il.AliasT (tup_typ' ts' t.at) - | true, mixop, _ids, ts' -> Il.NotationT (mixop, tup_typ' ts' t.at) + let t' = elab_typ env t in + Il.AliasT t' ) $ t.at +and typ_rep env t : typ = + Debug.(log_at "el.typ_rep" t.at + (fun _ -> fmt "%s" (el_typ t)) + (fun r -> fmt "%s" (el_typ r)) + ) @@ fun _ -> + match expand_def env t with + | ConT ((t1, _), _) -> t1 + | RangeT tes -> + let ts_fes' = map_filter_nl_list (elab_typenum env (expand_id env t)) tes in + List.fold_left (fun t (tI, _) -> + if sub_typ env tI t then t else tI + ) (fst (List.hd ts_fes')) (List.tl ts_fes') + | _ -> t + and elab_typfield env tid at ((atom, (t, prems), hints) as tf) : Il.typfield = assert (tid.it <> ""); let env' = local_env env in - let _, _, _ids, ts' = elab_typ_notation env' tid t in + let _, _, _ids, _ts, ts' = elab_typ_notation env' tid t in let dims = Dim.check_typdef t prems in let dims' = Dim.Env.map (List.map (elab_iter env')) dims in let prems' = List.map (Dim.annot_prem dims') @@ -633,7 +703,7 @@ and elab_typfield env tid at ((atom, (t, prems), hints) as tf) : Il.typfield = and elab_typcase env tid at ((atom, (t, prems), hints) as tc) : Il.typcase = assert (tid.it <> ""); let env' = local_env env in - let _, _, ids, ts' = elab_typ_notation env' tid t in + let _, _, ids, _ts, ts' = elab_typ_notation env' tid t in let dims = Dim.check_typdef t prems in let dims' = Dim.Env.map (List.map (elab_iter env')) dims in let prems' = List.map (Dim.annot_prem dims') @@ -651,16 +721,56 @@ and elab_typcase env tid at ((atom, (t, prems), hints) as tc) : Il.typcase = elab_hints tid hints ) -and elab_typenum env tid (e1, e2o) : Il.typ = +and elab_typcon env tid at (((t, prems), hints) as tc) : Il.typcon = assert (tid.it <> ""); - let _e1' = elab_exp env e1 (NumT IntT $ e1.at) in - let _e2o' = Option.map (fun e2 -> elab_exp env e2 (NumT IntT $ e2.at)) e2o in - elab_typ env (snd (infer_exp env e1)) + let env' = local_env env in + let is_notation, mixop, ids, _ts, ts' = elab_typ_notation env' tid t in + let dims = Dim.check_typdef t prems in + let dims' = Dim.Env.map (List.map (elab_iter env')) dims in + let prems' = List.map (Dim.annot_prem dims') + (concat_map_filter_nl_list (elab_prem env') prems) in + let det = Free.det_typcon tc in + let free = Free.(diff (free_typcon tc) (union det (bound_env env))) in + if free <> Free.empty then + error at ("type constraint contains indeterminate variable(s) `" ^ + String.concat "`, `" (Free.Set.elements free.varid) ^ "`"); + let acc_bs', (module Arg : Iter.Arg) = make_binds_iter_arg env' det dims in + let module Acc = Iter.Make(Arg) in + Acc.prems prems; + assert (is_notation || prems <> []); + ( mixop, + (!acc_bs', tup_typ_bind' ids ts' at, prems'), + elab_hints tid hints + ) -and elab_typ_notation env tid t : bool * Il.mixop * id list * Il.typ list = +and elab_typenum env tid (e1, e2o) : typ * (Il.exp -> numtyp -> Il.exp) = + assert (tid.it <> ""); + let _e1' = elab_exp env e1 (NumT IntT $ e1.at) in (* ensure it's <= int *) + let _, t1 = infer_exp env e1 in (* get precise type *) + match e2o with + | None -> + t1, + fun eid' nt -> + let e1' = elab_exp env e1 (NumT nt $ e1.at) in (* redo with overall type *) + Il.(CmpE (EqOp, eid', e1') $$ e1'.at % (BoolT $ e1.at)) + | Some e2 -> + let at = Source.over_region [e1.at; e2.at] in + let _e2' = elab_exp env e2 (NumT IntT $ e2.at) in + let _, t2 = infer_exp env e2 in + (if sub_typ env t2 t1 then t1 else t2).it $ at, + fun eid' nt -> + let e1' = elab_exp env e1 (NumT nt $ e1.at) in + let e2' = elab_exp env e2 (NumT nt $ e2.at) in + let nt' = elab_numtyp nt in + Il.(BinE (AndOp, + CmpE (GeOp nt', eid', e1') $$ e1'.at % (BoolT $ e1.at), + CmpE (LeOp nt', eid', e2') $$ e2'.at % (BoolT $ e2.at) + ) $$ at % (BoolT $ at)) + +and elab_typ_notation env tid t : bool * Il.mixop * id list * typ list * Il.typ list = Debug.(log_at "el.elab_typ_notation" t.at (fun _ -> fmt "%s = %s" tid.it (el_typ t)) - (fun (_, mixop, _, ts') -> fmt "%s(%s)" (il_mixop mixop) (list il_typ ts')) + (fun (_, mixop, _, _, ts') -> fmt "%s(%s)" (il_mixop mixop) (list il_typ ts')) ) @@ fun _ -> assert (tid.it <> ""); match t.it with @@ -670,43 +780,45 @@ and elab_typ_notation env tid t : bool * Il.mixop * id list * Il.typ list = | _, Transp -> error_id id "invalid forward reference to syntax type" | ps, _ -> let as', _s = elab_args `Rhs env as_ ps t.at in - false, [[]; []], [id], [Il.VarT (id', as') $ t.at] + false, [[]; []], [id], [t], [Il.VarT (id', as') $ t.at] ) | AtomT atom -> - true, [[elab_atom atom tid]], [], [] + true, [[elab_atom atom tid]], [], [], [] | SeqT [] -> - true, [[]], [], [] + true, [[]], [], [], [] | SeqT (t1::ts2) -> - let _b1, mixop1, ids1, ts1' = elab_typ_notation env tid t1 in - let _b2, mixop2, ids2, ts2' = elab_typ_notation env tid (SeqT ts2 $ t.at) in - true, merge_mixop mixop1 mixop2, ids1 @ ids2, ts1' @ ts2' + let _b1, mixop1, ids1, ts1, ts1' = elab_typ_notation env tid t1 in + let _b2, mixop2, ids2, ts2, ts2' = elab_typ_notation env tid (SeqT ts2 $ t.at) in + true, merge_mixop mixop1 mixop2, ids1 @ ids2, ts1 @ ts2, ts1' @ ts2' | InfixT (t1, atom, t2) -> - let _b1, mixop1, ids1, ts1' = elab_typ_notation env tid t1 in - let _b2, mixop2, ids2, ts2' = elab_typ_notation env tid t2 in + let _b1, mixop1, ids1, ts1, ts1' = elab_typ_notation env tid t1 in + let _b2, mixop2, ids2, ts2, ts2' = elab_typ_notation env tid t2 in true, merge_mixop (merge_mixop mixop1 [[elab_atom atom tid]]) mixop2, - ids1 @ ids2, ts1' @ ts2' + ids1 @ ids2, ts1 @ ts2, ts1' @ ts2' | BrackT (l, t1, r) -> - let _b1, mixop1, ids1, ts1' = elab_typ_notation env tid t1 in - true, merge_mixop (merge_mixop [[elab_atom l tid]] mixop1) [[elab_atom r tid]], ids1, ts1' + let _b1, mixop1, ids1, ts1, ts1' = elab_typ_notation env tid t1 in + true, merge_mixop (merge_mixop [[elab_atom l tid]] mixop1) [[elab_atom r tid]], + ids1, ts1, ts1' | ParenT t1 -> - let b1, mixop1, ids1, ts1' = elab_typ_notation env tid t1 in - b1, merge_mixop (merge_mixop [[Il.LParen]] mixop1) [[Il.RParen]], ids1, ts1' + let b1, mixop1, ids1, ts1, ts1' = elab_typ_notation env tid t1 in + b1, merge_mixop (merge_mixop [[Il.LParen]] mixop1) [[Il.RParen]], ids1, ts1, ts1' | IterT (t1, iter) -> (match iter with | List1 | ListN _ -> error t.at "illegal iterator in notation type" | _ -> - let b1, mixop1, _ids, ts1' = elab_typ_notation env tid t1 in + let b1, mixop1, _ids, ts1, ts1' = elab_typ_notation env tid t1 in let iter' = elab_iter env iter in + let tit = IterT (tup_typ ts1 t1.at, iter) $ t.at in let t' = Il.IterT (tup_typ' ts1' t1.at, iter') $ t.at in let op = match iter with Opt -> Il.Quest | _ -> Il.Star in - b1, [List.flatten mixop1] @ [[op]], ["_" $ t'.at], [t'] + b1, [List.flatten mixop1] @ [[op]], ["_" $ t'.at], [tit], [t'] ) | _ -> - false, [[]; []], ["_" $ t.at], [elab_typ env t] + false, [[]; []], [Convert.varid_of_typ t], [t], [elab_typ env t] and (!!!) env tid t = - let _, _, _, ts' = elab_typ_notation env tid t in tup_typ' ts' t.at + let _, _, _, _, ts' = elab_typ_notation env tid t in tup_typ' ts' t.at (* Expressions *) @@ -756,12 +868,12 @@ and infer_exp' env e : Il.exp' * typ = Il.TextE s, TextT $ e.at | UnE (op, e1) -> let e1', t1 = infer_exp env e1 in - let op', t = elab_unop env op t1 e.at in + let op', t = infer_unop env op (typ_rep env t1) e.at in Il.UnE (op', cast_exp "operand" env e1' t1 t), t | BinE (e1, op, e2) -> let e1', t1 = infer_exp env e1 in let e2', t2 = infer_exp env e2 in - let op', t = elab_binop env op t1 t2 e.at in + let op', t = infer_binop env op (typ_rep env t1) (typ_rep env t2) e.at in Il.BinE (op', cast_exp "operand" env e1' t1 t, cast_exp "operand" env e2' t2 t @@ -771,7 +883,7 @@ and infer_exp' env e : Il.exp' * typ = let e2', _t2 = infer_exp env e2 in Il.BinE (Il.AndOp, e1', e2'), BoolT $ e.at | CmpE (e1, op, e2) -> - (match elab_cmpop env op with + (match infer_cmpop env op with | `Poly op' -> let e1', e2' = if must_elab_exp env e1 then @@ -787,7 +899,7 @@ and infer_exp' env e : Il.exp' * typ = | `Over elab_cmpop' -> let e1', t1 = infer_exp env e1 in let e2', t2 = infer_exp env e2 in - let op', t = elab_cmpop' t1 t2 e.at in + let op', t = elab_cmpop' (typ_rep env t1) (typ_rep env t2) e.at in Il.CmpE (op', cast_exp "operand" env e1' t1 t, cast_exp "operand" env e2' t2 t @@ -1068,10 +1180,10 @@ and elab_exp_notation env tid e nt t : Il.exp = (* Convert notation into applications of mixin operators *) assert (tid.it <> ""); let es', _s = elab_exp_notation' env tid e nt in - let e' = tup_exp' es' e.at in match elab_typ_notation env tid nt with - | false, _, _, _ -> e' - | true, mixop, _, _ -> Il.MixE (mixop, e') $$ e.at % elab_typ env t + | false, _, _, _, _ -> tup_exp' es' e.at + | true, mixop, ids, _, _ -> + Il.MixE (mixop, tup_exp_bind' ids es' e.at) $$ e.at % elab_typ env t and elab_exp_notation' env tid e t : Il.exp list * Subst.t = Debug.(log_at "el.elab_exp_notation" e.at @@ -1174,7 +1286,7 @@ and elab_exp_notation' env tid e t : Il.exp list * Subst.t = and elab_exp_notation_iter env tid es (t1, iter) t at : Il.exp = assert (tid.it <> ""); let e' = elab_exp_notation_iter' env tid es (t1, iter) t at in - let _, _, _, ts' = elab_typ_notation env tid t in + let _, _, _, _, ts' = elab_typ_notation env tid t in e' $$ at % tup_typ' ts' t.at and elab_exp_notation_iter' env tid es (t1, iter) t at : Il.exp' = @@ -1223,10 +1335,11 @@ and elab_exp_variant env tid e cases t at : Il.exp = in let t1, _prems = find_case cases atom at t in let es', _s = elab_exp_notation' env tid e t1 in + let _, _, ids, _, _ = elab_typ_notation env tid t1 in let t2 = expand_singular env t $ at in let t2' = elab_typ env t2 in cast_exp "variant case" env - (Il.CaseE (elab_atom atom tid, tup_exp_bind' es' at) $$ at % t2') t2 t + (Il.CaseE (elab_atom atom tid, tup_exp_bind' ids es' at) $$ at % t2') t2 t and elab_path env p t : Il.path * typ = @@ -1263,10 +1376,10 @@ and cast_empty phrase env t at t' : Il.exp = assert (is_notation_typ env t); (match expand_iter_notation env t with | IterT (_, iter) as t1 -> - let _, mixop, _ids, ts' = elab_typ_notation env (expand_id env t) (t1 $ t.at) in + let _, mixop, ids, _ts, ts' = elab_typ_notation env (expand_id env t) (t1 $ t.at) in assert (List.length ts' = 1); let e1' = if iter = Opt then Il.OptE None else Il.ListE [] in - Il.MixE (mixop, e1' $$ at % tup_typ' ts' at) $$ at % t' + Il.MixE (mixop, tup_exp_bind' ids [e1' $$ at % List.hd ts'] at) $$ at % t' | _ -> error_typ env at phrase t ) | _ -> error_typ env at phrase t @@ -1277,29 +1390,54 @@ and cast_exp phrase env e' t1 t2 : Il.exp = and cast_exp' phrase env e' t1 t2 : Il.exp' = Debug.(log_at "el.cast_exp" e'.at - (fun _ -> fmt "%s <: %s >> (%s) <: (%s) = %s" (el_typ t1) (el_typ t1) - (el_typ (expand env t1 $ t1.at)) (el_typ (expand env t2 $ t2.at)) + (fun _ -> fmt "%s <: %s >> (%s) <: (%s) = %s" (el_typ t1) (el_typ t2) + (el_typ (expand_def env t1 $ t1.at)) (el_typ (expand_def env t2 $ t2.at)) (el_typ (expand_nondef env t2)) ) (fun r -> fmt "%s" (il_exp (r $$ e'.at % elab_typ env t2))) ) @@ fun _ -> if equiv_typ env t1 t2 then e'.it else - match expand env t2 with - | RangeT _ -> - if sub_typ env t1 (NumT IntT $ t1.at) then - (* TODO: can't generally prove it's in range *) - e'.it - else - error_typ2 env e'.at "expression" t1 t2 "" - | _ when sub_typ env t1 t2 -> + match expand_def env t1, expand_def env t2 with + | _, _ when sub_typ env t1 t2 -> let t1' = elab_typ env (expand_nondef env t1) in let t2' = elab_typ env (expand_nondef env t2) in Il.SubE (e', t1', t2') - | IterT (t21, Opt) -> + | _, IterT (t21, Opt) -> Il.OptE (Some (cast_exp phrase env e' t1 t21)) - | IterT (t21, (List | List1)) -> + | _, IterT (t21, (List | List1)) -> Il.ListE [cast_exp phrase env e' t1 t21] - | _ when is_variant_typ env t1 && is_variant_typ env t2 -> + | ConT ((t11, _), _), ConT ((t21, _), _) -> + let _, mixop1, ids1, ts1, ts1' = elab_typ_notation env (expand_id env t1) t11 in + let _, mixop2, ids2, ts2, _ts2' = elab_typ_notation env (expand_id env t2) t21 in + if mixop1 <> mixop2 then + error_typ2 env e'.at phrase t1 t2 ""; + let e'' = Il.UnmixE (e', mixop1) $$ e'.at % tup_typ_bind' ids1 ts1' e'.at in + let es' = List.mapi (fun i t1I' -> Il.ProjE (e'', i) $$ e''.at % t1I') ts1' in + let es'' = List.map2 (fun eI' (t1I, t2I) -> + cast_exp phrase env eI' t1I t2I) es' (List.combine ts1 ts2) in + Il.MixE (mixop2, tup_exp_bind' ids2 es'' e'.at) + | ConT ((t11, _), _), _ -> + let _, mixop, ids, ts, ts' = elab_typ_notation env (expand_id env t1) t11 in + let t111, t111' = match ts, ts' with [t111], [t111'] -> t111, t111' | _ -> + error_typ2 env e'.at phrase t1 t2 "" in + let e'' = Il.UnmixE (e', mixop) $$ e'.at % tup_typ_bind' ids ts' e'.at in + cast_exp' phrase env (Il.ProjE (e'', 0) $$ e'.at % t111') t111 t2 + | _, ConT ((t21, _), _) -> + let _, mixop, ids, ts, _ts' = elab_typ_notation env (expand_id env t2) t21 in + let t211 = match ts with [t211] -> t211 | _ -> + error_typ2 env e'.at phrase t1 t2 "" in + Il.MixE (mixop, tup_exp_bind' ids [cast_exp phrase env e' t1 t211] e'.at) + | RangeT _, _ -> + let t11 = typ_rep env t1 in + let t11' = elab_typ env t11 in + let e'' = Il.UnmixE (e', [[]; []]) $$ e'.at % tup_typ_bind' ["i" $ e'.at] [t11'] e'.at in + let e''' = Il.ProjE (e'', 0) $$ e'.at % t11' in + cast_exp' phrase env e''' t11 t2 + | _, RangeT _ -> + let t21 = typ_rep env t2 in + let e'' = cast_exp phrase env e' t1 t21 in + Il.MixE ([[]; []], tup_exp_bind' ["i" $ e'.at] [e''] e'.at) + | _, _ when is_variant_typ env t1 && is_variant_typ env t2 -> let cases1, dots1 = as_variant_typ "" env Check t1 e'.at in let cases2, _dots2 = as_variant_typ "" env Check t2 e'.at in if dots1 = Dots then @@ -1317,7 +1455,7 @@ and cast_exp' phrase env e' t1 t2 : Il.exp' = let t1' = elab_typ env (expand_nondef env t1) in let t2' = elab_typ env (expand_nondef env t2) in Il.SubE (e', t1', t2') - | _ -> + | _, _ -> error_typ2 env e'.at phrase t1 t2 "" @@ -1334,7 +1472,7 @@ and elab_prem env prem : Il.prem list = [] | RulePr (id, e) -> let t, _ = find "relation" env.rels id in - let _, mixop, _, _ = elab_typ_notation env id t in + let _, mixop, _, _, _ = elab_typ_notation env id t in let es', _s = elab_exp_notation' env id e t in [Il.RulePr (id, mixop, tup_exp' es' e.at) $ prem.at] | IfPr e -> @@ -1574,6 +1712,7 @@ let elab_params env ps : Il.param list = let infer_typ_definition _env t : kind = match t.it with | StrT _ | CaseT _ -> Opaque + | ConT _ | RangeT _ -> Transp | _ -> Transp let infer_typdef env d = @@ -1704,7 +1843,7 @@ let elab_def env d : Il.def list = ) @ elab_hintdef env (TypH (id1, id2, hints) $ d.at) | GramD _ -> [] | RelD (id, t, hints) -> - let _, mixop, _ids, ts' = elab_typ_notation env id t in + let _, mixop, _ids, _ts, ts' = elab_typ_notation env id t in elab_no_binds env d; env.rels <- bind "relation" env.rels id (t, []); [Il.RelD (id, mixop, tup_typ' ts' t.at, []) $ d.at] @@ -1714,7 +1853,7 @@ let elab_def env d : Il.def list = let dims = Dim.check_def d in let dims' = Dim.Env.map (List.map (elab_iter env')) dims in let t, rules' = find "relation" env.rels id1 in - let _, mixop, _, _ = elab_typ_notation env id1 t in + let _, mixop, _, _, _ = elab_typ_notation env id1 t in let es' = List.map (Dim.annot_exp dims') (fst (elab_exp_notation' env' id1 e t)) in let prems' = List.map (Dim.annot_prem dims') (concat_map_filter_nl_list (elab_prem env') prems) in diff --git a/spectec/src/frontend/eval.ml b/spectec/src/frontend/eval.ml index 733fa120dc..e457f8eccb 100644 --- a/spectec/src/frontend/eval.ml +++ b/spectec/src/frontend/eval.ml @@ -70,7 +70,7 @@ let rec reduce_typ env t : typ = let id' = El.Convert.strip_var_suffix id in (match reduce_typ_app env id args' t.at (Map.find id'.it env.typs) with | Some t' -> -(* TODO: renable? +(* TODO: reenable? if id'.it <> id.it then Source.error id.at "syntax" "identifer suffix encountered during reduction"; *) @@ -487,7 +487,7 @@ and match_exp env s e1 e2 : subst option = | Some t1 -> sub_typ env t1 t2' || if disj_typ env t1 t2' then false else raise Irred ) - | _, (RangeT _ | StrT _ | CaseT _) -> raise Irred + | _, (StrT _ | CaseT _ | ConT _ | RangeT _) -> raise Irred | _, _ -> true then if id2.it = "_" then Some s else @@ -637,6 +637,7 @@ and equiv_typ env t1 t2 = | StrT tfs1, StrT tfs2 -> equiv_nl_list equiv_typfield env tfs1 tfs2 | CaseT (NoDots, [], tcs1, NoDots), CaseT (NoDots, [], tcs2, NoDots) -> equiv_nl_list equiv_typcase env tcs1 tcs2 + | ConT tc1, ConT tc2 -> equiv_typcon env tc1 tc2 | RangeT tes1, RangeT tes2 -> equiv_nl_list equiv_typenum env tes1 tes2 | _, _ -> t1.it = t2.it @@ -644,6 +645,8 @@ and equiv_typfield env (atom1, (t1, prems1), _) (atom2, (t2, prems2), _) = atom1.it = atom2.it && equiv_typ env t1 t2 && Eq.(eq_nl_list eq_prem prems1 prems2) and equiv_typcase env (atom1, (t1, prems1), _) (atom2, (t2, prems2), _) = atom1.it = atom2.it && equiv_typ env t1 t2 && Eq.(eq_nl_list eq_prem prems1 prems2) +and equiv_typcon env ((t1, prems1), _) ((t2, prems2), _) = + equiv_typ env t1 t2 && Eq.(eq_nl_list eq_prem prems1 prems2) and equiv_typenum env (e11, e12o) (e21, e22o) = equiv_exp env e11 e21 && equiv_opt equiv_exp env e12o e22o @@ -676,21 +679,10 @@ and sub_typ env t1 t2 = Debug.(log "el.sub_typ" (fun _ -> fmt "%s <: %s" (el_typ t1) (el_typ t2)) Bool.to_string ) @@ fun _ -> - match (reduce_typ env t1).it, (reduce_typ env t2).it with + let t1 = reduce_typ env t1 in + let t2 = reduce_typ env t2 in + match t1.it, t2.it with | NumT t1', NumT t2' -> t1' <= t2' - | RangeT (Elem (e1, _)::_), NumT t2' -> - (match (reduce_exp env e1).it with - | NatE _ -> true - | UnE (MinusOp, _) -> t2' <= IntT - | _ -> assert false - ) - | NumT t1', RangeT (Elem (e2, _)::_) -> - (* HACK to treat nat and int interconvertible with ranges *) - (match (reduce_exp env e2).it with - | NatE _ -> t1' <= NatT - | UnE (MinusOp, _) -> true - | _ -> assert false - ) | StrT tfs1, StrT tfs2 -> El.Convert.forall_nl_list (fun (atom, (t2, prems2), _) -> match find_field tfs1 atom with @@ -705,6 +697,25 @@ and sub_typ env t1 t2 = equiv_typ env t1 t2 && Eq.eq_nl_list Eq.eq_prem prems1 prems2 | None -> false ) tcs1 + | ConT ((t11, _), _), ConT ((t21, _), _) -> sub_typ env t11 t21 +(* + | ConT ((t11, _), _), _ -> sub_typ env t11 t2 + | _, ConT ((t21, _), _) -> sub_typ env t1 t21 + | RangeT [], NumT _ -> true + | RangeT (Elem (e1, _)::tes1), NumT t2' -> + (match (reduce_exp env e1).it with + | NatE _ -> true + | UnE (MinusOp, _) -> t2' <= IntT + | _ -> assert false + ) && sub_typ env (RangeT tes1 $ t1.at) t2 + | NumT _, RangeT [] -> true + | NumT t1', RangeT (Elem (e2, _)::tes2) -> + (match (reduce_exp env e2).it with + | NatE _ -> t1' <= NatT + | UnE (MinusOp, _) -> true + | _ -> assert false + ) && sub_typ env t1 (RangeT tes2 $ t2.at) +*) | TupT ts1, TupT ts2 | SeqT ts1, SeqT ts2 -> List.length ts1 = List.length ts2 && List.for_all2 (sub_typ env) ts1 ts2 @@ -767,6 +778,7 @@ and disj_typ env t1 t2 = | Some (t2, _prems2) -> disj_typ env t1 t2 | None -> false ) tcs1 + | ConT ((t11, _), _), ConT ((t21, _), _) -> disj_typ env t11 t21 | RangeT _, RangeT _ -> false (* approximation *) | _, _ -> t1.it <> t2.it diff --git a/spectec/src/frontend/eval.mli b/spectec/src/frontend/eval.mli index eb63dc006c..0048150d27 100644 --- a/spectec/src/frontend/eval.mli +++ b/spectec/src/frontend/eval.mli @@ -12,6 +12,7 @@ val (let*) : subst option -> (subst -> subst option) -> subst option val reduce_exp : env -> exp -> exp val reduce_typ : env -> typ -> typ +val reduce_arg : env -> arg -> arg val equiv_typ : env -> typ -> typ -> bool val sub_typ : env -> typ -> typ -> bool diff --git a/spectec/src/frontend/parser.mly b/spectec/src/frontend/parser.mly index 5f36a6f3ea..c68bfcb7ca 100644 --- a/spectec/src/frontend/parser.mly +++ b/spectec/src/frontend/parser.mly @@ -90,6 +90,13 @@ let is_post_exp e = | HoleE _ -> true | _ -> false +let rec is_typcon t = + match t.it with + | VarT _ | BoolT | NumT _ | TextT | TupT _ -> false + | StrT _ | CaseT _ | ConT _ | RangeT _ + | AtomT _ | SeqT _ | InfixT _ | BrackT _ -> true + | ParenT t1 | IterT (t1, _) -> is_typcon t1 + %} %token LPAREN RPAREN LBRACK RBRACK LBRACE RBRACE @@ -353,7 +360,13 @@ typ : typ_post { $1 } deftyp : deftyp_ { $1 $ $sloc } deftyp_ : - | nottyp { $1.it } + | nottyp hint* prem_list + { if is_typcon $1 || $3 <> [] then + ConT (($1, $3), $2) + else if $2 <> [] then + Source.error (List.hd $2).hintid.at "syntax" "misplaced hint" + else $1.it + } | LBRACE comma_nl_list(fieldtyp) RBRACE { StrT $2 } | dots_list(casetyp) { let x, y, z = $1 in diff --git a/spectec/src/il/ast.ml b/spectec/src/il/ast.ml index 540118e852..3b651c1df1 100644 --- a/spectec/src/il/ast.ml +++ b/spectec/src/il/ast.ml @@ -83,13 +83,14 @@ and typ' = and deftyp = deftyp' phrase and deftyp' = - | AliasT of typ (* type alias *) - | NotationT of mixop * typ (* notation type *) - | StructT of typfield list (* record type *) - | VariantT of typcase list (* variant type *) + | AliasT of typ (* type alias *) + | NotationT of typcon (* notation type *) + | StructT of typfield list (* record type *) + | VariantT of typcase list (* variant type *) and typfield = atom * (bind list * typ * prem list) * hint list (* record field *) and typcase = atom * (bind list * typ * prem list) * hint list (* variant case *) +and typcon = mixop * (bind list * typ * prem list) * hint list (* notation *) (* Expressions *) @@ -142,6 +143,7 @@ and exp' = | CallE of id * arg list (* defid( arg* ) *) | IterE of exp * iterexp (* exp iter *) | ProjE of exp * int (* exp.i *) + | UnmixE of exp * mixop (* exp.mixop *) | OptE of exp option (* exp? *) | TheE of exp (* exp! *) | ListE of exp list (* [exp ... exp] *) diff --git a/spectec/src/il/eq.ml b/spectec/src/il/eq.ml index ae47291b73..17689c1197 100644 --- a/spectec/src/il/eq.ml +++ b/spectec/src/il/eq.ml @@ -46,11 +46,14 @@ and eq_typ t1 t2 = and eq_deftyp dt1 dt2 = match dt1.it, dt2.it with | AliasT t1, AliasT t2 -> eq_typ t1 t2 - | NotationT (op1, t1), NotationT (op2, t2) -> op1 = op2 && eq_typ t1 t2 + | NotationT tc1, NotationT tc2 -> eq_typcon tc1 tc2 | StructT tfs1, StructT tfs2 -> eq_list eq_typfield tfs1 tfs2 | VariantT tcs1, VariantT tcs2 -> eq_list eq_typcase tcs1 tcs2 | _, _ -> false +and eq_typcon (op1, (_binds1, t1, prems1), _) (op2, (_binds2, t2, prems2), _) = + op1 = op2 && eq_typ t1 t2 && eq_list eq_prem prems1 prems2 + and eq_typfield (atom1, (_binds1, t1, prems1), _) (atom2, (_binds2, t2, prems2), _) = atom1 = atom2 && eq_typ t1 t2 && eq_list eq_prem prems1 prems2 @@ -81,7 +84,8 @@ and eq_exp e1 e2 = | ListE es1, ListE es2 -> eq_list eq_exp es1 es2 | StrE efs1, StrE efs2 -> eq_list eq_expfield efs1 efs2 | DotE (e11, atom1), DotE (e21, atom2) -> eq_exp e11 e21 && atom1 = atom2 - | MixE (op1, e1), MixE (op2, e2) -> op1 = op2 && eq_exp e1 e2 + | MixE (op1, e1), MixE (op2, e2) + | UnmixE (e1, op1), UnmixE (e2, op2) -> op1 = op2 && eq_exp e1 e2 | CallE (id1, as1), CallE (id2, as2) -> eq_id id1 id2 && eq_list eq_arg as1 as2 | IterE (e11, iter1), IterE (e21, iter2) -> eq_exp e11 e21 && eq_iterexp iter1 iter2 diff --git a/spectec/src/il/eval.ml b/spectec/src/il/eval.ml index 36939ddd6a..61a54d0426 100644 --- a/spectec/src/il/eval.ml +++ b/spectec/src/il/eval.ml @@ -246,6 +246,12 @@ and reduce_exp env e : exp = | TupE es -> List.nth es i | _ -> ProjE (e1', i) $> e ) + | UnmixE (e1, mixop) -> + let e1' = reduce_exp env e1 in + (match e1'.it with + | MixE (_, e11') -> e11' + | _ -> UnmixE (e1', mixop) $> e + ) | OptE eo -> OptE (Option.map (reduce_exp env) eo) $> e | TheE e1 -> let e1' = reduce_exp env e1 in @@ -331,6 +337,10 @@ and reduce_path env e p f = reduce_path env e p1 f' and reduce_arg env a : arg = + Debug.(log "il.reduce_arg" + (fun _ -> fmt "%s" (il_arg a)) + (fun a' -> fmt "%s" (il_arg a')) + ) @@ fun _ -> match a.it with | ExpA e -> ExpA (reduce_exp env e) $ a.at | TypA _t -> a (* types are reduced on demand *) @@ -564,7 +574,11 @@ and equiv_typ env t1 t2 = let t2' = reduce_typ env t2 in (t1 <> t1' || t2 <> t2') && equiv_typ env t1' t2' || (match reduce_typ_app env id1 as1 t1'.at, reduce_typ_app env id2 as2 t2'.at with - | Some dt1, Some dt2 -> Eq.eq_deftyp (dt1 $ t1.at) (dt2 $ t2.at) + | Some (NotationT tc1), Some (NotationT tc2) -> + let (op1, (_binds1, t11, prems1), _) = tc1 in + let (op2, (_binds2, t21, prems2), _) = tc2 in + op1 = op2 && equiv_typ env t11 t21 && equiv_list equiv_prem env prems1 prems2 + | Some dt1, Some dt2 -> Eq.eq_deftyp (dt1 $ t1.at) (dt2 $ t2.at) (* TODO *) | _, _ -> false ) | VarT _, _ -> @@ -575,7 +589,7 @@ and equiv_typ env t1 t2 = t2 <> t2' && equiv_typ env t1 t2' | TupT xts1, TupT xts2 -> equiv_tup env xts1 xts2 | IterT (t11, iter1), IterT (t21, iter2) -> - equiv_typ env t11 t21 && Eq.eq_iter iter1 iter2 + equiv_typ env t11 t21 && equiv_iter env iter1 iter2 | _, _ -> t1.it = t2.it @@ -586,6 +600,22 @@ and equiv_tup env xts1 xts2 = equiv_typ env t1 t2 && equiv_tup env xts1' (List.map (Subst.subst_typbind s) xts2') | _, _ -> xts1 = xts2 +and equiv_iter env iter1 iter2 = + match iter1, iter2 with + | ListN (e1, ido1), ListN (e2, ido2) -> + equiv_exp env e1 e2 && Option.equal (fun id1 id2 -> id1.it = id2.it) ido1 ido2 + | _, _ -> iter1 = iter2 + +and equiv_prem env pr1 pr2 = + match pr1.it, pr2.it with + | RulePr (id1, mixop1, e1), RulePr (id2, mixop2, e2) -> + id1.it = id2.it && mixop1 = mixop2 && equiv_exp env e1 e2 + | IfPr e1, IfPr e2 -> equiv_exp env e1 e2 + | LetPr (e11, e12, _ids1), LetPr (e21, e22, _id2) -> + equiv_exp env e11 e21 && equiv_exp env e12 e22 + | IterPr (pr11, iter1), IterPr (pr21, iter2) -> + equiv_prem env pr11 pr21 && equiv_iter env (fst iter1) (fst iter2) + | pr1', pr2' -> pr1' = pr2' and equiv_exp env e1 e2 = Debug.(log "il.equiv_exp" @@ -632,10 +662,28 @@ and sub_typ env t1 t2 = equiv_typ env t1 t2 && Eq.eq_list Eq.eq_prem prems1 prems2 | None -> false ) tcs1 - | Some (NotationT (mixop1, t11)), Some (NotationT (mixop2, t21)) -> - mixop1 = mixop2 && sub_typ env t11 t21 + | Some (NotationT tc1), _ -> + let (_op1, (_binds1, t11, _prems1), _) = tc1 in + sub_typ env t11 t2' + | _, Some (NotationT tc2) -> + let (_op2, (_binds2, t21, _prems2), _) = tc2 in + sub_typ env t1' t21 | _, _ -> false ) + | VarT (id1, as1), _ -> + (match reduce_typ_app env id1 as1 t1'.at with + | Some (NotationT tc1) -> + let (_op1, (_binds1, t11, _prems1), _) = tc1 in + sub_typ env t11 t2' + | _ -> false + ) + | _, VarT (id2, as2) -> + (match reduce_typ_app env id2 as2 t2'.at with + | Some (NotationT tc2) -> + let (_op2, (_binds2, t21, _prems2), _) = tc2 in + sub_typ env t1' t21 + | _ -> false + ) | _, _ -> false diff --git a/spectec/src/il/free.ml b/spectec/src/il/free.ml index 363c069a4f..6b542592b0 100644 --- a/spectec/src/il/free.ml +++ b/spectec/src/il/free.ml @@ -90,10 +90,13 @@ and free_typbinds xts = free_list_dep free_typbind bound_typbind xts and free_deftyp dt = match dt.it with - | AliasT t | NotationT (_, t) -> free_typ t + | AliasT t -> free_typ t + | NotationT tc -> free_typcon tc | StructT tfs -> free_list free_typfield tfs | VariantT tcs -> free_list free_typcase tcs +and free_typcon (_, (bs, t, prems), _) = + free_binds bs + (free_typ t + (free_prems prems - bound_typ t) - bound_binds bs) and free_typfield (_, (bs, t, prems), _) = free_binds bs + (free_typ t + (free_prems prems - bound_typ t) - bound_binds bs) and free_typcase (_, (bs, t, prems), _) = @@ -114,7 +117,7 @@ and free_exp e = | TupE es | ListE es -> free_list free_exp es | UpdE (e1, p, e2) | ExtE (e1, p, e2) -> free_exp e1 + free_path p + free_exp e2 | StrE efs -> free_list free_expfield efs - | MixE (_, e1) | CaseE (_, e1) -> free_exp e1 + | MixE (_, e1) | CaseE (_, e1) | UnmixE (e1, _) -> free_exp e1 | CallE (id, as1) -> free_defid id + free_args as1 | IterE (e1, iter) -> free_exp e1 + free_iterexp iter | SubE (e1, t1, t2) -> free_exp e1 + free_typ t1 + free_typ t2 diff --git a/spectec/src/il/print.ml b/spectec/src/il/print.ml index d60edb521a..6c6ffa92e2 100644 --- a/spectec/src/il/print.ml +++ b/spectec/src/il/print.ml @@ -130,7 +130,7 @@ and string_of_typbind (id, t) = and string_of_deftyp layout dt = match dt.it with | AliasT t -> string_of_typ t - | NotationT (mixop, t) -> string_of_typ_mix mixop t + | NotationT tc -> string_of_typcon tc | StructT tfs when layout = `H -> "{" ^ concat ", " (List.map string_of_typfield tfs) ^ "}" | StructT tfs -> @@ -140,10 +140,6 @@ and string_of_deftyp layout dt = | VariantT tcs -> "\n | " ^ concat "\n | " (List.map string_of_typcase tcs) -and string_of_typ_mix mixop t = - if mixop = [[]; []] then string_of_typ t else - string_of_mixop mixop ^ string_of_typ_args t - and string_of_typfield (atom, (bs, t, prems), _hints) = string_of_atom atom ^ string_of_binds bs ^ " " ^ string_of_typ t ^ concat "" (List.map (prefix "\n -- " string_of_prem) prems) @@ -152,6 +148,10 @@ and string_of_typcase (atom, (bs, t, prems), _hints) = string_of_atom atom ^ string_of_binds bs ^ string_of_typ_args t ^ concat "" (List.map (prefix "\n -- " string_of_prem) prems) +and string_of_typcon (mixop, (bs, t, prems), _hints) = + string_of_mixop mixop ^ string_of_binds bs ^ string_of_typ_args t ^ + concat "" (List.map (prefix "\n -- " string_of_prem) prems) + (* Expressions *) @@ -186,6 +186,7 @@ and string_of_exp e = | CallE (id, as1) -> "$" ^ id.it ^ string_of_args as1 | IterE (e1, iter) -> string_of_exp e1 ^ string_of_iterexp iter | ProjE (e1, i) -> string_of_exp e1 ^ "." ^ string_of_int i + | UnmixE (e1, op) -> string_of_exp e1 ^ "." ^ string_of_mixop op | OptE eo -> "?(" ^ string_of_exps "" (Option.to_list eo) ^ ")" | TheE e1 -> "!(" ^ string_of_exp e1 ^ ")" | ListE es -> "[" ^ string_of_exps " " es ^ "]" @@ -307,7 +308,8 @@ let rec string_of_def ?(suppress_pos = false) d = pre ^ "syntax " ^ id.it ^ string_of_params ps ^ concat "\n" (List.map (string_of_inst ~suppress_pos id) insts) ^ "\n" | RelD (id, mixop, t, rules) -> - pre ^ "relation " ^ id.it ^ ": " ^ string_of_typ_mix mixop t ^ + pre ^ "relation " ^ id.it ^ ": " ^ + string_of_typcon (mixop, ([], t, []), []) ^ concat "\n" (List.map (string_of_rule ~suppress_pos) rules) ^ "\n" | DecD (id, ps, t, clauses) -> pre ^ "def $" ^ id.it ^ string_of_params ps ^ " : " ^ string_of_typ t ^ diff --git a/spectec/src/il/subst.ml b/spectec/src/il/subst.ml index e1efd5d073..85bee1d6d4 100644 --- a/spectec/src/il/subst.ml +++ b/spectec/src/il/subst.ml @@ -77,11 +77,15 @@ and subst_typbind s (id, t) = and subst_deftyp s dt = (match dt.it with | AliasT t -> AliasT (subst_typ s t) - | NotationT (op, t) -> NotationT (op, subst_typ s t) + | NotationT tc -> NotationT (subst_typcon s tc) | StructT tfs -> StructT (subst_list subst_typfield s tfs) | VariantT tcs -> VariantT (subst_list subst_typcase s tcs) ) $ dt.at +and subst_typcon s (op, (bs, t, prems), hints) = + let bs', s' = subst_binds s bs in + (op, (bs', subst_typ s' t, subst_list subst_prem s' prems), hints) + and subst_typfield s (atom, (bs, t, prems), hints) = let bs', s' = subst_binds s bs in (atom, (bs', subst_typ s' t, subst_list subst_prem s' prems), hints) @@ -117,6 +121,7 @@ and subst_exp s e = | CallE (id, as_) -> CallE (id, subst_args s as_) | IterE (e1, iterexp) -> IterE (subst_exp s e1, subst_iterexp s iterexp) | ProjE (e1, i) -> ProjE (subst_exp s e1, i) + | UnmixE (e1, op) -> UnmixE (subst_exp s e1, op) | OptE eo -> OptE (subst_opt subst_exp s eo) | TheE e -> TheE (subst_exp s e) | ListE es -> ListE (subst_list subst_exp s es) diff --git a/spectec/src/il/valid.ml b/spectec/src/il/valid.ml index 4f0c154e72..b3fbc8d702 100644 --- a/spectec/src/il/valid.ml +++ b/spectec/src/il/valid.ml @@ -94,7 +94,7 @@ let expand_app env id as_ : deftyp' option = let InstD (_binds, as', dt) = inst.it in if as' = [] && as_ = [] then Some dt.it else (* optimisation *) match Eval.(match_list match_arg env' Subst.empty as_ as') with - | exception Eval.Irred -> None (* cannot reduce *) + | exception Eval.Irred -> lookup insts' (* cannot reduce, try next *) | None -> lookup insts' | Some s -> Some (Subst.subst_deftyp s dt).it in lookup insts @@ -154,7 +154,7 @@ let as_tup_typ phrase env dir t at : (id * typ) list = let as_mix_typ phrase env dir t at : mixop * typ = match expand_def env t with - | NotationT (mixop, t) -> mixop, t + | NotationT (mixop, (_, t, _), _) -> mixop, t | _ -> as_error at phrase dir t ("`mixin-op`(...)") let as_struct_typ phrase env dir t at : typfield list = @@ -274,8 +274,8 @@ and valid_deftyp env dt = match dt.it with | AliasT t -> valid_typ env [] t - | NotationT (mixop, t) -> - valid_typ_mix env mixop t dt.at + | NotationT tc -> + valid_typcon env tc dt.at | StructT tfs -> check_atoms "record" "field" tfs dt.at; List.iter (valid_typfield env) tfs @@ -283,7 +283,7 @@ and valid_deftyp env dt = check_atoms "variant" "case" tcs dt.at; List.iter (valid_typcase env) tcs -and valid_typ_mix env mixop t at = +and valid_typcon env (mixop, (bs, t, prems), _hints) at = let arity = match t.it with | TupT ts -> List.length ts @@ -292,7 +292,10 @@ and valid_typ_mix env mixop t at = if List.length mixop <> arity + 1 then error at ("inconsistent arity in mixin notation, `" ^ string_of_mixop mixop ^ "` applied to " ^ typ_string env t); - valid_typ env [] t + let env' = local_env env in + List.iter (valid_bind env') bs; + valid_typ env' [] t; + List.iter (valid_prem env') prems and valid_typfield env (_atom, (bs, t, prems), _hints) = let env' = local_env env in @@ -347,6 +350,12 @@ and infer_exp env e : typ = if i >= List.length xts then error e.at "invalid tuple projection"; snd (List.nth xts i) + | UnmixE (e1, op) -> + let t1 = infer_exp env e1 in + let op', t = as_mix_typ "expression" env Infer (selfify_typ env e1 t1) e1.at in + if op <> op' then + error e.at "invalid mixfix projection"; + t | OptE _ -> error e.at "cannot infer type of option" | TheE e1 -> as_iter_typ Opt "option" env Check (infer_exp env e1) e1.at | ListE _ -> error e.at "cannot infer type of list" @@ -452,6 +461,12 @@ and valid_exp env e t = if i >= List.length xts then error e.at "invalid tuple projection"; equiv_typ env (snd (List.nth xts i)) t e.at + | UnmixE (e1, op) -> + let t1 = infer_exp env e1 in + let op', t' = as_mix_typ "expression" env Infer (selfify_typ env e1 t1) e1.at in + if op <> op' then + error e.at "invalid mixfix projection"; + equiv_typ env t' t e.at | OptE eo -> let t1 = as_iter_typ Opt "option" env Check t e.at in Option.iter (fun e1 -> valid_exp env e1 t1) eo @@ -644,7 +659,7 @@ let infer_def env d = List.iter (valid_param env') ps; env.typs <- bind "syntax type" env.typs id (ps, []) | RelD (id, mixop, t, _rules) -> - valid_typ_mix env mixop t d.at; + valid_typcon env (mixop, ([], t, []), []) d.at; env.rels <- bind "relation" env.rels id (mixop, t) | DecD (id, ps, t, clauses) -> let env' = local_env env in @@ -666,7 +681,7 @@ let rec valid_def {bind} env d = List.iter (valid_inst env ps) insts; env.typs <- bind "syntax type" env.typs id (ps, insts); | RelD (id, mixop, t, rules) -> - valid_typ_mix env mixop t d.at; + valid_typcon env (mixop, ([], t, []), []) d.at; List.iter (valid_rule env mixop t) rules; env.rels <- bind "relation" env.rels id (mixop, t) | DecD (id, ps, t, clauses) -> diff --git a/spectec/src/il2al/free.ml b/spectec/src/il2al/free.ml index 59046aa224..846f319a99 100644 --- a/spectec/src/il2al/free.ml +++ b/spectec/src/il2al/free.ml @@ -22,7 +22,7 @@ let rec free_exp ignore_listN e = | VarE id -> free_varid id | BoolE _ | NatE _ | TextE _ -> empty | UnE (_, e1) | LenE e1 | TheE e1 | MixE (_, e1) | SubE (e1, _, _) - | DotE (e1, _) | CaseE (_, e1) | ProjE (e1, _) -> + | DotE (e1, _) | CaseE (_, e1) | ProjE (e1, _) | UnmixE (e1, _) -> f e1 | BinE (_, e1, e2) | CmpE (_, e1, e2) | IdxE (e1, e2) | CompE (e1, e2) | CatE (e1, e2) -> free_list f [e1; e2] diff --git a/spectec/src/il2al/il2il.ml b/spectec/src/il2al/il2il.ml index 1be69b5c86..623abbc87d 100644 --- a/spectec/src/il2al/il2il.ml +++ b/spectec/src/il2al/il2il.ml @@ -43,6 +43,7 @@ let rec transform_expr f e = | CallE (id, as1) -> CallE (id, List.map (transform_arg f) as1) | IterE (e1, iter) -> IterE (new_ e1, iter) (* TODO iter *) | ProjE (e1, i) -> ProjE (new_ e1, i) + | UnmixE (e1, op) -> UnmixE (new_ e1, op) | OptE eo -> OptE ((Option.map new_) eo) | TheE e1 -> TheE (new_ e1) | ListE es -> ListE ((List.map new_) es) @@ -148,6 +149,8 @@ let rec overlap e1 e2 = if eq_exp e1 e2 then e1 else IterE (overlap e1 e2, itere1) | ProjE (e1, i1), ProjE (e2, i2) when i1 = i2 -> ProjE (overlap e1 e2, i1) + | UnmixE (e1, op1), UnmixE (e2, op2) when op1 = op2 -> + UnmixE (overlap e1 e2, op1) | OptE (Some e1), OptE (Some e2) -> OptE (Some (overlap e1 e2)) | TheE e1, TheE e2 -> @@ -190,6 +193,7 @@ let rec collect_unified template e = if eq_exp template e then [], [] else | MixE (_, e1), MixE (_, e2) | IterE (e1, _), IterE (e2, _) | ProjE (e1, _), ProjE (e2, _) + | UnmixE (e1, _), UnmixE (e2, _) | OptE (Some e1), OptE (Some e2) | TheE e1, TheE e2 | CaseE (_, e1), CaseE (_, e2) diff --git a/spectec/src/il2al/translate.ml b/spectec/src/il2al/translate.ml index d013277978..e3506ed9ca 100644 --- a/spectec/src/il2al/translate.ml +++ b/spectec/src/il2al/translate.ml @@ -178,6 +178,7 @@ and translate_exp exp = (* CaseE *) | Il.CaseE (Il.Atom cons, argexp) -> caseE (kwd cons exp.note, translate_argexp argexp) ~at:at (* Tuple *) + | Il.TupE [e] -> translate_exp e | Il.TupE exps -> tupE (List.map translate_exp exps) ~at:at (* Call *) | Il.CallE (id, args) -> callE (id.it, translate_args args) ~at:at @@ -198,6 +199,7 @@ and translate_exp exp = | _ -> [ e ] in match (op, exps) with + | [ []; [] ], [ e1 ] -> translate_exp e1 | [ []; []; [] ], [ e1; e2 ] | [ []; [ Il.Semicolon ]; [] ], [ e1; e2 ] | [ []; [ Il.Semicolon ]; [ Il.Star ] ], [ e1; e2 ] @@ -246,6 +248,11 @@ and translate_exp exp = when List.for_all (fun l -> l = [] || l = [ Il.Star ] || l = [ Il.Quest ]) ll -> caseE ((name, lower name), List.map translate_exp el) ~at:at | _ -> yetE (Il.Print.string_of_exp exp) ~at:at) + | Il.UnmixE (e, op) -> ( + match op with + | [ []; [] ] -> translate_exp e + | _ -> yetE (Il.Print.string_of_exp exp) ~at:at) + | Il.ProjE (e, 0) -> translate_exp e | Il.OptE inner_exp -> optE (Option.map translate_exp inner_exp) ~at:at (* Yet *) | _ -> yetE (Il.Print.string_of_exp exp) ~at:at diff --git a/spectec/src/middlend/sideconditions.ml b/spectec/src/middlend/sideconditions.ml index 3dd527882a..262d96bb35 100644 --- a/spectec/src/middlend/sideconditions.ml +++ b/spectec/src/middlend/sideconditions.ml @@ -79,6 +79,7 @@ let rec t_exp env e : prem list = | LenE exp | MixE (_, exp) | ProjE (exp, _) + | UnmixE (exp, _) | OptE (Some exp) | TheE exp | CaseE (_, exp) diff --git a/spectec/src/middlend/sub.ml b/spectec/src/middlend/sub.ml index 61f9ab674e..2ab6b33742 100644 --- a/spectec/src/middlend/sub.ml +++ b/spectec/src/middlend/sub.ml @@ -126,7 +126,7 @@ and t_deftyp env x = { x with it = t_deftyp' env x.it } and t_deftyp' env = function | AliasT t -> AliasT (t_typ env t) - | NotationT (mixop, t) -> NotationT (mixop, t_typ env t) + | NotationT typcon -> NotationT (t_typcon env typcon) | StructT typfields -> StructT (List.map (t_typfield env) typfields) | VariantT typcases -> VariantT (List.map (t_typcase env) typcases) @@ -134,6 +134,8 @@ and t_typfield env (atom, (binds, t, prems), hints) = (atom, (t_binds env binds, t_typ env t, t_prems env prems), hints) and t_typcase env (atom, (binds, t, prems), hints) = (atom, (t_binds env binds, t_typ env t, t_prems env prems), hints) +and t_typcon env (mixop, (binds, t, prems), hints) = + (mixop, (t_binds env binds, t_typ env t, t_prems env prems), hints) and t_exp2 env x = { x with it = t_exp' env x.it; note = t_typ env x.note } @@ -155,6 +157,7 @@ and t_exp' env = function | CallE (a, args) -> CallE (a, t_args env args) | IterE (e, iterexp) -> IterE (t_exp env e, t_iterexp env iterexp) | ProjE (e, i) -> ProjE (t_exp env e, i) + | UnmixE (e, mixop) -> UnmixE (t_exp env e, mixop) | OptE None -> OptE None | OptE (Some exp) -> OptE (Some exp) | TheE exp -> TheE exp diff --git a/spectec/src/middlend/totalize.ml b/spectec/src/middlend/totalize.ml index bcb5a80eea..b484ecd0a8 100644 --- a/spectec/src/middlend/totalize.ml +++ b/spectec/src/middlend/totalize.ml @@ -64,7 +64,7 @@ and t_deftyp env x = { x with it = t_deftyp' env x.it } and t_deftyp' env = function | AliasT t -> AliasT (t_typ env t) - | NotationT (mixop, t) -> NotationT (mixop, t_typ env t) + | NotationT typcon -> NotationT (t_typcon env typcon) | StructT typfields -> StructT (List.map (t_typfield env) typfields) | VariantT typcases -> VariantT (List.map (t_typcase env) typcases) @@ -72,6 +72,8 @@ and t_typfield env (atom, (binds, t, prems), hints) = (atom, (t_binds env binds, t_typ env t, t_prems env prems), hints) and t_typcase env (atom, (binds, t, prems), hints) = (atom, (t_binds env binds, t_typ env t, t_prems env prems), hints) +and t_typcon env (mixop, (binds, t, prems), hints) = + (mixop, (t_binds env binds, t_typ env t, t_prems env prems), hints) (* Expr traversal *) @@ -96,6 +98,7 @@ and t_exp' env = function | CallE (a, args) -> CallE (a, List.map (t_arg env) args) | IterE (e, iterexp) -> IterE (t_exp env e, t_iterexp env iterexp) | ProjE (e, i) -> ProjE (t_exp env e, i) + | UnmixE (e, mixop) -> UnmixE (t_exp env e, mixop) | OptE None -> OptE None | OptE (Some exp) -> OptE (Some exp) | TheE exp -> TheE exp diff --git a/spectec/src/middlend/unthe.ml b/spectec/src/middlend/unthe.ml index fa2e1d0b89..596ff93fb9 100644 --- a/spectec/src/middlend/unthe.ml +++ b/spectec/src/middlend/unthe.ml @@ -92,7 +92,7 @@ let rec t_exp n e : eqns * exp = (* Descend first using t_exp2, and then see if we have to pull out the current expression *) let eqns, e' = t_exp2 n e in match e.it with - | TheE exp -> + | TheE exp -> let ot = exp.note in let t = match ot.it with | IterT (t, Opt) -> t @@ -126,6 +126,7 @@ and t_exp' n e : eqns * exp' = | MixE (mo, exp) -> t_e n exp (fun exp' -> MixE (mo, exp')) | CallE (f, args) -> t_list t_arg n args (fun args' -> CallE (f, args')) | ProjE (exp, i) -> t_e n exp (fun exp' -> ProjE (exp', i)) + | UnmixE (exp, mo) -> t_e n exp (fun exp' -> UnmixE (exp', mo)) | OptE (Some exp) -> t_e n exp (fun exp' -> OptE (Some exp')) | TheE exp -> t_e n exp (fun exp' -> TheE exp') | CaseE (a, exp) -> t_e n exp (fun exp' -> CaseE (a, exp')) diff --git a/spectec/src/middlend/wild.ml b/spectec/src/middlend/wild.ml index 58739a6396..17c840a51f 100644 --- a/spectec/src/middlend/wild.ml +++ b/spectec/src/middlend/wild.ml @@ -148,6 +148,7 @@ and t_exp' env e : bind list * exp' = | MixE (mo, exp) -> t_e env exp (fun exp' -> MixE (mo, exp')) | CallE (f, args) -> t_list t_arg env args (fun args' -> CallE (f, args')) | ProjE (exp, i) -> t_e env exp (fun exp' -> ProjE (exp', i)) + | UnmixE (exp, mo) -> t_e env exp (fun exp' -> UnmixE (exp', mo)) | OptE (Some exp) -> t_e env exp (fun exp' -> OptE (Some exp')) | TheE exp -> t_e env exp (fun exp' -> TheE exp') | CaseE (a, exp) -> t_e env exp (fun exp' -> CaseE (a, exp')) diff --git a/spectec/src/util/debug_log.ml b/spectec/src/util/debug_log.ml index 35aafc7021..a842ec0705 100644 --- a/spectec/src/util/debug_log.ml +++ b/spectec/src/util/debug_log.ml @@ -3,6 +3,10 @@ let active : string list = [] let fmt = Printf.sprintf +let log_exn _exn = + if active <> [] then + Printf.eprintf "\n%s\n%!" (Printexc.get_backtrace ()) + let log_at (type a) label at (arg_f : unit -> string) (res_f : a -> string) (f : unit -> a) : a = if not (List.mem label active) then f () else let ats = if at = Source.no_region then "" else " " ^ Source.string_of_region at in From 69016a3e56ed100e644301fdf1515a72e166ecb8 Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Sun, 25 Feb 2024 18:13:33 +0100 Subject: [PATCH 2/5] Simplify expansion in IL --- document/core/syntax/types.rst | 15 +++++--- document/core/syntax/values.rst | 2 +- spectec/src/il/eval.ml | 68 ++++++++++++++++++--------------- spectec/src/il/eval.mli | 1 + spectec/src/il/valid.ml | 55 +++++--------------------- 5 files changed, 60 insertions(+), 81 deletions(-) diff --git a/document/core/syntax/types.rst b/document/core/syntax/types.rst index c0f4631f3f..3006058d3a 100644 --- a/document/core/syntax/types.rst +++ b/document/core/syntax/types.rst @@ -36,8 +36,10 @@ Values of number type can be stored in :ref:`memories `. Conventions ........... -* The notation ${:|t|}` denotes the *bit width* of a number type ${:t}. - That is, ${:|I32| = |F32| = 32} and ${:|I64| = |F64| = 64}. +* The notation ${:$size(t)}` denotes the *bit width* of a number type ${:t}. + That is, ${:$size(I32) = $size(F32) = 32} and ${:$size(I64) = $size(F64) = 64}. + +$${definition-ignore: size} .. index:: ! vector type, integer, floating-point, IEEE 754, bit width, memory, SIMD @@ -64,8 +66,9 @@ Values of vector type can be stored in :ref:`memories `. Conventions ........... -* The notation ${:|t|} for :ref:`bit width ` extends to vector types as well, that is, ${:|V128| = 128}. +* The notation ${:$vsize(t)} for :ref:`bit width ` extends to vector types as well, that is, ${:$vsize(V128} = 128}. +$${definition-ignore: vsize} .. index:: ! heap type, store, type index, ! abstract type, ! concrete type, ! unboxed scalar @@ -85,7 +88,7 @@ There are three disjoint hierarchies of heap types: - *aggregate types* classify dynamically allocated *managed* data, such as *structures*, *arrays*, or *unboxed scalars*, - *external types* classify *external* references possibly owned by the :ref:`embedder `. -The values from the latter two hierarchies are interconvertible by ways of the |EXTERNCONVERTANY| and |ANYCONVERTEXTERN| instructions. +The values from the latter two hierarchies are interconvertible by ways of the ${instr: EXTERN.CONVERT_ANY} and ${instr: ANY.CONVERT_EXTERN} instructions. That is, both type hierarchies are inhabited by an isomorphic set of values, but may have different, incompatible representations in practice. $${syntax: {absheaptype/syn heaptype/syn}} @@ -250,7 +253,9 @@ $${syntax: {structtype arraytype fieldtype storagetype packtype}} Conventions ........... -* The notation ${:|t|} for :ref:`bit width ` extends to packed types as well, that is, ${:|I8| = 8} and ${:|I16| = 16}. +* The notation ${:$psize(t)} for :ref:`bit width ` extends to packed types as well, that is, ${:$psize(I8) = 8} and ${:$psize(I16) = 16}. + +$${definition-ignore: psize} .. index:: ! composite type, function type, aggreagate type, structure type, array type diff --git a/document/core/syntax/values.rst b/document/core/syntax/values.rst index d20e6b28e9..db600ba2a8 100644 --- a/document/core/syntax/values.rst +++ b/document/core/syntax/values.rst @@ -134,7 +134,7 @@ Vectors ~~~~~~~ *Numeric vectors* are 128-bit values that are processed by vector instructions (also known as *SIMD* instructions, single instruction multiple data). -They are represented in the abstract syntax using |i128|. The interpretation of lane types (:ref:`integer ` or :ref:`floating-point ` numbers) and lane sizes are determined by the specific instruction operating on them. +They are represented in the abstract syntax using ${:i128}. The interpretation of lane types (:ref:`integer ` or :ref:`floating-point ` numbers) and lane sizes are determined by the specific instruction operating on them. .. index:: ! name, byte, Unicode, UTF-8, character, binary format diff --git a/spectec/src/il/eval.ml b/spectec/src/il/eval.ml index 61a54d0426..387a72ba24 100644 --- a/spectec/src/il/eval.ml +++ b/spectec/src/il/eval.ml @@ -46,7 +46,7 @@ let equiv_list equiv_x env xs1 xs2 = (* Type Reduction (weak-head) *) let rec reduce_typ env t : typ = - Debug.(log_if "il.reduce_typ_app" (t.it <> NumT NatT) + Debug.(log_if "il.reduce_typ" (t.it <> NumT NatT) (fun _ -> fmt "%s" (il_typ t)) (fun r -> fmt "%s" (il_typ r)) ) @@ fun _ -> @@ -54,15 +54,25 @@ let rec reduce_typ env t : typ = | VarT (id, args) -> let args' = List.map (reduce_arg env) args in (match reduce_typ_app' env id args' t.at (Map.find id.it env.typs) with - | Some (AliasT t') -> reduce_typ env t' + | Some {it = AliasT t'; _} -> reduce_typ env t' | _ -> VarT (id, args') $ t.at ) | _ -> t -and reduce_typ_app env id args at : deftyp' option = +and reduce_typdef env t : deftyp = + let t' = reduce_typ env t in + match t'.it with + | VarT (id, as_) -> + (match reduce_typ_app env id as_ t'.at with + | Some dt -> dt + | None -> AliasT t $ t'.at + ) + | _ -> AliasT t $ t'.at + +and reduce_typ_app env id args at : deftyp option = Debug.(log "il.reduce_typ_app" (fun _ -> fmt "%s(%s)" id.it (il_args args)) - (fun r -> fmt "%s" (opt il_deftyp (Option.map (fun dt -> dt $ no_region) r))) + (fun r -> fmt "%s" (opt il_deftyp r)) ) @@ fun _ -> reduce_typ_app' env id (List.map (reduce_arg env) args) at (Map.find id.it env.typs) @@ -81,7 +91,7 @@ and reduce_typ_app' env id args at = function if not !assume_coherent_matches then None else reduce_typ_app' env id args at insts' | None -> reduce_typ_app' env id args at insts' - | Some s -> Some (Subst.subst_deftyp s dt).it + | Some s -> Some (Subst.subst_deftyp s dt) (* Expression Reduction *) @@ -524,13 +534,12 @@ and match_exp env s e1 e2 : subst option = | NatE _, NumT _ | TextE _, TextT -> true | UnE (MinusOp _, _), NumT t -> t >= IntT - | CaseE (atom, _), VarT (id, as_) -> - (match reduce_typ_app env id as_ t21'.at with - | Some (VariantT tcs) -> + | CaseE (atom, _), VarT _ -> + (match (reduce_typdef env t21).it with + | VariantT tcs -> (* Assumes that we only have shallow subtyping. *) List.exists (fun (atomN, _, _) -> atomN = atom) tcs - | Some _ -> false - | None -> raise Irred + | _ -> false ) | VarE id1, _ -> let t1 = reduce_typ env (Map.find id1.it env.vars) in @@ -573,13 +582,12 @@ and equiv_typ env t1 t2 = let t1' = reduce_typ env t1 in let t2' = reduce_typ env t2 in (t1 <> t1' || t2 <> t2') && equiv_typ env t1' t2' || - (match reduce_typ_app env id1 as1 t1'.at, reduce_typ_app env id2 as2 t2'.at with - | Some (NotationT tc1), Some (NotationT tc2) -> + (match (reduce_typdef env t1').it, (reduce_typdef env t2').it with + | NotationT tc1, NotationT tc2 -> let (op1, (_binds1, t11, prems1), _) = tc1 in let (op2, (_binds2, t21, prems2), _) = tc2 in op1 = op2 && equiv_typ env t11 t21 && equiv_list equiv_prem env prems1 prems2 - | Some dt1, Some dt2 -> Eq.eq_deftyp (dt1 $ t1.at) (dt2 $ t2.at) (* TODO *) - | _, _ -> false + | dt1, dt2 -> Eq.eq_deftyp (dt1 $ t1'.at) (dt2 $ t2'.at) (* TODO *) ) | VarT _, _ -> let t1' = reduce_typ env t1 in @@ -646,40 +654,40 @@ and sub_typ env t1 t2 = match t1'.it, t2'.it with | NumT t1', NumT t2' -> t1' < t2' | TupT xts1, TupT xts2 -> sub_tup env xts1 xts2 - | VarT (id1, as1), VarT (id2, as2) -> - (match reduce_typ_app env id1 as1 t1'.at, reduce_typ_app env id2 as2 t2'.at with - | Some (StructT tfs1), Some (StructT tfs2) -> + | VarT _, VarT _ -> + (match (reduce_typdef env t1').it, (reduce_typdef env t2').it with + | StructT tfs1, StructT tfs2 -> List.for_all (fun (atom, (_binds2, t2, prems2), _) -> match find_field tfs1 atom with | Some (_binds1, t1, prems1) -> equiv_typ env t1 t2 && Eq.eq_list Eq.eq_prem prems1 prems2 | None -> false ) tfs2 - | Some (VariantT tcs1), Some (VariantT tcs2) -> + | VariantT tcs1, VariantT tcs2 -> List.for_all (fun (atom, (_binds1, t1, prems1), _) -> match find_case tcs2 atom with | Some (_binds2, t2, prems2) -> equiv_typ env t1 t2 && Eq.eq_list Eq.eq_prem prems1 prems2 | None -> false ) tcs1 - | Some (NotationT tc1), _ -> + | NotationT tc1, _ -> let (_op1, (_binds1, t11, _prems1), _) = tc1 in sub_typ env t11 t2' - | _, Some (NotationT tc2) -> + | _, NotationT tc2 -> let (_op2, (_binds2, t21, _prems2), _) = tc2 in sub_typ env t1' t21 | _, _ -> false ) - | VarT (id1, as1), _ -> - (match reduce_typ_app env id1 as1 t1'.at with - | Some (NotationT tc1) -> + | VarT _, _ -> + (match (reduce_typdef env t1').it with + | NotationT tc1 -> let (_op1, (_binds1, t11, _prems1), _) = tc1 in sub_typ env t11 t2' | _ -> false ) - | _, VarT (id2, as2) -> - (match reduce_typ_app env id2 as2 t2'.at with - | Some (NotationT tc2) -> + | _, VarT _ -> + (match (reduce_typdef env t2').it with + | NotationT tc2 -> let (_op2, (_binds2, t21, _prems2), _) = tc2 in sub_typ env t1' t21 | _ -> false @@ -712,16 +720,16 @@ and disj_typ env t1 t2 = (fun _ -> fmt "%s ## %s" (il_typ t1) (il_typ t2)) Bool.to_string ) @@ fun _ -> match t1.it, t2.it with - | VarT (id1, as1), VarT (id2, as2) -> - (match reduce_typ_app env id1 as1 t1.at, reduce_typ_app env id2 as2 t2.at with - | Some (StructT tfs1), Some (StructT tfs2) -> + | VarT _, VarT _ -> + (match (reduce_typdef env t1).it, (reduce_typdef env t2).it with + | StructT tfs1, StructT tfs2 -> unordered (atoms tfs1) (atoms tfs2) || List.exists (fun (atom, (_binds2, t2, _prems2), _) -> match find_field tfs1 atom with | Some (_binds1, t1, _prems1) -> disj_typ env t1 t2 | None -> true ) tfs2 - | Some (VariantT tcs1), Some (VariantT tcs2) -> + | VariantT tcs1, VariantT tcs2 -> Set.disjoint (atoms tcs1) (atoms tcs2) || List.exists (fun (atom, (_binds1, t1, _prems1), _) -> match find_case tcs2 atom with diff --git a/spectec/src/il/eval.mli b/spectec/src/il/eval.mli index 57a73f9831..e118caa1e7 100644 --- a/spectec/src/il/eval.mli +++ b/spectec/src/il/eval.mli @@ -11,6 +11,7 @@ val (let*) : subst option -> (subst -> subst option) -> subst option val reduce_exp : env -> exp -> exp val reduce_typ : env -> typ -> typ +val reduce_typdef : env -> typ -> deftyp val reduce_arg : env -> arg -> arg val equiv_typ : env -> typ -> typ -> bool diff --git a/spectec/src/il/valid.ml b/spectec/src/il/valid.ml index b3fbc8d702..397c367a70 100644 --- a/spectec/src/il/valid.ml +++ b/spectec/src/il/valid.ml @@ -34,6 +34,7 @@ let new_env () = let local_env env = {env with vars = env.vars; typs = env.typs} +(* TODO: avoid repeated copying of environment *) let to_eval_env env = let vars = Env.map (fun (t, _iters) -> t) env.vars in let typs = Env.map (fun (_ps, insts) -> insts) env.typs in @@ -79,44 +80,8 @@ let typ_string env t = (* Type Accessors *) -(* Returns None when args cannot be reduced enough to decide family instance. *) -let expand_app env id as_ : deftyp' option = - Debug.(log "il.expand_app" - (fun _ -> fmt "%s(%s)" id.it (il_args as_)) - (fun r -> fmt "%s" (opt il_deftyp (Option.map (fun r -> r $ no_region) r))) - ) @@ fun _ -> - let env' = to_eval_env env in - let as_ = List.map (Eval.reduce_arg env') as_ in - let _ps, insts = find "syntax type" env.typs id in - let rec lookup = function - | [] -> None (* no match, cannot reduce *) - | inst::insts' -> - let InstD (_binds, as', dt) = inst.it in - if as' = [] && as_ = [] then Some dt.it else (* optimisation *) - match Eval.(match_list match_arg env' Subst.empty as_ as') with - | exception Eval.Irred -> lookup insts' (* cannot reduce, try next *) - | None -> lookup insts' - | Some s -> Some (Subst.subst_deftyp s dt).it - in lookup insts - -let rec expand env t : typ' = - match t.it with - | VarT (id, as_) -> - (match expand_app env id as_ with - | Some (AliasT t1) -> expand env t1 - | _ -> t.it - ) - | _ -> t.it - -let expand_def env t : deftyp' = - match expand env t with - | VarT (id, as_) -> - (match expand_app env id as_ with - | Some dt' -> dt' - | None -> AliasT t - ) - | _ -> AliasT t - +let expand_typ env t = (Eval.reduce_typ (to_eval_env env) t).it +let expand_typdef env t = (Eval.reduce_typdef (to_eval_env env) t).it type direction = Infer | Check @@ -137,33 +102,33 @@ let match_iter iter1 iter2 = iter2 = List || Eq.eq_iter iter1 iter2 let as_iter_typ iter phrase env dir t at : typ = - match expand env t with + match expand_typ env t with | IterT (t1, iter2) when match_iter iter iter2 -> t1 | _ -> as_error at phrase dir t ("(_)" ^ string_of_iter iter) let as_list_typ phrase env dir t at : typ = - match expand env t with + match expand_typ env t with | IterT (t1, (List | List1 | ListN _)) -> t1 | _ -> as_error at phrase dir t "(_)*" let as_tup_typ phrase env dir t at : (id * typ) list = - match expand env t with + match expand_typ env t with | TupT xts -> xts | _ -> as_error at phrase dir t "(_,...,_)" let as_mix_typ phrase env dir t at : mixop * typ = - match expand_def env t with + match expand_typdef env t with | NotationT (mixop, (_, t, _), _) -> mixop, t | _ -> as_error at phrase dir t ("`mixin-op`(...)") let as_struct_typ phrase env dir t at : typfield list = - match expand_def env t with + match expand_typdef env t with | StructT tfs -> tfs | _ -> as_error at phrase dir t "{...}" let as_variant_typ phrase env dir t at : typcase list = - match expand_def env t with + match expand_typdef env t with | VariantT tcs -> tcs | _ -> as_error at phrase dir t "| ..." @@ -181,7 +146,7 @@ let sub_typ env t1 t2 at = "does not match expected supertype `" ^ typ_string env t2 ^ "`") and selfify_typ env e t = - match expand env t with + match expand_typ env t with | TupT xts -> let s, _ = List.fold_left (fun (s, i) (xI, tI) -> From 531d3426f567bd1bc25666b41b475e97568e300c Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Tue, 27 Feb 2024 11:20:18 +0100 Subject: [PATCH 3/5] Allow exp patterns in IL tuples; type annotation on iteration variables --- spectec/spec/wasm-1.0/1-syntax.watsup | 4 +- spectec/spec/wasm-2.0/1-syntax.watsup | 4 +- spectec/spec/wasm-3.0/1-syntax.watsup | 4 +- spectec/src/backend-prose/gen.ml | 4 +- spectec/src/el/convert.ml | 36 + spectec/src/el/convert.mli | 3 + spectec/src/el/free.ml | 15 +- spectec/src/el/free.mli | 5 +- spectec/src/frontend/dim.ml | 53 +- spectec/src/frontend/elab.ml | 201 +- spectec/src/il/ast.ml | 4 +- spectec/src/il/eq.ml | 6 +- spectec/src/il/eval.ml | 221 +- spectec/src/il/free.ml | 14 +- spectec/src/il/free.mli | 3 +- spectec/src/il/print.ml | 13 +- spectec/src/il/subst.ml | 51 +- spectec/src/il/subst.mli | 2 +- spectec/src/il/valid.ml | 132 +- spectec/src/il2al/il2il.ml | 2 +- spectec/src/il2al/translate.ml | 10 +- spectec/src/il2al/transpile.ml | 4 +- spectec/src/middlend/sideconditions.ml | 6 +- spectec/src/middlend/unthe.ml | 4 +- spectec/src/middlend/wild.ml | 2 +- spectec/src/util/lib.ml | 20 +- spectec/src/util/lib.mli | 3 +- spectec/test-frontend/TEST.md | 1882 ++-- spectec/test-middlend/TEST.md | 11486 +++++++++++------------ 29 files changed, 7205 insertions(+), 6989 deletions(-) diff --git a/spectec/spec/wasm-1.0/1-syntax.watsup b/spectec/spec/wasm-1.0/1-syntax.watsup index 6f390f0840..270dfd0d1e 100644 --- a/spectec/spec/wasm-1.0/1-syntax.watsup +++ b/spectec/spec/wasm-1.0/1-syntax.watsup @@ -2,8 +2,8 @@ ;; Lists ;; -;; TODO: make alias -syntax list(syntax A) = | _LIST A* -- if |A*| < $(2^32) +;; TODO: enable writing X^n +syntax list(syntax X) = X* ;;-- if |X*| < $(2^32) ;; diff --git a/spectec/spec/wasm-2.0/1-syntax.watsup b/spectec/spec/wasm-2.0/1-syntax.watsup index 2c56d89c51..e5a908c4ea 100644 --- a/spectec/spec/wasm-2.0/1-syntax.watsup +++ b/spectec/spec/wasm-2.0/1-syntax.watsup @@ -2,8 +2,8 @@ ;; Lists ;; -;; TODO: make alias -syntax list(syntax A) = | _LIST A* -- if |A*| < $(2^32) +;; TODO: enable writing X^n +syntax list(syntax X) = X* ;;-- if |X*| < $(2^32) ;; diff --git a/spectec/spec/wasm-3.0/1-syntax.watsup b/spectec/spec/wasm-3.0/1-syntax.watsup index 6a481e91c0..339c7ee01d 100644 --- a/spectec/spec/wasm-3.0/1-syntax.watsup +++ b/spectec/spec/wasm-3.0/1-syntax.watsup @@ -2,8 +2,8 @@ ;; Lists ;; -;; TODO: enable side condition -syntax list(syntax X) = X* ;; -- if |X*| < $(2^32) +;; TODO: enable writing X^n +syntax list(syntax X) = X* ;;-- if |X*| < $(2^32) ;; diff --git a/spectec/src/backend-prose/gen.ml b/spectec/src/backend-prose/gen.ml index d5d249480f..9803abc06b 100644 --- a/spectec/src/backend-prose/gen.ml +++ b/spectec/src/backend-prose/gen.ml @@ -65,8 +65,8 @@ let rec prem_to_instrs prem = match prem.it with ) | Ast.IterPr (prem, iter) -> ( match iter with - | Ast.Opt, [id] -> [ IfI (isDefinedE (varE id.it), prem_to_instrs prem) ] - | Ast.(List | ListN _), [id] -> + | Ast.Opt, [(id, _)] -> [ IfI (isDefinedE (varE id.it), prem_to_instrs prem) ] + | Ast.(List | ListN _), [(id, _)] -> let name = varE id.it in [ ForallI (name, iterE (name, [id.it], Al.Ast.List), prem_to_instrs prem) ] | _ -> print_endline "prem_to_instr: Invalid prem 3"; [ YetI "TODO: prem_to_intrs 3" ]) diff --git a/spectec/src/el/convert.ml b/spectec/src/el/convert.ml index 2730ffaeb4..77e345e5ab 100644 --- a/spectec/src/el/convert.ml +++ b/spectec/src/el/convert.ml @@ -92,6 +92,42 @@ and expfield_of_typfield (atom, (t, _prems), _) = (atom, exp_of_typ t) +let expify t = function + | Some e -> e + | None -> VarE ("_" $ t.at, []) $ t.at + +module Set = Set.Make(String) + +let rec pat_of_typ' s t : exp option = + let (let*) = Option.bind in + match t.it with + | VarT (id, _args) when not (Set.mem id.it !s) -> + (* Suppress duplicates. *) + s := Set.add id.it !s; + Some (VarE (id, []) $ t.at) + | ParenT t1 -> + let* e1 = pat_of_typ' s t1 in + Some (ParenE (e1, false) $ t.at) + | TupT ts -> + let* es = pats_of_typs' s ts in + Some (TupE es $ t.at) + | SeqT ts -> + let* es = pats_of_typs' s ts in + Some (SeqE es $ t.at) + | IterT (t1, iter) -> + let* e1 = pat_of_typ' s t1 in + Some (IterE (e1, iter) $ t.at) + | _ -> None + +and pats_of_typs' s ts : exp list option = + let eos = List.map (pat_of_typ' s) ts in + if List.for_all ((=) None) eos then None else + Some (List.map2 expify ts eos) + +let pat_of_typ t = expify t (pat_of_typ' (ref Set.empty) t) +let pats_of_typs ts = List.map2 expify ts (List.map (pat_of_typ' (ref Set.empty)) ts) + + let rec sym_of_exp e = (match e.it with | VarE (id, args) -> VarG (id, args) diff --git a/spectec/src/el/convert.mli b/spectec/src/el/convert.mli index 36562e8415..4eda7c5159 100644 --- a/spectec/src/el/convert.mli +++ b/spectec/src/el/convert.mli @@ -23,4 +23,7 @@ val exp_of_arg : arg -> exp (* raises Source.Error *) val param_of_arg : arg -> param (* raises Source.Error *) val arg_of_param : param -> arg (* raises Source.Error *) +val pat_of_typ : typ -> exp +val pats_of_typs : typ list -> exp list + val strip_var_suffix : id -> id diff --git a/spectec/src/el/free.ml b/spectec/src/el/free.ml index ae52d2287c..6e13ae42ab 100644 --- a/spectec/src/el/free.ml +++ b/spectec/src/el/free.ml @@ -97,7 +97,7 @@ and free_typ t = | CaseT (_, ts, tcs, _) -> free_nl_list free_typ ts + free_nl_list (fun tc -> free_typcase tc - det_typcase tc) tcs - | ConT tc -> free_typcon tc + | ConT tc -> free_typcon tc - det_typcon tc | RangeT tes -> free_nl_list free_typenum tes | AtomT _ -> empty | SeqT ts -> free_list free_typ ts @@ -111,12 +111,7 @@ and free_typenum (e, eo) = free_exp e + free_opt free_exp eo (* Variables can be determined by types through implicit binders *) -and det_typ t = - match t.it with - | VarT (id, _) | ParenT {it = VarT (id, _); _} -> free_varid id - | SeqT ts -> free_list det_typ ts - | IterT (t1, iter) -> det_typ t1 + det_iter iter - | _ -> empty +and det_typ t = det_exp (Convert.pat_of_typ t) and det_typfield (_, (t, prems), _) = det_typ t + det_prems prems and det_typcase (_, (t, prems), _) = det_typ t + det_prems prems @@ -157,7 +152,7 @@ and free_path p = and det_exp e = match e.it with - | VarE (id, []) -> free_varid id + | VarE (id, []) -> bound_varid id | VarE _ -> assert false | UnE ((PlusOp | MinusOp), e1) | ParenE (e1, _) | BrackE (_, e1, _) -> det_exp e1 @@ -185,7 +180,7 @@ and det_expfield (_, e) = det_exp e and det_iter iter = match iter with | Opt | List | List1 -> empty - | ListN (e, id_opt) -> det_exp e + free_opt free_varid id_opt + | ListN (e, id_opt) -> det_exp e + free_opt bound_varid id_opt and idx_exp e = match e.it with @@ -205,7 +200,7 @@ and idx_expfield (_, e) = idx_exp e and idx_iter iter = match iter with | Opt | List | List1 -> empty - | ListN (e, id_opt) -> idx_exp e + free_opt free_varid id_opt + | ListN (e, id_opt) -> idx_exp e + free_opt bound_varid id_opt and det_cond_exp e = match e.it with diff --git a/spectec/src/el/free.mli b/spectec/src/el/free.mli index 7d90d499b3..3a7a341c4f 100644 --- a/spectec/src/el/free.mli +++ b/spectec/src/el/free.mli @@ -42,9 +42,8 @@ val free_def : def -> sets (this case is to handle function inverses) This is a pragmatic criterium, intended only for sanity checks. *) -val det_typfield : typfield -> sets -val det_typcase : typcase -> sets -val det_typcon : typcon -> sets +val det_exp : exp -> sets +val det_prems : prem nl_list -> sets val det_prod : prod -> sets val det_def : def -> sets diff --git a/spectec/src/frontend/dim.ml b/spectec/src/frontend/dim.ml index baeab561ff..b6054e43c6 100644 --- a/spectec/src/frontend/dim.ml +++ b/spectec/src/frontend/dim.ml @@ -81,7 +81,8 @@ let rec check_iter env ctx iter = and check_typ env ctx t = match t.it with | VarT (id, args) -> - check_typid env ctx id; + check_typid env ctx (Convert.strip_var_suffix id); + check_varid env ctx id; List.iter (check_arg env ctx) args | BoolT | NumT _ @@ -96,22 +97,26 @@ and check_typ env ctx t = check_typ env (strip_index iter::ctx) t1 | StrT tfs -> iter_nl_list (fun (_, (tI, prems), _) -> - check_typ env ctx tI; - iter_nl_list (check_prem env ctx) prems + let env' = ref Env.empty in + check_typ env' ctx tI; + iter_nl_list (check_prem env' ctx) prems ) tfs | CaseT (_, ts, tcs, _) -> iter_nl_list (check_typ env ctx) ts; iter_nl_list (fun (_, (tI, prems), _) -> - check_typ env ctx tI; - iter_nl_list (check_prem env ctx) prems + let env' = ref Env.empty in + check_typ env' ctx tI; + iter_nl_list (check_prem env' ctx) prems ) tcs | ConT ((t1, prems), _) -> - check_typ env ctx t1; - iter_nl_list (check_prem env ctx) prems + let env' = ref Env.empty in + check_typ env' ctx t1; + iter_nl_list (check_prem env' ctx) prems | RangeT tes -> iter_nl_list (fun (eI1, eoI2) -> - check_exp env ctx eI1; - Option.iter (check_exp env ctx) eoI2; + let env' = ref Env.empty in + check_exp env' ctx eI1; + Option.iter (check_exp env' ctx) eoI2; ) tes | InfixT (t1, _, t2) -> check_typ env ctx t1; @@ -283,10 +288,11 @@ let check_typdef t prems : env = open Il.Ast type env' = iter list Env.t -type occur = Il.Ast.iter list Env.t +type occur = (Il.Ast.typ * Il.Ast.iter list) Env.t -let union = Env.union (fun _ ctx1 ctx2 -> - Some (if List.length ctx1 < List.length ctx2 then ctx1 else ctx2)) +let union = Env.union (fun _ (t1, ctx1) (t2, ctx2) -> + (* For well-typed scripts, t1 == t2. *) + Some (if List.length ctx1 < List.length ctx2 then (t1, ctx1) else (t2, ctx2))) let strip_index = function | ListN (e, Some _) -> ListN (e, None) @@ -300,16 +306,17 @@ let rec annot_iter env iter : Il.Ast.iter * occur * occur = let occur2 = match id_opt with | None -> Env.empty - | Some id -> Env.singleton id.it (Env.find id.it env) + | Some id -> Env.singleton id.it (NumT NatT $ id.at, Env.find id.it env) in ListN (e', id_opt), occur1, occur2 and annot_exp env e : Il.Ast.exp * occur = + Il.Debug.(log_in "el.annot_exp" (fun _ -> il_exp e)); let it, occur = match e.it with - | VarE id -> - VarE id, Env.singleton id.it (Env.find id.it env) - | BoolE _ | NatE _ | TextE _ -> + | VarE id when id.it <> "_" -> + VarE id, Env.singleton id.it (e.note, Env.find id.it env) + | VarE _ | BoolE _ | NatE _ | TextE _ -> e.it, Env.empty | UnE (op, e1) -> let e1', occur1 = annot_exp env e1 in @@ -418,19 +425,19 @@ and annot_path env p : Il.Ast.path * occur = DotP (p1', atom), occur1 in {p with it}, occur -and annot_iterexp env occur1 (iter, ids) at : Il.Ast.iterexp * occur = - assert (ids = []); +and annot_iterexp env occur1 (iter, bs) at : Il.Ast.iterexp * occur = + assert (bs = []); let iter', occur2, occur3 = annot_iter env iter in let occur1' = - Env.filter_map (fun _ iters -> + Env.filter_map (fun _ (t, iters) -> match iters with | [] -> None | iter1::iters' -> - assert (Il.Eq.eq_iter (strip_index iter) iter1); Some iters' + assert (Il.Eq.eq_iter (strip_index iter) iter1); Some (t, iters') ) (union occur1 occur3) in - let ids' = List.map (fun (x, _) -> x $ at) (Env.bindings occur1') in - (iter', ids'), union occur1' occur2 + let bs' = List.map (fun (x, (t, _)) -> x $ at, t) (Env.bindings occur1') in + (iter', bs'), union occur1' occur2 and annot_arg env a : Il.Ast.arg * occur = let it, occur = @@ -465,7 +472,7 @@ and annot_prem env prem : Il.Ast.prem * occur = let annot_top annot_x env x = let x', occurs = annot_x env x in - assert (Env.for_all (fun _ ctx -> ctx = []) occurs); + assert (Env.for_all (fun _ (_t, ctx) -> ctx = []) occurs); x' let annot_exp = annot_top annot_exp diff --git a/spectec/src/frontend/elab.ml b/spectec/src/frontend/elab.ml index 0432124a96..98b4ff991e 100644 --- a/spectec/src/frontend/elab.ml +++ b/spectec/src/frontend/elab.ml @@ -26,6 +26,8 @@ module Debug = struct include El.Debug include Il.Debug end (* Helpers *) +let wild_exp t' = Il.VarE ("_" $ t'.at) $$ t'.at % t' + let unparen_exp e = match e.it with | ParenE (e1, _) -> e1 @@ -45,26 +47,19 @@ let tup_typ ts at = let tup_typ' ts' at = match ts' with | [t'] -> t' - | _ -> Il.TupT (List.map (fun t' -> "_" $ t'.at, t') ts') $ at + | _ -> Il.TupT (List.map (fun t' -> wild_exp t', t') ts') $ at -let tup_typ_bind' ids ts' at = - match ids, ts' with -(* - | [{it = "_"; _}], [t'] -> t' -*) - | _ -> Il.TupT (List.combine ids ts') $ at +let tup_typ_bind' es' ts' at = + Il.TupT (List.combine es' ts') $ at let tup_exp' es' at = match es' with | [e'] -> e' | _ -> Il.TupE es' $$ (at, tup_typ' (List.map note es') at) -let tup_exp_bind' ids es' at = - match es' with -(* - | [e'] -> e' -*) - | _ -> Il.TupE es' $$ (at, tup_typ_bind' ids (List.map note es') at) +let tup_exp_bind' es' at = + let ts' = List.map note es' in + Il.TupE es' $$ (at, tup_typ_bind' (List.map wild_exp ts') ts' at) let lift_exp' e' iter' = if iter' = Opt then @@ -657,9 +652,10 @@ and elab_typ_definition env tid t : Il.deftyp = let t' = elab_typ env t1 in let nt = match t1.it with NumT nt -> nt | _ -> assert false in let id' = "i" $ t.at in + let eid' = Il.VarE id' $$ t.at % t' in let bs' = [Il.ExpB (id', t', []) $ t.at] in - let prems' = [Il.IfPr (fe' (Il.VarE id' $$ t.at % t') nt) $ t.at] in - Il.NotationT ([[]; []], (bs', Il.TupT [(id', t')] $ t.at, prems'), []) + let prems' = [Il.IfPr (fe' eid' nt) $ t.at] in + Il.NotationT ([[]; []], (bs', Il.TupT [(eid', t')] $ t.at, prems'), []) | _ -> let t' = elab_typ env t in Il.AliasT t' @@ -682,64 +678,73 @@ and typ_rep env t : typ = and elab_typfield env tid at ((atom, (t, prems), hints) as tf) : Il.typfield = assert (tid.it <> ""); let env' = local_env env in - let _, _, _ids, _ts, ts' = elab_typ_notation env' tid t in + let _, _, ts', ts = elab_typ_notation env' tid t in + let es = Convert.pats_of_typs ts in let dims = Dim.check_typdef t prems in let dims' = Dim.Env.map (List.map (elab_iter env')) dims in + let es' = List.map (Dim.annot_exp dims') (List.map2 (elab_exp env') es ts) in let prems' = List.map (Dim.annot_prem dims') (concat_map_filter_nl_list (elab_prem env') prems) in - let det = Free.det_typfield tf in + let det = Free.(union (free_list det_exp es) (det_prems prems)) in let free = Free.(diff (free_typfield tf) (union det (bound_env env))) in if free <> Free.empty then error at ("type case contains indeterminate variable(s) `" ^ String.concat "`, `" (Free.Set.elements free.varid) ^ "`"); let acc_bs', (module Arg : Iter.Arg) = make_binds_iter_arg env' det dims in let module Acc = Iter.Make(Arg) in + List.iter Acc.exp es; Acc.prems prems; ( elab_atom atom tid, - (!acc_bs', tup_typ' ts' t.at, prems'), + (!acc_bs', (if prems = [] then tup_typ' else tup_typ_bind' es') ts' t.at, prems'), elab_hints tid hints ) and elab_typcase env tid at ((atom, (t, prems), hints) as tc) : Il.typcase = assert (tid.it <> ""); let env' = local_env env in - let _, _, ids, _ts, ts' = elab_typ_notation env' tid t in + let _, _, ts', ts = elab_typ_notation env' tid t in + let es = Convert.pats_of_typs ts in let dims = Dim.check_typdef t prems in let dims' = Dim.Env.map (List.map (elab_iter env')) dims in + let es' = List.map (Dim.annot_exp dims') (List.map2 (elab_exp env') es ts) in let prems' = List.map (Dim.annot_prem dims') (concat_map_filter_nl_list (elab_prem env') prems) in - let det = Free.det_typcase tc in + let det = Free.(union (free_list det_exp es) (det_prems prems)) in let free = Free.(diff (free_typcase tc) (union det (bound_env env))) in if free <> Free.empty then error at ("type case contains indeterminate variable(s) `" ^ String.concat "`, `" (Free.Set.elements free.varid) ^ "`"); let acc_bs', (module Arg : Iter.Arg) = make_binds_iter_arg env' det dims in let module Acc = Iter.Make(Arg) in + List.iter Acc.exp es; Acc.prems prems; ( elab_atom atom tid, - (!acc_bs', tup_typ_bind' ids ts' at, prems'), + (!acc_bs', tup_typ_bind' es' ts' at, prems'), elab_hints tid hints ) and elab_typcon env tid at (((t, prems), hints) as tc) : Il.typcon = assert (tid.it <> ""); let env' = local_env env in - let is_notation, mixop, ids, _ts, ts' = elab_typ_notation env' tid t in + let is_notation, mixop, ts', ts = elab_typ_notation env' tid t in + let es = Convert.pats_of_typs ts in let dims = Dim.check_typdef t prems in let dims' = Dim.Env.map (List.map (elab_iter env')) dims in + let es' = List.map (Dim.annot_exp dims') (List.map2 (elab_exp env') es ts) in let prems' = List.map (Dim.annot_prem dims') (concat_map_filter_nl_list (elab_prem env') prems) in - let det = Free.det_typcon tc in + let det = Free.(union (free_list det_exp es) (det_prems prems)) in let free = Free.(diff (free_typcon tc) (union det (bound_env env))) in if free <> Free.empty then error at ("type constraint contains indeterminate variable(s) `" ^ String.concat "`, `" (Free.Set.elements free.varid) ^ "`"); let acc_bs', (module Arg : Iter.Arg) = make_binds_iter_arg env' det dims in let module Acc = Iter.Make(Arg) in + List.iter Acc.exp es; Acc.prems prems; assert (is_notation || prems <> []); ( mixop, - (!acc_bs', tup_typ_bind' ids ts' at, prems'), + (!acc_bs', tup_typ_bind' es' ts' at, prems'), elab_hints tid hints ) @@ -767,10 +772,10 @@ and elab_typenum env tid (e1, e2o) : typ * (Il.exp -> numtyp -> Il.exp) = CmpE (LeOp nt', eid', e2') $$ e2'.at % (BoolT $ e2.at) ) $$ at % (BoolT $ at)) -and elab_typ_notation env tid t : bool * Il.mixop * id list * typ list * Il.typ list = +and elab_typ_notation env tid t : bool * Il.mixop * Il.typ list * typ list = Debug.(log_at "el.elab_typ_notation" t.at (fun _ -> fmt "%s = %s" tid.it (el_typ t)) - (fun (_, mixop, _, _, ts') -> fmt "%s(%s)" (il_mixop mixop) (list il_typ ts')) + (fun (_, mixop, ts', _) -> fmt "%s(%s)" (il_mixop mixop) (list il_typ ts')) ) @@ fun _ -> assert (tid.it <> ""); match t.it with @@ -780,45 +785,45 @@ and elab_typ_notation env tid t : bool * Il.mixop * id list * typ list * Il.typ | _, Transp -> error_id id "invalid forward reference to syntax type" | ps, _ -> let as', _s = elab_args `Rhs env as_ ps t.at in - false, [[]; []], [id], [t], [Il.VarT (id', as') $ t.at] + false, [[]; []], [Il.VarT (id', as') $ t.at], [t] ) | AtomT atom -> - true, [[elab_atom atom tid]], [], [], [] + true, [[elab_atom atom tid]], [], [] | SeqT [] -> - true, [[]], [], [], [] + true, [[]], [], [] | SeqT (t1::ts2) -> - let _b1, mixop1, ids1, ts1, ts1' = elab_typ_notation env tid t1 in - let _b2, mixop2, ids2, ts2, ts2' = elab_typ_notation env tid (SeqT ts2 $ t.at) in - true, merge_mixop mixop1 mixop2, ids1 @ ids2, ts1 @ ts2, ts1' @ ts2' + let _b1, mixop1, ts1', ts1 = elab_typ_notation env tid t1 in + let _b2, mixop2, ts2', ts2 = elab_typ_notation env tid (SeqT ts2 $ t.at) in + true, merge_mixop mixop1 mixop2, ts1' @ ts2', ts1 @ ts2 | InfixT (t1, atom, t2) -> - let _b1, mixop1, ids1, ts1, ts1' = elab_typ_notation env tid t1 in - let _b2, mixop2, ids2, ts2, ts2' = elab_typ_notation env tid t2 in + let _b1, mixop1, ts1', ts1 = elab_typ_notation env tid t1 in + let _b2, mixop2, ts2', ts2 = elab_typ_notation env tid t2 in true, merge_mixop (merge_mixop mixop1 [[elab_atom atom tid]]) mixop2, - ids1 @ ids2, ts1 @ ts2, ts1' @ ts2' + ts1' @ ts2', ts1 @ ts2 | BrackT (l, t1, r) -> - let _b1, mixop1, ids1, ts1, ts1' = elab_typ_notation env tid t1 in + let _b1, mixop1, ts1', ts1 = elab_typ_notation env tid t1 in true, merge_mixop (merge_mixop [[elab_atom l tid]] mixop1) [[elab_atom r tid]], - ids1, ts1, ts1' + ts1', ts1 | ParenT t1 -> - let b1, mixop1, ids1, ts1, ts1' = elab_typ_notation env tid t1 in - b1, merge_mixop (merge_mixop [[Il.LParen]] mixop1) [[Il.RParen]], ids1, ts1, ts1' + let b1, mixop1, ts1', ts1 = elab_typ_notation env tid t1 in + b1, merge_mixop (merge_mixop [[Il.LParen]] mixop1) [[Il.RParen]], ts1', ts1 | IterT (t1, iter) -> (match iter with | List1 | ListN _ -> error t.at "illegal iterator in notation type" | _ -> - let b1, mixop1, _ids, ts1, ts1' = elab_typ_notation env tid t1 in + let b1, mixop1, ts1', ts1 = elab_typ_notation env tid t1 in let iter' = elab_iter env iter in let tit = IterT (tup_typ ts1 t1.at, iter) $ t.at in let t' = Il.IterT (tup_typ' ts1' t1.at, iter') $ t.at in let op = match iter with Opt -> Il.Quest | _ -> Il.Star in - b1, [List.flatten mixop1] @ [[op]], ["_" $ t'.at], [tit], [t'] + b1, [List.flatten mixop1] @ [[op]], [t'], [tit] ) | _ -> - false, [[]; []], [Convert.varid_of_typ t], [t], [elab_typ env t] + false, [[]; []], [elab_typ env t], [t] and (!!!) env tid t = - let _, _, _, _, ts' = elab_typ_notation env tid t in tup_typ' ts' t.at + let _, _, ts', _ = elab_typ_notation env tid t in tup_typ' ts' t.at (* Expressions *) @@ -844,7 +849,9 @@ and infer_exp' env e : Il.exp' * typ = | VarE (id, args) -> if args <> [] then (* Args may only occur due to syntactic overloading with types *) - Source.error e.at "syntax" "malformed expression"; + error e.at "malformed expression"; + if id.it = "_" then + error e.at "cannot infer type of wildcard"; let t = if bound env.vars id then find "variable" env.vars id @@ -932,8 +939,10 @@ and infer_exp' env e : Il.exp' * typ = | DotE (e1, atom) -> let e1', t1 = infer_exp env e1 in let tfs = as_struct_typ "expression" env Infer t1 e1.at in - let t, _prems = find_field tfs atom e1.at t1 in - Il.DotE (e1', elab_atom atom (expand_id env t1)), t + let t, prems = find_field tfs atom e1.at t1 in + let e' = Il.DotE (e1', elab_atom atom (expand_id env t1)) in + let e'' = if prems = [] then e' else Il.ProjE (e' $$ e.at % elab_typ env t, 0) in + e'', t | CommaE (e1, e2) -> let e1', t1 = infer_exp env e1 in let tfs = as_struct_typ "expression" env Infer t1 e1.at in @@ -995,6 +1004,8 @@ and elab_exp' env e t : Il.exp' = (fun e' -> fmt "%s" (il_exp (e' $$ no_region % elab_typ env t))) ) @@ fun _ -> match e.it with + | VarE (id, []) when id.it = "_" -> + Il.VarE id | VarE (id, []) when not (Map.mem id.it env.vars) -> if bound env.gvars (strip_var_suffix id) then (* Variable type must be consistent with possible type hint. *) @@ -1131,14 +1142,16 @@ and elab_expfields env tid efs tfs t at : Il.expfield list = assert (tid.it <> ""); match efs, tfs with | [], [] -> [] - | (atom1, e)::efs2, (atom2, (t, _prems), _)::tfs2 when atom1.it = atom2.it -> + | (atom1, e)::efs2, (atom2, (t, prems), _)::tfs2 when atom1.it = atom2.it -> let es', _s = elab_exp_notation' env tid e t in let efs2' = elab_expfields env tid efs2 tfs2 t at in - (elab_atom atom1 tid, tup_exp' es' e.at) :: efs2' - | _, (atom, (t, _prems), _)::tfs2 -> + let e' = (if prems = [] then tup_exp' else tup_exp_bind') es' e.at in + (elab_atom atom1 tid, e') :: efs2' + | _, (atom, (t, prems), _)::tfs2 -> let atom' = string_of_atom atom in - let e' = - cast_empty ("omitted record field `" ^ atom' ^ "`") env t at (elab_typ env t) in + let es' = + [cast_empty ("omitted record field `" ^ atom' ^ "`") env t at (elab_typ env t)] in + let e' = (if prems = [] then tup_exp' else tup_exp_bind') es' at in let efs2' = elab_expfields env tid efs tfs2 t at in (elab_atom atom tid, e') :: efs2' | (atom, e)::_, [] -> @@ -1181,9 +1194,9 @@ and elab_exp_notation env tid e nt t : Il.exp = assert (tid.it <> ""); let es', _s = elab_exp_notation' env tid e nt in match elab_typ_notation env tid nt with - | false, _, _, _, _ -> tup_exp' es' e.at - | true, mixop, ids, _, _ -> - Il.MixE (mixop, tup_exp_bind' ids es' e.at) $$ e.at % elab_typ env t + | false, _, _, _ -> tup_exp' es' e.at + | true, mixop, _, _ -> + Il.MixE (mixop, tup_exp_bind' es' e.at) $$ e.at % elab_typ env t and elab_exp_notation' env tid e t : Il.exp list * Subst.t = Debug.(log_at "el.elab_exp_notation" e.at @@ -1286,7 +1299,7 @@ and elab_exp_notation' env tid e t : Il.exp list * Subst.t = and elab_exp_notation_iter env tid es (t1, iter) t at : Il.exp = assert (tid.it <> ""); let e' = elab_exp_notation_iter' env tid es (t1, iter) t at in - let _, _, _, _, ts' = elab_typ_notation env tid t in + let _, _, ts', _ = elab_typ_notation env tid t in e' $$ at % tup_typ' ts' t.at and elab_exp_notation_iter' env tid es (t1, iter) t at : Il.exp' = @@ -1335,11 +1348,10 @@ and elab_exp_variant env tid e cases t at : Il.exp = in let t1, _prems = find_case cases atom at t in let es', _s = elab_exp_notation' env tid e t1 in - let _, _, ids, _, _ = elab_typ_notation env tid t1 in let t2 = expand_singular env t $ at in let t2' = elab_typ env t2 in cast_exp "variant case" env - (Il.CaseE (elab_atom atom tid, tup_exp_bind' ids es' at) $$ at % t2') t2 t + (Il.CaseE (elab_atom atom tid, tup_exp_bind' es' at) $$ at % t2') t2 t and elab_path env p t : Il.path * typ = @@ -1376,10 +1388,10 @@ and cast_empty phrase env t at t' : Il.exp = assert (is_notation_typ env t); (match expand_iter_notation env t with | IterT (_, iter) as t1 -> - let _, mixop, ids, _ts, ts' = elab_typ_notation env (expand_id env t) (t1 $ t.at) in + let _, mixop, ts', _ts = elab_typ_notation env (expand_id env t) (t1 $ t.at) in assert (List.length ts' = 1); let e1' = if iter = Opt then Il.OptE None else Il.ListE [] in - Il.MixE (mixop, tup_exp_bind' ids [e1' $$ at % List.hd ts'] at) $$ at % t' + Il.MixE (mixop, tup_exp_bind' [e1' $$ at % List.hd ts'] at) $$ at % t' | _ -> error_typ env at phrase t ) | _ -> error_typ env at phrase t @@ -1407,36 +1419,36 @@ and cast_exp' phrase env e' t1 t2 : Il.exp' = | _, IterT (t21, (List | List1)) -> Il.ListE [cast_exp phrase env e' t1 t21] | ConT ((t11, _), _), ConT ((t21, _), _) -> - let _, mixop1, ids1, ts1, ts1' = elab_typ_notation env (expand_id env t1) t11 in - let _, mixop2, ids2, ts2, _ts2' = elab_typ_notation env (expand_id env t2) t21 in + let _, mixop1, ts1', ts1 = elab_typ_notation env (expand_id env t1) t11 in + let _, mixop2, _ts2', ts2 = elab_typ_notation env (expand_id env t2) t21 in if mixop1 <> mixop2 then error_typ2 env e'.at phrase t1 t2 ""; - let e'' = Il.UnmixE (e', mixop1) $$ e'.at % tup_typ_bind' ids1 ts1' e'.at in + let e'' = Il.UnmixE (e', mixop1) $$ e'.at % tup_typ' ts1' e'.at in let es' = List.mapi (fun i t1I' -> Il.ProjE (e'', i) $$ e''.at % t1I') ts1' in let es'' = List.map2 (fun eI' (t1I, t2I) -> cast_exp phrase env eI' t1I t2I) es' (List.combine ts1 ts2) in - Il.MixE (mixop2, tup_exp_bind' ids2 es'' e'.at) + Il.MixE (mixop2, tup_exp_bind' es'' e'.at) | ConT ((t11, _), _), _ -> - let _, mixop, ids, ts, ts' = elab_typ_notation env (expand_id env t1) t11 in + let _, mixop, ts', ts = elab_typ_notation env (expand_id env t1) t11 in let t111, t111' = match ts, ts' with [t111], [t111'] -> t111, t111' | _ -> error_typ2 env e'.at phrase t1 t2 "" in - let e'' = Il.UnmixE (e', mixop) $$ e'.at % tup_typ_bind' ids ts' e'.at in + let e'' = Il.UnmixE (e', mixop) $$ e'.at % tup_typ' ts' e'.at in cast_exp' phrase env (Il.ProjE (e'', 0) $$ e'.at % t111') t111 t2 | _, ConT ((t21, _), _) -> - let _, mixop, ids, ts, _ts' = elab_typ_notation env (expand_id env t2) t21 in + let _, mixop, _ts', ts = elab_typ_notation env (expand_id env t2) t21 in let t211 = match ts with [t211] -> t211 | _ -> error_typ2 env e'.at phrase t1 t2 "" in - Il.MixE (mixop, tup_exp_bind' ids [cast_exp phrase env e' t1 t211] e'.at) + Il.MixE (mixop, tup_exp_bind' [cast_exp phrase env e' t1 t211] e'.at) | RangeT _, _ -> let t11 = typ_rep env t1 in let t11' = elab_typ env t11 in - let e'' = Il.UnmixE (e', [[]; []]) $$ e'.at % tup_typ_bind' ["i" $ e'.at] [t11'] e'.at in + let e'' = Il.UnmixE (e', [[]; []]) $$ e'.at % tup_typ' [t11'] e'.at in let e''' = Il.ProjE (e'', 0) $$ e'.at % t11' in cast_exp' phrase env e''' t11 t2 | _, RangeT _ -> let t21 = typ_rep env t2 in let e'' = cast_exp phrase env e' t1 t21 in - Il.MixE ([[]; []], tup_exp_bind' ["i" $ e'.at] [e''] e'.at) + Il.MixE ([[]; []], tup_exp_bind' [e''] e'.at) | _, _ when is_variant_typ env t1 && is_variant_typ env t2 -> let cases1, dots1 = as_variant_typ "" env Check t1 e'.at in let cases2, _dots2 = as_variant_typ "" env Check t2 e'.at in @@ -1472,7 +1484,7 @@ and elab_prem env prem : Il.prem list = [] | RulePr (id, e) -> let t, _ = find "relation" env.rels id in - let _, mixop, _, _, _ = elab_typ_notation env id t in + let _, mixop, _, _ = elab_typ_notation env id t in let es', _s = elab_exp_notation' env id e t in [Il.RulePr (id, mixop, tup_exp' es' e.at) $ prem.at] | IfPr e -> @@ -1557,16 +1569,17 @@ and elab_gram env gram t = (* Definitions *) and make_binds_iter_arg env free dims : Il.bind list ref * (module Iter.Arg) = - let left = ref free in - let r = ref [] in let module Arg = struct include Iter.Skip + let left = ref free + let acc = ref [] + let visit_typid id = if Free.Set.mem id.it !left.typid then ( - r := !r @ [Il.TypB id $ id.at]; - left := Free.{!left with typid = Set.remove id.it !left.typid} + acc := !acc @ [Il.TypB id $ id.at]; + left := Free.{!left with typid = Set.remove id.it !left.typid}; ) let visit_varid id = @@ -1584,8 +1597,8 @@ and make_binds_iter_arg env free dims : Il.bind list ref * (module Iter.Arg) = ", which only occur(s) to its right; try to reorder parameters or premises"); let t' = elab_typ env t in let ctx = List.map (elab_iter env) (Dim.Env.find id.it dims) in - r := !r @ [Il.ExpB (id, t', ctx) $ id.at]; - left := Free.{!left with varid = Set.remove id.it !left.varid} + acc := !acc @ [Il.ExpB (id, t', ctx) $ id.at]; + left := Free.{!left with varid = Set.remove id.it !left.varid}; ) let visit_gramid id = @@ -1599,10 +1612,10 @@ and make_binds_iter_arg env free dims : Il.bind list ref * (module Iter.Arg) = List.map (fun id -> "`" ^ id ^ "`") |> String.concat ", " ) ^ ", which only occur(s) to its right; try to reorder parameters or premises"); - left := Free.{!left with varid = Set.remove id.it !left.varid} + left := Free.{!left with varid = Set.remove id.it !left.gramid}; ) end - in r, (module Arg) + in Arg.acc, (module Arg) and elab_arg in_lhs env a p s : Il.arg option * Subst.subst = (match !(a.it), p.it with (* HACK: handle shorthands *) @@ -1773,7 +1786,7 @@ let elab_hintdef _env hd : Il.def list = [] -let elab_binds env env' dims d : Il.bind list = +let infer_binds env env' dims d : Il.bind list = let det = Free.det_def d in let free = Free.(diff (free_def d) (union det (bound_env env))) in if free <> Free.empty then @@ -1784,8 +1797,8 @@ let elab_binds env env' dims d : Il.bind list = Acc.def d; !acc_bs' -let elab_no_binds env d = - let bs' = elab_binds env env (Dim.check_def d) d in +let infer_no_binds env d = + let bs' = infer_binds env env (Dim.check_def d) d in assert (bs' = []) @@ -1795,7 +1808,7 @@ let elab_def env d : Il.def list = match d.it with | FamD (id, ps, hints) -> let ps' = elab_params (local_env env) ps in - elab_no_binds env d; + infer_no_binds env d; env.typs <- rebind "syntax type" env.typs id (ps, Family []); [Il.TypD (id, ps', []) $ d.at] @ elab_hintdef env (TypH (id, "" $ id.at, hints) $ d.at) @@ -1805,7 +1818,7 @@ let elab_def env d : Il.def list = let as', _s = elab_args `Lhs env' as_ ps1 d.at in let dt' = elab_typ_definition env' id1 t in let dims = Dim.check_def d in - let bs' = elab_binds env env' dims d in + let bs' = infer_binds env env' dims d in let inst' = Il.InstD (bs', as', dt') $ d.at in let k1', closed = match k1, t.it with @@ -1815,12 +1828,12 @@ let elab_def env d : Il.def list = Defined (t, dt'), dots2 = NoDots | (Opaque | Transp), _ -> Defined (t, dt'), true - | Defined ({it = CaseT (dots1, ids1, tcs1, Dots); at; _}, _), - CaseT (Dots, ids2, tcs2, dots2) -> + | Defined ({it = CaseT (dots1, ts1, tcs1, Dots); at; _}, _), + CaseT (Dots, ts2, tcs2, dots2) -> let ps = List.map Convert.param_of_arg as_ in if not Eq.(eq_list eq_param ps ps1) then error d.at "syntax parameters differ from previous fragment"; - let t1 = CaseT (dots1, ids1 @ ids2, tcs1 @ tcs2, dots2) $ over_region [at; t.at] in + let t1 = CaseT (dots1, ts1 @ ts2, tcs1 @ tcs2, dots2) $ over_region [at; t.at] in Defined (t1, dt'), dots2 = NoDots | Defined _, CaseT (Dots, _, _, _) -> error_id id1 "extension of non-extensible syntax type" @@ -1843,8 +1856,8 @@ let elab_def env d : Il.def list = ) @ elab_hintdef env (TypH (id1, id2, hints) $ d.at) | GramD _ -> [] | RelD (id, t, hints) -> - let _, mixop, _ids, _ts, ts' = elab_typ_notation env id t in - elab_no_binds env d; + let _, mixop, ts', _ts = elab_typ_notation env id t in + infer_no_binds env d; env.rels <- bind "relation" env.rels id (t, []); [Il.RelD (id, mixop, tup_typ' ts' t.at, []) $ d.at] @ elab_hintdef env (RelH (id, hints) $ d.at) @@ -1853,24 +1866,24 @@ let elab_def env d : Il.def list = let dims = Dim.check_def d in let dims' = Dim.Env.map (List.map (elab_iter env')) dims in let t, rules' = find "relation" env.rels id1 in - let _, mixop, _, _, _ = elab_typ_notation env id1 t in + let _, mixop, _, _ = elab_typ_notation env id1 t in let es' = List.map (Dim.annot_exp dims') (fst (elab_exp_notation' env' id1 e t)) in let prems' = List.map (Dim.annot_prem dims') (concat_map_filter_nl_list (elab_prem env') prems) in - let bs' = elab_binds env env' dims d in + let bs' = infer_binds env env' dims d in let rule' = Il.RuleD (id2, bs', mixop, tup_exp' es' e.at, prems') $ d.at in env.rels <- rebind "relation" env.rels id1 (t, rules' @ [rule']); [] | VarD (id, t, _hints) -> let _t' = elab_typ env t in - elab_no_binds env d; + infer_no_binds env d; env.gvars <- rebind "variable" env.gvars id t; [] | DecD (id, ps, t, hints) -> let env' = local_env env in let ps' = elab_params env' ps in let t' = elab_typ env' t in - elab_no_binds env d; + infer_no_binds env d; env.defs <- bind "definition" env.defs id (ps, t, []); [Il.DecD (id, ps', t', []) $ d.at] @ elab_hintdef env (DecH (id, hints) $ d.at) @@ -1884,7 +1897,7 @@ let elab_def env d : Il.def list = let e' = Dim.annot_exp dims' (elab_exp env' e (Subst.subst_typ s t)) in let prems' = List.map (Dim.annot_prem dims') (concat_map_filter_nl_list (elab_prem env') prems) in - let bs' = elab_binds env env' dims d in + let bs' = infer_binds env env' dims d in let clause' = Il.DefD (bs', as', e', prems') $ d.at in env.defs <- rebind "definition" env.defs id (ps, t, clauses' @ [(d, clause')]); [] @@ -1902,7 +1915,7 @@ let elab_gramdef env d = let _ps' = elab_params env' ps in let _t' = elab_typ env' t in elab_gram env' gram t; - elab_no_binds env' d; + infer_no_binds env' d; let ps1, t1, gram1_opt = find "grammar" env.syms id1 in let gram' = match gram1_opt, gram.it with diff --git a/spectec/src/il/ast.ml b/spectec/src/il/ast.ml index 3b651c1df1..df3ebb6f6b 100644 --- a/spectec/src/il/ast.ml +++ b/spectec/src/il/ast.ml @@ -78,7 +78,7 @@ and typ' = | BoolT (* `bool` *) | NumT of numtyp (* numtyp *) | TextT (* `text` *) - | TupT of (id * typ) list (* typ * ... * typ *) + | TupT of (exp * typ) list (* typ * ... * typ *) | IterT of typ * iter (* typ iter *) and deftyp = deftyp' phrase @@ -160,7 +160,7 @@ and path' = | SliceP of path * exp * exp (* path `[` exp `:` exp `]` *) | DotP of path * atom (* path `.` atom *) -and iterexp = iter * id list +and iterexp = iter * (id * typ) list (* Definitions *) diff --git a/spectec/src/il/eq.ml b/spectec/src/il/eq.ml index 17689c1197..1d9173b381 100644 --- a/spectec/src/il/eq.ml +++ b/spectec/src/il/eq.ml @@ -38,7 +38,7 @@ and eq_typ t1 t2 = t1.it = t2.it || match t1.it, t2.it with | VarT (id1, as1), VarT (id2, as2) -> eq_id id1 id2 && eq_list eq_arg as1 as2 - | TupT xts1, TupT xts2 -> eq_list (eq_pair eq_id eq_typ) xts1 xts2 + | TupT xts1, TupT xts2 -> eq_list (eq_pair eq_exp eq_typ) xts1 xts2 | IterT (t11, iter1), IterT (t21, iter2) -> eq_typ t11 t21 && eq_iter iter1 iter2 | _, _ -> t1.it = t2.it @@ -109,8 +109,8 @@ and eq_path p1 p2 = | DotP (p11, atom1), DotP (p21, atom2) -> eq_path p11 p21 && atom1 = atom2 | _, _ -> p1.it = p2.it -and eq_iterexp (iter1, ids1) (iter2, ids2) = - eq_iter iter1 iter2 && eq_list eq_id ids1 ids2 +and eq_iterexp (iter1, bs1) (iter2, bs2) = + eq_iter iter1 iter2 && eq_list (eq_pair eq_id eq_typ) bs1 bs2 (* Premises *) diff --git a/spectec/src/il/eval.ml b/spectec/src/il/eval.ml index 387a72ba24..11e338ff75 100644 --- a/spectec/src/il/eval.ml +++ b/spectec/src/il/eval.ml @@ -28,6 +28,11 @@ let (let*) = Option.bind let ($>) it e = {e with it} +let fst3 (x, _, _) = x +let snd3 (_, x, _) = x + +let unordered s1 s2 = not Set.(subset s1 s2 || subset s2 s1) + (* Matching Lists *) @@ -247,9 +252,29 @@ and reduce_exp env e : exp = | None -> CallE (id, args') $> e | Some e -> e ) - | IterE (e1, iter) -> + | IterE (e1, (iter, bs)) -> let e1' = reduce_exp env e1 in - IterE (e1', iter) $> e (* TODO *) + let (iter', bs') = reduce_iterexp env (iter, bs) in + (match iter' with + | ListN ({it = NatE n; _}, ido) -> + ListE (List.init (Z.to_int n) (fun i -> + let idx = NatE (Z.of_int i) $$ e.at % (NumT NatT $ e.at) in + let s = + match ido with + | None -> Subst.empty + | Some id -> Subst.add_varid Subst.empty id idx + in + let s' = + List.fold_left (fun s (id, t) -> + let iterX = (iter', [(id, t)]) in + let tX = IterT (t, List) $ id.at in + let eX = IterE (VarE id $$ id.at % t, iterX) $$ id.at % tX in + Subst.add_varid s id (IdxE (eX, idx) $$ id.at % t) + ) s bs' + in reduce_exp env (Subst.subst_exp s' e1') + )) + | _ -> IterE (e1', (iter', bs')) + ) $> e | ProjE (e1, i) -> let e1' = reduce_exp env e1 in (match e1'.it with @@ -289,16 +314,23 @@ and reduce_exp env e : exp = reduce_exp env (SubE (e11', t11', t2') $> e) | TupE es' -> (match t1.it, t2.it with - | TupT xts1, TupT xts2 -> - let s1 = List.fold_left2 (fun s (x, _) e -> - Subst.add_varid s x e) Subst.empty xts1 es' in - let s2 = List.fold_left2 (fun s (x, _) e -> - Subst.add_varid s x e) Subst.empty xts2 es' in - TupE (List.map2 (fun eI ((_, t1I), (_, t2I)) -> - let t1I' = Subst.subst_typ s1 t1I in - let t2I' = Subst.subst_typ s2 t2I in - reduce_exp env (SubE (eI, t1I', t2I') $$ eI.at % t2I') - ) es' (List.combine xts1 xts2)) $> e + | TupT ets1, TupT ets2 -> + (match + List.fold_left2 (fun opt eI ((e1I, t1I), (e2I, t2I)) -> + let* (s1, s2, res') = opt in + let t1I' = Subst.subst_typ s1 t1I in + let t2I' = Subst.subst_typ s2 t2I in + let e1I' = reduce_exp env (Subst.subst_exp s1 e1I) in + let e2I' = reduce_exp env (Subst.subst_exp s2 e2I) in + let* s1' = try match_exp env s1 eI e1I' with Irred -> None in + let* s2' = try match_exp env s2 eI e2I' with Irred -> None in + let eI' = reduce_exp env (SubE (eI, t1I', t2I') $$ eI.at % t2I') in + Some (s1', s2', eI'::res') + ) (Some (Subst.empty, Subst.empty, [])) es' (List.combine ets1 ets2) + with + | Some (_, _, res') -> TupE (List.rev res') $> e + | None -> SubE (e1', t1', t2') $> e + ) | _ -> SubE (e1', t1', t2') $> e ) | _ when is_normal_exp e1' -> @@ -306,6 +338,12 @@ and reduce_exp env e : exp = | _ -> SubE (e1', t1', t2') $> e ) +and reduce_iter env = function + | ListN (e, ido) -> ListN (reduce_exp env e, ido) + | iter -> iter + +and reduce_iterexp env (iter, ids) = (reduce_iter env iter, ids) + and reduce_expfield env (atom, e) : expfield = (atom, reduce_exp env e) and reduce_path env e p f = @@ -394,10 +432,10 @@ and reduce_prem env prem : bool option = ) | ElsePr -> Some true | LetPr (e1, e2, _ids) -> - let e2' = reduce_exp env e2 in - (match match_exp env Subst.empty e2' e1 with + (match match_exp env Subst.empty e2 e1 with | Some _ -> Some true (* TODO: need to keep substitution? *) | None -> None + | exception Irred -> None ) | IterPr (_prem, _iter) -> None (* TODO *) @@ -412,6 +450,7 @@ and match_iter env s iter1 iter2 : subst option = | List, List -> Some s | List1, List1 -> Some s | ListN (e1, _ido1), ListN (e2, _ido2) -> match_exp env s e1 e2 + | (Opt | List1 | ListN _), List -> Some s | _, _ -> None @@ -443,19 +482,23 @@ and match_typ env s t1 t2 : subst option = let t2' = reduce_typ env t2 in if Eq.eq_typ t2 t2' then None else match_typ env s t1 t2' - | TupT xts1, TupT xts2 -> match_list match_typbind env s xts1 xts2 + | TupT ets1, TupT ets2 -> match_list match_typbind env s ets1 ets2 | IterT (t11, iter1), IterT (t21, iter2) -> let* s' = match_typ env s t11 t21 in match_iter env s' iter1 iter2 | _, _ -> None -and match_typbind env s (id1, t1) (id2, t2) = - let* s' = match_typ env s t1 (Subst.subst_typ s t2) in - Some (Subst.add_varid s' id2 (VarE id1 $$ id1.at % t1)) +and match_typbind env s (e1, t1) (e2, t2) = + let* s' = match_exp env s e1 (Subst.subst_exp s e2) in + let* s'' = match_typ env s' t1 (Subst.subst_typ s t2) in + Some s'' (* Expressions *) and match_exp env s e1 e2 : subst option = + match_exp' env s (reduce_exp env e1) e2 + +and match_exp' env s e1 e2 : subst option = Debug.(log "il.match_exp" (fun _ -> fmt "%s : %s =: %s" (il_exp e1) (il_typ e1.note) (il_exp (Subst.subst_exp s e2))) (fun r -> fmt "%s" (opt il_subst r)) @@ -476,56 +519,73 @@ and match_exp env s e1 e2 : subst option = | BoolE b1, BoolE b2 when b1 = b2 -> Some s | NatE n1, NatE n2 when n1 = n2 -> Some s | TextE s1, TextE s2 when s1 = s2 -> Some s - | UnE (MinusOp _, e11), UnE (MinusOp _, e21) -> match_exp env s e11 e21 + | UnE (MinusOp _, e11), UnE (MinusOp _, e21) -> match_exp' env s e11 e21 (* - | UnE (op1, e11), UnE (op2, e21) when op1 = op2 -> match_exp env s e11 e21 + | UnE (op1, e11), UnE (op2, e21) when op1 = op2 -> match_exp' env s e11 e21 | BinE (e11, op1, e12), BinE (e21, op2, e22) when op1 = op2 -> - let* s' = match_exp env s e11 e21 in match_exp env s' e12 e22 + let* s' = match_exp' env s e11 e21 in match_exp' env s' e12 e22 | CmpE (e11, op1, e12), CmpE (e21, op2, e22) when op1 = op2 -> - let* s' = match_exp env s e11 e21 in match_exp env s' e12 e22 + let* s' = match_exp' env s e11 e21 in match_exp' env s' e12 e22 | (EpsE | SeqE []), (EpsE | SeqE []) -> Some s *) | ListE es1, ListE es2 - | TupE es1, TupE es2 -> match_list match_exp env s es1 es2 + | TupE es1, TupE es2 -> match_list match_exp' env s es1 es2 + | _, TupE es2 -> + let* es1 = eta_tup_exp env e1 in + match_list match_exp' env s es1 es2 + | ListE es1, CatE ({it = ListE es21; _} as e21, e22) + when List.length es21 <= List.length es1 -> + let es11, es12 = Lib.List.split (List.length es21) es1 in + let* s' = match_exp' env s (ListE es11 $> e1) e21 in + match_exp' env s' (ListE es12 $> e1) e22 + | ListE es1, CatE (e21, ({it = ListE es22; _} as e22)) + when List.length es22 <= List.length es1 -> + let es11, es12 = Lib.List.split (List.length es22) es1 in + let* s' = match_exp' env s (ListE es11 $> e1) e21 in + match_exp' env s' (ListE es12 $> e1) e22 (* | IdxE (e11, e12), IdxE (e21, e22) | CommaE (e11, e12), CommaE (e21, e22) | CompE (e11, e12), CompE (e21, e22) -> - let* s' = match_exp env s e11 e21 in match_exp env s' e12 e22 + let* s' = match_exp' env s e11 e21 in match_exp' env s' e12 e22 | SliceE (e11, e12, e13), SliceE (e21, e22, e23) -> - let* s' = match_exp env s e11 e21 in - let* s'' = match_exp env s' e12 e22 in - match_exp env s'' e13 e23 + let* s' = match_exp' env s e11 e21 in + let* s'' = match_exp' env s' e12 e22 in + match_exp' env s'' e13 e23 | UpdE (e11, p1, e12), UpdE (e21, p2, e22) | ExtE (e11, p1, e12), ExtE (e21, p2, e22) -> - let* s' = match_exp env s e11 e21 in + let* s' = match_exp' env s e11 e21 in let* s'' = match_path env s' p1 p2 in - match_exp env s'' e12 e22 + match_exp' env s'' e12 e22 *) | StrE efs1, StrE efs2 -> match_list match_expfield env s efs1 efs2 (* | DotE (e11, atom1), DotE (e21, atom2) when atom1 = atom2 -> - match_exp env s e11 e21 - | LenE e11, LenE e21 -> match_exp env s e11 e21 + match_exp' env s e11 e21 + | LenE e11, LenE e21 -> match_exp' env s e11 e21 *) | CaseE (atom1, e11), CaseE (atom2, e21) when atom1 = atom2 -> - match_exp env s e11 e21 + match_exp' env s e11 e21 | MixE (op1, e11), MixE (op2, e21) when op1 = op2 -> - match_exp env s e11 e21 + match_exp' env s e11 e21 (* | CallE (id1, args1), CallE (id2, args2) when id1.it = id2.it -> match_list match_arg env s args1 args2 *) | IterE (e11, iter1), IterE (e21, iter2) -> - let* s' = match_exp env s e11 e21 in + let* s' = match_exp' env s e11 e21 in + match_iterexp env s' iter1 iter2 + | _, IterE (e21, iter2) -> + let e11, iter1 = eta_iter_exp env e1 in + let* s' = match_exp' env s e11 e21 in match_iterexp env s' iter1 iter2 | SubE (e11, t11, _t12), SubE (e21, t21, _t22) when sub_typ env t11 t21 -> - match_exp env s (reduce_exp env (SubE (e11, t11, t21) $> e21)) e21 + match_exp' env s (reduce_exp env (SubE (e11, t11, t21) $> e21)) e21 | SubE (_e11, t11, _t12), SubE (_e21, t21, _t22) when disj_typ env t11 t21 -> None | _, SubE (e21, t21, _t22) -> if sub_typ env e1.note t21 then - match_exp env s (reduce_exp env (SubE (e1, e1.note, t21) $> e21)) e21 + match_exp' env s (reduce_exp env (SubE (e1, e1.note, t21) $> e21)) e21 else if is_normal_exp e1 then let t21' = reduce_typ env t21 in if @@ -545,7 +605,7 @@ and match_exp env s e1 e2 : subst option = let t1 = reduce_typ env (Map.find id1.it env.vars) in sub_typ env t1 t21 || raise Irred | _, _ -> false - then match_exp env s {e1 with note = t21} e21 + then match_exp' env s {e1 with note = t21} e21 else None else raise Irred | _, _ when is_normal_exp e1 -> None @@ -554,12 +614,38 @@ and match_exp env s e1 e2 : subst option = and match_expfield env s (atom1, e1) (atom2, e2) = if atom1 <> atom2 then None else - match_exp env s e1 e2 + match_exp' env s e1 e2 and match_iterexp env s (iter1, _ids1) (iter2, _ids2) = match_iter env s iter1 iter2 +and eta_tup_exp env e : exp list option = + let ets = + match (reduce_typ env e.note).it with + | TupT ets -> ets + | _ -> assert false + in + let* es' = + List.fold_left (fun opt (eI, tI) -> + let* res', i, s = opt in + let eI' = ProjE (e, i) $$ e.at % Subst.subst_typ s tI in + let* s' = try match_exp env s eI' eI with Irred -> None in + Some (eI'::res', i + 1, s') + ) (Some ([], 0, Subst.empty)) ets |> Option.map fst3 |> Option.map List.rev + in Some es' + +and eta_iter_exp env e : exp * iterexp = + match (reduce_typ env e.note).it with + | IterT (t, Opt) -> reduce_exp env (TheE e $$ e.at % t), (Opt, []) + | IterT (t, List) -> + let id = "_i_" $ e.at in (* TODO: this is unbound now *) + let len = reduce_exp env (LenE e $$ e.at % (NumT NatT $ e.at)) in + IdxE (e, VarE id $$ e.at % (NumT NatT $ e.at)) $$ e.at % t, + (ListN (len, Some id), [(id, t)]) + | _ -> assert false + + (* Parameters *) and match_arg env s a1 a2 : subst option = @@ -595,18 +681,22 @@ and equiv_typ env t1 t2 = | _, VarT _ -> let t2' = reduce_typ env t2 in t2 <> t2' && equiv_typ env t1 t2' - | TupT xts1, TupT xts2 -> equiv_tup env xts1 xts2 + | TupT ets1, TupT ets2 -> equiv_tup env Subst.empty ets1 ets2 | IterT (t11, iter1), IterT (t21, iter2) -> equiv_typ env t11 t21 && equiv_iter env iter1 iter2 | _, _ -> t1.it = t2.it -and equiv_tup env xts1 xts2 = - match xts1, xts2 with - | (id1, t1)::xts1', (id2, t2)::xts2' -> - let s = Subst.(add_varid empty) id2 (VarE id1 $$ id1.at % t1) in - equiv_typ env t1 t2 && equiv_tup env xts1' (List.map (Subst.subst_typbind s) xts2') - | _, _ -> xts1 = xts2 +and equiv_tup env s ets1 ets2 = + match ets1, ets2 with + | (e1, t1)::ets1', (e2, t2)::ets2' -> + equiv_typ env t1 (Subst.subst_typ s t2) && + (match match_exp env s e1 e2 with + | None -> false + | Some s' -> equiv_tup env s' ets1' ets2' + | exception Irred -> false + ) + | _, _ -> ets1 = ets2 and equiv_iter env iter1 iter2 = match iter1, iter2 with @@ -653,7 +743,7 @@ and sub_typ env t1 t2 = let t2' = reduce_typ env t2 in match t1'.it, t2'.it with | NumT t1', NumT t2' -> t1' < t2' - | TupT xts1, TupT xts2 -> sub_tup env xts1 xts2 + | TupT ets1, TupT ets2 -> sub_tup env Subst.empty ets1 ets2 | VarT _, VarT _ -> (match (reduce_typdef env t1').it, (reduce_typdef env t2').it with | StructT tfs1, StructT tfs2 -> @@ -695,12 +785,16 @@ and sub_typ env t1 t2 = | _, _ -> false -and sub_tup env xts1 xts2 = - match xts1, xts2 with - | (id1, t1)::xts1', (id2, t2)::xts2' -> - let s = Subst.(add_varid empty) id2 (VarE id1 $$ id1.at % t1) in - sub_typ env t1 t2 && sub_tup env xts1' (List.map (Subst.subst_typbind s) xts2') - | _, _ -> xts1 = xts2 +and sub_tup env s ets1 ets2 = + match ets1, ets2 with + | (e1, t1)::ets1', (e2, t2)::ets2' -> + sub_typ env t1 (Subst.subst_typ s t2) && + (match match_exp env s e1 e2 with + | None -> false + | Some s' -> sub_tup env s' ets1' ets2' + | exception Irred -> false + ) + | _, _ -> ets1 = ets2 and find_field tfs atom = @@ -709,9 +803,6 @@ and find_field tfs atom = and find_case tcs atom = List.find_opt (fun (atom', _, _) -> atom' = atom) tcs |> Option.map snd3 -and fst3 (x, _, _) = x -and snd3 (_, x, _) = x - (* Type Disjointness *) @@ -744,7 +835,7 @@ and disj_typ env t1 t2 = | _, VarT _ -> let t2' = reduce_typ env t2 in t2 <> t2' && disj_typ env t1 t2' - | TupT xts1, TupT xts2 -> disj_tup env xts1 xts2 + | TupT ets1, TupT ets2 -> disj_tup env Subst.empty ets1 ets2 | IterT (t11, iter1), IterT (t21, iter2) -> disj_typ env t11 t21 || not (Eq.eq_iter iter1 iter2) | _, _ -> @@ -752,11 +843,13 @@ and disj_typ env t1 t2 = and atoms xs = Set.of_list (List.map Print.string_of_atom (List.map fst3 xs)) -and unordered s1 s2 = not Set.(subset s1 s2 || subset s2 s1) - -and disj_tup env xts1 xts2 = - match xts1, xts2 with - | (id1, t1)::xts1', (id2, t2)::xts2' -> - let s = Subst.(add_varid empty) id2 (VarE id1 $$ id1.at % t1) in - disj_typ env t1 t2 || disj_tup env xts1' (List.map (Subst.subst_typbind s) xts2') - | _, _ -> xts1 <> xts2 +and disj_tup env s ets1 ets2 = + match ets1, ets2 with + | (e1, t1)::ets1', (e2, t2)::ets2' -> + disj_typ env t1 (Subst.subst_typ s t2) || + (match match_exp env s e1 e2 with + | None -> false + | Some s' -> disj_tup env s' ets1' ets2' + | exception Irred -> false + ) + | _, _ -> ets1 = ets2 diff --git a/spectec/src/il/free.ml b/spectec/src/il/free.ml index 6b542592b0..b30da34371 100644 --- a/spectec/src/il/free.ml +++ b/spectec/src/il/free.ml @@ -40,9 +40,9 @@ let disjoint sets1 sets2 = Set.disjoint sets1.varid sets2.varid && Set.disjoint sets1.defid sets2.defid - let free_opt free_x xo = Option.(value (map free_x xo) ~default:empty) let free_list free_x xs = List.(fold_left (+) empty (map free_x xs)) +let free_pair free_x free_y (x, y) = free_x x + free_y y let bound_list = free_list let rec free_list_dep free_x bound_x = function @@ -75,17 +75,17 @@ and free_typ t = match t.it with | VarT (id, as_) -> free_typid id + free_args as_ | BoolT | NumT _ | TextT -> empty - | TupT xts -> free_typbinds xts + | TupT ets -> free_typbinds ets | IterT (t1, iter) -> free_typ t1 + free_iter iter and bound_typ t = match t.it with | VarT _ | BoolT | NumT _ | TextT -> empty - | TupT xts -> bound_list bound_typbind xts + | TupT ets -> bound_list bound_typbind ets | IterT (t1, _iter) -> bound_typ t1 -and free_typbind (_id, t) = free_typ t -and bound_typbind (id, _t) = bound_varid id +and free_typbind (_e, t) = free_typ t +and bound_typbind (e, _t) = free_exp e and free_typbinds xts = free_list_dep free_typbind bound_typbind xts and free_deftyp dt = @@ -131,8 +131,8 @@ and free_path p = | SliceP (p1, e1, e2) -> free_path p1 + free_exp e1 + free_exp e2 | DotP (p1, _atom) -> free_path p1 -and free_iterexp (iter, ids) = - free_iter iter + free_list free_varid ids +and free_iterexp (iter, bs) = + free_iter iter + free_list (free_pair free_varid free_typ) bs (* Premises *) diff --git a/spectec/src/il/free.mli b/spectec/src/il/free.mli index de47a97230..3d72e9ee99 100644 --- a/spectec/src/il/free.mli +++ b/spectec/src/il/free.mli @@ -6,6 +6,7 @@ type sets = {typid : Set.t; relid : Set.t; varid : Set.t; defid : Set.t} val subset : sets -> sets -> bool val disjoint : sets -> sets -> bool + val union : sets -> sets -> sets val diff : sets -> sets -> sets @@ -23,7 +24,7 @@ val free_arg : arg -> sets val free_def : def -> sets val free_deftyp : deftyp -> sets -val bound_typbind : id * typ -> sets +val bound_typbind : exp * typ -> sets val bound_bind : bind -> sets val bound_param : param -> sets val bound_def : def -> sets diff --git a/spectec/src/il/print.ml b/spectec/src/il/print.ml index 6c6ffa92e2..f80827811d 100644 --- a/spectec/src/il/print.ml +++ b/spectec/src/il/print.ml @@ -115,7 +115,7 @@ and string_of_typ t = | BoolT -> "bool" | NumT t -> string_of_numtyp t | TextT -> "text" - | TupT xts -> "(" ^ concat ", " (List.map string_of_typbind xts) ^ ")" + | TupT ets -> "(" ^ concat ", " (List.map string_of_typbind ets) ^ ")" | IterT (t1, iter) -> string_of_typ t1 ^ string_of_iter iter and string_of_typ_args t = @@ -124,8 +124,10 @@ and string_of_typ_args t = | TupT _ -> string_of_typ t | _ -> "(" ^ string_of_typ t ^ ")" -and string_of_typbind (id, t) = - (if id.it = "_" then "" else id.it ^ " : ") ^ string_of_typ t +and string_of_typbind (e, t) = + match e.it with + | VarE {it = "_"; _} -> string_of_typ t + | _ -> string_of_exp e ^ " : " ^ string_of_typ t and string_of_deftyp layout dt = match dt.it with @@ -220,8 +222,9 @@ and string_of_path p = | DotP (p1, atom) -> string_of_path p1 ^ "." ^ string_of_atom atom ^ "_" ^ string_of_typ p1.note -and string_of_iterexp (iter, ids) = - string_of_iter iter ^ "{" ^ String.concat " " (List.map Source.it ids) ^ "}" +and string_of_iterexp (iter, bs) = + string_of_iter iter ^ "{" ^ String.concat " " + (List.map (fun (id, t) -> id.it ^ " : " ^ string_of_typ t) bs) ^ "}" (* Premises *) diff --git a/spectec/src/il/subst.ml b/spectec/src/il/subst.ml index 85bee1d6d4..1edb4c9eb4 100644 --- a/spectec/src/il/subst.ml +++ b/spectec/src/il/subst.ml @@ -67,12 +67,12 @@ and subst_typ s t = | Some t' -> assert (as_ = []); t'.it (* We do not support higher-order substitutions yet *) ) | BoolT | NumT _ | TextT -> t.it - | TupT xts -> TupT (fst (subst_list_dep subst_typbind Free.bound_typbind s xts)) + | TupT ets -> TupT (fst (subst_list_dep subst_typbind Free.bound_typbind s ets)) | IterT (t1, iter) -> IterT (subst_typ s t1, subst_iter s iter) ) $ t.at -and subst_typbind s (id, t) = - (id, subst_typ s t) +and subst_typbind s (e, t) = + (e, subst_typ s t) and subst_deftyp s dt = (match dt.it with @@ -141,9 +141,47 @@ and subst_path s p = | DotP (p1, atom) -> DotP (subst_path s p1, atom) ) $$ p.at % subst_typ s p.note -and subst_iterexp s (iter, ids) = +and subst_iterexp s (iter, bs) = (* TODO: This is assuming expressions in s are closed. *) - (subst_iter s iter, List.filter (fun id -> not (mem_varid s id)) ids) + subst_iter s iter, + List.map (fun (id, t) -> + let id' = + match Map.find_opt id.it s.varid with + | None -> id + | Some {it = VarE id'; _} -> id' + | Some _ -> + id (* TODO: would need to update bind list; change bs to proper bindings *) + in (id', subst_typ s t) + ) bs +(* + let iter' = subst_iter s iter in + let bs' = + List.map_filter (fun (id, t) -> + if mem_varid s id then None else Some (id, subst_typ s t) + ) bs + in + let iter'', f = + match iter' with + | Opt -> iter', fun e -> TheE e + | ListN (e1, Some idx) -> + let eidx = VarE idx $$ idx.at % (NumT NatT $ idx.at) in + iter', fun e -> IdxE (e, eidx) + | ListN (e1, None) -> + let idx = gen_id "i" $ e1.at in + let eidx = VarE idx $$ at % (NumT NatT $ idx.at) in + ListN (e1, Some idx), fun e -> IdxE (e, eidx) + | List1 | List -> + let idx = gen_id "i" $ at in + let eidx = VarE idx $$ idx.at % (NumT NatT $ idx.at) in + let e1 = LenE (gen_id "n" $ at) $$ at % (NumT NatT $ idx.at) in + ListN (e1, Some idx), fun e -> IdxE (e, eidx) + in + (iter'', bs'), + List.fold_left (fun s' (id, t) -> + let e = Map.find id.it s.varid in + add_varid s' id (f e $$ e.at % subst_typ s t) + ) s bs +*) (* Premises *) @@ -153,7 +191,8 @@ and subst_prem s prem = | RulePr (id, op, e) -> RulePr (id, op, subst_exp s e) | IfPr e -> IfPr (subst_exp s e) | ElsePr -> ElsePr - | IterPr (prem1, iterexp) -> IterPr (subst_prem s prem1, subst_iterexp s iterexp) + | IterPr (prem1, iterexp) -> + IterPr (subst_prem s prem1, subst_iterexp s iterexp) | LetPr (e1, e2, ids) -> LetPr (subst_exp s e1, subst_exp s e2, ids) ) $ prem.at diff --git a/spectec/src/il/subst.mli b/spectec/src/il/subst.mli index cb1424cb8d..36c6e25893 100644 --- a/spectec/src/il/subst.mli +++ b/spectec/src/il/subst.mli @@ -24,7 +24,7 @@ val subst_param : subst -> param -> param val subst_deftyp : subst -> deftyp -> deftyp val subst_typcase : subst -> typcase -> typcase val subst_typfield : subst -> typfield -> typfield -val subst_typbind : subst -> id * typ -> id * typ +val subst_typbind : subst -> exp * typ -> exp * typ val subst_args : subst -> arg list -> arg list val subst_binds : subst -> bind list -> bind list * subst diff --git a/spectec/src/il/valid.ml b/spectec/src/il/valid.ml index 397c367a70..da9d13bc47 100644 --- a/spectec/src/il/valid.ml +++ b/spectec/src/il/valid.ml @@ -111,9 +111,9 @@ let as_list_typ phrase env dir t at : typ = | IterT (t1, (List | List1 | ListN _)) -> t1 | _ -> as_error at phrase dir t "(_)*" -let as_tup_typ phrase env dir t at : (id * typ) list = +let as_tup_typ phrase env dir t at : (exp * typ) list = match expand_typ env t with - | TupT xts -> xts + | TupT ets -> ets | _ -> as_error at phrase dir t "(_,...,_)" @@ -145,16 +145,6 @@ let sub_typ env t1 t2 at = error at ("expression's type `" ^ typ_string env t1 ^ "` " ^ "does not match expected supertype `" ^ typ_string env t2 ^ "`") -and selfify_typ env e t = - match expand_typ env t with - | TupT xts -> - let s, _ = - List.fold_left (fun (s, i) (xI, tI) -> - Subst.add_varid s xI (ProjE (e, i) $$ e.at % Subst.subst_typ s tI), i + 1 - ) (Subst.empty, 0) xts - in TupT (List.map (fun (xI, tI) -> xI, Subst.subst_typ s tI) xts) $ t.at - | _ -> t - (* Operators *) @@ -211,7 +201,7 @@ let rec valid_iter env iter = (* Types *) -and valid_typ env dim t = +and valid_typ env t = Debug.(log_at "il.valid_typ" t.at (fun _ -> fmt "%s" (il_typ t)) (Fun.const "ok") ) @@ fun _ -> @@ -223,22 +213,22 @@ and valid_typ env dim t = | NumT _ | TextT -> () - | TupT xts -> + | TupT ets -> let env' = local_env env in - List.iter (valid_typbind env' dim) xts + List.iter (valid_typbind env') ets | IterT (t1, iter) -> match iter with | ListN (e, _) -> error e.at "definite iterator not allowed in type" - | _ -> valid_iter env iter; valid_typ env (iter::dim) t1 + | _ -> valid_iter env iter; valid_typ env t1 -and valid_typbind env dim (id, t) = - valid_typ env dim t; - env.vars <- bind "variable" env.vars id (t, dim) +and valid_typbind env (e, t) = + valid_typ env t; + valid_exp env e t and valid_deftyp env dt = match dt.it with | AliasT t -> - valid_typ env [] t + valid_typ env t | NotationT tc -> valid_typcon env tc dt.at | StructT tfs -> @@ -259,22 +249,34 @@ and valid_typcon env (mixop, (bs, t, prems), _hints) at = "` applied to " ^ typ_string env t); let env' = local_env env in List.iter (valid_bind env') bs; - valid_typ env' [] t; + valid_typ env' t; List.iter (valid_prem env') prems and valid_typfield env (_atom, (bs, t, prems), _hints) = let env' = local_env env in List.iter (valid_bind env') bs; - valid_typ env' [] t; + valid_typ env' t; List.iter (valid_prem env') prems and valid_typcase env (_atom, (bs, t, prems), _hints) = let env' = local_env env in List.iter (valid_bind env') bs; - valid_typ env' [] t; + valid_typ env' t; List.iter (valid_prem env') prems +and proj_tup_typ env s e ets i : typ option = + match ets, i with + | (_eI, tI)::_, 0 -> Some tI + | (eI, tI)::ets', i -> + (match Eval.match_exp env s (ProjE (e, i) $$ e.at % tI) eI with + | None -> None + | Some s' -> proj_tup_typ env s' e ets' (i - 1) + | exception Eval.Irred -> None + ) + | [], _ -> assert false + + (* Expressions *) and infer_exp env e : typ = @@ -300,7 +302,8 @@ and infer_exp env e : typ = let tfs = as_struct_typ "expression" env Infer (infer_exp env e1) e1.at in let _binds, t, _prems = find_field tfs atom e1.at in t - | TupE es -> TupT (List.map (fun e -> "_" $ e.at, infer_exp env e) es) $ e.at + | TupE es -> + TupT (List.map (fun eI -> eI, infer_exp env eI) es) $ e.at | CallE (id, as_) -> let ps, t, _ = find "function" env.defs id in let s = valid_args env as_ ps Subst.empty e.at in @@ -311,13 +314,16 @@ and infer_exp env e : typ = IterT (infer_exp env e1, iter') $ e.at | ProjE (e1, i) -> let t1 = infer_exp env e1 in - let xts = as_tup_typ "expression" env Infer (selfify_typ env e1 t1) e1.at in - if i >= List.length xts then + let ets = as_tup_typ "expression" env Infer t1 e1.at in + if i >= List.length ets then error e.at "invalid tuple projection"; - snd (List.nth xts i) + (match proj_tup_typ (to_eval_env env) Subst.empty e1 ets i with + | Some tI -> tI + | None -> error e.at "cannot infer type of tuple projection" + ) | UnmixE (e1, op) -> let t1 = infer_exp env e1 in - let op', t = as_mix_typ "expression" env Infer (selfify_typ env e1 t1) e1.at in + let op', t = as_mix_typ "expression" env Infer t1 e1.at in if op <> op' then error e.at "invalid mixfix projection"; t @@ -334,8 +340,8 @@ and valid_exp env e t = (fun _ -> fmt "%s : %s == %s" (il_exp e) (il_typ e.note) (il_typ t)) (Fun.const "ok") ) @@ fun _ -> - equiv_typ env e.note (selfify_typ env e t) e.at; match e.it with + | VarE id when id.it = "_" -> () | VarE id -> let t', dim = find "variable" env.vars id in equiv_typ env t' t e.at; @@ -404,11 +410,12 @@ and valid_exp env e t = valid_exp env e1 t1; equiv_typ env (NumT NatT $ e.at) t e.at | TupE es -> - let xts = as_tup_typ "tuple" env Check t e.at in - if List.length es <> List.length xts then + let ets = as_tup_typ "tuple" env Check t e.at in + if List.length es <> List.length ets then error e.at ("arity mismatch for tuple, expected " ^ - string_of_int (List.length xts) ^ ", got " ^ string_of_int (List.length es)); - ignore (List.fold_left2 (valid_exptup env) Subst.empty es xts) + string_of_int (List.length ets) ^ ", got " ^ string_of_int (List.length es)); + if not (valid_tup_exp env Subst.empty es ets) then + as_error e.at "tuple" Check t "" | CallE (id, as_) -> let ps, t', _ = find "function" env.defs id in let s = valid_args env as_ ps Subst.empty e.at in @@ -422,13 +429,16 @@ and valid_exp env e t = valid_exp env' e1 t1 | ProjE (e1, i) -> let t1 = infer_exp env e1 in - let xts = as_tup_typ "expression" env Infer (selfify_typ env e1 t1) e1.at in - if i >= List.length xts then + let ets = as_tup_typ "expression" env Infer t1 e1.at in + if i >= List.length ets then error e.at "invalid tuple projection"; - equiv_typ env (snd (List.nth xts i)) t e.at + (match proj_tup_typ (to_eval_env env) Subst.empty e1 ets i with + | Some tI -> equiv_typ env tI t e.at + | None -> error e.at "invalid tuple projection, cannot match pattern" + ) | UnmixE (e1, op) -> let t1 = infer_exp env e1 in - let op', t' = as_mix_typ "expression" env Infer (selfify_typ env e1 t1) e1.at in + let op', t' = as_mix_typ "expression" env Infer t1 e1.at in if op <> op' then error e.at "invalid mixfix projection"; equiv_typ env t' t e.at @@ -449,8 +459,8 @@ and valid_exp env e t = let _binds, t1, _prems = find_case cases atom e1.at in valid_exp env e1 t1 | SubE (e1, t1, t2) -> - valid_typ env [] t1; - valid_typ env [] t2; + valid_typ env t1; + valid_typ env t2; valid_exp env e1 t1; equiv_typ env t2 t e.at; sub_typ env t1 t2 e.at @@ -464,9 +474,16 @@ and valid_expmix env mixop e (mixop', t) at = ); valid_exp env e t -and valid_exptup env s e (id, t) : Subst.t = - valid_exp env e (Subst.subst_typ s t); - Subst.add_varid s id e +and valid_tup_exp env s es ets = + match es, ets with + | e1::es', (e2, t)::ets' -> + valid_exp env e1 (Subst.subst_typ s t); + (match Eval.match_exp (to_eval_env env) s e1 e2 with + | Some s' -> valid_tup_exp env s' es' ets' + | None -> false + | exception Eval.Irred -> false + ) + | _, _ -> true and valid_expfield env (atom1, e) (atom2, (_binds, t, _prems), _) = if atom1 <> atom2 then error e.at "unexpected record field"; @@ -495,25 +512,26 @@ and valid_path env p t : typ = equiv_typ env p.note t' p.at; t' -and valid_iterexp env (iter, ids) : env = +and valid_iterexp env (iter, bs) : env = valid_iter env iter; let iter' = match iter with - | ListN (e, Some _) -> ListN (e, None) + | ListN (e, _) -> ListN (e, None) | iter -> iter in - List.fold_left (fun env id -> - match find "variable" env.vars id with - | t, iter1::iters - when Eq.eq_iter (snd (Lib.List.split_last (iter1::iters))) iter' -> - {env with vars = - Env.add id.it (t, fst (Lib.List.split_last (iter1::iters))) env.vars} - | _, iters -> + List.fold_left (fun env' (id, t) -> + let t', iters = find "variable" env.vars id in + valid_typ env t; + equiv_typ env t' t id.at; + match Lib.List.split_last_opt iters with + | Some (iters', iterN) when Eq.eq_iter iterN iter' -> + {env' with vars = Env.add id.it (t, iters') env'.vars} + | _ -> error id.at ("iteration variable `" ^ id.it ^ "` has incompatible dimension `" ^ id.it ^ String.concat "" (List.map string_of_iter iters) ^ "` in iteration `_" ^ string_of_iter iter' ^ "`") - ) env ids + ) env bs (* Premises *) @@ -549,7 +567,7 @@ and valid_arg env a p s = ) @@ fun _ -> match a.it, p.it with | ExpA e, ExpP (id, t) -> valid_exp env e (Subst.subst_typ s t); Subst.add_varid s id e - | TypA t, TypP id -> valid_typ env [] t; Subst.add_typid s id t + | TypA t, TypP id -> valid_typ env t; Subst.add_typid s id t | _, _ -> error a.at "sort mismatch for argument" and valid_args env as_ ps s at : Subst.t = @@ -567,7 +585,7 @@ and valid_args env as_ ps s at : Subst.t = and valid_bind env b = match b.it with | ExpB (id, t, dim) -> - valid_typ env dim t; + valid_typ env t; env.vars <- bind "variable" env.vars id (t, dim) | TypB id -> env.typs <- bind "syntax" env.typs id ([], []) @@ -575,7 +593,7 @@ and valid_bind env b = let valid_param env p = match p.it with | ExpP (id, t) -> - valid_typ env [] t; + valid_typ env t; env.vars <- bind "variable" env.vars id (t, []) | TypP id -> env.typs <- bind "syntax" env.typs id ([], []) @@ -629,7 +647,7 @@ let infer_def env d = | DecD (id, ps, t, clauses) -> let env' = local_env env in List.iter (valid_param env') ps; - valid_typ env' [] t; + valid_typ env' t; env.defs <- bind "function" env.defs id (ps, t, clauses) | _ -> () @@ -652,7 +670,7 @@ let rec valid_def {bind} env d = | DecD (id, ps, t, clauses) -> let env' = local_env env in List.iter (valid_param env') ps; - valid_typ env' [] t; + valid_typ env' t; List.iter (valid_clause env ps t) clauses; env.defs <- bind "function" env.defs id (ps, t, clauses) | RecD ds -> diff --git a/spectec/src/il2al/il2il.ml b/spectec/src/il2al/il2il.ml index 623abbc87d..f1a0c07ff8 100644 --- a/spectec/src/il2al/il2il.ml +++ b/spectec/src/il2al/il2il.ml @@ -167,7 +167,7 @@ let rec overlap e1 e2 = if eq_exp e1 e2 then e1 else let ty = e1.note in let id = gen_new_unified ty in match ty.it with - | IterT (ty, iter) -> to_iter (VarE id $$ no_region % ty) (iter, [id]) + | IterT (ty, iter) -> to_iter (VarE id $$ no_region % ty) (iter, [(id, ty)]) | _ -> VarE id in { e1 with it } diff --git a/spectec/src/il2al/translate.ml b/spectec/src/il2al/translate.ml index e3506ed9ca..4435c6c977 100644 --- a/spectec/src/il2al/translate.ml +++ b/spectec/src/il2al/translate.ml @@ -114,7 +114,7 @@ and translate_exp exp = | Il.SubE ({ it = Il.VarE id; _}, { it = VarT (t, _); _ }, _) -> subE (id.it, t.it) ~at:at | Il.SubE (inner_exp, _, _) -> translate_exp inner_exp | Il.IterE (inner_exp, (iter, ids)) -> - let names = List.map (fun id -> id.it) ids in + let names = List.map (fun (id, _) -> id.it) ids in iterE (translate_exp inner_exp, names, translate_iter iter) ~at:at (* property access *) | Il.DotE (inner_exp, Atom p) -> @@ -324,7 +324,7 @@ let rec translate_rhs exp = | Il.IterE ({ it = SubE ({ it = VarE id; _ }, _, _); _}, (Il.List, _)) when String.starts_with ~prefix:"instr" id.it -> [ executeseqI (translate_exp exp) ~at:at ] - | Il.IterE ({ it = CaseE (Atom id', _); note = note; _ }, (Opt, [ id ])) + | Il.IterE ({ it = CaseE (Atom id', _); note = note; _ }, (Opt, [ (id, _) ])) when id' = "CALL" -> let new_name = varE (id.it ^ "_0") in [ ifI (isDefinedE (varE id.it), @@ -582,7 +582,7 @@ let translate_rulepr id exp = let rec translate_iterpr pr (iter, ids) = let instrs = translate_prem pr in - let iter', ids' = translate_iter iter, IdSet.of_list (List.map it ids) in + let iter', ids' = translate_iter iter, IdSet.of_list (List.map (fun (id, _) -> id.it) ids) in let lhs_iter = match iter' with | ListN (e, _) -> ListN (e, None) | _ -> iter' in let distribute_iter lhs rhs = @@ -620,8 +620,8 @@ and translate_prem prem = (* Insert `target` at the innermost if instruction *) let rec insert_instrs target il = match Util.Lib.List.split_last_opt il with - | [], Some { it = OtherwiseI il'; _ } -> [ otherwiseI (il' @ insert_nop target) ] - | h, Some { it = IfI (cond, il', []); _ } -> + | Some ([], { it = OtherwiseI il'; _ }) -> [ otherwiseI (il' @ insert_nop target) ] + | Some (h, { it = IfI (cond, il', []); _ }) -> h @ [ ifI (cond, insert_instrs (insert_nop target) il' , []) ] | _ -> il @ target diff --git a/spectec/src/il2al/transpile.ml b/spectec/src/il2al/transpile.ml index 3c7039030b..f5e0052d7d 100644 --- a/spectec/src/il2al/transpile.ml +++ b/spectec/src/il2al/transpile.ml @@ -390,8 +390,8 @@ let infer_case_assert instrs = | _ -> i ) il in match Util.Lib.List.split_last_opt il' with - | _, None -> [] - | hd, Some tl -> hd @ rewrite_if tl + | None -> [] + | Some (hd, tl) -> hd @ rewrite_if tl in rewrite_il instrs diff --git a/spectec/src/middlend/sideconditions.ml b/spectec/src/middlend/sideconditions.ml index 262d96bb35..d3076cd3af 100644 --- a/spectec/src/middlend/sideconditions.ml +++ b/spectec/src/middlend/sideconditions.ml @@ -36,20 +36,20 @@ let fully_iterated v t is = | [] -> VarE v $$ v.at % t | (i::is) -> let e = go is in - IterE (e, (i, [v])) $$ v.at % (IterT (e.note, i) $ v.at) + IterE (e, (i, [(v, t)])) $$ v.at % (IterT (e.note, i) $ v.at) in go (List.rev is) (* updates the types in the environment as we go under iteras *) let env_under_iter env ((_, vs) : iterexp) = - let vs' = List.map (fun v -> v.it) vs in + let vs' = List.map (fun (v, _) -> v.it) vs in Env.mapi (fun v (t,is) -> if List.mem v vs' then (t, fst (Lib.List.split_last is)) else (t, is) ) env let iter_side_conditions env ((iter, vs) : iterexp) : prem list = (* let iter' = if iter = Opt then Opt else List in *) - let ves = List.map (fun v -> + let ves = List.map (fun (v, _) -> let (t,is) = Env.find v.it env in fully_iterated v t is ) vs in diff --git a/spectec/src/middlend/unthe.ml b/spectec/src/middlend/unthe.ml index 596ff93fb9..b2185ef488 100644 --- a/spectec/src/middlend/unthe.ml +++ b/spectec/src/middlend/unthe.ml @@ -35,14 +35,14 @@ let fresh_id (n : int ref) : id = drop some variables from the iterexp *) let update_iterexp_vars (sets : Il.Free.sets) ((iter, vs) : iterexp) : iterexp = - (iter, List.filter (fun v -> Il.Free.Set.mem v.it sets.varid) vs) + (iter, List.filter (fun (v, _) -> Il.Free.Set.mem v.it sets.varid) vs) (* If a bind and premise is generated under an iteration, wrap them accordingly *) let under_iterexp (iter, vs) eqns : iterexp * eqns = let new_vs = List.map (fun (bind, _) -> match bind.it with - | ExpB (v, _, _) -> v + | ExpB (v, t, _) -> (v, t) | TypB _ -> error bind.at "unexpected type binding") eqns in let iterexp' = (iter, vs @ new_vs) in let eqns' = List.map (fun (bind, pr) -> diff --git a/spectec/src/middlend/wild.ml b/spectec/src/middlend/wild.ml index 17c840a51f..ef6551a289 100644 --- a/spectec/src/middlend/wild.ml +++ b/spectec/src/middlend/wild.ml @@ -74,7 +74,7 @@ let fresh_id env : id = let under_iterexp (iter, vs) binds : iterexp * bind list = let new_vs = List.map (fun bind -> match bind.it with - | ExpB (v, _, _) -> v + | ExpB (v, t, _) -> (v, t) | TypB _ -> error bind.at "unexpected type binding") binds in let iterexp' = (iter, vs @ new_vs) in let binds' = List.map (fun bind -> diff --git a/spectec/src/util/lib.ml b/spectec/src/util/lib.ml index e01f51de39..3771f5f1aa 100644 --- a/spectec/src/util/lib.ml +++ b/spectec/src/util/lib.ml @@ -14,17 +14,25 @@ struct | n, _::xs' when n > 0 -> drop (n - 1) xs' | _ -> failwith "drop" + let rec split n xs = + match n, xs with + | 0, _ -> [], xs + | n, x::xs' when n > 0 -> + let xs1', xs2' = split (n - 1) xs' in x::xs1', xs2' + | _ -> failwith "split" + let split_hd = function | x::xs -> x, xs | _ -> failwith "split_hd" - let rec split_last_opt = function - | x::[] -> [], Some x - | x::xs -> let ys, y = split_last_opt xs in x::ys, y - | [] -> [], None - let split_last l = let ys, y = split_last_opt l in ys, Option.get y + let rec split_last_opt' ys = function + | x::[] -> Some (List.rev ys, x) + | x::xs -> split_last_opt' (x::ys) xs + | [] -> None + let split_last_opt xs = split_last_opt' [] xs + let split_last l = Option.get (split_last_opt l) - let last_opt l = snd (split_last_opt l) + let last_opt l = Option.map snd (split_last_opt l) let last l = snd (split_last l) let rec nub pred = function diff --git a/spectec/src/util/lib.mli b/spectec/src/util/lib.mli index 5e11c02521..356774743e 100644 --- a/spectec/src/util/lib.mli +++ b/spectec/src/util/lib.mli @@ -4,8 +4,9 @@ module List : sig val take : int -> 'a list -> 'a list (* raises Failure *) val drop : int -> 'a list -> 'a list (* raises Failure *) + val split : int -> 'a list -> 'a list * 'a list (* raises Failure *) val split_hd : 'a list -> 'a * 'a list (* raises Failure *) - val split_last_opt : 'a list -> 'a list * 'a option + val split_last_opt : 'a list -> ('a list * 'a) option val split_last : 'a list -> 'a list * 'a (* raises Failure *) val last_opt : 'a list -> 'a option val last : 'a list -> 'a (* raises Failure *) diff --git a/spectec/test-frontend/TEST.md b/spectec/test-frontend/TEST.md index 6d9ee24d79..9f74dabf45 100644 --- a/spectec/test-frontend/TEST.md +++ b/spectec/test-frontend/TEST.md @@ -53,7 +53,7 @@ def $sum(nat*) : nat ;; 0-aux.watsup:33.1-33.18 def $sum([]) = 0 ;; 0-aux.watsup:34.1-34.35 - def $sum{n : n, n'* : n*}([n] :: n'*{n'}) = (n + $sum(n'*{n'})) + def $sum{n : n, n'* : n*}([n] :: n'*{n' : nat}) = (n + $sum(n'*{n' : nat})) } ;; 0-aux.watsup @@ -64,7 +64,7 @@ def $concat_(syntax X, X**) : X* ;; 0-aux.watsup:40.1-40.34 def $concat_{syntax X}(syntax X, []) = [] ;; 0-aux.watsup:41.1-41.61 - def $concat_{syntax X, w* : X*, w'** : X**}(syntax X, [w*{w}] :: w'*{w'}*{w'}) = w*{w} :: $concat_(syntax X, w'*{w'}*{w'}) + def $concat_{syntax X, w* : X*, w'** : X**}(syntax X, [w*{w : X}] :: w'*{w' : X}*{w' : X}) = w*{w : X} :: $concat_(syntax X, w'*{w' : X}*{w' : X}) } ;; 1-syntax.watsup @@ -153,8 +153,8 @@ syntax fNmag{N : N}(N) = ;; 1-syntax.watsup syntax fN{N : N}(N) = - | POS(fNmag : fNmag(N)) - | NEG(fNmag : fNmag(N)) + | POS{fNmag : fNmag(N)}(fNmag : fNmag(N)) + | NEG{fNmag : fNmag(N)}(fNmag : fNmag(N)) ;; 1-syntax.watsup syntax f32 = fN(32) @@ -257,7 +257,7 @@ syntax valtype = | F32 | F64 | V128 - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | BOT ;; 1-syntax.watsup:154.1-155.16 @@ -271,15 +271,15 @@ syntax storagetype = | F32 | F64 | V128 - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | I8 | I16 ;; 1-syntax.watsup:175.1-176.18 -syntax fieldtype = `%%`(mut : mut, storagetype : storagetype) +syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) ;; 1-syntax.watsup:178.1-178.70 -syntax functype = `%->%`(resulttype : resulttype, resulttype : resulttype) +syntax functype = `%->%`{resulttype : resulttype}(resulttype : resulttype, resulttype) ;; 1-syntax.watsup:179.1-179.64 syntax structtype = list(syntax fieldtype) @@ -289,22 +289,22 @@ syntax arraytype = fieldtype ;; 1-syntax.watsup:182.1-185.18 syntax comptype = - | STRUCT(structtype : structtype) - | ARRAY(arraytype : arraytype) - | FUNC(functype : functype) + | STRUCT{structtype : structtype}(structtype : structtype) + | ARRAY{arraytype : arraytype}(arraytype : arraytype) + | FUNC{functype : functype}(functype : functype) ;; 1-syntax.watsup:189.1-190.60 syntax subtype = - | SUB(fin : fin, typeidx*, comptype : comptype) - | SUBD(fin : fin, heaptype*, comptype : comptype) + | SUB{fin : fin, typeidx* : typeidx*, comptype : comptype}(fin : fin, typeidx*{typeidx : typeidx} : typeidx*, comptype : comptype) + | SUBD{fin : fin, heaptype* : heaptype*, comptype : comptype}(fin : fin, heaptype*{heaptype : heaptype} : heaptype*, comptype : comptype) ;; 1-syntax.watsup:192.1-193.22 syntax rectype = - | REC(list : list(syntax subtype)) + | REC{list : list(syntax subtype)}(list : list(syntax subtype)) ;; 1-syntax.watsup:198.1-199.26 syntax heaptype = - | _IDX(typeidx : typeidx) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY | EQ | I31 @@ -316,13 +316,13 @@ syntax heaptype = | EXTERN | NOEXTERN | BOT - | DEF(rectype : rectype, nat : nat) - | REC(n : n) + | DEF{rectype : rectype}(rectype : rectype, nat) + | REC{n : n}(n : n) } ;; 1-syntax.watsup syntax reftype = - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) ;; 1-syntax.watsup syntax inn = @@ -375,19 +375,19 @@ syntax imm = ;; 1-syntax.watsup syntax deftype = - | DEF(rectype : rectype, nat : nat) + | DEF{rectype : rectype}(rectype : rectype, nat) ;; 1-syntax.watsup -syntax limits = `[%..%]`(u32 : u32, u32 : u32) +syntax limits = `[%..%]`{u32 : u32}(u32 : u32, u32) ;; 1-syntax.watsup -syntax globaltype = `%%`(mut : mut, valtype : valtype) +syntax globaltype = `%%`{mut : mut, valtype : valtype}(mut : mut, valtype : valtype) ;; 1-syntax.watsup -syntax tabletype = `%%`(limits : limits, reftype : reftype) +syntax tabletype = `%%`{limits : limits, reftype : reftype}(limits : limits, reftype : reftype) ;; 1-syntax.watsup -syntax memtype = `%I8`(limits : limits) +syntax memtype = `%I8`{limits : limits}(limits : limits) ;; 1-syntax.watsup syntax elemtype = reftype @@ -397,10 +397,10 @@ syntax datatype = OK ;; 1-syntax.watsup syntax externtype = - | FUNC(deftype : deftype) - | GLOBAL(globaltype : globaltype) - | TABLE(tabletype : tabletype) - | MEM(memtype : memtype) + | FUNC{deftype : deftype}(deftype : deftype) + | GLOBAL{globaltype : globaltype}(globaltype : globaltype) + | TABLE{tabletype : tabletype}(tabletype : tabletype) + | MEM{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup def $size(numtype : numtype) : nat @@ -446,7 +446,7 @@ syntax dim = `%`{i : nat}(i : nat) -- if (((((i = 1) \/ (i = 2)) \/ (i = 4)) \/ (i = 8)) \/ (i = 16)) ;; 1-syntax.watsup -syntax shape = `%X%`(lanetype : lanetype, dim : dim) +syntax shape = `%X%`{lanetype : lanetype, dim : dim}(lanetype : lanetype, dim : dim) ;; 1-syntax.watsup def $lanetype(shape : shape) : lanetype @@ -514,7 +514,7 @@ syntax unop_(numtype : numtype) | CLZ | CTZ | POPCNT - | EXTEND(n : n) + | EXTEND{n : n}(n : n) ;; 1-syntax.watsup @@ -535,13 +535,13 @@ syntax binop_(numtype : numtype) | ADD | SUB | MUL - | DIV(sx : sx) - | REM(sx : sx) + | DIV{sx : sx}(sx : sx) + | REM{sx : sx}(sx : sx) | AND | OR | XOR | SHL - | SHR(sx : sx) + | SHR{sx : sx}(sx : sx) | ROTL | ROTR @@ -567,10 +567,10 @@ syntax relop_(numtype : numtype) syntax relop_{inn : inn}((inn : inn <: numtype)) = | EQ | NE - | LT(sx : sx) - | GT(sx : sx) - | LE(sx : sx) - | GE(sx : sx) + | LT{sx : sx}(sx : sx) + | GT{sx : sx}(sx : sx) + | LE{sx : sx}(sx : sx) + | GE{sx : sx}(sx : sx) ;; 1-syntax.watsup @@ -590,13 +590,13 @@ syntax cvtop = | REINTERPRET ;; 1-syntax.watsup -syntax ishape = `%X%`(imm : imm, dim : dim) +syntax ishape = `%X%`{imm : imm, dim : dim}(imm : imm, dim : dim) ;; 1-syntax.watsup -syntax fshape = `%X%`(fnn : fnn, dim : dim) +syntax fshape = `%X%`{fnn : fnn, dim : dim}(fnn : fnn, dim : dim) ;; 1-syntax.watsup -syntax pshape = `%X%`(pnn : pnn, dim : dim) +syntax pshape = `%X%`{pnn : pnn, dim : dim}(pnn : pnn, dim : dim) ;; 1-syntax.watsup def $dim(shape : shape) : dim @@ -654,9 +654,9 @@ syntax vbinop_(shape : shape) syntax vbinop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ADD | SUB - | ADD_SAT(sx : sx) + | ADD_SAT{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 16) - | SUB_SAT(sx : sx) + | SUB_SAT{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 16) | MUL -- if ($lsize((imm : imm <: lanetype)) >= 16) @@ -664,9 +664,9 @@ syntax vbinop_(shape : shape) -- if ($lsize((imm : imm <: lanetype)) <= 16) | Q15MULR_SAT_S{imm : imm} -- if ($lsize((imm : imm <: lanetype)) = 16) - | MIN(sx : sx) + | MIN{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 32) - | MAX(sx : sx) + | MAX{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 32) @@ -692,10 +692,10 @@ syntax vrelop_(shape : shape) syntax vrelop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | EQ | NE - | LT(sx : sx) - | GT(sx : sx) - | LE(sx : sx) - | GE(sx : sx) + | LT{sx : sx}(sx : sx) + | GT{sx : sx}(sx : sx) + | LE{sx : sx}(sx : sx) + | GE{sx : sx}(sx : sx) ;; 1-syntax.watsup @@ -719,7 +719,7 @@ syntax vcvtop = ;; 1-syntax.watsup syntax vshiftop_{imm : imm, N : N}(`%X%`(imm, `%`(N))) = | SHL - | SHR(sx : sx) + | SHR{sx : sx}(sx : sx) ;; 1-syntax.watsup syntax vextunop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = @@ -733,27 +733,27 @@ syntax half = ;; 1-syntax.watsup syntax vextbinop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = - | EXTMUL(half : half) + | EXTMUL{half : half}(half : half) | DOT{imm_1 : imm} -- if ($lsize((imm_1 : imm <: lanetype)) = 32) ;; 1-syntax.watsup syntax memop = { - ALIGN u32, - OFFSET u32 + ALIGN{u32 : u32} u32, + OFFSET{u32 : u32} u32 } ;; 1-syntax.watsup syntax vloadop = - | SHAPE(nat : nat, nat : nat, sx : sx) - | SPLAT(nat : nat) - | ZERO(nat : nat) + | SHAPE{sx : sx}(nat, nat, sx : sx) + | SPLAT(nat) + | ZERO(nat) ;; 1-syntax.watsup syntax blocktype = - | _RESULT(valtype?) - | _IDX(funcidx : funcidx) + | _RESULT{valtype? : valtype?}(valtype?{valtype : valtype} : valtype?) + | _IDX{funcidx : funcidx}(funcidx : funcidx) ;; 1-syntax.watsup syntax zero = `ZERO%?`(()?) @@ -766,108 +766,108 @@ syntax instr = | UNREACHABLE | NOP | DROP - | SELECT(valtype*?) - | BLOCK(blocktype : blocktype, instr*) - | LOOP(blocktype : blocktype, instr*) - | IF(blocktype : blocktype, instr*, instr*) - | BR(labelidx : labelidx) - | BR_IF(labelidx : labelidx) - | BR_TABLE(labelidx*, labelidx : labelidx) - | BR_ON_NULL(labelidx : labelidx) - | BR_ON_NON_NULL(labelidx : labelidx) - | BR_ON_CAST(labelidx : labelidx, reftype : reftype, reftype : reftype) - | BR_ON_CAST_FAIL(labelidx : labelidx, reftype : reftype, reftype : reftype) - | CALL(funcidx : funcidx) - | CALL_REF(typeidx?) - | CALL_INDIRECT(tableidx : tableidx, typeidx : typeidx) + | SELECT{valtype*? : valtype*?}(valtype*{valtype : valtype}?{valtype : valtype} : valtype*?) + | BLOCK{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*) + | LOOP{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*) + | IF{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*, instr*) + | BR{labelidx : labelidx}(labelidx : labelidx) + | BR_IF{labelidx : labelidx}(labelidx : labelidx) + | BR_TABLE{labelidx : labelidx}(labelidx*{} : labelidx*, labelidx) + | BR_ON_NULL{labelidx : labelidx}(labelidx : labelidx) + | BR_ON_NON_NULL{labelidx : labelidx}(labelidx : labelidx) + | BR_ON_CAST{labelidx : labelidx, reftype : reftype}(labelidx : labelidx, reftype : reftype, reftype) + | BR_ON_CAST_FAIL{labelidx : labelidx, reftype : reftype}(labelidx : labelidx, reftype : reftype, reftype) + | CALL{funcidx : funcidx}(funcidx : funcidx) + | CALL_REF{typeidx? : typeidx?}(typeidx?{typeidx : typeidx} : typeidx?) + | CALL_INDIRECT{tableidx : tableidx, typeidx : typeidx}(tableidx : tableidx, typeidx : typeidx) | RETURN - | RETURN_CALL(funcidx : funcidx) - | RETURN_CALL_REF(typeidx?) - | RETURN_CALL_INDIRECT(tableidx : tableidx, typeidx : typeidx) - | CONST(numtype : numtype, num_ : num_(numtype)) - | UNOP(numtype : numtype, unop_ : unop_(numtype)) - | BINOP(numtype : numtype, binop_ : binop_(numtype)) - | TESTOP(numtype : numtype, testop_ : testop_(numtype)) - | RELOP(numtype : numtype, relop_ : relop_(numtype)) - | CVTOP(numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx?) - | EXTEND(numtype : numtype, n : n) - | VCONST(vectype : vectype, vec_ : vec_(vectype)) - | VVUNOP(vectype : vectype, vvunop : vvunop) - | VVBINOP(vectype : vectype, vvbinop : vvbinop) - | VVTERNOP(vectype : vectype, vvternop : vvternop) - | VVTESTOP(vectype : vectype, vvtestop : vvtestop) + | RETURN_CALL{funcidx : funcidx}(funcidx : funcidx) + | RETURN_CALL_REF{typeidx? : typeidx?}(typeidx?{typeidx : typeidx} : typeidx?) + | RETURN_CALL_INDIRECT{tableidx : tableidx, typeidx : typeidx}(tableidx : tableidx, typeidx : typeidx) + | CONST{numtype : numtype, num_ : num_(numtype)}(numtype : numtype, num_ : num_(numtype)) + | UNOP{numtype : numtype, unop_ : unop_(numtype)}(numtype : numtype, unop_ : unop_(numtype)) + | BINOP{numtype : numtype, binop_ : binop_(numtype)}(numtype : numtype, binop_ : binop_(numtype)) + | TESTOP{numtype : numtype, testop_ : testop_(numtype)}(numtype : numtype, testop_ : testop_(numtype)) + | RELOP{numtype : numtype, relop_ : relop_(numtype)}(numtype : numtype, relop_ : relop_(numtype)) + | CVTOP{numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx? : sx?}(numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx?{sx : sx} : sx?) + | EXTEND{numtype : numtype, n : n}(numtype : numtype, n : n) + | VCONST{vectype : vectype, vec_ : vec_(vectype)}(vectype : vectype, vec_ : vec_(vectype)) + | VVUNOP{vectype : vectype, vvunop : vvunop}(vectype : vectype, vvunop : vvunop) + | VVBINOP{vectype : vectype, vvbinop : vvbinop}(vectype : vectype, vvbinop : vvbinop) + | VVTERNOP{vectype : vectype, vvternop : vvternop}(vectype : vectype, vvternop : vvternop) + | VVTESTOP{vectype : vectype, vvtestop : vvtestop}(vectype : vectype, vvtestop : vvtestop) | VSWIZZLE{ishape : ishape}(ishape : ishape) -- if (ishape = `%X%`(I8_imm, `%`(16))) - | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*) - -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) - | VSPLAT(shape : shape) - | VEXTRACT_LANE{shape : shape, numtype : numtype, sx? : sx?}(shape : shape, sx?, laneidx : laneidx) - -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx} = ?())) - | VREPLACE_LANE(shape : shape, laneidx : laneidx) - | VUNOP(shape : shape, vunop_ : vunop_(shape)) - | VBINOP(shape : shape, vbinop_ : vbinop_(shape)) - | VTESTOP(shape : shape, vtestop_ : vtestop_(shape)) - | VRELOP(shape : shape, vrelop_ : vrelop_(shape)) - | VSHIFTOP(ishape : ishape, vshiftop_ : vshiftop_(ishape)) - | VBITMASK(ishape : ishape) - | VCVTOP(shape : shape, vcvtop : vcvtop, half?, shape : shape, sx?, zero : zero) - | VNARROW(ishape : ishape, ishape : ishape, sx : sx) - | VEXTUNOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) + | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*{laneidx : laneidx} : laneidx*) + -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx : laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) + | VSPLAT{shape : shape}(shape : shape) + | VEXTRACT_LANE{shape : shape, sx? : sx?, laneidx : laneidx, numtype : numtype}(shape : shape, sx?{sx : sx} : sx?, laneidx : laneidx) + -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx : sx} = ?())) + | VREPLACE_LANE{shape : shape, laneidx : laneidx}(shape : shape, laneidx : laneidx) + | VUNOP{shape : shape, vunop_ : vunop_(shape)}(shape : shape, vunop_ : vunop_(shape)) + | VBINOP{shape : shape, vbinop_ : vbinop_(shape)}(shape : shape, vbinop_ : vbinop_(shape)) + | VTESTOP{shape : shape, vtestop_ : vtestop_(shape)}(shape : shape, vtestop_ : vtestop_(shape)) + | VRELOP{shape : shape, vrelop_ : vrelop_(shape)}(shape : shape, vrelop_ : vrelop_(shape)) + | VSHIFTOP{ishape : ishape, vshiftop_ : vshiftop_(ishape)}(ishape : ishape, vshiftop_ : vshiftop_(ishape)) + | VBITMASK{ishape : ishape}(ishape : ishape) + | VCVTOP{shape : shape, vcvtop : vcvtop, half? : half?, sx? : sx?, zero : zero}(shape : shape, vcvtop : vcvtop, half?{half : half} : half?, shape, sx?{sx : sx} : sx?, zero : zero) + | VNARROW{ishape : ishape, sx : sx}(ishape : ishape, ishape, sx : sx) + | VEXTUNOP{ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | VEXTBINOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) + | VEXTBINOP{ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | REF.NULL(heaptype : heaptype) + | REF.NULL{heaptype : heaptype}(heaptype : heaptype) | REF.I31 - | REF.FUNC(funcidx : funcidx) + | REF.FUNC{funcidx : funcidx}(funcidx : funcidx) | REF.IS_NULL | REF.AS_NON_NULL | REF.EQ - | REF.TEST(reftype : reftype) - | REF.CAST(reftype : reftype) - | I31.GET(sx : sx) - | STRUCT.NEW(typeidx : typeidx) - | STRUCT.NEW_DEFAULT(typeidx : typeidx) - | STRUCT.GET(sx?, typeidx : typeidx, u32 : u32) - | STRUCT.SET(typeidx : typeidx, u32 : u32) - | ARRAY.NEW(typeidx : typeidx) - | ARRAY.NEW_DEFAULT(typeidx : typeidx) - | ARRAY.NEW_FIXED(typeidx : typeidx, nat : nat) - | ARRAY.NEW_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.NEW_ELEM(typeidx : typeidx, elemidx : elemidx) - | ARRAY.GET(sx?, typeidx : typeidx) - | ARRAY.SET(typeidx : typeidx) + | REF.TEST{reftype : reftype}(reftype : reftype) + | REF.CAST{reftype : reftype}(reftype : reftype) + | I31.GET{sx : sx}(sx : sx) + | STRUCT.NEW{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.GET{sx? : sx?, typeidx : typeidx, u32 : u32}(sx?{sx : sx} : sx?, typeidx : typeidx, u32 : u32) + | STRUCT.SET{typeidx : typeidx, u32 : u32}(typeidx : typeidx, u32 : u32) + | ARRAY.NEW{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_FIXED{typeidx : typeidx}(typeidx : typeidx, nat) + | ARRAY.NEW_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.NEW_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) + | ARRAY.GET{sx? : sx?, typeidx : typeidx}(sx?{sx : sx} : sx?, typeidx : typeidx) + | ARRAY.SET{typeidx : typeidx}(typeidx : typeidx) | ARRAY.LEN - | ARRAY.FILL(typeidx : typeidx) - | ARRAY.COPY(typeidx : typeidx, typeidx : typeidx) - | ARRAY.INIT_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.INIT_ELEM(typeidx : typeidx, elemidx : elemidx) + | ARRAY.FILL{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.COPY{typeidx : typeidx}(typeidx : typeidx, typeidx) + | ARRAY.INIT_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.INIT_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) | EXTERN.CONVERT_ANY | ANY.CONVERT_EXTERN - | LOCAL.GET(localidx : localidx) - | LOCAL.SET(localidx : localidx) - | LOCAL.TEE(localidx : localidx) - | GLOBAL.GET(globalidx : globalidx) - | GLOBAL.SET(globalidx : globalidx) - | TABLE.GET(tableidx : tableidx) - | TABLE.SET(tableidx : tableidx) - | TABLE.SIZE(tableidx : tableidx) - | TABLE.GROW(tableidx : tableidx) - | TABLE.FILL(tableidx : tableidx) - | TABLE.COPY(tableidx : tableidx, tableidx : tableidx) - | TABLE.INIT(tableidx : tableidx, elemidx : elemidx) - | ELEM.DROP(elemidx : elemidx) - | MEMORY.SIZE(memidx : memidx) - | MEMORY.GROW(memidx : memidx) - | MEMORY.FILL(memidx : memidx) - | MEMORY.COPY(memidx : memidx, memidx : memidx) - | MEMORY.INIT(memidx : memidx, dataidx : dataidx) - | DATA.DROP(dataidx : dataidx) - | LOAD(numtype : numtype, (n, sx)?, memidx : memidx, memop : memop) - | STORE(numtype : numtype, n?, memidx : memidx, memop : memop) - | VLOAD(vloadop?, memidx : memidx, memop : memop) - | VLOAD_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | VSTORE(memidx : memidx, memop : memop) - | VSTORE_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | LOCAL.GET{localidx : localidx}(localidx : localidx) + | LOCAL.SET{localidx : localidx}(localidx : localidx) + | LOCAL.TEE{localidx : localidx}(localidx : localidx) + | GLOBAL.GET{globalidx : globalidx}(globalidx : globalidx) + | GLOBAL.SET{globalidx : globalidx}(globalidx : globalidx) + | TABLE.GET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SIZE{tableidx : tableidx}(tableidx : tableidx) + | TABLE.GROW{tableidx : tableidx}(tableidx : tableidx) + | TABLE.FILL{tableidx : tableidx}(tableidx : tableidx) + | TABLE.COPY{tableidx : tableidx}(tableidx : tableidx, tableidx) + | TABLE.INIT{tableidx : tableidx, elemidx : elemidx}(tableidx : tableidx, elemidx : elemidx) + | ELEM.DROP{elemidx : elemidx}(elemidx : elemidx) + | MEMORY.SIZE{memidx : memidx}(memidx : memidx) + | MEMORY.GROW{memidx : memidx}(memidx : memidx) + | MEMORY.FILL{memidx : memidx}(memidx : memidx) + | MEMORY.COPY{memidx : memidx}(memidx : memidx, memidx) + | MEMORY.INIT{memidx : memidx, dataidx : dataidx}(memidx : memidx, dataidx : dataidx) + | DATA.DROP{dataidx : dataidx}(dataidx : dataidx) + | LOAD{numtype : numtype, n? : n?, sx? : sx?, memidx : memidx, memop : memop}(numtype : numtype, (n, sx)?{n : n sx : sx} : (n, sx)?, memidx : memidx, memop : memop) + | STORE{numtype : numtype, n? : n?, memidx : memidx, memop : memop}(numtype : numtype, n?{n : n} : n?, memidx : memidx, memop : memop) + | VLOAD{vloadop? : vloadop?, memidx : memidx, memop : memop}(vloadop?{vloadop : vloadop} : vloadop?, memidx : memidx, memop : memop) + | VLOAD_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | VSTORE{memidx : memidx, memop : memop}(memidx : memidx, memop : memop) + | VSTORE_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) } ;; 1-syntax.watsup @@ -875,57 +875,57 @@ syntax expr = instr* ;; 1-syntax.watsup syntax elemmode = - | ACTIVE(tableidx : tableidx, expr : expr) + | ACTIVE{tableidx : tableidx, expr : expr}(tableidx : tableidx, expr : expr) | PASSIVE | DECLARE ;; 1-syntax.watsup syntax datamode = - | ACTIVE(memidx : memidx, expr : expr) + | ACTIVE{memidx : memidx, expr : expr}(memidx : memidx, expr : expr) | PASSIVE ;; 1-syntax.watsup -syntax type = TYPE(rectype : rectype) +syntax type = TYPE{rectype : rectype}(rectype : rectype) ;; 1-syntax.watsup -syntax local = LOCAL(valtype : valtype) +syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`(typeidx : typeidx, local*, expr : expr) +syntax func = `FUNC%%*%`{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) ;; 1-syntax.watsup -syntax global = GLOBAL(globaltype : globaltype, expr : expr) +syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) ;; 1-syntax.watsup -syntax table = TABLE(tabletype : tabletype, expr : expr) +syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, expr : expr) ;; 1-syntax.watsup -syntax mem = MEMORY(memtype : memtype) +syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`(reftype : reftype, expr*, elemmode : elemmode) +syntax elem = `ELEM%%*%`{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) ;; 1-syntax.watsup -syntax data = `DATA%*%`(byte*, datamode : datamode) +syntax data = `DATA%*%`{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup -syntax start = START(funcidx : funcidx) +syntax start = START{funcidx : funcidx}(funcidx : funcidx) ;; 1-syntax.watsup syntax externidx = - | FUNC(funcidx : funcidx) - | GLOBAL(globalidx : globalidx) - | TABLE(tableidx : tableidx) - | MEM(memidx : memidx) + | FUNC{funcidx : funcidx}(funcidx : funcidx) + | GLOBAL{globalidx : globalidx}(globalidx : globalidx) + | TABLE{tableidx : tableidx}(tableidx : tableidx) + | MEM{memidx : memidx}(memidx : memidx) ;; 1-syntax.watsup -syntax export = EXPORT(name : name, externidx : externidx) +syntax export = EXPORT{name : name, externidx : externidx}(name : name, externidx : externidx) ;; 1-syntax.watsup -syntax import = IMPORT(name : name, name : name, externtype : externtype) +syntax import = IMPORT{name : name, externtype : externtype}(name : name, name, externtype : externtype) ;; 1-syntax.watsup -syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*, import*, func*, global*, table*, mem*, elem*, data*, start*, export*) +syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) ;; 2-syntax-aux.watsup rec { @@ -935,10 +935,10 @@ def $setminus1(idx : idx, idx*) : idx* ;; 2-syntax-aux.watsup:13.1-13.27 def $setminus1{x : idx}(x, []) = [x] ;; 2-syntax-aux.watsup:14.1-14.61 - def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y}) = [] + def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y : idx}) = [] -- if (x = y_1) ;; 2-syntax-aux.watsup:15.1-15.60 - def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y}) = $setminus1(x, y*{y}) + def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y : idx}) = $setminus1(x, y*{y : idx}) -- otherwise } @@ -948,9 +948,9 @@ rec { ;; 2-syntax-aux.watsup:7.1-7.49 def $setminus(idx*, idx*) : idx* ;; 2-syntax-aux.watsup:10.1-10.29 - def $setminus{y* : idx*}([], y*{y}) = [] + def $setminus{y* : idx*}([], y*{y : idx}) = [] ;; 2-syntax-aux.watsup:11.1-11.66 - def $setminus{x_1 : idx, x* : idx*, y* : idx*}([x_1] :: x*{x}, y*{y}) = $setminus1(x_1, y*{y}) :: $setminus(x*{x}, y*{y}) + def $setminus{x_1 : idx, x* : idx*, y* : idx*}([x_1] :: x*{x : idx}, y*{y : idx}) = $setminus1(x_1, y*{y : idx}) :: $setminus(x*{x : idx}, y*{y : idx}) } ;; 2-syntax-aux.watsup @@ -970,18 +970,18 @@ def $free_dataidx_instrs(instr*) : dataidx* ;; 2-syntax-aux.watsup:26.1-26.36 def $free_dataidx_instrs([]) = [] ;; 2-syntax-aux.watsup:27.1-27.99 - def $free_dataidx_instrs{instr : instr, instr'* : instr*}([instr] :: instr'*{instr'}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr'}) + def $free_dataidx_instrs{instr : instr, instr'* : instr*}([instr] :: instr'*{instr' : instr}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr' : instr}) } ;; 2-syntax-aux.watsup def $free_dataidx_expr(expr : expr) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_expr{in* : instr*}(in*{in}) = $free_dataidx_instrs(in*{in}) + def $free_dataidx_expr{in* : instr*}(in*{in : instr}) = $free_dataidx_instrs(in*{in : instr}) ;; 2-syntax-aux.watsup def $free_dataidx_func(func : func) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc}, e)) = $free_dataidx_expr(e) + def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) ;; 2-syntax-aux.watsup rec { @@ -991,7 +991,7 @@ def $free_dataidx_funcs(func*) : dataidx* ;; 2-syntax-aux.watsup:36.1-36.35 def $free_dataidx_funcs([]) = [] ;; 2-syntax-aux.watsup:37.1-37.92 - def $free_dataidx_funcs{func : func, func'* : func*}([func] :: func'*{func'}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func'}) + def $free_dataidx_funcs{func : func, func'* : func*}([func] :: func'*{func' : func}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func' : func}) } ;; 2-syntax-aux.watsup @@ -1036,8 +1036,8 @@ def $diffrt(reftype : reftype, reftype : reftype) : reftype ;; 2-syntax-aux.watsup syntax typevar = - | _IDX(typeidx : typeidx) - | REC(nat : nat) + | _IDX{typeidx : typeidx}(typeidx : typeidx) + | REC(nat) ;; 2-syntax-aux.watsup def $idx(typeidx : typeidx) : typevar @@ -1052,27 +1052,27 @@ def $subst_typevar(typevar : typevar, typevar*, heaptype*) : heaptype ;; 2-syntax-aux.watsup:150.1-150.38 def $subst_typevar{xx : typevar}(xx, [], []) = (xx : typevar <: heaptype) ;; 2-syntax-aux.watsup:151.1-151.95 - def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 + def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = ht_1 -- if (xx = xx_1) ;; 2-syntax-aux.watsup:152.1-152.92 - def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = $subst_typevar(xx, xx'*{xx'}, ht'*{ht'}) + def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = $subst_typevar(xx, xx'*{xx' : typevar}, ht'*{ht' : heaptype}) -- otherwise } ;; 2-syntax-aux.watsup def $subst_numtype(numtype : numtype, typevar*, heaptype*) : numtype ;; 2-syntax-aux.watsup - def $subst_numtype{nt : numtype, xx* : typevar*, ht* : heaptype*}(nt, xx*{xx}, ht*{ht}) = nt + def $subst_numtype{nt : numtype, xx* : typevar*, ht* : heaptype*}(nt, xx*{xx : typevar}, ht*{ht : heaptype}) = nt ;; 2-syntax-aux.watsup def $subst_vectype(vectype : vectype, typevar*, heaptype*) : vectype ;; 2-syntax-aux.watsup - def $subst_vectype{vt : vectype, xx* : typevar*, ht* : heaptype*}(vt, xx*{xx}, ht*{ht}) = vt + def $subst_vectype{vt : vectype, xx* : typevar*, ht* : heaptype*}(vt, xx*{xx : typevar}, ht*{ht : heaptype}) = vt ;; 2-syntax-aux.watsup def $subst_packtype(packtype : packtype, typevar*, heaptype*) : packtype ;; 2-syntax-aux.watsup - def $subst_packtype{pt : packtype, xx* : typevar*, ht* : heaptype*}(pt, xx*{xx}, ht*{ht}) = pt + def $subst_packtype{pt : packtype, xx* : typevar*, ht* : heaptype*}(pt, xx*{xx : typevar}, ht*{ht : heaptype}) = pt ;; 2-syntax-aux.watsup rec { @@ -1080,108 +1080,108 @@ rec { ;; 2-syntax-aux.watsup:129.1-129.92 def $subst_heaptype(heaptype : heaptype, typevar*, heaptype*) : heaptype ;; 2-syntax-aux.watsup:157.1-157.67 - def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) + def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx : typevar}, ht*{ht : heaptype}) = $subst_typevar(xx', xx*{xx : typevar}, ht*{ht : heaptype}) ;; 2-syntax-aux.watsup:158.1-158.65 - def $subst_heaptype{dt : deftype, xx* : typevar*, ht* : heaptype*}((dt : deftype <: heaptype), xx*{xx}, ht*{ht}) = ($subst_deftype(dt, xx*{xx}, ht*{ht}) : deftype <: heaptype) + def $subst_heaptype{dt : deftype, xx* : typevar*, ht* : heaptype*}((dt : deftype <: heaptype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_deftype(dt, xx*{xx : typevar}, ht*{ht : heaptype}) : deftype <: heaptype) ;; 2-syntax-aux.watsup:159.1-159.55 - def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx}, ht*{ht}) = ht' + def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx : typevar}, ht*{ht : heaptype}) = ht' -- otherwise ;; 2-syntax-aux.watsup:130.1-130.92 def $subst_reftype(reftype : reftype, typevar*, heaptype*) : reftype ;; 2-syntax-aux.watsup:161.1-161.85 - def $subst_reftype{nul : nul, ht' : heaptype, xx* : typevar*, ht* : heaptype*}(REF_reftype(nul, ht'), xx*{xx}, ht*{ht}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx}, ht*{ht})) + def $subst_reftype{nul : nul, ht' : heaptype, xx* : typevar*, ht* : heaptype*}(REF_reftype(nul, ht'), xx*{xx : typevar}, ht*{ht : heaptype}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:131.1-131.92 def $subst_valtype(valtype : valtype, typevar*, heaptype*) : valtype ;; 2-syntax-aux.watsup:163.1-163.64 - def $subst_valtype{nt : numtype, xx* : typevar*, ht* : heaptype*}((nt : numtype <: valtype), xx*{xx}, ht*{ht}) = ($subst_numtype(nt, xx*{xx}, ht*{ht}) : numtype <: valtype) + def $subst_valtype{nt : numtype, xx* : typevar*, ht* : heaptype*}((nt : numtype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_numtype(nt, xx*{xx : typevar}, ht*{ht : heaptype}) : numtype <: valtype) ;; 2-syntax-aux.watsup:164.1-164.64 - def $subst_valtype{vt : vectype, xx* : typevar*, ht* : heaptype*}((vt : vectype <: valtype), xx*{xx}, ht*{ht}) = ($subst_vectype(vt, xx*{xx}, ht*{ht}) : vectype <: valtype) + def $subst_valtype{vt : vectype, xx* : typevar*, ht* : heaptype*}((vt : vectype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_vectype(vt, xx*{xx : typevar}, ht*{ht : heaptype}) : vectype <: valtype) ;; 2-syntax-aux.watsup:165.1-165.64 - def $subst_valtype{rt : reftype, xx* : typevar*, ht* : heaptype*}((rt : reftype <: valtype), xx*{xx}, ht*{ht}) = ($subst_reftype(rt, xx*{xx}, ht*{ht}) : reftype <: valtype) + def $subst_valtype{rt : reftype, xx* : typevar*, ht* : heaptype*}((rt : reftype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_reftype(rt, xx*{xx : typevar}, ht*{ht : heaptype}) : reftype <: valtype) ;; 2-syntax-aux.watsup:166.1-166.40 - def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx : typevar}, ht*{ht : heaptype}) = BOT_valtype ;; 2-syntax-aux.watsup:134.1-134.92 def $subst_storagetype(storagetype : storagetype, typevar*, heaptype*) : storagetype ;; 2-syntax-aux.watsup:170.1-170.66 - def $subst_storagetype{t : valtype, xx* : typevar*, ht* : heaptype*}((t : valtype <: storagetype), xx*{xx}, ht*{ht}) = ($subst_valtype(t, xx*{xx}, ht*{ht}) : valtype <: storagetype) + def $subst_storagetype{t : valtype, xx* : typevar*, ht* : heaptype*}((t : valtype <: storagetype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_valtype(t, xx*{xx : typevar}, ht*{ht : heaptype}) : valtype <: storagetype) ;; 2-syntax-aux.watsup:171.1-171.69 - def $subst_storagetype{pt : packtype, xx* : typevar*, ht* : heaptype*}((pt : packtype <: storagetype), xx*{xx}, ht*{ht}) = ($subst_packtype(pt, xx*{xx}, ht*{ht}) : packtype <: storagetype) + def $subst_storagetype{pt : packtype, xx* : typevar*, ht* : heaptype*}((pt : packtype <: storagetype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_packtype(pt, xx*{xx : typevar}, ht*{ht : heaptype}) : packtype <: storagetype) ;; 2-syntax-aux.watsup:135.1-135.92 def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype ;; 2-syntax-aux.watsup:173.1-173.80 - def $subst_fieldtype{mut : mut, zt : storagetype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, zt), xx*{xx}, ht*{ht}) = `%%`(mut, $subst_storagetype(zt, xx*{xx}, ht*{ht})) + def $subst_fieldtype{mut : mut, zt : storagetype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, zt), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(mut, $subst_storagetype(zt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype ;; 2-syntax-aux.watsup:175.1-175.85 - def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) + def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt : fieldtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype}) ;; 2-syntax-aux.watsup:176.1-176.81 - def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) + def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx : typevar}, ht*{ht : heaptype}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:177.1-177.78 - def $subst_comptype{ft : functype, xx* : typevar*, ht* : heaptype*}(FUNC_comptype(ft), xx*{xx}, ht*{ht}) = FUNC_comptype($subst_functype(ft, xx*{xx}, ht*{ht})) + def $subst_comptype{ft : functype, xx* : typevar*, ht* : heaptype*}(FUNC_comptype(ft), xx*{xx : typevar}, ht*{ht : heaptype}) = FUNC_comptype($subst_functype(ft, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:138.1-138.92 def $subst_subtype(subtype : subtype, typevar*, heaptype*) : subtype ;; 2-syntax-aux.watsup:179.1-180.76 - def $subst_subtype{fin : fin, y* : idx*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + def $subst_subtype{fin : fin, y* : idx*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUB_subtype(fin, y*{y : typeidx}, ct), xx*{xx : typevar}, ht*{ht : heaptype}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx : typevar}, ht*{ht : heaptype})*{y : typeidx}, $subst_comptype(ct, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:181.1-182.73 - def $subst_subtype{fin : fin, ht'* : heaptype*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUBD_subtype(fin, ht'*{ht'}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx}, ht*{ht})*{ht'}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + def $subst_subtype{fin : fin, ht'* : heaptype*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUBD_subtype(fin, ht'*{ht' : heaptype}, ct), xx*{xx : typevar}, ht*{ht : heaptype}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})*{ht' : heaptype}, $subst_comptype(ct, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype ;; 2-syntax-aux.watsup:184.1-184.76 - def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st}), xx*{xx}, ht*{ht}) = REC_rectype($subst_subtype(st, xx*{xx}, ht*{ht})*{st}) + def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st : subtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype}) ;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype ;; 2-syntax-aux.watsup:186.1-186.78 - def $subst_deftype{qt : rectype, i : nat, xx* : typevar*, ht* : heaptype*}(DEF_deftype(qt, i), xx*{xx}, ht*{ht}) = DEF_deftype($subst_rectype(qt, xx*{xx}, ht*{ht}), i) + def $subst_deftype{qt : rectype, i : nat, xx* : typevar*, ht* : heaptype*}(DEF_deftype(qt, i), xx*{xx : typevar}, ht*{ht : heaptype}) = DEF_deftype($subst_rectype(qt, xx*{xx : typevar}, ht*{ht : heaptype}), i) ;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype ;; 2-syntax-aux.watsup:189.1-189.113 - def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1}, t_2*{t_2}), xx*{xx}, ht*{ht}) = `%->%`($subst_valtype(t_1, xx*{xx}, ht*{ht})*{t_1}, $subst_valtype(t_2, xx*{xx}, ht*{ht})*{t_2}) + def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}, $subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype}) } ;; 2-syntax-aux.watsup def $subst_globaltype(globaltype : globaltype, typevar*, heaptype*) : globaltype ;; 2-syntax-aux.watsup - def $subst_globaltype{mut : mut, t : valtype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, t), xx*{xx}, ht*{ht}) = `%%`(mut, $subst_valtype(t, xx*{xx}, ht*{ht})) + def $subst_globaltype{mut : mut, t : valtype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, t), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(mut, $subst_valtype(t, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_tabletype(tabletype : tabletype, typevar*, heaptype*) : tabletype ;; 2-syntax-aux.watsup - def $subst_tabletype{lim : limits, rt : reftype, xx* : typevar*, ht* : heaptype*}(`%%`(lim, rt), xx*{xx}, ht*{ht}) = `%%`(lim, $subst_reftype(rt, xx*{xx}, ht*{ht})) + def $subst_tabletype{lim : limits, rt : reftype, xx* : typevar*, ht* : heaptype*}(`%%`(lim, rt), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(lim, $subst_reftype(rt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_memtype(memtype : memtype, typevar*, heaptype*) : memtype ;; 2-syntax-aux.watsup - def $subst_memtype{lim : limits, xx* : typevar*, ht* : heaptype*}(`%I8`(lim), xx*{xx}, ht*{ht}) = `%I8`(lim) + def $subst_memtype{lim : limits, xx* : typevar*, ht* : heaptype*}(`%I8`(lim), xx*{xx : typevar}, ht*{ht : heaptype}) = `%I8`(lim) ;; 2-syntax-aux.watsup def $subst_externtype(externtype : externtype, typevar*, heaptype*) : externtype ;; 2-syntax-aux.watsup - def $subst_externtype{dt : deftype, xx* : typevar*, ht* : heaptype*}(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) + def $subst_externtype{dt : deftype, xx* : typevar*, ht* : heaptype*}(FUNC_externtype(dt), xx*{xx : typevar}, ht*{ht : heaptype}) = FUNC_externtype($subst_deftype(dt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{gt : globaltype, xx* : typevar*, ht* : heaptype*}(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) + def $subst_externtype{gt : globaltype, xx* : typevar*, ht* : heaptype*}(GLOBAL_externtype(gt), xx*{xx : typevar}, ht*{ht : heaptype}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{tt : tabletype, xx* : typevar*, ht* : heaptype*}(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) + def $subst_externtype{tt : tabletype, xx* : typevar*, ht* : heaptype*}(TABLE_externtype(tt), xx*{xx : typevar}, ht*{ht : heaptype}) = TABLE_externtype($subst_tabletype(tt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{mt : memtype, xx* : typevar*, ht* : heaptype*}(MEM_externtype(mt), xx*{xx}, ht*{ht}) = MEM_externtype($subst_memtype(mt, xx*{xx}, ht*{ht})) + def $subst_externtype{mt : memtype, xx* : typevar*, ht* : heaptype*}(MEM_externtype(mt), xx*{xx : typevar}, ht*{ht : heaptype}) = MEM_externtype($subst_memtype(mt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_all_reftype(reftype : reftype, heaptype*) : reftype ;; 2-syntax-aux.watsup - def $subst_all_reftype{rt : reftype, ht^n : heaptype^n, n : n, i^n : nat^n}(rt, ht^n{ht}) = $subst_reftype(rt, $idx(`%`(i))^(i (sx?{sx} = ?())) - | VREPLACE_LANE(shape : shape, laneidx : laneidx) - | VUNOP(shape : shape, vunop_ : vunop_(shape)) - | VBINOP(shape : shape, vbinop_ : vbinop_(shape)) - | VTESTOP(shape : shape, vtestop_ : vtestop_(shape)) - | VRELOP(shape : shape, vrelop_ : vrelop_(shape)) - | VSHIFTOP(ishape : ishape, vshiftop_ : vshiftop_(ishape)) - | VBITMASK(ishape : ishape) - | VCVTOP(shape : shape, vcvtop : vcvtop, half?, shape : shape, sx?, zero : zero) - | VNARROW(ishape : ishape, ishape : ishape, sx : sx) - | VEXTUNOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) + | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*{laneidx : laneidx} : laneidx*) + -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx : laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) + | VSPLAT{shape : shape}(shape : shape) + | VEXTRACT_LANE{shape : shape, sx? : sx?, laneidx : laneidx, numtype : numtype}(shape : shape, sx?{sx : sx} : sx?, laneidx : laneidx) + -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx : sx} = ?())) + | VREPLACE_LANE{shape : shape, laneidx : laneidx}(shape : shape, laneidx : laneidx) + | VUNOP{shape : shape, vunop_ : vunop_(shape)}(shape : shape, vunop_ : vunop_(shape)) + | VBINOP{shape : shape, vbinop_ : vbinop_(shape)}(shape : shape, vbinop_ : vbinop_(shape)) + | VTESTOP{shape : shape, vtestop_ : vtestop_(shape)}(shape : shape, vtestop_ : vtestop_(shape)) + | VRELOP{shape : shape, vrelop_ : vrelop_(shape)}(shape : shape, vrelop_ : vrelop_(shape)) + | VSHIFTOP{ishape : ishape, vshiftop_ : vshiftop_(ishape)}(ishape : ishape, vshiftop_ : vshiftop_(ishape)) + | VBITMASK{ishape : ishape}(ishape : ishape) + | VCVTOP{shape : shape, vcvtop : vcvtop, half? : half?, sx? : sx?, zero : zero}(shape : shape, vcvtop : vcvtop, half?{half : half} : half?, shape, sx?{sx : sx} : sx?, zero : zero) + | VNARROW{ishape : ishape, sx : sx}(ishape : ishape, ishape, sx : sx) + | VEXTUNOP{ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | VEXTBINOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) + | VEXTBINOP{ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | REF.NULL(heaptype : heaptype) + | REF.NULL{heaptype : heaptype}(heaptype : heaptype) | REF.I31 - | REF.FUNC(funcidx : funcidx) + | REF.FUNC{funcidx : funcidx}(funcidx : funcidx) | REF.IS_NULL | REF.AS_NON_NULL | REF.EQ - | REF.TEST(reftype : reftype) - | REF.CAST(reftype : reftype) - | I31.GET(sx : sx) - | STRUCT.NEW(typeidx : typeidx) - | STRUCT.NEW_DEFAULT(typeidx : typeidx) - | STRUCT.GET(sx?, typeidx : typeidx, u32 : u32) - | STRUCT.SET(typeidx : typeidx, u32 : u32) - | ARRAY.NEW(typeidx : typeidx) - | ARRAY.NEW_DEFAULT(typeidx : typeidx) - | ARRAY.NEW_FIXED(typeidx : typeidx, nat : nat) - | ARRAY.NEW_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.NEW_ELEM(typeidx : typeidx, elemidx : elemidx) - | ARRAY.GET(sx?, typeidx : typeidx) - | ARRAY.SET(typeidx : typeidx) + | REF.TEST{reftype : reftype}(reftype : reftype) + | REF.CAST{reftype : reftype}(reftype : reftype) + | I31.GET{sx : sx}(sx : sx) + | STRUCT.NEW{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.GET{sx? : sx?, typeidx : typeidx, u32 : u32}(sx?{sx : sx} : sx?, typeidx : typeidx, u32 : u32) + | STRUCT.SET{typeidx : typeidx, u32 : u32}(typeidx : typeidx, u32 : u32) + | ARRAY.NEW{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_FIXED{typeidx : typeidx}(typeidx : typeidx, nat) + | ARRAY.NEW_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.NEW_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) + | ARRAY.GET{sx? : sx?, typeidx : typeidx}(sx?{sx : sx} : sx?, typeidx : typeidx) + | ARRAY.SET{typeidx : typeidx}(typeidx : typeidx) | ARRAY.LEN - | ARRAY.FILL(typeidx : typeidx) - | ARRAY.COPY(typeidx : typeidx, typeidx : typeidx) - | ARRAY.INIT_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.INIT_ELEM(typeidx : typeidx, elemidx : elemidx) + | ARRAY.FILL{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.COPY{typeidx : typeidx}(typeidx : typeidx, typeidx) + | ARRAY.INIT_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.INIT_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) | EXTERN.CONVERT_ANY | ANY.CONVERT_EXTERN - | LOCAL.GET(localidx : localidx) - | LOCAL.SET(localidx : localidx) - | LOCAL.TEE(localidx : localidx) - | GLOBAL.GET(globalidx : globalidx) - | GLOBAL.SET(globalidx : globalidx) - | TABLE.GET(tableidx : tableidx) - | TABLE.SET(tableidx : tableidx) - | TABLE.SIZE(tableidx : tableidx) - | TABLE.GROW(tableidx : tableidx) - | TABLE.FILL(tableidx : tableidx) - | TABLE.COPY(tableidx : tableidx, tableidx : tableidx) - | TABLE.INIT(tableidx : tableidx, elemidx : elemidx) - | ELEM.DROP(elemidx : elemidx) - | MEMORY.SIZE(memidx : memidx) - | MEMORY.GROW(memidx : memidx) - | MEMORY.FILL(memidx : memidx) - | MEMORY.COPY(memidx : memidx, memidx : memidx) - | MEMORY.INIT(memidx : memidx, dataidx : dataidx) - | DATA.DROP(dataidx : dataidx) - | LOAD(numtype : numtype, (n, sx)?, memidx : memidx, memop : memop) - | STORE(numtype : numtype, n?, memidx : memidx, memop : memop) - | VLOAD(vloadop?, memidx : memidx, memop : memop) - | VLOAD_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | VSTORE(memidx : memidx, memop : memop) - | VSTORE_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | REF.I31_NUM(u31 : u31) - | REF.STRUCT_ADDR(structaddr : structaddr) - | REF.ARRAY_ADDR(arrayaddr : arrayaddr) - | REF.FUNC_ADDR(funcaddr : funcaddr) - | REF.HOST_ADDR(hostaddr : hostaddr) - | REF.EXTERN(addrref : addrref) - | LABEL_(n : n, instr*, admininstr*) - | FRAME_(n : n, frame : frame, admininstr*) + | LOCAL.GET{localidx : localidx}(localidx : localidx) + | LOCAL.SET{localidx : localidx}(localidx : localidx) + | LOCAL.TEE{localidx : localidx}(localidx : localidx) + | GLOBAL.GET{globalidx : globalidx}(globalidx : globalidx) + | GLOBAL.SET{globalidx : globalidx}(globalidx : globalidx) + | TABLE.GET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SIZE{tableidx : tableidx}(tableidx : tableidx) + | TABLE.GROW{tableidx : tableidx}(tableidx : tableidx) + | TABLE.FILL{tableidx : tableidx}(tableidx : tableidx) + | TABLE.COPY{tableidx : tableidx}(tableidx : tableidx, tableidx) + | TABLE.INIT{tableidx : tableidx, elemidx : elemidx}(tableidx : tableidx, elemidx : elemidx) + | ELEM.DROP{elemidx : elemidx}(elemidx : elemidx) + | MEMORY.SIZE{memidx : memidx}(memidx : memidx) + | MEMORY.GROW{memidx : memidx}(memidx : memidx) + | MEMORY.FILL{memidx : memidx}(memidx : memidx) + | MEMORY.COPY{memidx : memidx}(memidx : memidx, memidx) + | MEMORY.INIT{memidx : memidx, dataidx : dataidx}(memidx : memidx, dataidx : dataidx) + | DATA.DROP{dataidx : dataidx}(dataidx : dataidx) + | LOAD{numtype : numtype, n? : n?, sx? : sx?, memidx : memidx, memop : memop}(numtype : numtype, (n, sx)?{n : n sx : sx} : (n, sx)?, memidx : memidx, memop : memop) + | STORE{numtype : numtype, n? : n?, memidx : memidx, memop : memop}(numtype : numtype, n?{n : n} : n?, memidx : memidx, memop : memop) + | VLOAD{vloadop? : vloadop?, memidx : memidx, memop : memop}(vloadop?{vloadop : vloadop} : vloadop?, memidx : memidx, memop : memop) + | VLOAD_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | VSTORE{memidx : memidx, memop : memop}(memidx : memidx, memop : memop) + | VSTORE_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | REF.I31_NUM{u31 : u31}(u31 : u31) + | REF.STRUCT_ADDR{structaddr : structaddr}(structaddr : structaddr) + | REF.ARRAY_ADDR{arrayaddr : arrayaddr}(arrayaddr : arrayaddr) + | REF.FUNC_ADDR{funcaddr : funcaddr}(funcaddr : funcaddr) + | REF.HOST_ADDR{hostaddr : hostaddr}(hostaddr : hostaddr) + | REF.EXTERN{addrref : addrref}(addrref : addrref) + | LABEL_{n : n, instr* : instr*, admininstr* : admininstr*}(n : n, instr*{instr : instr} : instr*, admininstr*{admininstr : admininstr} : admininstr*) + | FRAME_{n : n, frame : frame, admininstr* : admininstr*}(n : n, frame : frame, admininstr*{admininstr : admininstr} : admininstr*) | TRAP } ;; 4-runtime.watsup -syntax config = `%;%*`(state : state, admininstr*) +syntax config = `%;%*`{state : state, admininstr* : admininstr*}(state : state, admininstr*{admininstr : admininstr} : admininstr*) ;; 4-runtime.watsup rec { @@ -2295,15 +2295,15 @@ rec { ;; 4-runtime.watsup:165.1-168.25 syntax E = | _HOLE - | _SEQ(val*, E : E, instr*) - | LABEL_(n : n, instr*, E : E) + | _SEQ{val* : val*, E : E, instr* : instr*}(val*{val : val} : val*, E : E, instr*{instr : instr} : instr*) + | LABEL_{n : n, instr* : instr*, E : E}(n : n, instr*{instr : instr} : instr*, E : E) } ;; 5-runtime-aux.watsup def $inst_reftype(moduleinst : moduleinst, reftype : reftype) : reftype ;; 5-runtime-aux.watsup - def $inst_reftype{mm : moduleinst, rt : reftype, dt* : deftype*}(mm, rt) = $subst_all_reftype(rt, (dt : deftype <: heaptype)*{dt}) - -- if (dt*{dt} = mm.TYPE_moduleinst) + def $inst_reftype{mm : moduleinst, rt : reftype, dt* : deftype*}(mm, rt) = $subst_all_reftype(rt, (dt : deftype <: heaptype)*{dt : deftype}) + -- if (dt*{dt : deftype} = mm.TYPE_moduleinst) ;; 5-runtime-aux.watsup def $default(valtype : valtype) : val? @@ -2344,9 +2344,9 @@ def $funcsxv(externval*) : funcaddr* ;; 5-runtime-aux.watsup:49.1-49.24 def $funcsxv([]) = [] ;; 5-runtime-aux.watsup:50.1-50.47 - def $funcsxv{fa : funcaddr, xv* : externval*}([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) + def $funcsxv{fa : funcaddr, xv* : externval*}([FUNC_externval(fa)] :: xv*{xv : externval}) = [fa] :: $funcsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:51.1-51.58 - def $funcsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $funcsxv(xv*{xv}) + def $funcsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $funcsxv(xv*{xv : externval}) -- otherwise } @@ -2358,9 +2358,9 @@ def $globalsxv(externval*) : globaladdr* ;; 5-runtime-aux.watsup:53.1-53.26 def $globalsxv([]) = [] ;; 5-runtime-aux.watsup:54.1-54.53 - def $globalsxv{ga : globaladdr, xv* : externval*}([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) + def $globalsxv{ga : globaladdr, xv* : externval*}([GLOBAL_externval(ga)] :: xv*{xv : externval}) = [ga] :: $globalsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:55.1-55.62 - def $globalsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $globalsxv(xv*{xv}) + def $globalsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $globalsxv(xv*{xv : externval}) -- otherwise } @@ -2372,9 +2372,9 @@ def $tablesxv(externval*) : tableaddr* ;; 5-runtime-aux.watsup:57.1-57.25 def $tablesxv([]) = [] ;; 5-runtime-aux.watsup:58.1-58.50 - def $tablesxv{ta : tableaddr, xv* : externval*}([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) + def $tablesxv{ta : tableaddr, xv* : externval*}([TABLE_externval(ta)] :: xv*{xv : externval}) = [ta] :: $tablesxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:59.1-59.60 - def $tablesxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $tablesxv(xv*{xv}) + def $tablesxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $tablesxv(xv*{xv : externval}) -- otherwise } @@ -2386,9 +2386,9 @@ def $memsxv(externval*) : memaddr* ;; 5-runtime-aux.watsup:61.1-61.23 def $memsxv([]) = [] ;; 5-runtime-aux.watsup:62.1-62.44 - def $memsxv{ma : memaddr, xv* : externval*}([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) + def $memsxv{ma : memaddr, xv* : externval*}([MEM_externval(ma)] :: xv*{xv : externval}) = [ma] :: $memsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:63.1-63.56 - def $memsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $memsxv(xv*{xv}) + def $memsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $memsxv(xv*{xv : externval}) -- otherwise } @@ -2515,7 +2515,7 @@ def $with_tableinst(state : state, tableidx : tableidx, tableinst : tableinst) : ;; 5-runtime-aux.watsup def $with_mem(state : state, memidx : memidx, nat : nat, nat : nat, byte*) : state ;; 5-runtime-aux.watsup - def $with_mem{s : store, f : frame, x : idx, i : nat, j : nat, b* : byte*}(`%;%`(s, f), x, i, j, b*{b}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]].DATA_meminst[i : j] = b*{b}], f) + def $with_mem{s : store, f : frame, x : idx, i : nat, j : nat, b* : byte*}(`%;%`(s, f), x, i, j, b*{b : byte}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]].DATA_meminst[i : j] = b*{b : byte}], f) ;; 5-runtime-aux.watsup def $with_meminst(state : state, memidx : memidx, meminst : meminst) : state @@ -2525,12 +2525,12 @@ def $with_meminst(state : state, memidx : memidx, meminst : meminst) : state ;; 5-runtime-aux.watsup def $with_elem(state : state, elemidx : elemidx, ref*) : state ;; 5-runtime-aux.watsup - def $with_elem{s : store, f : frame, x : idx, r* : ref*}(`%;%`(s, f), x, r*{r}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]].ELEM_eleminst = r*{r}], f) + def $with_elem{s : store, f : frame, x : idx, r* : ref*}(`%;%`(s, f), x, r*{r : ref}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]].ELEM_eleminst = r*{r : ref}], f) ;; 5-runtime-aux.watsup def $with_data(state : state, dataidx : dataidx, byte*) : state ;; 5-runtime-aux.watsup - def $with_data{s : store, f : frame, x : idx, b* : byte*}(`%;%`(s, f), x, b*{b}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]].DATA_datainst = b*{b}], f) + def $with_data{s : store, f : frame, x : idx, b* : byte*}(`%;%`(s, f), x, b*{b : byte}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]].DATA_datainst = b*{b : byte}], f) ;; 5-runtime-aux.watsup def $with_struct(state : state, structaddr : structaddr, nat : nat, fieldval : fieldval) : state @@ -2545,29 +2545,29 @@ def $with_array(state : state, arrayaddr : arrayaddr, nat : nat, fieldval : fiel ;; 5-runtime-aux.watsup def $ext_structinst(state : state, structinst*) : state ;; 5-runtime-aux.watsup - def $ext_structinst{s : store, f : frame, si* : structinst*}(`%;%`(s, f), si*{si}) = `%;%`(s[STRUCT_store =.. si*{si}], f) + def $ext_structinst{s : store, f : frame, si* : structinst*}(`%;%`(s, f), si*{si : structinst}) = `%;%`(s[STRUCT_store =.. si*{si : structinst}], f) ;; 5-runtime-aux.watsup def $ext_arrayinst(state : state, arrayinst*) : state ;; 5-runtime-aux.watsup - def $ext_arrayinst{s : store, f : frame, ai* : arrayinst*}(`%;%`(s, f), ai*{ai}) = `%;%`(s[ARRAY_store =.. ai*{ai}], f) + def $ext_arrayinst{s : store, f : frame, ai* : arrayinst*}(`%;%`(s, f), ai*{ai : arrayinst}) = `%;%`(s[ARRAY_store =.. ai*{ai : arrayinst}], f) ;; 5-runtime-aux.watsup def $growtable(tableinst : tableinst, nat : nat, ref : ref) : tableinst ;; 5-runtime-aux.watsup def $growtable{ti : tableinst, n : n, r : ref, ti' : tableinst, i : nat, j : nat, rt : reftype, r'* : ref*, i' : nat}(ti, n, r) = ti' - -- if (ti = {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM r'*{r'}}) - -- if (i' = (|r'*{r'}| + n)) - -- if (ti' = {TYPE `%%`(`[%..%]`(`%`(i'), `%`(j)), rt), ELEM r'*{r'} :: r^n{}}) + -- if (ti = {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM r'*{r' : ref}}) + -- if (i' = (|r'*{r' : ref}| + n)) + -- if (ti' = {TYPE `%%`(`[%..%]`(`%`(i'), `%`(j)), rt), ELEM r'*{r' : ref} :: r^n{}}) -- if (i' <= j) ;; 5-runtime-aux.watsup def $growmemory(meminst : meminst, nat : nat) : meminst ;; 5-runtime-aux.watsup def $growmemory{mi : meminst, n : n, mi' : meminst, i : nat, j : nat, b* : byte*, i' : nat}(mi, n) = mi' - -- if (mi = {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA b*{b}}) - -- if (i' = ((|b*{b}| / (64 * $Ki)) + n)) - -- if (mi' = {TYPE `%I8`(`[%..%]`(`%`(i'), `%`(j))), DATA b*{b} :: `%`(0)^((n * 64) * $Ki){}}) + -- if (mi = {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA b*{b : byte}}) + -- if (i' = ((|b*{b : byte}| / (64 * $Ki)) + n)) + -- if (mi' = {TYPE `%I8`(`[%..%]`(`%`(i'), `%`(j))), DATA b*{b : byte} :: `%`(0)^((n * 64) * $Ki){}}) -- if (i' <= j) ;; 6-typing.watsup @@ -2576,25 +2576,25 @@ syntax init = | UNSET ;; 6-typing.watsup -syntax localtype = `%%`(init : init, valtype : valtype) +syntax localtype = `%%`{init : init, valtype : valtype}(init : init, valtype : valtype) ;; 6-typing.watsup -syntax instrtype = `%->%*%`(resulttype : resulttype, localidx*, resulttype : resulttype) +syntax instrtype = `%->%*%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) ;; 6-typing.watsup syntax context = { - TYPE deftype*, - REC subtype*, - FUNC deftype*, - GLOBAL globaltype*, - TABLE tabletype*, - MEM memtype*, - ELEM elemtype*, - DATA datatype*, - LOCAL localtype*, - LABEL resulttype*, - RETURN resulttype? + TYPE{deftype* : deftype*} deftype*, + REC{subtype* : subtype*} subtype*, + FUNC{deftype* : deftype*} deftype*, + GLOBAL{globaltype* : globaltype*} globaltype*, + TABLE{tabletype* : tabletype*} tabletype*, + MEM{memtype* : memtype*} memtype*, + ELEM{elemtype* : elemtype*} elemtype*, + DATA{datatype* : datatype*} datatype*, + LOCAL{localtype* : localtype*} localtype*, + LABEL{resulttype* : resulttype*} resulttype*, + RETURN{resulttype? : resulttype?} resulttype? } ;; 6-typing.watsup @@ -2605,7 +2605,7 @@ def $with_locals(context : context, localidx*, localtype*) : context ;; 6-typing.watsup:28.1-28.34 def $with_locals{C : context}(C, [], []) = C ;; 6-typing.watsup:29.1-29.85 - def $with_locals{C : context, x_1 : idx, x* : idx*, lt_1 : localtype, lt* : localtype*}(C, [x_1] :: x*{x}, [lt_1] :: lt*{lt}) = $with_locals(C[LOCAL_context[x_1.`%`.0] = lt_1], x*{x}, lt*{lt}) + def $with_locals{C : context, x_1 : idx, x* : idx*, lt_1 : localtype, lt* : localtype*}(C, [x_1] :: x*{x : localidx}, [lt_1] :: lt*{lt : localtype}) = $with_locals(C[LOCAL_context[x_1.`%`.0] = lt_1], x*{x : localidx}, lt*{lt : localtype}) } ;; 6-typing.watsup @@ -2616,15 +2616,15 @@ def $clostypes(deftype*) : deftype* ;; 6-typing.watsup:37.1-37.26 def $clostypes([]) = [] ;; 6-typing.watsup:38.1-38.93 - def $clostypes{dt* : deftype*, dt_N : deftype, dt'* : deftype*}(dt*{dt} :: [dt_N]) = dt'*{dt'} :: [$subst_all_deftype(dt_N, (dt' : deftype <: heaptype)*{dt'})] - -- if (dt'*{dt'} = $clostypes(dt*{dt})) + def $clostypes{dt* : deftype*, dt_N : deftype, dt'* : deftype*}(dt*{dt : deftype} :: [dt_N]) = dt'*{dt' : deftype} :: [$subst_all_deftype(dt_N, (dt' : deftype <: heaptype)*{dt' : deftype})] + -- if (dt'*{dt' : deftype} = $clostypes(dt*{dt : deftype})) } ;; 6-typing.watsup def $clostype(context : context, deftype : deftype) : deftype ;; 6-typing.watsup - def $clostype{C : context, dt : deftype, dt'* : deftype*}(C, dt) = $subst_all_deftype(dt, (dt' : deftype <: heaptype)*{dt'}) - -- if (dt'*{dt'} = $clostypes(C.TYPE_context)) + def $clostype{C : context, dt : deftype, dt'* : deftype*}(C, dt) = $subst_all_deftype(dt, (dt' : deftype <: heaptype)*{dt' : deftype}) + -- if (dt'*{dt' : deftype} = $clostypes(C.TYPE_context)) ;; 6-typing.watsup relation Numtype_ok: `%|-%:_OK`(context, numtype) @@ -2686,25 +2686,25 @@ relation Valtype_ok: `%|-%:_OK`(context, valtype) relation Resulttype_ok: `%|-%:_OK`(context, resulttype) ;; 6-typing.watsup rule _{C : context, t* : valtype*}: - `%|-%:_OK`(C, t*{t}) - -- (Valtype_ok: `%|-%:_OK`(C, t))*{t} + `%|-%:_OK`(C, t*{t : valtype}) + -- (Valtype_ok: `%|-%:_OK`(C, t))*{t : valtype} ;; 6-typing.watsup relation Instrtype_ok: `%|-%:_OK`(context, instrtype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, x* : idx*, t_2* : valtype*, lt* : localtype*}: - `%|-%:_OK`(C, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2}) - -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt x} + `%|-%:_OK`(C, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) + -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt : localtype x : idx} ;; 6-typing.watsup syntax oktypeidx = - | OK(typeidx : typeidx) + | OK{typeidx : typeidx}(typeidx : typeidx) ;; 6-typing.watsup syntax oktypeidxnat = - | OK(typeidx : typeidx, nat : nat) + | OK{typeidx : typeidx}(typeidx : typeidx, nat) ;; 6-typing.watsup relation Packtype_ok: `%|-%:_OK`(context, packtype) @@ -2735,16 +2735,16 @@ relation Fieldtype_ok: `%|-%:_OK`(context, fieldtype) relation Functype_ok: `%|-%:_OK`(context, functype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:_OK`(C, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2}) + `%|-%:_OK`(C, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) + -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) ;; 6-typing.watsup relation Comptype_ok: `%|-%:_OK`(context, comptype) ;; 6-typing.watsup rule struct{C : context, yt* : fieldtype*}: - `%|-%:_OK`(C, STRUCT_comptype(yt*{yt})) - -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt} + `%|-%:_OK`(C, STRUCT_comptype(yt*{yt : fieldtype})) + -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt : fieldtype} ;; 6-typing.watsup rule array{C : context, yt : fieldtype}: @@ -2781,7 +2781,7 @@ relation Deftype_sub: `%|-%<:%`(context, deftype, deftype) ;; 6-typing.watsup:438.1-441.40 rule super{C : context, deftype_1 : deftype, deftype_2 : deftype, fin : fin, ht_1* : heaptype*, ht : heaptype, ht_2* : heaptype*, ct : comptype}: `%|-%<:%`(C, deftype_1, deftype_2) - -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1 : heaptype} :: [ht] :: ht_2*{ht_2 : heaptype}, ct)) -- Heaptype_sub: `%|-%<:%`(C, ht, (deftype_2 : deftype <: heaptype)) ;; 6-typing.watsup:271.1-271.79 @@ -2816,7 +2816,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:303.1-305.35 rule struct{C : context, deftype : deftype, yt* : fieldtype*}: `%|-%<:%`(C, (deftype : deftype <: heaptype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) + -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt : fieldtype})) ;; 6-typing.watsup:307.1-309.33 rule array{C : context, deftype : deftype, yt : fieldtype}: @@ -2846,7 +2846,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:327.1-329.48 rule rec{C : context, i : nat, ht : heaptype, fin : fin, ht_1* : heaptype*, ht_2* : heaptype*, ct : comptype}: `%|-%<:%`(C, REC_heaptype(i), ht) - -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1 : heaptype} :: [ht] :: ht_2*{ht_2 : heaptype}, ct)) ;; 6-typing.watsup:331.1-333.40 rule none{C : context, heaptype : heaptype}: @@ -2942,8 +2942,8 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) ;; 6-typing.watsup rule struct{C : context, yt_1* : fieldtype*, yt'_1 : fieldtype, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) - -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} + `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1 : fieldtype} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2 : fieldtype})) + -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 : fieldtype yt_2 : fieldtype} ;; 6-typing.watsup rule array{C : context, yt_1 : fieldtype, yt_2 : fieldtype}: @@ -2959,12 +2959,12 @@ relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) ;; 6-typing.watsup rule _{C : context, fin : fin, y* : idx*, ct : comptype, x : idx, y'** : idx**, ct'* : comptype*}: - `%|-%:%`(C, SUB_subtype(fin, y*{y}, ct), OK_oktypeidx(x)) - -- if (|y*{y}| <= 1) - -- (if (y.`%`.0 < x.`%`.0))*{y} - -- (if ($unrolldt(C.TYPE_context[y.`%`.0]) = SUB_subtype(`FINAL%?`(?()), y'*{y'}, ct')))*{ct' y y'} + `%|-%:%`(C, SUB_subtype(fin, y*{y : typeidx}, ct), OK_oktypeidx(x)) + -- if (|y*{y : idx}| <= 1) + -- (if (y.`%`.0 < x.`%`.0))*{y : idx} + -- (if ($unrolldt(C.TYPE_context[y.`%`.0]) = SUB_subtype(`FINAL%?`(?()), y'*{y' : typeidx}, ct')))*{ct' : comptype y : idx y' : typeidx} -- Comptype_ok: `%|-%:_OK`(C, ct) - -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct'} + -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct' : comptype} ;; 6-typing.watsup def $before(heaptype : heaptype, typeidx : typeidx, nat : nat) : bool @@ -2988,12 +2988,12 @@ def $unrollht(context : context, heaptype : heaptype) : subtype relation Subtype_ok2: `%|-%:%`(context, subtype, oktypeidxnat) ;; 6-typing.watsup rule _{C : context, fin : fin, ht* : heaptype*, ct : comptype, x : idx, i : nat, ht'** : heaptype**, ct'* : comptype*}: - `%|-%:%`(C, SUBD_subtype(fin, ht*{ht}, ct), OK_oktypeidxnat(x, i)) - -- if (|ht*{ht}| <= 1) - -- (if $before(ht, x, i))*{ht} - -- (if ($unrollht(C, ht) = SUBD_subtype(`FINAL%?`(?()), ht'*{ht'}, ct')))*{ct' ht ht'} + `%|-%:%`(C, SUBD_subtype(fin, ht*{ht : heaptype}, ct), OK_oktypeidxnat(x, i)) + -- if (|ht*{ht : heaptype}| <= 1) + -- (if $before(ht, x, i))*{ht : heaptype} + -- (if ($unrollht(C, ht) = SUBD_subtype(`FINAL%?`(?()), ht'*{ht' : heaptype}, ct')))*{ct' : comptype ht : heaptype ht' : heaptype} -- Comptype_ok: `%|-%:_OK`(C, ct) - -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct'} + -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct' : comptype} ;; 6-typing.watsup rec { @@ -3006,9 +3006,9 @@ relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) ;; 6-typing.watsup:199.1-202.50 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidxnat(x, i)) + `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) - -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) } ;; 6-typing.watsup @@ -3022,14 +3022,14 @@ relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) ;; 6-typing.watsup:187.1-190.43 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidx(x)) + `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidx(x)) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) - -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) + -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) ;; 6-typing.watsup:192.1-194.49 rule rec2{C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) + `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(x, 0)) } ;; 6-typing.watsup @@ -3038,7 +3038,7 @@ relation Deftype_ok: `%|-%:_OK`(context, deftype) rule _{C : context, qt : rectype, i : nat, x : idx, st^n : subtype^n, n : n}: `%|-%:_OK`(C, DEF_deftype(qt, i)) -- Rectype_ok: `%|-%:%`(C, qt, OK_oktypeidx(x)) - -- if (qt = REC_rectype(st^n{st})) + -- if (qt = REC_rectype(st^n{st : subtype})) -- if (i < n) ;; 6-typing.watsup @@ -3097,18 +3097,18 @@ relation Externtype_ok: `%|-%:_OK`(context, externtype) relation Resulttype_sub: `%|-%*_<:%*`(context, valtype*, valtype*) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%*_<:%*`(C, t_1*{t_1}, t_2*{t_2}) - -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 t_2} + `%|-%*_<:%*`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) + -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 : valtype t_2 : valtype} ;; 6-typing.watsup relation Instrtype_sub: `%|-%<:%`(context, instrtype, instrtype) ;; 6-typing.watsup rule _{C : context, t_11* : valtype*, x_1* : idx*, t_12* : valtype*, t_21* : valtype*, x_2* : idx*, t_22* : valtype*, x* : idx*, t* : valtype*}: - `%|-%<:%`(C, `%->%*%`(t_11*{t_11}, x_1*{x_1}, t_12*{t_12}), `%->%*%`(t_21*{t_21}, x_2*{x_2}, t_22*{t_22})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21}, t_11*{t_11}) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12}, t_22*{t_22}) - -- if (x*{x} = $setminus(x_2*{x_2}, x_1*{x_1})) - -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t x} + `%|-%<:%`(C, `%->%*%`(t_11*{t_11 : valtype}, x_1*{x_1 : localidx}, t_12*{t_12 : valtype}), `%->%*%`(t_21*{t_21 : valtype}, x_2*{x_2 : localidx}, t_22*{t_22 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) + -- if (x*{x : idx} = $setminus(x_2*{x_2 : idx}, x_1*{x_1 : idx})) + -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t : valtype x : idx} ;; 6-typing.watsup relation Limits_sub: `%|-%<:%`(context, limits, limits) @@ -3191,7 +3191,7 @@ rec { relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:544.1-545.34 rule unreachable{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:547.1-548.24 rule nop{C : context}: @@ -3213,55 +3213,55 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:578.1-581.61 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:583.1-586.61 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:588.1-592.65 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_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_2*{x_2 : localidx}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:597.1-599.24 rule br{C : context, l : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.LABEL_context[l.`%`.0] = t*{t}) + `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) ;; 6-typing.watsup:601.1-603.24 rule br_if{C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) - -- if (C.LABEL_context[l.`%`.0] = t*{t}) + `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t : valtype} :: [I32_valtype], t*{t : valtype})) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) ;; 6-typing.watsup:605.1-608.44 rule br_table{C : context, l* : labelidx*, l' : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[l.`%`.0]))*{l} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[l'.`%`.0]) + `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0]))*{l : labelidx} + -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0]) ;; 6-typing.watsup:610.1-613.31 rule br_on_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t}) + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:615.1-618.31 rule br_on_non_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) - -- if (C.LABEL_context[l.`%`.0] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype})) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:620.1-626.34 rule br_on_cast{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 : reftype <: valtype)], t*{t} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -3269,8 +3269,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:628.1-634.49 rule br_on_cast_fail{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 : reftype <: valtype)], t*{t} :: [(rt_2 : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [(rt_2 : reftype <: valtype)])) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -3278,48 +3278,48 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:639.1-641.24 rule return{C : context, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.RETURN_context = ?(t*{t})) + `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + -- if (C.RETURN_context = ?(t*{t : valtype})) ;; 6-typing.watsup:643.1-645.46 rule call{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; 6-typing.watsup:647.1-649.46 rule call_ref{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2 : valtype})) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; 6-typing.watsup:651.1-655.46 rule call_indirect{C : context, x : idx, y : idx, t_1* : valtype*, t_2* : valtype*, lim : limits, rt : reftype}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; 6-typing.watsup:657.1-661.40 rule return_call{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}, t_4*{t_4 : valtype})) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:663.1-667.40 rule return_call_ref{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4 : valtype})) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:669.1-675.40 rule return_call_indirect{C : context, x : idx, y : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, lim : limits, rt : reftype, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype], t_4*{t_4 : valtype})) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:680.1-681.33 rule const{C : context, nt : numtype, c_nt : num_(nt)}: @@ -3349,9 +3349,9 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:701.1-704.50 rule convert-i{C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: - `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) -- if (inn_1 =/= inn_2) - -- if ((sx?{sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) + -- if ((sx?{sx : sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) ;; 6-typing.watsup:706.1-708.24 rule convert-f{C : context, fnn_1 : fnn, fnn_2 : fnn}: @@ -3405,27 +3405,27 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:756.1-758.43 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) ;; 6-typing.watsup:760.1-763.39 rule struct.new_default{C : context, x : idx, zt* : storagetype*, mut* : mut*, val* : val*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpack(zt)) = ?(val)))*{val zt} + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 6-typing.watsup:765.1-769.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: - `%|-%:%`(C, STRUCT.GET_instr(sx?{sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(mut, zt)) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + -- if (yt*{yt : fieldtype}[i] = `%%`(mut, zt)) + -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:771.1-774.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + -- if (yt*{yt : fieldtype}[i] = `%%`(`MUT%?`(?(())), zt)) ;; 6-typing.watsup:779.1-781.41 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: @@ -3458,9 +3458,9 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:803.1-806.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:808.1-810.41 rule array.set{C : context, x : idx, zt : storagetype}: @@ -3535,8 +3535,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:870.1-872.22 rule vshuffle{C : context, imm : imm, N : N, i* : nat*}: - `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) - -- (if (i < (N * 2)))*{i} + `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + -- (if (i < (N * 2)))*{i : nat} ;; 6-typing.watsup:874.1-875.48 rule vsplat{C : context, lnn : lnn, N : N}: @@ -3544,7 +3544,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:878.1-880.14 rule vextract_lane{C : context, lnn : lnn, N : N, sx? : sx?, i : nat}: - `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) + `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) -- if (i < N) ;; 6-typing.watsup:882.1-884.14 @@ -3574,7 +3574,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:902.1-903.55 rule vcvtop{C : context, sh : shape, vcvtop : vcvtop, hf? : half?, sx? : sx?, zero : zero}: - `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf}, sh, sx?{sx}, zero), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`([V128_valtype], [V128_valtype])) ;; 6-typing.watsup:905.1-906.44 rule vnarrow{C : context, sh : ishape, sx : sx}: @@ -3685,19 +3685,19 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1011.1-1016.29 rule load{C : context, nt : numtype, n? : n?, sx? : sx?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} + -- if ((n?{n : n} = ?()) \/ (nt = (inn : inn <: numtype))) ;; 6-typing.watsup:1018.1-1023.29 rule store{C : context, nt : numtype, n? : n?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) + `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} + -- if ((n?{n : n} = ?()) \/ (nt = (inn : inn <: numtype))) ;; 6-typing.watsup:1025.1-1028.30 rule vload{C : context, M : M, N : N, sx : sx, x : idx, n_A : n, n_O : n, mt : memtype}: @@ -3741,8 +3741,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) relation Instrf_ok: `%|-%:%`(context, instr, instrtype) ;; 6-typing.watsup:518.1-520.41 rule instr{C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1 : valtype}, [], t_2*{t_2 : valtype})) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:924.1-926.28 rule local.set{C : context, x : idx, t : valtype, init : init}: @@ -3762,30 +3762,30 @@ relation Instrs_ok: `%|-%*_:%`(context, instr*, instrtype) ;; 6-typing.watsup:525.1-530.52 rule seq{C : context, instr_1 : instr, instr_2* : instr*, t_1* : valtype*, x_1* : idx*, x_2* : idx*, t_3* : valtype*, init* : init*, t* : valtype*, C' : context, t_2* : valtype*}: - `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_1*{x_1} :: x_2*{x_2}, t_3*{t_3})) - -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init t x_1} - -- if (C' = $with_locals(C, x_1*{x_1}, `%%`(SET_init, t)*{t})) - -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2}, `%->%*%`(t_2*{t_2}, x_2*{x_2}, t_3*{t_3})) + `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init : init t : valtype x_1 : idx} + -- if (C' = $with_locals(C, x_1*{x_1 : localidx}, `%%`(SET_init, t)*{t : valtype})) + -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2 : instr}, `%->%*%`(t_2*{t_2 : valtype}, x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) ;; 6-typing.watsup:532.1-535.35 rule sub{C : context, instr* : instr*, it' : instrtype, it : instrtype}: - `%|-%*_:%`(C, instr*{instr}, it') - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, it) + `%|-%*_:%`(C, instr*{instr : instr}, it') + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, it) -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:537.1-539.47 rule frame{C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, x* : idx*, t_2* : valtype*}: - `%|-%*_:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t*{t : valtype} :: t_1*{t_1 : valtype}, x*{x : localidx}, t*{t : valtype} :: t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) } ;; 6-typing.watsup relation Expr_ok: `%|-%:%`(context, expr, resulttype) ;; 6-typing.watsup rule _{C : context, instr* : instr*, t* : valtype*}: - `%|-%:%`(C, instr*{instr}, t*{t}) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, `%->%*%`([], [], t*{t})) + `%|-%:%`(C, instr*{instr : instr}, t*{t : valtype}) + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`([], [], t*{t : valtype})) ;; 6-typing.watsup rec { @@ -3795,7 +3795,7 @@ def $in_binop(numtype : numtype, binop_ : binop_(numtype), binop_(numtype)*) : b ;; 6-typing.watsup:1087.1-1087.42 def $in_binop{nt : numtype, binop : binop_(nt), epsilon : binop_(nt)*}(nt, binop, epsilon) = false ;; 6-typing.watsup:1088.1-1088.99 - def $in_binop{nt : numtype, binop : binop_(nt), ibinop_1 : binop_(nt), ibinop'* : binop_(nt)*}(nt, binop, [ibinop_1] :: ibinop'*{ibinop'}) = ((binop = ibinop_1) \/ $in_binop(nt, binop, ibinop'*{ibinop'})) + def $in_binop{nt : numtype, binop : binop_(nt), ibinop_1 : binop_(nt), ibinop'* : binop_(nt)*}(nt, binop, [ibinop_1] :: ibinop'*{ibinop' : binop_(nt)}) = ((binop = ibinop_1) \/ $in_binop(nt, binop, ibinop'*{ibinop' : binop_(nt)})) } ;; 6-typing.watsup @@ -3806,7 +3806,7 @@ def $in_numtype(numtype : numtype, numtype*) : bool ;; 6-typing.watsup:1083.1-1083.37 def $in_numtype{nt : numtype, epsilon : numtype*}(nt, epsilon) = false ;; 6-typing.watsup:1084.1-1084.68 - def $in_numtype{nt : numtype, nt_1 : numtype, nt'* : numtype*}(nt, [nt_1] :: nt'*{nt'}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt'})) + def $in_numtype{nt : numtype, nt_1 : numtype, nt'* : numtype*}(nt, [nt_1] :: nt'*{nt' : numtype}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt' : numtype})) } ;; 6-typing.watsup @@ -3842,8 +3842,8 @@ relation Instr_const: `%|-%CONST`(context, instr) relation Expr_const: `%|-%CONST`(context, expr) ;; 6-typing.watsup rule _{C : context, instr* : instr*}: - `%|-%CONST`(C, instr*{instr}) - -- (Instr_const: `%|-%CONST`(C, instr))*{instr} + `%|-%CONST`(C, instr*{instr : instr}) + -- (Instr_const: `%|-%CONST`(C, instr))*{instr : instr} ;; 6-typing.watsup relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) @@ -3857,10 +3857,10 @@ relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) relation Type_ok: `%|-%:%*`(context, type, deftype*) ;; 6-typing.watsup rule _{C : context, rectype : rectype, dt* : deftype*, x : idx}: - `%|-%:%*`(C, TYPE(rectype), dt*{dt}) + `%|-%:%*`(C, TYPE(rectype), dt*{dt : deftype}) -- if (x = `%`(|C.TYPE_context|)) - -- if (dt*{dt} = $rolldt(x, rectype)) - -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt}], rectype, OK_oktypeidx(x)) + -- if (dt*{dt : deftype} = $rolldt(x, rectype)) + -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt : deftype}], rectype, OK_oktypeidx(x)) ;; 6-typing.watsup relation Local_ok: `%|-%:%`(context, local, localtype) @@ -3878,10 +3878,10 @@ relation Local_ok: `%|-%:%`(context, local, localtype) relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup rule _{C : context, x : idx, local* : local*, expr : expr, t_1* : valtype*, t_2* : valtype*, lt* : localtype*}: - `%|-%:%`(C, `FUNC%%*%`(x, local*{local}, expr), C.TYPE_context[x.`%`.0]) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- (Local_ok: `%|-%:%`(C, local, lt))*{local lt} - -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1} :: lt*{lt}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2})}, expr, t_2*{t_2}) + `%|-%:%`(C, `FUNC%%*%`(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- (Local_ok: `%|-%:%`(C, local, lt))*{local : local lt : localtype} + -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2 : valtype})}, expr, t_2*{t_2 : valtype}) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -3928,8 +3928,8 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup rule _{C : context, rt : reftype, expr* : expr*, elemmode : elemmode}: - `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr}, elemmode), rt) - -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr} + `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr : expr}, elemmode), rt) + -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr : expr} -- Elemmode_ok: `%|-%:%`(C, elemmode, rt) ;; 6-typing.watsup @@ -3948,7 +3948,7 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) relation Data_ok: `%|-%:_OK`(context, data) ;; 6-typing.watsup rule _{C : context, b* : byte*, datamode : datamode}: - `%|-%:_OK`(C, `DATA%*%`(b*{b}, datamode)) + `%|-%:_OK`(C, `DATA%*%`(b*{b : byte}, datamode)) -- Datamode_ok: `%|-%:_OK`(C, datamode) ;; 6-typing.watsup @@ -4005,9 +4005,9 @@ relation Globals_ok: `%|-%*_:%*`(context, global*, globaltype*) ;; 6-typing.watsup:1275.1-1278.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: - `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt}) + `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) - -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt}) + -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) } ;; 6-typing.watsup @@ -4021,32 +4021,32 @@ relation Types_ok: `%|-%*_:%*`(context, type*, deftype*) ;; 6-typing.watsup:1267.1-1270.49 rule cons{C : context, type_1 : type, type* : type*, dt_1 : deftype, dt* : deftype*}: - `%|-%*_:%*`(C, [type_1] :: type*{type}, dt_1*{} :: dt*{dt}) + `%|-%*_:%*`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, dt*{dt}) + -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) } ;; 6-typing.watsup relation Module_ok: `|-%:_OK`(module) ;; 6-typing.watsup rule _{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data^n : data^n, n : n, start? : start?, export* : export*, dt'* : deftype*, ixt* : externtype*, C' : context, gt* : globaltype*, tt* : tabletype*, mt* : memtype*, C : context, dt* : deftype*, rt* : reftype*, et* : externtype*, idt* : deftype*, igt* : globaltype*, itt* : tabletype*, imt* : memtype*}: - `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type}, import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data^n{data}, start?{start}, export*{export})) - -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type}, dt'*{dt'}) - -- (Import_ok: `%|-%:%`({TYPE dt'*{dt'}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import ixt} - -- Globals_ok: `%|-%*_:%*`(C', global*{global}, gt*{gt}) - -- (Table_ok: `%|-%:%`(C', table, tt))*{table tt} - -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem mt} - -- (Func_ok: `%|-%:%`(C, func, dt))*{dt func} - -- (Elem_ok: `%|-%:%`(C, elem, rt))*{elem rt} - -- (Data_ok: `%|-%:_OK`(C, data))^n{data} - -- (Start_ok: `%|-%:_OK`(C, start))?{start} - -- (Export_ok: `%|-%:%`(C, export, et))*{et export} - -- if (C = {TYPE dt'*{dt'}, REC [], FUNC idt*{idt} :: dt*{dt}, GLOBAL igt*{igt} :: gt*{gt}, TABLE itt*{itt} :: tt*{tt}, MEM imt*{imt} :: mt*{mt}, ELEM rt*{rt}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) - -- if (C' = {TYPE dt'*{dt'}, REC [], FUNC idt*{idt} :: dt*{dt}, GLOBAL igt*{igt}, TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}) - -- if (idt*{idt} = $funcsxt(ixt*{ixt})) - -- if (igt*{igt} = $globalsxt(ixt*{ixt})) - -- if (itt*{itt} = $tablesxt(ixt*{ixt})) - -- if (imt*{imt} = $memsxt(ixt*{ixt})) + `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) + -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) + -- (Import_ok: `%|-%:%`({TYPE dt'*{dt' : deftype}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import : import ixt : externtype} + -- Globals_ok: `%|-%*_:%*`(C', global*{global : global}, gt*{gt : globaltype}) + -- (Table_ok: `%|-%:%`(C', table, tt))*{table : table tt : tabletype} + -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem : mem mt : memtype} + -- (Func_ok: `%|-%:%`(C, func, dt))*{dt : deftype func : func} + -- (Elem_ok: `%|-%:%`(C, elem, rt))*{elem : elem rt : reftype} + -- (Data_ok: `%|-%:_OK`(C, data))^n{data : data} + -- (Start_ok: `%|-%:_OK`(C, start))?{start : start} + -- (Export_ok: `%|-%:%`(C, export, et))*{et : externtype export : export} + -- if (C = {TYPE dt'*{dt' : deftype}, REC [], FUNC idt*{idt : deftype} :: dt*{dt : deftype}, GLOBAL igt*{igt : globaltype} :: gt*{gt : globaltype}, TABLE itt*{itt : tabletype} :: tt*{tt : tabletype}, MEM imt*{imt : memtype} :: mt*{mt : memtype}, ELEM rt*{rt : elemtype}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) + -- if (C' = {TYPE dt'*{dt' : deftype}, REC [], FUNC idt*{idt : deftype} :: dt*{dt : deftype}, GLOBAL igt*{igt : globaltype}, TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}) + -- if (idt*{idt : deftype} = $funcsxt(ixt*{ixt : externtype})) + -- if (igt*{igt : globaltype} = $globalsxt(ixt*{ixt : externtype})) + -- if (itt*{itt : tabletype} = $tablesxt(ixt*{ixt : externtype})) + -- if (imt*{imt : memtype} = $memsxt(ixt*{ixt : externtype})) ;; 7-runtime-typing.watsup relation Ref_ok: `%|-%:%`(store, ref, reftype) @@ -4097,35 +4097,35 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule select-true{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_1 : val <: admininstr)]) + `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule select-false{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_2 : val <: admininstr)]) + `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule if-true{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) + `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule if-false{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) + `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule label-vals{n : n, instr* : instr*, val* : val*}: - `%*_~>%*`([LABEL__admininstr(n, instr*{instr}, (val : val <: admininstr)*{val})], (val : val <: admininstr)*{val}) + `%*_~>%*`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) ;; 8-reduction.watsup rule br-zero{n : n, instr'* : instr*, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)^n{val} :: (instr' : instr <: admininstr)*{instr'}) + `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule br-succ{n : n, instr'* : instr*, val* : val*, l : labelidx, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val : val <: admininstr)*{val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)*{val} :: [BR_admininstr(l)]) + `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) ;; 8-reduction.watsup rule br_if-true{c : num_(I32_numtype), l : labelidx}: @@ -4139,13 +4139,13 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule br_table-lt{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) - -- if (i < |l*{l}|) + `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) + -- if (i < |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_table-ge{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) - -- if (i >= |l*{l}|) + `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) + -- if (i >= |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_on_null-null{val : val, l : labelidx, ht : heaptype}: @@ -4177,15 +4177,15 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule frame-vals{n : n, f : frame, val^n : val^n}: - `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val})], (val : val <: admininstr)^n{val}) + `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-frame{n : n, f : frame, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)^n{val}) + `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-label{k : nat, instr'* : instr*, val* : val*, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(k, instr'*{instr'}, (val : val <: admininstr)*{val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)*{val} :: [RETURN_admininstr]) + `%*_~>%*`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) ;; 8-reduction.watsup rule unop-val{nt : numtype, c_1 : num_(nt), unop : unop_(nt), c : num_(nt)}: @@ -4219,13 +4219,13 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?, c : num_(nt_2)}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx}, c_1) = [c]) + `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) + -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = [c]) ;; 8-reduction.watsup rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx}, c_1) = []) + `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) + -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: @@ -4314,15 +4314,15 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vswizzle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn : inn, N : N, c' : vec_(V128_vnn), c : iN($size((inn : inn <: numtype))), ci* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*, k^N : nat^N}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) - -- if (ci*{ci} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) + -- if (ci*{ci : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) -- if (c*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: `%`(0)^(256 - N){}) - -- if (c' = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c*{}[ci*{ci}[k].`%`.0]^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i})], [VCONST_admininstr(V128_vectype, c)]) + `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) - -- if (c = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c'*{}[i*{i}[k]]^(k%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vshiftop{c_1 : vec_(V128_vnn), n : n, imm : imm, N : N, vshiftop : vshiftop_(`%X%`(imm, `%`(N))), c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) - -- if (c'*{c'} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1)) - -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c'})) + -- if (c'*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1)) + -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))})) ;; 8-reduction.watsup rule vtestop-true{c : vec_(V128_vnn), inn : inn, N : N, ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) - -- (if (ci_1 =/= `%`(0)))*{ci_1} + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) + -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), inn : inn, N : N}: @@ -4384,35 +4384,35 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vbitmask{c : vec_(V128_vnn), inn : inn, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) - -- if ($ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1}) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) + -- if ($ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($size((inn : inn <: numtype)))}) ;; 8-reduction.watsup rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn_1 : inn, N_1 : N, inn_2 : inn, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, cj_1* : iN($size((inn_2 : inn <: numtype)))*, cj_2* : iN($size((inn_2 : inn <: numtype)))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) - -- if (ci_2*{ci_2} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2)) - -- if (cj_1*{cj_1} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1}) - -- if (cj_2*{cj_2} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_2)*{ci_2}) - -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), cj_1*{cj_1} :: cj_2*{cj_2})) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) + -- if (ci_2*{ci_2 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2)) + -- if (cj_1*{cj_1 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1 : iN($size((inn_1 : inn <: numtype)))}) + -- if (cj_2*{cj_2 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_2)*{ci_2 : iN($size((inn_1 : inn <: numtype)))}) + -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), cj_1*{cj_1 : lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), `%`(N_2))))} :: cj_2*{cj_2 : lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), `%`(N_2))))})) ;; 8-reduction.watsup rule vcvtop-normal{c_1 : vec_(V128_vnn), lnn_2 : lnn, N_2 : N, vcvtop : vcvtop, lnn_1 : lnn, N_1 : N, sx : sx, c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- if (c'*{c'} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1)) - -- if (c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c'})) + -- if (c'*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1)) + -- if (c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-half{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, hf : half, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci*{ci} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) - -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx}, ci)*{ci})) + `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) + -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-zero{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci*{ci} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) - -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx}, ci)*{ci} :: `%`(0)^N_1{})) + `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) + -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} :: `%`(0)^N_1{})) ;; 8-reduction.watsup rule vextunop{c_1 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: @@ -4442,13 +4442,13 @@ def $blocktype(state : state, blocktype : blocktype) : functype relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule block{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, n : n, t_1^k : valtype^k, t_2^n : valtype^n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val} :: (instr : instr <: admininstr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) ;; 8-reduction.watsup rule loop{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, t_1^k : valtype^k, t_2^n : valtype^n, n : n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], (val : val <: admininstr)^k{val} :: (instr : instr <: admininstr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) ;; 8-reduction.watsup rule br_on_cast-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: @@ -4478,15 +4478,15 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule call_ref-null{z : state, ht : heaptype, x? : idx?}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule call_ref-func{z : state, val^n : val^n, n : n, a : addr, x? : idx?, m : m, f : frame, instr* : instr*, fi : funcinst, t_1^n : valtype^n, t_2^m : valtype^m, y : idx, t* : valtype*}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr})])]) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) -- if ($funcinst(z)[a] = fi) - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) - -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) + -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t : valtype}, instr*{instr : instr})) + -- if (f = {LOCAL ?(val)^n{val : val} :: $default(t)*{t : valtype}, MODULE fi.MODULE_funcinst}) ;; 8-reduction.watsup rule return_call{z : state, x : idx}: @@ -4494,16 +4494,16 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule return_call_ref-label{z : state, k : nat, instr'* : instr*, val* : val*, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, (val : val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), (val : val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) + `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) ;; 8-reduction.watsup rule return_call_ref-frame-addr{z : state, k : nat, f : frame, val'* : val*, val^n : val^n, n : n, a : addr, x? : idx?, instr* : instr*, t_1^n : valtype^n, t_2^m : valtype^m, m : m}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) ;; 8-reduction.watsup rule return_call_ref-frame-null{z : state, k : nat, f : frame, val* : val*, ht : heaptype, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule ref.func{z : state, x : idx}: @@ -4533,19 +4533,19 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule struct.new_default{z : state, x : idx, val* : val*, mut* : mut*, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val} :: [STRUCT.NEW_admininstr(x)]) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpack(zt)) = ?(val)))*{val zt} + `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 8-reduction.watsup rule struct.get-null{z : state, ht : heaptype, sx? : sx?, x : idx, i : nat}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, `%`(i))]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) ;; 8-reduction.watsup rule struct.get-struct{z : state, a : addr, sx? : sx?, x : idx, i : nat, zt* : storagetype*, si : structinst, mut* : mut*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, `%`(i))]), [($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]) : val <: admininstr)]) + `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) -- if ($structinst(z)[a] = si) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) ;; 8-reduction.watsup rule array.new{z : state, val : val, n : n, x : idx}: @@ -4564,8 +4564,8 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.new_elem-alloc{z : state, i : nat, n : n, x : idx, y : idx, ref^n : ref^n}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- if (ref^n{ref : ref} = $elem(z, y).ELEM_eleminst[i : n]) ;; 8-reduction.watsup rule array.new_data-oob{z : state, i : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: @@ -4575,30 +4575,30 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.new_data-num{z : state, i : nat, n : n, x : idx, y : idx, nt : numtype, c^n : num_(nt)^n, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (nt = $nunpack(zt)) - -- if ($concat_(syntax byte, $nbytes(nt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) + -- if ($concat_(syntax byte, $nbytes(nt, c)^n{c : num_(nt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) ;; 8-reduction.watsup rule array.new_data-vec{z : state, i : nat, n : n, x : idx, y : idx, vt : vectype, c^n : vec_(vt)^n, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (vt = $vunpack(zt)) - -- if ($concat_(syntax byte, $vbytes(vt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) + -- if ($concat_(syntax byte, $vbytes(vt, c)^n{c : vec_(vt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) ;; 8-reduction.watsup rule array.get-null{z : state, ht : heaptype, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.get-oob{z : state, a : addr, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.get-array{z : state, a : addr, i : nat, sx? : sx?, x : idx, zt : storagetype, fv : fieldval, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [($unpackval(zt, sx?{sx}, fv) : val <: admininstr)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) @@ -4657,18 +4657,18 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.copy-le{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) + -- if (sx?{sx : sx} = $sxfield(zt_2)) -- if (i_1 <= i_2) ;; 8-reduction.watsup rule array.copy-gt{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) + -- if (sx?{sx : sx} = $sxfield(zt_2)) ;; 8-reduction.watsup rule array.init_elem-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: @@ -4849,9 +4849,9 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule vload-shape-val{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop, c : vec_(V128_vnn), j^N : nat^N, k^N : nat^N, inn : inn}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) - -- (if ($ibytes(M, `%`(j)) = $mem(z, x).DATA_meminst[((i + mo.OFFSET_memop.`%`.0) + ((k * M) / 8)) : (M / 8)]))^(k%*`(config, admininstr*) relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule pure{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr'})) - -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr}, (instr' : instr <: admininstr)*{instr'}) + `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule read{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr'})) - -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), (instr' : instr <: admininstr)*{instr'}) + `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule struct.new{z : state, val^n : val^n, n : n, x : idx, si : structinst, mut^n : mut^n, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) - -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) + `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut : mut zt : storagetype})) + -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val zt : storagetype}}) ;; 8-reduction.watsup rule struct.set-null{z : state, ht : heaptype, val : val, x : idx, i : nat}: @@ -4974,14 +4974,14 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule struct.set-struct{z : state, a : addr, val : val, x : idx, i : nat, fv : fieldval, mut* : mut*, zt* : storagetype*}: `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`($with_struct(z, a, i, fv), [])) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- if (fv = $packval(zt*{zt}[i], val)) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- if (fv = $packval(zt*{zt : storagetype}[i], val)) ;; 8-reduction.watsup rule array.new_fixed{z : state, val^n : val^n, n : n, x : idx, ai : arrayinst, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) + -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val}}) ;; 8-reduction.watsup rule array.set-null{z : state, ht : heaptype, i : nat, val : val, x : idx}: @@ -5036,8 +5036,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule store-num-val{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b}), [])) - -- if (b*{b} = $nbytes(nt, c)) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) + -- if (b*{b : byte} = $nbytes(nt, c)) ;; 8-reduction.watsup rule store-pack-oob{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop}: @@ -5046,8 +5046,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule store-pack-val{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b}), [])) - -- if (b*{b} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c))) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) + -- if (b*{b : byte} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c))) ;; 8-reduction.watsup rule vstore-oob{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop}: @@ -5056,8 +5056,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule vstore-val{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b}), [])) - -- if (b*{b} = $vbytes(V128_vectype, c)) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) + -- if (b*{b : byte} = $vbytes(V128_vectype, c)) ;; 8-reduction.watsup rule vstore_lane-oob{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: @@ -5066,10 +5066,10 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule vstore_lane-val{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, b* : byte*, imm : imm, M : M}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b}), [])) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = (128 / N)) - -- if (b*{b} = $ibytes(N, `%`($lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)[j].`%`.0))) + -- if (b*{b : byte} = $ibytes(N, `%`($lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)[j].`%`.0))) ;; 8-reduction.watsup rule memory.grow-succeed{z : state, n : n, x : idx, mi : meminst}: @@ -5091,21 +5091,21 @@ rec { relation Steps: `%~>*%`(config, config) ;; 8-reduction.watsup:18.1-19.36 rule refl{z : state, admininstr* : admininstr*}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) + `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z, admininstr*{admininstr : admininstr})) ;; 8-reduction.watsup:21.1-24.53 rule trans{z : state, admininstr* : admininstr*, z'' : state, admininstr''* : admininstr*, z' : state, admininstr' : admininstr}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z'', admininstr''*{admininstr''})) - -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z', admininstr'*{})) - -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr''})) + `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) + -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z', admininstr'*{})) + -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) } ;; 8-reduction.watsup relation Eval_expr: `%;%~>*%;%*`(state, expr, state, val*) ;; 8-reduction.watsup rule _{z : state, instr* : instr*, z' : state, val* : val*}: - `%;%~>*%;%*`(z, instr*{instr}, z', val*{val}) - -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z', (val : val <: admininstr)*{val})) + `%;%~>*%;%*`(z, instr*{instr : instr}, z', val*{val : val}) + -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z', (val : val <: admininstr)*{val : val})) ;; 9-module.watsup rec { @@ -5115,18 +5115,18 @@ def $alloctypes(type*) : deftype* ;; 9-module.watsup:8.1-8.27 def $alloctypes([]) = [] ;; 9-module.watsup:9.1-13.24 - def $alloctypes{type'* : type*, type : type, deftype'* : deftype*, deftype* : deftype*, rectype : rectype, x : idx}(type'*{type'} :: [type]) = deftype'*{deftype'} :: deftype*{deftype} - -- if (deftype'*{deftype'} = $alloctypes(type'*{type'})) + def $alloctypes{type'* : type*, type : type, deftype'* : deftype*, deftype* : deftype*, rectype : rectype, x : idx}(type'*{type' : type} :: [type]) = deftype'*{deftype' : deftype} :: deftype*{deftype : deftype} + -- if (deftype'*{deftype' : deftype} = $alloctypes(type'*{type' : type})) -- if (type = TYPE(rectype)) - -- if (deftype*{deftype} = $subst_all_deftypes($rolldt(x, rectype), (deftype' : deftype <: heaptype)*{deftype'})) - -- if (x = `%`(|deftype'*{deftype'}|)) + -- if (deftype*{deftype : deftype} = $subst_all_deftypes($rolldt(x, rectype), (deftype' : deftype <: heaptype)*{deftype' : deftype})) + -- if (x = `%`(|deftype'*{deftype' : deftype}|)) } ;; 9-module.watsup def $allocfunc(store : store, moduleinst : moduleinst, func : func) : (store, funcaddr) ;; 9-module.watsup def $allocfunc{s : store, mm : moduleinst, func : func, fi : funcinst, x : idx, local* : local*, expr : expr}(s, mm, func) = (s[FUNC_store =.. [fi]], |s.FUNC_store|) - -- if (func = `FUNC%%*%`(x, local*{local}, expr)) + -- if (func = `FUNC%%*%`(x, local*{local : local}, expr)) -- if (fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func}) ;; 9-module.watsup @@ -5137,9 +5137,9 @@ def $allocfuncs(store : store, moduleinst : moduleinst, func*) : (store, funcadd ;; 9-module.watsup:21.1-21.39 def $allocfuncs{s : store, mm : moduleinst}(s, mm, []) = (s, []) ;; 9-module.watsup:22.1-24.51 - def $allocfuncs{s : store, mm : moduleinst, func : func, func'* : func*, s_2 : store, fa : funcaddr, fa'* : funcaddr*, s_1 : store}(s, mm, [func] :: func'*{func'}) = (s_2, [fa] :: fa'*{fa'}) + def $allocfuncs{s : store, mm : moduleinst, func : func, func'* : func*, s_2 : store, fa : funcaddr, fa'* : funcaddr*, s_1 : store}(s, mm, [func] :: func'*{func' : func}) = (s_2, [fa] :: fa'*{fa' : funcaddr}) -- if ((s_1, fa) = $allocfunc(s, mm, func)) - -- if ((s_2, fa'*{fa'}) = $allocfuncs(s_1, mm, func'*{func'})) + -- if ((s_2, fa'*{fa' : funcaddr}) = $allocfuncs(s_1, mm, func'*{func' : func})) } ;; 9-module.watsup @@ -5156,9 +5156,9 @@ def $allocglobals(store : store, globaltype*, val*) : (store, globaladdr*) ;; 9-module.watsup:31.1-31.42 def $allocglobals{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:32.1-34.62 - def $allocglobals{s : store, globaltype : globaltype, globaltype'* : globaltype*, val : val, val'* : val*, s_2 : store, ga : globaladdr, ga'* : globaladdr*, s_1 : store}(s, [globaltype] :: globaltype'*{globaltype'}, [val] :: val'*{val'}) = (s_2, [ga] :: ga'*{ga'}) + def $allocglobals{s : store, globaltype : globaltype, globaltype'* : globaltype*, val : val, val'* : val*, s_2 : store, ga : globaladdr, ga'* : globaladdr*, s_1 : store}(s, [globaltype] :: globaltype'*{globaltype' : globaltype}, [val] :: val'*{val' : val}) = (s_2, [ga] :: ga'*{ga' : globaladdr}) -- if ((s_1, ga) = $allocglobal(s, globaltype, val)) - -- if ((s_2, ga'*{ga'}) = $allocglobals(s_1, globaltype'*{globaltype'}, val'*{val'})) + -- if ((s_2, ga'*{ga' : globaladdr}) = $allocglobals(s_1, globaltype'*{globaltype' : globaltype}, val'*{val' : val})) } ;; 9-module.watsup @@ -5175,9 +5175,9 @@ def $alloctables(store : store, tabletype*, ref*) : (store, tableaddr*) ;; 9-module.watsup:41.1-41.41 def $alloctables{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:42.1-44.60 - def $alloctables{s : store, tabletype : tabletype, tabletype'* : tabletype*, ref : ref, ref'* : ref*, s_2 : store, ta : tableaddr, ta'* : tableaddr*, s_1 : store}(s, [tabletype] :: tabletype'*{tabletype'}, [ref] :: ref'*{ref'}) = (s_2, [ta] :: ta'*{ta'}) + def $alloctables{s : store, tabletype : tabletype, tabletype'* : tabletype*, ref : ref, ref'* : ref*, s_2 : store, ta : tableaddr, ta'* : tableaddr*, s_1 : store}(s, [tabletype] :: tabletype'*{tabletype' : tabletype}, [ref] :: ref'*{ref' : ref}) = (s_2, [ta] :: ta'*{ta' : tableaddr}) -- if ((s_1, ta) = $alloctable(s, tabletype, ref)) - -- if ((s_2, ta'*{ta'}) = $alloctables(s_1, tabletype'*{tabletype'}, ref'*{ref'})) + -- if ((s_2, ta'*{ta' : tableaddr}) = $alloctables(s_1, tabletype'*{tabletype' : tabletype}, ref'*{ref' : ref})) } ;; 9-module.watsup @@ -5194,16 +5194,16 @@ def $allocmems(store : store, memtype*) : (store, memaddr*) ;; 9-module.watsup:51.1-51.34 def $allocmems{s : store}(s, []) = (s, []) ;; 9-module.watsup:52.1-54.49 - def $allocmems{s : store, memtype : memtype, memtype'* : memtype*, s_2 : store, ma : memaddr, ma'* : memaddr*, s_1 : store}(s, [memtype] :: memtype'*{memtype'}) = (s_2, [ma] :: ma'*{ma'}) + def $allocmems{s : store, memtype : memtype, memtype'* : memtype*, s_2 : store, ma : memaddr, ma'* : memaddr*, s_1 : store}(s, [memtype] :: memtype'*{memtype' : memtype}) = (s_2, [ma] :: ma'*{ma' : memaddr}) -- if ((s_1, ma) = $allocmem(s, memtype)) - -- if ((s_2, ma'*{ma'}) = $allocmems(s_1, memtype'*{memtype'})) + -- if ((s_2, ma'*{ma' : memaddr}) = $allocmems(s_1, memtype'*{memtype' : memtype})) } ;; 9-module.watsup def $allocelem(store : store, reftype : reftype, ref*) : (store, elemaddr) ;; 9-module.watsup - def $allocelem{s : store, rt : reftype, ref* : ref*, ei : eleminst}(s, rt, ref*{ref}) = (s[ELEM_store =.. [ei]], |s.ELEM_store|) - -- if (ei = {TYPE rt, ELEM ref*{ref}}) + def $allocelem{s : store, rt : reftype, ref* : ref*, ei : eleminst}(s, rt, ref*{ref : ref}) = (s[ELEM_store =.. [ei]], |s.ELEM_store|) + -- if (ei = {TYPE rt, ELEM ref*{ref : ref}}) ;; 9-module.watsup rec { @@ -5213,16 +5213,16 @@ def $allocelems(store : store, reftype*, ref**) : (store, elemaddr*) ;; 9-module.watsup:61.1-61.40 def $allocelems{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:62.1-64.55 - def $allocelems{s : store, rt : reftype, rt'* : reftype*, ref* : ref*, ref'** : ref**, s_2 : store, ea : elemaddr, ea'* : elemaddr*, s_1 : store}(s, [rt] :: rt'*{rt'}, [ref*{ref}] :: ref'*{ref'}*{ref'}) = (s_2, [ea] :: ea'*{ea'}) - -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref})) - -- if ((s_2, ea'*{ea'}) = $allocelems(s_2, rt'*{rt'}, ref'*{ref'}*{ref'})) + def $allocelems{s : store, rt : reftype, rt'* : reftype*, ref* : ref*, ref'** : ref**, s_2 : store, ea : elemaddr, ea'* : elemaddr*, s_1 : store}(s, [rt] :: rt'*{rt' : reftype}, [ref*{ref : ref}] :: ref'*{ref' : ref}*{ref' : ref}) = (s_2, [ea] :: ea'*{ea' : elemaddr}) + -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref : ref})) + -- if ((s_2, ea'*{ea' : elemaddr}) = $allocelems(s_2, rt'*{rt' : reftype}, ref'*{ref' : ref}*{ref' : ref})) } ;; 9-module.watsup def $allocdata(store : store, byte*) : (store, dataaddr) ;; 9-module.watsup - def $allocdata{s : store, byte* : byte*, di : datainst}(s, byte*{byte}) = (s[DATA_store =.. [di]], |s.DATA_store|) - -- if (di = {DATA byte*{byte}}) + def $allocdata{s : store, byte* : byte*, di : datainst}(s, byte*{byte : byte}) = (s[DATA_store =.. [di]], |s.DATA_store|) + -- if (di = {DATA byte*{byte : byte}}) ;; 9-module.watsup rec { @@ -5232,92 +5232,92 @@ def $allocdatas(store : store, byte**) : (store, dataaddr*) ;; 9-module.watsup:71.1-71.35 def $allocdatas{s : store}(s, []) = (s, []) ;; 9-module.watsup:72.1-74.50 - def $allocdatas{s : store, byte* : byte*, byte'** : byte**, s_2 : store, da : dataaddr, da'* : dataaddr*, s_1 : store}(s, [byte*{byte}] :: byte'*{byte'}*{byte'}) = (s_2, [da] :: da'*{da'}) - -- if ((s_1, da) = $allocdata(s, byte*{byte})) - -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) + def $allocdatas{s : store, byte* : byte*, byte'** : byte**, s_2 : store, da : dataaddr, da'* : dataaddr*, s_1 : store}(s, [byte*{byte : byte}] :: byte'*{byte' : byte}*{byte' : byte}) = (s_2, [da] :: da'*{da' : dataaddr}) + -- if ((s_1, da) = $allocdata(s, byte*{byte : byte})) + -- if ((s_2, da'*{da' : dataaddr}) = $allocdatas(s_1, byte'*{byte' : byte}*{byte' : byte})) } ;; 9-module.watsup def $instexport(funcaddr*, globaladdr*, tableaddr*, memaddr*, export : export) : exportinst ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa : funcaddr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga : globaladdr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta : tableaddr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma : memaddr}[x.`%`.0])} ;; 9-module.watsup def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) : (store, moduleinst) ;; 9-module.watsup - def $allocmodule{s : store, module : module, externval* : externval*, val_g* : val*, ref_t* : ref*, ref_e** : ref**, s_6 : store, mm : moduleinst, type* : type*, import* : import*, func^n_f : func^n_f, n_f : n, globaltype^n_g : globaltype^n_g, expr_g^n_g : expr^n_g, n_g : n, tabletype^n_t : tabletype^n_t, expr_t^n_t : expr^n_t, n_t : n, memtype^n_m : memtype^n_m, n_m : n, reftype^n_e : reftype^n_e, expr_e*^n_e : expr*^n_e, elemmode^n_e : elemmode^n_e, n_e : n, byte*^n_d : byte*^n_d, datamode^n_d : datamode^n_d, n_d : n, start? : start?, export* : export*, fa_ex* : funcaddr*, ga_ex* : globaladdr*, ta_ex* : tableaddr*, ma_ex* : memaddr*, fa* : funcaddr*, i_f^n_f : nat^n_f, ga* : globaladdr*, i_g^n_g : nat^n_g, ta* : tableaddr*, i_t^n_t : nat^n_t, ma* : memaddr*, i_m^n_m : nat^n_m, ea* : elemaddr*, i_e^n_e : nat^n_e, da* : dataaddr*, i_d^n_d : nat^n_d, xi* : exportinst*, dt* : deftype*, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store}(s, module, externval*{externval}, val_g*{val_g}, ref_t*{ref_t}, ref_e*{ref_e}*{ref_e}) = (s_6, mm) - -- if (module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type}, import*{import}, func^n_f{func}, GLOBAL(globaltype, expr_g)^n_g{expr_g globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t tabletype}, MEMORY(memtype)^n_m{memtype}, `ELEM%%*%`(reftype, expr_e*{expr_e}, elemmode)^n_e{elemmode expr_e reftype}, `DATA%*%`(byte*{byte}, datamode)^n_d{byte datamode}, start?{start}, export*{export})) - -- if (fa_ex*{fa_ex} = $funcsxv(externval*{externval})) - -- if (ga_ex*{ga_ex} = $globalsxv(externval*{externval})) - -- if (ta_ex*{ta_ex} = $tablesxv(externval*{externval})) - -- if (ma_ex*{ma_ex} = $memsxv(externval*{externval})) - -- if (fa*{fa} = (|s.FUNC_store| + i_f)^(i_f*%;%*`(z, expr_G, z, [val_G]))*{expr_G val_G} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T ref_T} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E ref_E}*{expr_E ref_E} - -- if ((s', mm) = $allocmodule(s, module, externval*{externval}, val_G*{val_G}, ref_T*{ref_T}, ref_E*{ref_E}*{ref_E})) + -- (Eval_expr: `%;%~>*%;%*`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} + -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} + -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} + -- if ((s', mm) = $allocmodule(s, module, externval*{externval : externval}, val_G*{val_G : val}, ref_T*{ref_T : ref}, ref_E*{ref_E : ref}*{ref_E : ref})) -- if (f = {LOCAL [], MODULE mm}) - -- if (instr_E*{instr_E} = $concat_(syntax instr, $runelem(elem*{elem}[i], `%`(i))^(i%`(t_1^n{t_1}, t_2*{t_2}))) + -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = `FUNC%%*%`(x, local*{local : local}, expr)) + -- Expand: `%~~%`(s.FUNC_store[fa].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; A-binary.watsup rec { @@ -5337,7 +5337,7 @@ def $utf8(name : name) : byte* def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([`%`(ch)]) = [b_1 b_2 b_3 b_4] -- if (((65536 <= ch) /\ (ch < 69632)) /\ (ch = (((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128)))) ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(`%`(ch)*{ch}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch}) + def $utf8{ch* : nat*}(`%`(ch)*{ch : nat}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch : nat}) } ;; A-binary.watsup @@ -5357,14 +5357,14 @@ syntax B = nat ;; C-conventions.watsup syntax sym = - | _FIRST(A_1 : A) + | _FIRST{A_1 : A}(A_1 : A) | _DOTS - | _LAST(A_n : A) + | _LAST{A_n : A}(A_n : A) ;; C-conventions.watsup syntax symsplit = - | _FIRST(A_1 : A) - | _LAST(A_2 : A) + | _FIRST{A_1 : A}(A_1 : A) + | _LAST{A_2 : A}(A_2 : A) ;; C-conventions.watsup syntax recorddots = `...` @@ -5372,21 +5372,21 @@ syntax recorddots = `...` ;; C-conventions.watsup syntax record = { - FIELD_1 A, - FIELD_2 A, - DOTS recorddots + FIELD_1{A_1 : A} A, + FIELD_2{A_2 : A} A, + DOTS{recorddots : recorddots} recorddots } ;; C-conventions.watsup syntax recordstar = { - FIELD_1 A*, - FIELD_2 A*, - DOTS recorddots + FIELD_1{A_1* : A*} A*, + FIELD_2{A_2* : A*} A*, + DOTS{recorddots : recorddots} recorddots } ;; C-conventions.watsup -syntax recordeq = `%++%=%`(recordstar : recordstar, recordstar : recordstar, recordstar : recordstar) +syntax recordeq = `%++%=%`{recordstar : recordstar}(recordstar : recordstar, recordstar, recordstar) ;; C-conventions.watsup syntax pth = diff --git a/spectec/test-middlend/TEST.md b/spectec/test-middlend/TEST.md index fc5522bdcf..32956b4845 100644 --- a/spectec/test-middlend/TEST.md +++ b/spectec/test-middlend/TEST.md @@ -43,7 +43,7 @@ def $sum(nat*) : nat ;; 0-aux.watsup:33.1-33.18 def $sum([]) = 0 ;; 0-aux.watsup:34.1-34.35 - def $sum{n : n, n'* : n*}([n] :: n'*{n'}) = (n + $sum(n'*{n'})) + def $sum{n : n, n'* : n*}([n] :: n'*{n' : nat}) = (n + $sum(n'*{n' : nat})) } ;; 0-aux.watsup @@ -54,7 +54,7 @@ def $concat_(syntax X, X**) : X* ;; 0-aux.watsup:40.1-40.34 def $concat_{syntax X}(syntax X, []) = [] ;; 0-aux.watsup:41.1-41.61 - def $concat_{syntax X, w* : X*, w'** : X**}(syntax X, [w*{w}] :: w'*{w'}*{w'}) = w*{w} :: $concat_(syntax X, w'*{w'}*{w'}) + def $concat_{syntax X, w* : X*, w'** : X**}(syntax X, [w*{w : X}] :: w'*{w' : X}*{w' : X}) = w*{w : X} :: $concat_(syntax X, w'*{w' : X}*{w' : X}) } ;; 1-syntax.watsup @@ -143,8 +143,8 @@ syntax fNmag{N : N}(N) = ;; 1-syntax.watsup syntax fN{N : N}(N) = - | POS(fNmag : fNmag(N)) - | NEG(fNmag : fNmag(N)) + | POS{fNmag : fNmag(N)}(fNmag : fNmag(N)) + | NEG{fNmag : fNmag(N)}(fNmag : fNmag(N)) ;; 1-syntax.watsup syntax f32 = fN(32) @@ -247,7 +247,7 @@ syntax valtype = | F32 | F64 | V128 - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | BOT ;; 1-syntax.watsup:154.1-155.16 @@ -261,15 +261,15 @@ syntax storagetype = | F32 | F64 | V128 - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | I8 | I16 ;; 1-syntax.watsup:175.1-176.18 -syntax fieldtype = `%%`(mut : mut, storagetype : storagetype) +syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) ;; 1-syntax.watsup:178.1-178.70 -syntax functype = `%->%`(resulttype : resulttype, resulttype : resulttype) +syntax functype = `%->%`{resulttype : resulttype}(resulttype : resulttype, resulttype) ;; 1-syntax.watsup:179.1-179.64 syntax structtype = list(syntax fieldtype) @@ -279,22 +279,22 @@ syntax arraytype = fieldtype ;; 1-syntax.watsup:182.1-185.18 syntax comptype = - | STRUCT(structtype : structtype) - | ARRAY(arraytype : arraytype) - | FUNC(functype : functype) + | STRUCT{structtype : structtype}(structtype : structtype) + | ARRAY{arraytype : arraytype}(arraytype : arraytype) + | FUNC{functype : functype}(functype : functype) ;; 1-syntax.watsup:189.1-190.60 syntax subtype = - | SUB(fin : fin, typeidx*, comptype : comptype) - | SUBD(fin : fin, heaptype*, comptype : comptype) + | SUB{fin : fin, typeidx* : typeidx*, comptype : comptype}(fin : fin, typeidx*{typeidx : typeidx} : typeidx*, comptype : comptype) + | SUBD{fin : fin, heaptype* : heaptype*, comptype : comptype}(fin : fin, heaptype*{heaptype : heaptype} : heaptype*, comptype : comptype) ;; 1-syntax.watsup:192.1-193.22 syntax rectype = - | REC(list : list(syntax subtype)) + | REC{list : list(syntax subtype)}(list : list(syntax subtype)) ;; 1-syntax.watsup:198.1-199.26 syntax heaptype = - | _IDX(typeidx : typeidx) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY | EQ | I31 @@ -306,13 +306,13 @@ syntax heaptype = | EXTERN | NOEXTERN | BOT - | DEF(rectype : rectype, nat : nat) - | REC(n : n) + | DEF{rectype : rectype}(rectype : rectype, nat) + | REC{n : n}(n : n) } ;; 1-syntax.watsup syntax reftype = - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) ;; 1-syntax.watsup syntax inn = @@ -365,19 +365,19 @@ syntax imm = ;; 1-syntax.watsup syntax deftype = - | DEF(rectype : rectype, nat : nat) + | DEF{rectype : rectype}(rectype : rectype, nat) ;; 1-syntax.watsup -syntax limits = `[%..%]`(u32 : u32, u32 : u32) +syntax limits = `[%..%]`{u32 : u32}(u32 : u32, u32) ;; 1-syntax.watsup -syntax globaltype = `%%`(mut : mut, valtype : valtype) +syntax globaltype = `%%`{mut : mut, valtype : valtype}(mut : mut, valtype : valtype) ;; 1-syntax.watsup -syntax tabletype = `%%`(limits : limits, reftype : reftype) +syntax tabletype = `%%`{limits : limits, reftype : reftype}(limits : limits, reftype : reftype) ;; 1-syntax.watsup -syntax memtype = `%I8`(limits : limits) +syntax memtype = `%I8`{limits : limits}(limits : limits) ;; 1-syntax.watsup syntax elemtype = reftype @@ -387,10 +387,10 @@ syntax datatype = OK ;; 1-syntax.watsup syntax externtype = - | FUNC(deftype : deftype) - | GLOBAL(globaltype : globaltype) - | TABLE(tabletype : tabletype) - | MEM(memtype : memtype) + | FUNC{deftype : deftype}(deftype : deftype) + | GLOBAL{globaltype : globaltype}(globaltype : globaltype) + | TABLE{tabletype : tabletype}(tabletype : tabletype) + | MEM{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup def $size(numtype : numtype) : nat @@ -436,7 +436,7 @@ syntax dim = `%`{i : nat}(i : nat) -- if (((((i = 1) \/ (i = 2)) \/ (i = 4)) \/ (i = 8)) \/ (i = 16)) ;; 1-syntax.watsup -syntax shape = `%X%`(lanetype : lanetype, dim : dim) +syntax shape = `%X%`{lanetype : lanetype, dim : dim}(lanetype : lanetype, dim : dim) ;; 1-syntax.watsup def $lanetype(shape : shape) : lanetype @@ -504,7 +504,7 @@ syntax unop_(numtype : numtype) | CLZ | CTZ | POPCNT - | EXTEND(n : n) + | EXTEND{n : n}(n : n) ;; 1-syntax.watsup @@ -525,13 +525,13 @@ syntax binop_(numtype : numtype) | ADD | SUB | MUL - | DIV(sx : sx) - | REM(sx : sx) + | DIV{sx : sx}(sx : sx) + | REM{sx : sx}(sx : sx) | AND | OR | XOR | SHL - | SHR(sx : sx) + | SHR{sx : sx}(sx : sx) | ROTL | ROTR @@ -557,10 +557,10 @@ syntax relop_(numtype : numtype) syntax relop_{inn : inn}((inn : inn <: numtype)) = | EQ | NE - | LT(sx : sx) - | GT(sx : sx) - | LE(sx : sx) - | GE(sx : sx) + | LT{sx : sx}(sx : sx) + | GT{sx : sx}(sx : sx) + | LE{sx : sx}(sx : sx) + | GE{sx : sx}(sx : sx) ;; 1-syntax.watsup @@ -580,13 +580,13 @@ syntax cvtop = | REINTERPRET ;; 1-syntax.watsup -syntax ishape = `%X%`(imm : imm, dim : dim) +syntax ishape = `%X%`{imm : imm, dim : dim}(imm : imm, dim : dim) ;; 1-syntax.watsup -syntax fshape = `%X%`(fnn : fnn, dim : dim) +syntax fshape = `%X%`{fnn : fnn, dim : dim}(fnn : fnn, dim : dim) ;; 1-syntax.watsup -syntax pshape = `%X%`(pnn : pnn, dim : dim) +syntax pshape = `%X%`{pnn : pnn, dim : dim}(pnn : pnn, dim : dim) ;; 1-syntax.watsup def $dim(shape : shape) : dim @@ -644,9 +644,9 @@ syntax vbinop_(shape : shape) syntax vbinop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ADD | SUB - | ADD_SAT(sx : sx) + | ADD_SAT{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 16) - | SUB_SAT(sx : sx) + | SUB_SAT{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 16) | MUL -- if ($lsize((imm : imm <: lanetype)) >= 16) @@ -654,9 +654,9 @@ syntax vbinop_(shape : shape) -- if ($lsize((imm : imm <: lanetype)) <= 16) | Q15MULR_SAT_S{imm : imm} -- if ($lsize((imm : imm <: lanetype)) = 16) - | MIN(sx : sx) + | MIN{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 32) - | MAX(sx : sx) + | MAX{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 32) @@ -682,10 +682,10 @@ syntax vrelop_(shape : shape) syntax vrelop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | EQ | NE - | LT(sx : sx) - | GT(sx : sx) - | LE(sx : sx) - | GE(sx : sx) + | LT{sx : sx}(sx : sx) + | GT{sx : sx}(sx : sx) + | LE{sx : sx}(sx : sx) + | GE{sx : sx}(sx : sx) ;; 1-syntax.watsup @@ -709,7 +709,7 @@ syntax vcvtop = ;; 1-syntax.watsup syntax vshiftop_{imm : imm, N : N}(`%X%`(imm, `%`(N))) = | SHL - | SHR(sx : sx) + | SHR{sx : sx}(sx : sx) ;; 1-syntax.watsup syntax vextunop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = @@ -723,27 +723,27 @@ syntax half = ;; 1-syntax.watsup syntax vextbinop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = - | EXTMUL(half : half) + | EXTMUL{half : half}(half : half) | DOT{imm_1 : imm} -- if ($lsize((imm_1 : imm <: lanetype)) = 32) ;; 1-syntax.watsup syntax memop = { - ALIGN u32, - OFFSET u32 + ALIGN{u32 : u32} u32, + OFFSET{u32 : u32} u32 } ;; 1-syntax.watsup syntax vloadop = - | SHAPE(nat : nat, nat : nat, sx : sx) - | SPLAT(nat : nat) - | ZERO(nat : nat) + | SHAPE{sx : sx}(nat, nat, sx : sx) + | SPLAT(nat) + | ZERO(nat) ;; 1-syntax.watsup syntax blocktype = - | _RESULT(valtype?) - | _IDX(funcidx : funcidx) + | _RESULT{valtype? : valtype?}(valtype?{valtype : valtype} : valtype?) + | _IDX{funcidx : funcidx}(funcidx : funcidx) ;; 1-syntax.watsup syntax zero = `ZERO%?`(()?) @@ -756,108 +756,108 @@ syntax instr = | UNREACHABLE | NOP | DROP - | SELECT(valtype*?) - | BLOCK(blocktype : blocktype, instr*) - | LOOP(blocktype : blocktype, instr*) - | IF(blocktype : blocktype, instr*, instr*) - | BR(labelidx : labelidx) - | BR_IF(labelidx : labelidx) - | BR_TABLE(labelidx*, labelidx : labelidx) - | BR_ON_NULL(labelidx : labelidx) - | BR_ON_NON_NULL(labelidx : labelidx) - | BR_ON_CAST(labelidx : labelidx, reftype : reftype, reftype : reftype) - | BR_ON_CAST_FAIL(labelidx : labelidx, reftype : reftype, reftype : reftype) - | CALL(funcidx : funcidx) - | CALL_REF(typeidx?) - | CALL_INDIRECT(tableidx : tableidx, typeidx : typeidx) + | SELECT{valtype*? : valtype*?}(valtype*{valtype : valtype}?{valtype : valtype} : valtype*?) + | BLOCK{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*) + | LOOP{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*) + | IF{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*, instr*) + | BR{labelidx : labelidx}(labelidx : labelidx) + | BR_IF{labelidx : labelidx}(labelidx : labelidx) + | BR_TABLE{labelidx : labelidx}(labelidx*{} : labelidx*, labelidx) + | BR_ON_NULL{labelidx : labelidx}(labelidx : labelidx) + | BR_ON_NON_NULL{labelidx : labelidx}(labelidx : labelidx) + | BR_ON_CAST{labelidx : labelidx, reftype : reftype}(labelidx : labelidx, reftype : reftype, reftype) + | BR_ON_CAST_FAIL{labelidx : labelidx, reftype : reftype}(labelidx : labelidx, reftype : reftype, reftype) + | CALL{funcidx : funcidx}(funcidx : funcidx) + | CALL_REF{typeidx? : typeidx?}(typeidx?{typeidx : typeidx} : typeidx?) + | CALL_INDIRECT{tableidx : tableidx, typeidx : typeidx}(tableidx : tableidx, typeidx : typeidx) | RETURN - | RETURN_CALL(funcidx : funcidx) - | RETURN_CALL_REF(typeidx?) - | RETURN_CALL_INDIRECT(tableidx : tableidx, typeidx : typeidx) - | CONST(numtype : numtype, num_ : num_(numtype)) - | UNOP(numtype : numtype, unop_ : unop_(numtype)) - | BINOP(numtype : numtype, binop_ : binop_(numtype)) - | TESTOP(numtype : numtype, testop_ : testop_(numtype)) - | RELOP(numtype : numtype, relop_ : relop_(numtype)) - | CVTOP(numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx?) - | EXTEND(numtype : numtype, n : n) - | VCONST(vectype : vectype, vec_ : vec_(vectype)) - | VVUNOP(vectype : vectype, vvunop : vvunop) - | VVBINOP(vectype : vectype, vvbinop : vvbinop) - | VVTERNOP(vectype : vectype, vvternop : vvternop) - | VVTESTOP(vectype : vectype, vvtestop : vvtestop) + | RETURN_CALL{funcidx : funcidx}(funcidx : funcidx) + | RETURN_CALL_REF{typeidx? : typeidx?}(typeidx?{typeidx : typeidx} : typeidx?) + | RETURN_CALL_INDIRECT{tableidx : tableidx, typeidx : typeidx}(tableidx : tableidx, typeidx : typeidx) + | CONST{numtype : numtype, num_ : num_(numtype)}(numtype : numtype, num_ : num_(numtype)) + | UNOP{numtype : numtype, unop_ : unop_(numtype)}(numtype : numtype, unop_ : unop_(numtype)) + | BINOP{numtype : numtype, binop_ : binop_(numtype)}(numtype : numtype, binop_ : binop_(numtype)) + | TESTOP{numtype : numtype, testop_ : testop_(numtype)}(numtype : numtype, testop_ : testop_(numtype)) + | RELOP{numtype : numtype, relop_ : relop_(numtype)}(numtype : numtype, relop_ : relop_(numtype)) + | CVTOP{numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx? : sx?}(numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx?{sx : sx} : sx?) + | EXTEND{numtype : numtype, n : n}(numtype : numtype, n : n) + | VCONST{vectype : vectype, vec_ : vec_(vectype)}(vectype : vectype, vec_ : vec_(vectype)) + | VVUNOP{vectype : vectype, vvunop : vvunop}(vectype : vectype, vvunop : vvunop) + | VVBINOP{vectype : vectype, vvbinop : vvbinop}(vectype : vectype, vvbinop : vvbinop) + | VVTERNOP{vectype : vectype, vvternop : vvternop}(vectype : vectype, vvternop : vvternop) + | VVTESTOP{vectype : vectype, vvtestop : vvtestop}(vectype : vectype, vvtestop : vvtestop) | VSWIZZLE{ishape : ishape}(ishape : ishape) -- if (ishape = `%X%`(I8_imm, `%`(16))) - | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*) - -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) - | VSPLAT(shape : shape) - | VEXTRACT_LANE{shape : shape, numtype : numtype, sx? : sx?}(shape : shape, sx?, laneidx : laneidx) - -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx} = ?())) - | VREPLACE_LANE(shape : shape, laneidx : laneidx) - | VUNOP(shape : shape, vunop_ : vunop_(shape)) - | VBINOP(shape : shape, vbinop_ : vbinop_(shape)) - | VTESTOP(shape : shape, vtestop_ : vtestop_(shape)) - | VRELOP(shape : shape, vrelop_ : vrelop_(shape)) - | VSHIFTOP(ishape : ishape, vshiftop_ : vshiftop_(ishape)) - | VBITMASK(ishape : ishape) - | VCVTOP(shape : shape, vcvtop : vcvtop, half?, shape : shape, sx?, zero : zero) - | VNARROW(ishape : ishape, ishape : ishape, sx : sx) - | VEXTUNOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) + | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*{laneidx : laneidx} : laneidx*) + -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx : laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) + | VSPLAT{shape : shape}(shape : shape) + | VEXTRACT_LANE{shape : shape, sx? : sx?, laneidx : laneidx, numtype : numtype}(shape : shape, sx?{sx : sx} : sx?, laneidx : laneidx) + -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx : sx} = ?())) + | VREPLACE_LANE{shape : shape, laneidx : laneidx}(shape : shape, laneidx : laneidx) + | VUNOP{shape : shape, vunop_ : vunop_(shape)}(shape : shape, vunop_ : vunop_(shape)) + | VBINOP{shape : shape, vbinop_ : vbinop_(shape)}(shape : shape, vbinop_ : vbinop_(shape)) + | VTESTOP{shape : shape, vtestop_ : vtestop_(shape)}(shape : shape, vtestop_ : vtestop_(shape)) + | VRELOP{shape : shape, vrelop_ : vrelop_(shape)}(shape : shape, vrelop_ : vrelop_(shape)) + | VSHIFTOP{ishape : ishape, vshiftop_ : vshiftop_(ishape)}(ishape : ishape, vshiftop_ : vshiftop_(ishape)) + | VBITMASK{ishape : ishape}(ishape : ishape) + | VCVTOP{shape : shape, vcvtop : vcvtop, half? : half?, sx? : sx?, zero : zero}(shape : shape, vcvtop : vcvtop, half?{half : half} : half?, shape, sx?{sx : sx} : sx?, zero : zero) + | VNARROW{ishape : ishape, sx : sx}(ishape : ishape, ishape, sx : sx) + | VEXTUNOP{ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | VEXTBINOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) + | VEXTBINOP{ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | REF.NULL(heaptype : heaptype) + | REF.NULL{heaptype : heaptype}(heaptype : heaptype) | REF.I31 - | REF.FUNC(funcidx : funcidx) + | REF.FUNC{funcidx : funcidx}(funcidx : funcidx) | REF.IS_NULL | REF.AS_NON_NULL | REF.EQ - | REF.TEST(reftype : reftype) - | REF.CAST(reftype : reftype) - | I31.GET(sx : sx) - | STRUCT.NEW(typeidx : typeidx) - | STRUCT.NEW_DEFAULT(typeidx : typeidx) - | STRUCT.GET(sx?, typeidx : typeidx, u32 : u32) - | STRUCT.SET(typeidx : typeidx, u32 : u32) - | ARRAY.NEW(typeidx : typeidx) - | ARRAY.NEW_DEFAULT(typeidx : typeidx) - | ARRAY.NEW_FIXED(typeidx : typeidx, nat : nat) - | ARRAY.NEW_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.NEW_ELEM(typeidx : typeidx, elemidx : elemidx) - | ARRAY.GET(sx?, typeidx : typeidx) - | ARRAY.SET(typeidx : typeidx) + | REF.TEST{reftype : reftype}(reftype : reftype) + | REF.CAST{reftype : reftype}(reftype : reftype) + | I31.GET{sx : sx}(sx : sx) + | STRUCT.NEW{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.GET{sx? : sx?, typeidx : typeidx, u32 : u32}(sx?{sx : sx} : sx?, typeidx : typeidx, u32 : u32) + | STRUCT.SET{typeidx : typeidx, u32 : u32}(typeidx : typeidx, u32 : u32) + | ARRAY.NEW{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_FIXED{typeidx : typeidx}(typeidx : typeidx, nat) + | ARRAY.NEW_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.NEW_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) + | ARRAY.GET{sx? : sx?, typeidx : typeidx}(sx?{sx : sx} : sx?, typeidx : typeidx) + | ARRAY.SET{typeidx : typeidx}(typeidx : typeidx) | ARRAY.LEN - | ARRAY.FILL(typeidx : typeidx) - | ARRAY.COPY(typeidx : typeidx, typeidx : typeidx) - | ARRAY.INIT_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.INIT_ELEM(typeidx : typeidx, elemidx : elemidx) + | ARRAY.FILL{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.COPY{typeidx : typeidx}(typeidx : typeidx, typeidx) + | ARRAY.INIT_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.INIT_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) | EXTERN.CONVERT_ANY | ANY.CONVERT_EXTERN - | LOCAL.GET(localidx : localidx) - | LOCAL.SET(localidx : localidx) - | LOCAL.TEE(localidx : localidx) - | GLOBAL.GET(globalidx : globalidx) - | GLOBAL.SET(globalidx : globalidx) - | TABLE.GET(tableidx : tableidx) - | TABLE.SET(tableidx : tableidx) - | TABLE.SIZE(tableidx : tableidx) - | TABLE.GROW(tableidx : tableidx) - | TABLE.FILL(tableidx : tableidx) - | TABLE.COPY(tableidx : tableidx, tableidx : tableidx) - | TABLE.INIT(tableidx : tableidx, elemidx : elemidx) - | ELEM.DROP(elemidx : elemidx) - | MEMORY.SIZE(memidx : memidx) - | MEMORY.GROW(memidx : memidx) - | MEMORY.FILL(memidx : memidx) - | MEMORY.COPY(memidx : memidx, memidx : memidx) - | MEMORY.INIT(memidx : memidx, dataidx : dataidx) - | DATA.DROP(dataidx : dataidx) - | LOAD(numtype : numtype, (n, sx)?, memidx : memidx, memop : memop) - | STORE(numtype : numtype, n?, memidx : memidx, memop : memop) - | VLOAD(vloadop?, memidx : memidx, memop : memop) - | VLOAD_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | VSTORE(memidx : memidx, memop : memop) - | VSTORE_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | LOCAL.GET{localidx : localidx}(localidx : localidx) + | LOCAL.SET{localidx : localidx}(localidx : localidx) + | LOCAL.TEE{localidx : localidx}(localidx : localidx) + | GLOBAL.GET{globalidx : globalidx}(globalidx : globalidx) + | GLOBAL.SET{globalidx : globalidx}(globalidx : globalidx) + | TABLE.GET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SIZE{tableidx : tableidx}(tableidx : tableidx) + | TABLE.GROW{tableidx : tableidx}(tableidx : tableidx) + | TABLE.FILL{tableidx : tableidx}(tableidx : tableidx) + | TABLE.COPY{tableidx : tableidx}(tableidx : tableidx, tableidx) + | TABLE.INIT{tableidx : tableidx, elemidx : elemidx}(tableidx : tableidx, elemidx : elemidx) + | ELEM.DROP{elemidx : elemidx}(elemidx : elemidx) + | MEMORY.SIZE{memidx : memidx}(memidx : memidx) + | MEMORY.GROW{memidx : memidx}(memidx : memidx) + | MEMORY.FILL{memidx : memidx}(memidx : memidx) + | MEMORY.COPY{memidx : memidx}(memidx : memidx, memidx) + | MEMORY.INIT{memidx : memidx, dataidx : dataidx}(memidx : memidx, dataidx : dataidx) + | DATA.DROP{dataidx : dataidx}(dataidx : dataidx) + | LOAD{numtype : numtype, n? : n?, sx? : sx?, memidx : memidx, memop : memop}(numtype : numtype, (n, sx)?{n : n sx : sx} : (n, sx)?, memidx : memidx, memop : memop) + | STORE{numtype : numtype, n? : n?, memidx : memidx, memop : memop}(numtype : numtype, n?{n : n} : n?, memidx : memidx, memop : memop) + | VLOAD{vloadop? : vloadop?, memidx : memidx, memop : memop}(vloadop?{vloadop : vloadop} : vloadop?, memidx : memidx, memop : memop) + | VLOAD_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | VSTORE{memidx : memidx, memop : memop}(memidx : memidx, memop : memop) + | VSTORE_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) } ;; 1-syntax.watsup @@ -865,57 +865,57 @@ syntax expr = instr* ;; 1-syntax.watsup syntax elemmode = - | ACTIVE(tableidx : tableidx, expr : expr) + | ACTIVE{tableidx : tableidx, expr : expr}(tableidx : tableidx, expr : expr) | PASSIVE | DECLARE ;; 1-syntax.watsup syntax datamode = - | ACTIVE(memidx : memidx, expr : expr) + | ACTIVE{memidx : memidx, expr : expr}(memidx : memidx, expr : expr) | PASSIVE ;; 1-syntax.watsup -syntax type = TYPE(rectype : rectype) +syntax type = TYPE{rectype : rectype}(rectype : rectype) ;; 1-syntax.watsup -syntax local = LOCAL(valtype : valtype) +syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`(typeidx : typeidx, local*, expr : expr) +syntax func = `FUNC%%*%`{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) ;; 1-syntax.watsup -syntax global = GLOBAL(globaltype : globaltype, expr : expr) +syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) ;; 1-syntax.watsup -syntax table = TABLE(tabletype : tabletype, expr : expr) +syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, expr : expr) ;; 1-syntax.watsup -syntax mem = MEMORY(memtype : memtype) +syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`(reftype : reftype, expr*, elemmode : elemmode) +syntax elem = `ELEM%%*%`{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) ;; 1-syntax.watsup -syntax data = `DATA%*%`(byte*, datamode : datamode) +syntax data = `DATA%*%`{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup -syntax start = START(funcidx : funcidx) +syntax start = START{funcidx : funcidx}(funcidx : funcidx) ;; 1-syntax.watsup syntax externidx = - | FUNC(funcidx : funcidx) - | GLOBAL(globalidx : globalidx) - | TABLE(tableidx : tableidx) - | MEM(memidx : memidx) + | FUNC{funcidx : funcidx}(funcidx : funcidx) + | GLOBAL{globalidx : globalidx}(globalidx : globalidx) + | TABLE{tableidx : tableidx}(tableidx : tableidx) + | MEM{memidx : memidx}(memidx : memidx) ;; 1-syntax.watsup -syntax export = EXPORT(name : name, externidx : externidx) +syntax export = EXPORT{name : name, externidx : externidx}(name : name, externidx : externidx) ;; 1-syntax.watsup -syntax import = IMPORT(name : name, name : name, externtype : externtype) +syntax import = IMPORT{name : name, externtype : externtype}(name : name, name, externtype : externtype) ;; 1-syntax.watsup -syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*, import*, func*, global*, table*, mem*, elem*, data*, start*, export*) +syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) ;; 2-syntax-aux.watsup rec { @@ -925,10 +925,10 @@ def $setminus1(idx : idx, idx*) : idx* ;; 2-syntax-aux.watsup:13.1-13.27 def $setminus1{x : idx}(x, []) = [x] ;; 2-syntax-aux.watsup:14.1-14.61 - def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y}) = [] + def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y : idx}) = [] -- if (x = y_1) ;; 2-syntax-aux.watsup:15.1-15.60 - def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y}) = $setminus1(x, y*{y}) + def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y : idx}) = $setminus1(x, y*{y : idx}) -- otherwise } @@ -938,9 +938,9 @@ rec { ;; 2-syntax-aux.watsup:7.1-7.49 def $setminus(idx*, idx*) : idx* ;; 2-syntax-aux.watsup:10.1-10.29 - def $setminus{y* : idx*}([], y*{y}) = [] + def $setminus{y* : idx*}([], y*{y : idx}) = [] ;; 2-syntax-aux.watsup:11.1-11.66 - def $setminus{x_1 : idx, x* : idx*, y* : idx*}([x_1] :: x*{x}, y*{y}) = $setminus1(x_1, y*{y}) :: $setminus(x*{x}, y*{y}) + def $setminus{x_1 : idx, x* : idx*, y* : idx*}([x_1] :: x*{x : idx}, y*{y : idx}) = $setminus1(x_1, y*{y : idx}) :: $setminus(x*{x : idx}, y*{y : idx}) } ;; 2-syntax-aux.watsup @@ -960,18 +960,18 @@ def $free_dataidx_instrs(instr*) : dataidx* ;; 2-syntax-aux.watsup:26.1-26.36 def $free_dataidx_instrs([]) = [] ;; 2-syntax-aux.watsup:27.1-27.99 - def $free_dataidx_instrs{instr : instr, instr'* : instr*}([instr] :: instr'*{instr'}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr'}) + def $free_dataidx_instrs{instr : instr, instr'* : instr*}([instr] :: instr'*{instr' : instr}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr' : instr}) } ;; 2-syntax-aux.watsup def $free_dataidx_expr(expr : expr) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_expr{in* : instr*}(in*{in}) = $free_dataidx_instrs(in*{in}) + def $free_dataidx_expr{in* : instr*}(in*{in : instr}) = $free_dataidx_instrs(in*{in : instr}) ;; 2-syntax-aux.watsup def $free_dataidx_func(func : func) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc}, e)) = $free_dataidx_expr(e) + def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) ;; 2-syntax-aux.watsup rec { @@ -981,7 +981,7 @@ def $free_dataidx_funcs(func*) : dataidx* ;; 2-syntax-aux.watsup:36.1-36.35 def $free_dataidx_funcs([]) = [] ;; 2-syntax-aux.watsup:37.1-37.92 - def $free_dataidx_funcs{func : func, func'* : func*}([func] :: func'*{func'}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func'}) + def $free_dataidx_funcs{func : func, func'* : func*}([func] :: func'*{func' : func}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func' : func}) } ;; 2-syntax-aux.watsup @@ -1026,8 +1026,8 @@ def $diffrt(reftype : reftype, reftype : reftype) : reftype ;; 2-syntax-aux.watsup syntax typevar = - | _IDX(typeidx : typeidx) - | REC(nat : nat) + | _IDX{typeidx : typeidx}(typeidx : typeidx) + | REC(nat) ;; 2-syntax-aux.watsup def $idx(typeidx : typeidx) : typevar @@ -1042,27 +1042,27 @@ def $subst_typevar(typevar : typevar, typevar*, heaptype*) : heaptype ;; 2-syntax-aux.watsup:150.1-150.38 def $subst_typevar{xx : typevar}(xx, [], []) = (xx : typevar <: heaptype) ;; 2-syntax-aux.watsup:151.1-151.95 - def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 + def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = ht_1 -- if (xx = xx_1) ;; 2-syntax-aux.watsup:152.1-152.92 - def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = $subst_typevar(xx, xx'*{xx'}, ht'*{ht'}) + def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = $subst_typevar(xx, xx'*{xx' : typevar}, ht'*{ht' : heaptype}) -- otherwise } ;; 2-syntax-aux.watsup def $subst_numtype(numtype : numtype, typevar*, heaptype*) : numtype ;; 2-syntax-aux.watsup - def $subst_numtype{nt : numtype, xx* : typevar*, ht* : heaptype*}(nt, xx*{xx}, ht*{ht}) = nt + def $subst_numtype{nt : numtype, xx* : typevar*, ht* : heaptype*}(nt, xx*{xx : typevar}, ht*{ht : heaptype}) = nt ;; 2-syntax-aux.watsup def $subst_vectype(vectype : vectype, typevar*, heaptype*) : vectype ;; 2-syntax-aux.watsup - def $subst_vectype{vt : vectype, xx* : typevar*, ht* : heaptype*}(vt, xx*{xx}, ht*{ht}) = vt + def $subst_vectype{vt : vectype, xx* : typevar*, ht* : heaptype*}(vt, xx*{xx : typevar}, ht*{ht : heaptype}) = vt ;; 2-syntax-aux.watsup def $subst_packtype(packtype : packtype, typevar*, heaptype*) : packtype ;; 2-syntax-aux.watsup - def $subst_packtype{pt : packtype, xx* : typevar*, ht* : heaptype*}(pt, xx*{xx}, ht*{ht}) = pt + def $subst_packtype{pt : packtype, xx* : typevar*, ht* : heaptype*}(pt, xx*{xx : typevar}, ht*{ht : heaptype}) = pt ;; 2-syntax-aux.watsup rec { @@ -1070,108 +1070,108 @@ rec { ;; 2-syntax-aux.watsup:129.1-129.92 def $subst_heaptype(heaptype : heaptype, typevar*, heaptype*) : heaptype ;; 2-syntax-aux.watsup:157.1-157.67 - def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) + def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx : typevar}, ht*{ht : heaptype}) = $subst_typevar(xx', xx*{xx : typevar}, ht*{ht : heaptype}) ;; 2-syntax-aux.watsup:158.1-158.65 - def $subst_heaptype{dt : deftype, xx* : typevar*, ht* : heaptype*}((dt : deftype <: heaptype), xx*{xx}, ht*{ht}) = ($subst_deftype(dt, xx*{xx}, ht*{ht}) : deftype <: heaptype) + def $subst_heaptype{dt : deftype, xx* : typevar*, ht* : heaptype*}((dt : deftype <: heaptype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_deftype(dt, xx*{xx : typevar}, ht*{ht : heaptype}) : deftype <: heaptype) ;; 2-syntax-aux.watsup:159.1-159.55 - def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx}, ht*{ht}) = ht' + def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx : typevar}, ht*{ht : heaptype}) = ht' -- otherwise ;; 2-syntax-aux.watsup:130.1-130.92 def $subst_reftype(reftype : reftype, typevar*, heaptype*) : reftype ;; 2-syntax-aux.watsup:161.1-161.85 - def $subst_reftype{nul : nul, ht' : heaptype, xx* : typevar*, ht* : heaptype*}(REF_reftype(nul, ht'), xx*{xx}, ht*{ht}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx}, ht*{ht})) + def $subst_reftype{nul : nul, ht' : heaptype, xx* : typevar*, ht* : heaptype*}(REF_reftype(nul, ht'), xx*{xx : typevar}, ht*{ht : heaptype}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:131.1-131.92 def $subst_valtype(valtype : valtype, typevar*, heaptype*) : valtype ;; 2-syntax-aux.watsup:163.1-163.64 - def $subst_valtype{nt : numtype, xx* : typevar*, ht* : heaptype*}((nt : numtype <: valtype), xx*{xx}, ht*{ht}) = ($subst_numtype(nt, xx*{xx}, ht*{ht}) : numtype <: valtype) + def $subst_valtype{nt : numtype, xx* : typevar*, ht* : heaptype*}((nt : numtype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_numtype(nt, xx*{xx : typevar}, ht*{ht : heaptype}) : numtype <: valtype) ;; 2-syntax-aux.watsup:164.1-164.64 - def $subst_valtype{vt : vectype, xx* : typevar*, ht* : heaptype*}((vt : vectype <: valtype), xx*{xx}, ht*{ht}) = ($subst_vectype(vt, xx*{xx}, ht*{ht}) : vectype <: valtype) + def $subst_valtype{vt : vectype, xx* : typevar*, ht* : heaptype*}((vt : vectype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_vectype(vt, xx*{xx : typevar}, ht*{ht : heaptype}) : vectype <: valtype) ;; 2-syntax-aux.watsup:165.1-165.64 - def $subst_valtype{rt : reftype, xx* : typevar*, ht* : heaptype*}((rt : reftype <: valtype), xx*{xx}, ht*{ht}) = ($subst_reftype(rt, xx*{xx}, ht*{ht}) : reftype <: valtype) + def $subst_valtype{rt : reftype, xx* : typevar*, ht* : heaptype*}((rt : reftype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_reftype(rt, xx*{xx : typevar}, ht*{ht : heaptype}) : reftype <: valtype) ;; 2-syntax-aux.watsup:166.1-166.40 - def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx : typevar}, ht*{ht : heaptype}) = BOT_valtype ;; 2-syntax-aux.watsup:134.1-134.92 def $subst_storagetype(storagetype : storagetype, typevar*, heaptype*) : storagetype ;; 2-syntax-aux.watsup:170.1-170.66 - def $subst_storagetype{t : valtype, xx* : typevar*, ht* : heaptype*}((t : valtype <: storagetype), xx*{xx}, ht*{ht}) = ($subst_valtype(t, xx*{xx}, ht*{ht}) : valtype <: storagetype) + def $subst_storagetype{t : valtype, xx* : typevar*, ht* : heaptype*}((t : valtype <: storagetype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_valtype(t, xx*{xx : typevar}, ht*{ht : heaptype}) : valtype <: storagetype) ;; 2-syntax-aux.watsup:171.1-171.69 - def $subst_storagetype{pt : packtype, xx* : typevar*, ht* : heaptype*}((pt : packtype <: storagetype), xx*{xx}, ht*{ht}) = ($subst_packtype(pt, xx*{xx}, ht*{ht}) : packtype <: storagetype) + def $subst_storagetype{pt : packtype, xx* : typevar*, ht* : heaptype*}((pt : packtype <: storagetype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_packtype(pt, xx*{xx : typevar}, ht*{ht : heaptype}) : packtype <: storagetype) ;; 2-syntax-aux.watsup:135.1-135.92 def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype ;; 2-syntax-aux.watsup:173.1-173.80 - def $subst_fieldtype{mut : mut, zt : storagetype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, zt), xx*{xx}, ht*{ht}) = `%%`(mut, $subst_storagetype(zt, xx*{xx}, ht*{ht})) + def $subst_fieldtype{mut : mut, zt : storagetype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, zt), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(mut, $subst_storagetype(zt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype ;; 2-syntax-aux.watsup:175.1-175.85 - def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) + def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt : fieldtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype}) ;; 2-syntax-aux.watsup:176.1-176.81 - def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) + def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx : typevar}, ht*{ht : heaptype}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:177.1-177.78 - def $subst_comptype{ft : functype, xx* : typevar*, ht* : heaptype*}(FUNC_comptype(ft), xx*{xx}, ht*{ht}) = FUNC_comptype($subst_functype(ft, xx*{xx}, ht*{ht})) + def $subst_comptype{ft : functype, xx* : typevar*, ht* : heaptype*}(FUNC_comptype(ft), xx*{xx : typevar}, ht*{ht : heaptype}) = FUNC_comptype($subst_functype(ft, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:138.1-138.92 def $subst_subtype(subtype : subtype, typevar*, heaptype*) : subtype ;; 2-syntax-aux.watsup:179.1-180.76 - def $subst_subtype{fin : fin, y* : idx*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + def $subst_subtype{fin : fin, y* : idx*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUB_subtype(fin, y*{y : typeidx}, ct), xx*{xx : typevar}, ht*{ht : heaptype}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx : typevar}, ht*{ht : heaptype})*{y : typeidx}, $subst_comptype(ct, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:181.1-182.73 - def $subst_subtype{fin : fin, ht'* : heaptype*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUBD_subtype(fin, ht'*{ht'}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx}, ht*{ht})*{ht'}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + def $subst_subtype{fin : fin, ht'* : heaptype*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUBD_subtype(fin, ht'*{ht' : heaptype}, ct), xx*{xx : typevar}, ht*{ht : heaptype}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})*{ht' : heaptype}, $subst_comptype(ct, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype ;; 2-syntax-aux.watsup:184.1-184.76 - def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st}), xx*{xx}, ht*{ht}) = REC_rectype($subst_subtype(st, xx*{xx}, ht*{ht})*{st}) + def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st : subtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype}) ;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype ;; 2-syntax-aux.watsup:186.1-186.78 - def $subst_deftype{qt : rectype, i : nat, xx* : typevar*, ht* : heaptype*}(DEF_deftype(qt, i), xx*{xx}, ht*{ht}) = DEF_deftype($subst_rectype(qt, xx*{xx}, ht*{ht}), i) + def $subst_deftype{qt : rectype, i : nat, xx* : typevar*, ht* : heaptype*}(DEF_deftype(qt, i), xx*{xx : typevar}, ht*{ht : heaptype}) = DEF_deftype($subst_rectype(qt, xx*{xx : typevar}, ht*{ht : heaptype}), i) ;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype ;; 2-syntax-aux.watsup:189.1-189.113 - def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1}, t_2*{t_2}), xx*{xx}, ht*{ht}) = `%->%`($subst_valtype(t_1, xx*{xx}, ht*{ht})*{t_1}, $subst_valtype(t_2, xx*{xx}, ht*{ht})*{t_2}) + def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}, $subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype}) } ;; 2-syntax-aux.watsup def $subst_globaltype(globaltype : globaltype, typevar*, heaptype*) : globaltype ;; 2-syntax-aux.watsup - def $subst_globaltype{mut : mut, t : valtype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, t), xx*{xx}, ht*{ht}) = `%%`(mut, $subst_valtype(t, xx*{xx}, ht*{ht})) + def $subst_globaltype{mut : mut, t : valtype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, t), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(mut, $subst_valtype(t, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_tabletype(tabletype : tabletype, typevar*, heaptype*) : tabletype ;; 2-syntax-aux.watsup - def $subst_tabletype{lim : limits, rt : reftype, xx* : typevar*, ht* : heaptype*}(`%%`(lim, rt), xx*{xx}, ht*{ht}) = `%%`(lim, $subst_reftype(rt, xx*{xx}, ht*{ht})) + def $subst_tabletype{lim : limits, rt : reftype, xx* : typevar*, ht* : heaptype*}(`%%`(lim, rt), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(lim, $subst_reftype(rt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_memtype(memtype : memtype, typevar*, heaptype*) : memtype ;; 2-syntax-aux.watsup - def $subst_memtype{lim : limits, xx* : typevar*, ht* : heaptype*}(`%I8`(lim), xx*{xx}, ht*{ht}) = `%I8`(lim) + def $subst_memtype{lim : limits, xx* : typevar*, ht* : heaptype*}(`%I8`(lim), xx*{xx : typevar}, ht*{ht : heaptype}) = `%I8`(lim) ;; 2-syntax-aux.watsup def $subst_externtype(externtype : externtype, typevar*, heaptype*) : externtype ;; 2-syntax-aux.watsup - def $subst_externtype{dt : deftype, xx* : typevar*, ht* : heaptype*}(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) + def $subst_externtype{dt : deftype, xx* : typevar*, ht* : heaptype*}(FUNC_externtype(dt), xx*{xx : typevar}, ht*{ht : heaptype}) = FUNC_externtype($subst_deftype(dt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{gt : globaltype, xx* : typevar*, ht* : heaptype*}(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) + def $subst_externtype{gt : globaltype, xx* : typevar*, ht* : heaptype*}(GLOBAL_externtype(gt), xx*{xx : typevar}, ht*{ht : heaptype}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{tt : tabletype, xx* : typevar*, ht* : heaptype*}(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) + def $subst_externtype{tt : tabletype, xx* : typevar*, ht* : heaptype*}(TABLE_externtype(tt), xx*{xx : typevar}, ht*{ht : heaptype}) = TABLE_externtype($subst_tabletype(tt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{mt : memtype, xx* : typevar*, ht* : heaptype*}(MEM_externtype(mt), xx*{xx}, ht*{ht}) = MEM_externtype($subst_memtype(mt, xx*{xx}, ht*{ht})) + def $subst_externtype{mt : memtype, xx* : typevar*, ht* : heaptype*}(MEM_externtype(mt), xx*{xx : typevar}, ht*{ht : heaptype}) = MEM_externtype($subst_memtype(mt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_all_reftype(reftype : reftype, heaptype*) : reftype ;; 2-syntax-aux.watsup - def $subst_all_reftype{rt : reftype, ht^n : heaptype^n, n : n, i^n : nat^n}(rt, ht^n{ht}) = $subst_reftype(rt, $idx(`%`(i))^(i (sx?{sx} = ?())) - | VREPLACE_LANE(shape : shape, laneidx : laneidx) - | VUNOP(shape : shape, vunop_ : vunop_(shape)) - | VBINOP(shape : shape, vbinop_ : vbinop_(shape)) - | VTESTOP(shape : shape, vtestop_ : vtestop_(shape)) - | VRELOP(shape : shape, vrelop_ : vrelop_(shape)) - | VSHIFTOP(ishape : ishape, vshiftop_ : vshiftop_(ishape)) - | VBITMASK(ishape : ishape) - | VCVTOP(shape : shape, vcvtop : vcvtop, half?, shape : shape, sx?, zero : zero) - | VNARROW(ishape : ishape, ishape : ishape, sx : sx) - | VEXTUNOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) + | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*{laneidx : laneidx} : laneidx*) + -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx : laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) + | VSPLAT{shape : shape}(shape : shape) + | VEXTRACT_LANE{shape : shape, sx? : sx?, laneidx : laneidx, numtype : numtype}(shape : shape, sx?{sx : sx} : sx?, laneidx : laneidx) + -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx : sx} = ?())) + | VREPLACE_LANE{shape : shape, laneidx : laneidx}(shape : shape, laneidx : laneidx) + | VUNOP{shape : shape, vunop_ : vunop_(shape)}(shape : shape, vunop_ : vunop_(shape)) + | VBINOP{shape : shape, vbinop_ : vbinop_(shape)}(shape : shape, vbinop_ : vbinop_(shape)) + | VTESTOP{shape : shape, vtestop_ : vtestop_(shape)}(shape : shape, vtestop_ : vtestop_(shape)) + | VRELOP{shape : shape, vrelop_ : vrelop_(shape)}(shape : shape, vrelop_ : vrelop_(shape)) + | VSHIFTOP{ishape : ishape, vshiftop_ : vshiftop_(ishape)}(ishape : ishape, vshiftop_ : vshiftop_(ishape)) + | VBITMASK{ishape : ishape}(ishape : ishape) + | VCVTOP{shape : shape, vcvtop : vcvtop, half? : half?, sx? : sx?, zero : zero}(shape : shape, vcvtop : vcvtop, half?{half : half} : half?, shape, sx?{sx : sx} : sx?, zero : zero) + | VNARROW{ishape : ishape, sx : sx}(ishape : ishape, ishape, sx : sx) + | VEXTUNOP{ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | VEXTBINOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) + | VEXTBINOP{ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | REF.NULL(heaptype : heaptype) + | REF.NULL{heaptype : heaptype}(heaptype : heaptype) | REF.I31 - | REF.FUNC(funcidx : funcidx) + | REF.FUNC{funcidx : funcidx}(funcidx : funcidx) | REF.IS_NULL | REF.AS_NON_NULL | REF.EQ - | REF.TEST(reftype : reftype) - | REF.CAST(reftype : reftype) - | I31.GET(sx : sx) - | STRUCT.NEW(typeidx : typeidx) - | STRUCT.NEW_DEFAULT(typeidx : typeidx) - | STRUCT.GET(sx?, typeidx : typeidx, u32 : u32) - | STRUCT.SET(typeidx : typeidx, u32 : u32) - | ARRAY.NEW(typeidx : typeidx) - | ARRAY.NEW_DEFAULT(typeidx : typeidx) - | ARRAY.NEW_FIXED(typeidx : typeidx, nat : nat) - | ARRAY.NEW_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.NEW_ELEM(typeidx : typeidx, elemidx : elemidx) - | ARRAY.GET(sx?, typeidx : typeidx) - | ARRAY.SET(typeidx : typeidx) + | REF.TEST{reftype : reftype}(reftype : reftype) + | REF.CAST{reftype : reftype}(reftype : reftype) + | I31.GET{sx : sx}(sx : sx) + | STRUCT.NEW{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.GET{sx? : sx?, typeidx : typeidx, u32 : u32}(sx?{sx : sx} : sx?, typeidx : typeidx, u32 : u32) + | STRUCT.SET{typeidx : typeidx, u32 : u32}(typeidx : typeidx, u32 : u32) + | ARRAY.NEW{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_FIXED{typeidx : typeidx}(typeidx : typeidx, nat) + | ARRAY.NEW_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.NEW_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) + | ARRAY.GET{sx? : sx?, typeidx : typeidx}(sx?{sx : sx} : sx?, typeidx : typeidx) + | ARRAY.SET{typeidx : typeidx}(typeidx : typeidx) | ARRAY.LEN - | ARRAY.FILL(typeidx : typeidx) - | ARRAY.COPY(typeidx : typeidx, typeidx : typeidx) - | ARRAY.INIT_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.INIT_ELEM(typeidx : typeidx, elemidx : elemidx) + | ARRAY.FILL{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.COPY{typeidx : typeidx}(typeidx : typeidx, typeidx) + | ARRAY.INIT_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.INIT_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) | EXTERN.CONVERT_ANY | ANY.CONVERT_EXTERN - | LOCAL.GET(localidx : localidx) - | LOCAL.SET(localidx : localidx) - | LOCAL.TEE(localidx : localidx) - | GLOBAL.GET(globalidx : globalidx) - | GLOBAL.SET(globalidx : globalidx) - | TABLE.GET(tableidx : tableidx) - | TABLE.SET(tableidx : tableidx) - | TABLE.SIZE(tableidx : tableidx) - | TABLE.GROW(tableidx : tableidx) - | TABLE.FILL(tableidx : tableidx) - | TABLE.COPY(tableidx : tableidx, tableidx : tableidx) - | TABLE.INIT(tableidx : tableidx, elemidx : elemidx) - | ELEM.DROP(elemidx : elemidx) - | MEMORY.SIZE(memidx : memidx) - | MEMORY.GROW(memidx : memidx) - | MEMORY.FILL(memidx : memidx) - | MEMORY.COPY(memidx : memidx, memidx : memidx) - | MEMORY.INIT(memidx : memidx, dataidx : dataidx) - | DATA.DROP(dataidx : dataidx) - | LOAD(numtype : numtype, (n, sx)?, memidx : memidx, memop : memop) - | STORE(numtype : numtype, n?, memidx : memidx, memop : memop) - | VLOAD(vloadop?, memidx : memidx, memop : memop) - | VLOAD_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | VSTORE(memidx : memidx, memop : memop) - | VSTORE_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | REF.I31_NUM(u31 : u31) - | REF.STRUCT_ADDR(structaddr : structaddr) - | REF.ARRAY_ADDR(arrayaddr : arrayaddr) - | REF.FUNC_ADDR(funcaddr : funcaddr) - | REF.HOST_ADDR(hostaddr : hostaddr) - | REF.EXTERN(addrref : addrref) - | LABEL_(n : n, instr*, admininstr*) - | FRAME_(n : n, frame : frame, admininstr*) + | LOCAL.GET{localidx : localidx}(localidx : localidx) + | LOCAL.SET{localidx : localidx}(localidx : localidx) + | LOCAL.TEE{localidx : localidx}(localidx : localidx) + | GLOBAL.GET{globalidx : globalidx}(globalidx : globalidx) + | GLOBAL.SET{globalidx : globalidx}(globalidx : globalidx) + | TABLE.GET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SIZE{tableidx : tableidx}(tableidx : tableidx) + | TABLE.GROW{tableidx : tableidx}(tableidx : tableidx) + | TABLE.FILL{tableidx : tableidx}(tableidx : tableidx) + | TABLE.COPY{tableidx : tableidx}(tableidx : tableidx, tableidx) + | TABLE.INIT{tableidx : tableidx, elemidx : elemidx}(tableidx : tableidx, elemidx : elemidx) + | ELEM.DROP{elemidx : elemidx}(elemidx : elemidx) + | MEMORY.SIZE{memidx : memidx}(memidx : memidx) + | MEMORY.GROW{memidx : memidx}(memidx : memidx) + | MEMORY.FILL{memidx : memidx}(memidx : memidx) + | MEMORY.COPY{memidx : memidx}(memidx : memidx, memidx) + | MEMORY.INIT{memidx : memidx, dataidx : dataidx}(memidx : memidx, dataidx : dataidx) + | DATA.DROP{dataidx : dataidx}(dataidx : dataidx) + | LOAD{numtype : numtype, n? : n?, sx? : sx?, memidx : memidx, memop : memop}(numtype : numtype, (n, sx)?{n : n sx : sx} : (n, sx)?, memidx : memidx, memop : memop) + | STORE{numtype : numtype, n? : n?, memidx : memidx, memop : memop}(numtype : numtype, n?{n : n} : n?, memidx : memidx, memop : memop) + | VLOAD{vloadop? : vloadop?, memidx : memidx, memop : memop}(vloadop?{vloadop : vloadop} : vloadop?, memidx : memidx, memop : memop) + | VLOAD_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | VSTORE{memidx : memidx, memop : memop}(memidx : memidx, memop : memop) + | VSTORE_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | REF.I31_NUM{u31 : u31}(u31 : u31) + | REF.STRUCT_ADDR{structaddr : structaddr}(structaddr : structaddr) + | REF.ARRAY_ADDR{arrayaddr : arrayaddr}(arrayaddr : arrayaddr) + | REF.FUNC_ADDR{funcaddr : funcaddr}(funcaddr : funcaddr) + | REF.HOST_ADDR{hostaddr : hostaddr}(hostaddr : hostaddr) + | REF.EXTERN{addrref : addrref}(addrref : addrref) + | LABEL_{n : n, instr* : instr*, admininstr* : admininstr*}(n : n, instr*{instr : instr} : instr*, admininstr*{admininstr : admininstr} : admininstr*) + | FRAME_{n : n, frame : frame, admininstr* : admininstr*}(n : n, frame : frame, admininstr*{admininstr : admininstr} : admininstr*) | TRAP } ;; 4-runtime.watsup -syntax config = `%;%*`(state : state, admininstr*) +syntax config = `%;%*`{state : state, admininstr* : admininstr*}(state : state, admininstr*{admininstr : admininstr} : admininstr*) ;; 4-runtime.watsup rec { @@ -2285,15 +2285,15 @@ rec { ;; 4-runtime.watsup:165.1-168.25 syntax E = | _HOLE - | _SEQ(val*, E : E, instr*) - | LABEL_(n : n, instr*, E : E) + | _SEQ{val* : val*, E : E, instr* : instr*}(val*{val : val} : val*, E : E, instr*{instr : instr} : instr*) + | LABEL_{n : n, instr* : instr*, E : E}(n : n, instr*{instr : instr} : instr*, E : E) } ;; 5-runtime-aux.watsup def $inst_reftype(moduleinst : moduleinst, reftype : reftype) : reftype ;; 5-runtime-aux.watsup - def $inst_reftype{mm : moduleinst, rt : reftype, dt* : deftype*}(mm, rt) = $subst_all_reftype(rt, (dt : deftype <: heaptype)*{dt}) - -- if (dt*{dt} = mm.TYPE_moduleinst) + def $inst_reftype{mm : moduleinst, rt : reftype, dt* : deftype*}(mm, rt) = $subst_all_reftype(rt, (dt : deftype <: heaptype)*{dt : deftype}) + -- if (dt*{dt : deftype} = mm.TYPE_moduleinst) ;; 5-runtime-aux.watsup def $default(valtype : valtype) : val? @@ -2334,9 +2334,9 @@ def $funcsxv(externval*) : funcaddr* ;; 5-runtime-aux.watsup:49.1-49.24 def $funcsxv([]) = [] ;; 5-runtime-aux.watsup:50.1-50.47 - def $funcsxv{fa : funcaddr, xv* : externval*}([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) + def $funcsxv{fa : funcaddr, xv* : externval*}([FUNC_externval(fa)] :: xv*{xv : externval}) = [fa] :: $funcsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:51.1-51.58 - def $funcsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $funcsxv(xv*{xv}) + def $funcsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $funcsxv(xv*{xv : externval}) -- otherwise } @@ -2348,9 +2348,9 @@ def $globalsxv(externval*) : globaladdr* ;; 5-runtime-aux.watsup:53.1-53.26 def $globalsxv([]) = [] ;; 5-runtime-aux.watsup:54.1-54.53 - def $globalsxv{ga : globaladdr, xv* : externval*}([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) + def $globalsxv{ga : globaladdr, xv* : externval*}([GLOBAL_externval(ga)] :: xv*{xv : externval}) = [ga] :: $globalsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:55.1-55.62 - def $globalsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $globalsxv(xv*{xv}) + def $globalsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $globalsxv(xv*{xv : externval}) -- otherwise } @@ -2362,9 +2362,9 @@ def $tablesxv(externval*) : tableaddr* ;; 5-runtime-aux.watsup:57.1-57.25 def $tablesxv([]) = [] ;; 5-runtime-aux.watsup:58.1-58.50 - def $tablesxv{ta : tableaddr, xv* : externval*}([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) + def $tablesxv{ta : tableaddr, xv* : externval*}([TABLE_externval(ta)] :: xv*{xv : externval}) = [ta] :: $tablesxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:59.1-59.60 - def $tablesxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $tablesxv(xv*{xv}) + def $tablesxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $tablesxv(xv*{xv : externval}) -- otherwise } @@ -2376,9 +2376,9 @@ def $memsxv(externval*) : memaddr* ;; 5-runtime-aux.watsup:61.1-61.23 def $memsxv([]) = [] ;; 5-runtime-aux.watsup:62.1-62.44 - def $memsxv{ma : memaddr, xv* : externval*}([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) + def $memsxv{ma : memaddr, xv* : externval*}([MEM_externval(ma)] :: xv*{xv : externval}) = [ma] :: $memsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:63.1-63.56 - def $memsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $memsxv(xv*{xv}) + def $memsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $memsxv(xv*{xv : externval}) -- otherwise } @@ -2505,7 +2505,7 @@ def $with_tableinst(state : state, tableidx : tableidx, tableinst : tableinst) : ;; 5-runtime-aux.watsup def $with_mem(state : state, memidx : memidx, nat : nat, nat : nat, byte*) : state ;; 5-runtime-aux.watsup - def $with_mem{s : store, f : frame, x : idx, i : nat, j : nat, b* : byte*}(`%;%`(s, f), x, i, j, b*{b}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]].DATA_meminst[i : j] = b*{b}], f) + def $with_mem{s : store, f : frame, x : idx, i : nat, j : nat, b* : byte*}(`%;%`(s, f), x, i, j, b*{b : byte}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]].DATA_meminst[i : j] = b*{b : byte}], f) ;; 5-runtime-aux.watsup def $with_meminst(state : state, memidx : memidx, meminst : meminst) : state @@ -2515,12 +2515,12 @@ def $with_meminst(state : state, memidx : memidx, meminst : meminst) : state ;; 5-runtime-aux.watsup def $with_elem(state : state, elemidx : elemidx, ref*) : state ;; 5-runtime-aux.watsup - def $with_elem{s : store, f : frame, x : idx, r* : ref*}(`%;%`(s, f), x, r*{r}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]].ELEM_eleminst = r*{r}], f) + def $with_elem{s : store, f : frame, x : idx, r* : ref*}(`%;%`(s, f), x, r*{r : ref}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]].ELEM_eleminst = r*{r : ref}], f) ;; 5-runtime-aux.watsup def $with_data(state : state, dataidx : dataidx, byte*) : state ;; 5-runtime-aux.watsup - def $with_data{s : store, f : frame, x : idx, b* : byte*}(`%;%`(s, f), x, b*{b}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]].DATA_datainst = b*{b}], f) + def $with_data{s : store, f : frame, x : idx, b* : byte*}(`%;%`(s, f), x, b*{b : byte}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]].DATA_datainst = b*{b : byte}], f) ;; 5-runtime-aux.watsup def $with_struct(state : state, structaddr : structaddr, nat : nat, fieldval : fieldval) : state @@ -2535,29 +2535,29 @@ def $with_array(state : state, arrayaddr : arrayaddr, nat : nat, fieldval : fiel ;; 5-runtime-aux.watsup def $ext_structinst(state : state, structinst*) : state ;; 5-runtime-aux.watsup - def $ext_structinst{s : store, f : frame, si* : structinst*}(`%;%`(s, f), si*{si}) = `%;%`(s[STRUCT_store =.. si*{si}], f) + def $ext_structinst{s : store, f : frame, si* : structinst*}(`%;%`(s, f), si*{si : structinst}) = `%;%`(s[STRUCT_store =.. si*{si : structinst}], f) ;; 5-runtime-aux.watsup def $ext_arrayinst(state : state, arrayinst*) : state ;; 5-runtime-aux.watsup - def $ext_arrayinst{s : store, f : frame, ai* : arrayinst*}(`%;%`(s, f), ai*{ai}) = `%;%`(s[ARRAY_store =.. ai*{ai}], f) + def $ext_arrayinst{s : store, f : frame, ai* : arrayinst*}(`%;%`(s, f), ai*{ai : arrayinst}) = `%;%`(s[ARRAY_store =.. ai*{ai : arrayinst}], f) ;; 5-runtime-aux.watsup def $growtable(tableinst : tableinst, nat : nat, ref : ref) : tableinst ;; 5-runtime-aux.watsup def $growtable{ti : tableinst, n : n, r : ref, ti' : tableinst, i : nat, j : nat, rt : reftype, r'* : ref*, i' : nat}(ti, n, r) = ti' - -- if (ti = {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM r'*{r'}}) - -- if (i' = (|r'*{r'}| + n)) - -- if (ti' = {TYPE `%%`(`[%..%]`(`%`(i'), `%`(j)), rt), ELEM r'*{r'} :: r^n{}}) + -- if (ti = {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM r'*{r' : ref}}) + -- if (i' = (|r'*{r' : ref}| + n)) + -- if (ti' = {TYPE `%%`(`[%..%]`(`%`(i'), `%`(j)), rt), ELEM r'*{r' : ref} :: r^n{}}) -- if (i' <= j) ;; 5-runtime-aux.watsup def $growmemory(meminst : meminst, nat : nat) : meminst ;; 5-runtime-aux.watsup def $growmemory{mi : meminst, n : n, mi' : meminst, i : nat, j : nat, b* : byte*, i' : nat}(mi, n) = mi' - -- if (mi = {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA b*{b}}) - -- if (i' = ((|b*{b}| / (64 * $Ki)) + n)) - -- if (mi' = {TYPE `%I8`(`[%..%]`(`%`(i'), `%`(j))), DATA b*{b} :: `%`(0)^((n * 64) * $Ki){}}) + -- if (mi = {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA b*{b : byte}}) + -- if (i' = ((|b*{b : byte}| / (64 * $Ki)) + n)) + -- if (mi' = {TYPE `%I8`(`[%..%]`(`%`(i'), `%`(j))), DATA b*{b : byte} :: `%`(0)^((n * 64) * $Ki){}}) -- if (i' <= j) ;; 6-typing.watsup @@ -2566,25 +2566,25 @@ syntax init = | UNSET ;; 6-typing.watsup -syntax localtype = `%%`(init : init, valtype : valtype) +syntax localtype = `%%`{init : init, valtype : valtype}(init : init, valtype : valtype) ;; 6-typing.watsup -syntax instrtype = `%->%*%`(resulttype : resulttype, localidx*, resulttype : resulttype) +syntax instrtype = `%->%*%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) ;; 6-typing.watsup syntax context = { - TYPE deftype*, - REC subtype*, - FUNC deftype*, - GLOBAL globaltype*, - TABLE tabletype*, - MEM memtype*, - ELEM elemtype*, - DATA datatype*, - LOCAL localtype*, - LABEL resulttype*, - RETURN resulttype? + TYPE{deftype* : deftype*} deftype*, + REC{subtype* : subtype*} subtype*, + FUNC{deftype* : deftype*} deftype*, + GLOBAL{globaltype* : globaltype*} globaltype*, + TABLE{tabletype* : tabletype*} tabletype*, + MEM{memtype* : memtype*} memtype*, + ELEM{elemtype* : elemtype*} elemtype*, + DATA{datatype* : datatype*} datatype*, + LOCAL{localtype* : localtype*} localtype*, + LABEL{resulttype* : resulttype*} resulttype*, + RETURN{resulttype? : resulttype?} resulttype? } ;; 6-typing.watsup @@ -2595,7 +2595,7 @@ def $with_locals(context : context, localidx*, localtype*) : context ;; 6-typing.watsup:28.1-28.34 def $with_locals{C : context}(C, [], []) = C ;; 6-typing.watsup:29.1-29.85 - def $with_locals{C : context, x_1 : idx, x* : idx*, lt_1 : localtype, lt* : localtype*}(C, [x_1] :: x*{x}, [lt_1] :: lt*{lt}) = $with_locals(C[LOCAL_context[x_1.`%`.0] = lt_1], x*{x}, lt*{lt}) + def $with_locals{C : context, x_1 : idx, x* : idx*, lt_1 : localtype, lt* : localtype*}(C, [x_1] :: x*{x : localidx}, [lt_1] :: lt*{lt : localtype}) = $with_locals(C[LOCAL_context[x_1.`%`.0] = lt_1], x*{x : localidx}, lt*{lt : localtype}) } ;; 6-typing.watsup @@ -2606,15 +2606,15 @@ def $clostypes(deftype*) : deftype* ;; 6-typing.watsup:37.1-37.26 def $clostypes([]) = [] ;; 6-typing.watsup:38.1-38.93 - def $clostypes{dt* : deftype*, dt_N : deftype, dt'* : deftype*}(dt*{dt} :: [dt_N]) = dt'*{dt'} :: [$subst_all_deftype(dt_N, (dt' : deftype <: heaptype)*{dt'})] - -- if (dt'*{dt'} = $clostypes(dt*{dt})) + def $clostypes{dt* : deftype*, dt_N : deftype, dt'* : deftype*}(dt*{dt : deftype} :: [dt_N]) = dt'*{dt' : deftype} :: [$subst_all_deftype(dt_N, (dt' : deftype <: heaptype)*{dt' : deftype})] + -- if (dt'*{dt' : deftype} = $clostypes(dt*{dt : deftype})) } ;; 6-typing.watsup def $clostype(context : context, deftype : deftype) : deftype ;; 6-typing.watsup - def $clostype{C : context, dt : deftype, dt'* : deftype*}(C, dt) = $subst_all_deftype(dt, (dt' : deftype <: heaptype)*{dt'}) - -- if (dt'*{dt'} = $clostypes(C.TYPE_context)) + def $clostype{C : context, dt : deftype, dt'* : deftype*}(C, dt) = $subst_all_deftype(dt, (dt' : deftype <: heaptype)*{dt' : deftype}) + -- if (dt'*{dt' : deftype} = $clostypes(C.TYPE_context)) ;; 6-typing.watsup relation Numtype_ok: `%|-%:_OK`(context, numtype) @@ -2676,25 +2676,25 @@ relation Valtype_ok: `%|-%:_OK`(context, valtype) relation Resulttype_ok: `%|-%:_OK`(context, resulttype) ;; 6-typing.watsup rule _{C : context, t* : valtype*}: - `%|-%:_OK`(C, t*{t}) - -- (Valtype_ok: `%|-%:_OK`(C, t))*{t} + `%|-%:_OK`(C, t*{t : valtype}) + -- (Valtype_ok: `%|-%:_OK`(C, t))*{t : valtype} ;; 6-typing.watsup relation Instrtype_ok: `%|-%:_OK`(context, instrtype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, x* : idx*, t_2* : valtype*, lt* : localtype*}: - `%|-%:_OK`(C, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2}) - -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt x} + `%|-%:_OK`(C, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) + -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt : localtype x : idx} ;; 6-typing.watsup syntax oktypeidx = - | OK(typeidx : typeidx) + | OK{typeidx : typeidx}(typeidx : typeidx) ;; 6-typing.watsup syntax oktypeidxnat = - | OK(typeidx : typeidx, nat : nat) + | OK{typeidx : typeidx}(typeidx : typeidx, nat) ;; 6-typing.watsup relation Packtype_ok: `%|-%:_OK`(context, packtype) @@ -2725,16 +2725,16 @@ relation Fieldtype_ok: `%|-%:_OK`(context, fieldtype) relation Functype_ok: `%|-%:_OK`(context, functype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:_OK`(C, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2}) + `%|-%:_OK`(C, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) + -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) ;; 6-typing.watsup relation Comptype_ok: `%|-%:_OK`(context, comptype) ;; 6-typing.watsup rule struct{C : context, yt* : fieldtype*}: - `%|-%:_OK`(C, STRUCT_comptype(yt*{yt})) - -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt} + `%|-%:_OK`(C, STRUCT_comptype(yt*{yt : fieldtype})) + -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt : fieldtype} ;; 6-typing.watsup rule array{C : context, yt : fieldtype}: @@ -2771,7 +2771,7 @@ relation Deftype_sub: `%|-%<:%`(context, deftype, deftype) ;; 6-typing.watsup:438.1-441.40 rule super{C : context, deftype_1 : deftype, deftype_2 : deftype, fin : fin, ht_1* : heaptype*, ht : heaptype, ht_2* : heaptype*, ct : comptype}: `%|-%<:%`(C, deftype_1, deftype_2) - -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1 : heaptype} :: [ht] :: ht_2*{ht_2 : heaptype}, ct)) -- Heaptype_sub: `%|-%<:%`(C, ht, (deftype_2 : deftype <: heaptype)) ;; 6-typing.watsup:271.1-271.79 @@ -2806,7 +2806,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:303.1-305.35 rule struct{C : context, deftype : deftype, yt* : fieldtype*}: `%|-%<:%`(C, (deftype : deftype <: heaptype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) + -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt : fieldtype})) ;; 6-typing.watsup:307.1-309.33 rule array{C : context, deftype : deftype, yt : fieldtype}: @@ -2836,7 +2836,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:327.1-329.48 rule rec{C : context, i : nat, ht : heaptype, fin : fin, ht_1* : heaptype*, ht_2* : heaptype*, ct : comptype}: `%|-%<:%`(C, REC_heaptype(i), ht) - -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1 : heaptype} :: [ht] :: ht_2*{ht_2 : heaptype}, ct)) ;; 6-typing.watsup:331.1-333.40 rule none{C : context, heaptype : heaptype}: @@ -2932,8 +2932,8 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) ;; 6-typing.watsup rule struct{C : context, yt_1* : fieldtype*, yt'_1 : fieldtype, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) - -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} + `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1 : fieldtype} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2 : fieldtype})) + -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 : fieldtype yt_2 : fieldtype} ;; 6-typing.watsup rule array{C : context, yt_1 : fieldtype, yt_2 : fieldtype}: @@ -2949,12 +2949,12 @@ relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) ;; 6-typing.watsup rule _{C : context, fin : fin, y* : idx*, ct : comptype, x : idx, y'** : idx**, ct'* : comptype*}: - `%|-%:%`(C, SUB_subtype(fin, y*{y}, ct), OK_oktypeidx(x)) - -- if (|y*{y}| <= 1) - -- (if (y.`%`.0 < x.`%`.0))*{y} - -- (if ($unrolldt(C.TYPE_context[y.`%`.0]) = SUB_subtype(`FINAL%?`(?()), y'*{y'}, ct')))*{ct' y y'} + `%|-%:%`(C, SUB_subtype(fin, y*{y : typeidx}, ct), OK_oktypeidx(x)) + -- if (|y*{y : idx}| <= 1) + -- (if (y.`%`.0 < x.`%`.0))*{y : idx} + -- (if ($unrolldt(C.TYPE_context[y.`%`.0]) = SUB_subtype(`FINAL%?`(?()), y'*{y' : typeidx}, ct')))*{ct' : comptype y : idx y' : typeidx} -- Comptype_ok: `%|-%:_OK`(C, ct) - -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct'} + -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct' : comptype} ;; 6-typing.watsup def $before(heaptype : heaptype, typeidx : typeidx, nat : nat) : bool @@ -2978,12 +2978,12 @@ def $unrollht(context : context, heaptype : heaptype) : subtype relation Subtype_ok2: `%|-%:%`(context, subtype, oktypeidxnat) ;; 6-typing.watsup rule _{C : context, fin : fin, ht* : heaptype*, ct : comptype, x : idx, i : nat, ht'** : heaptype**, ct'* : comptype*}: - `%|-%:%`(C, SUBD_subtype(fin, ht*{ht}, ct), OK_oktypeidxnat(x, i)) - -- if (|ht*{ht}| <= 1) - -- (if $before(ht, x, i))*{ht} - -- (if ($unrollht(C, ht) = SUBD_subtype(`FINAL%?`(?()), ht'*{ht'}, ct')))*{ct' ht ht'} + `%|-%:%`(C, SUBD_subtype(fin, ht*{ht : heaptype}, ct), OK_oktypeidxnat(x, i)) + -- if (|ht*{ht : heaptype}| <= 1) + -- (if $before(ht, x, i))*{ht : heaptype} + -- (if ($unrollht(C, ht) = SUBD_subtype(`FINAL%?`(?()), ht'*{ht' : heaptype}, ct')))*{ct' : comptype ht : heaptype ht' : heaptype} -- Comptype_ok: `%|-%:_OK`(C, ct) - -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct'} + -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct' : comptype} ;; 6-typing.watsup rec { @@ -2996,9 +2996,9 @@ relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) ;; 6-typing.watsup:199.1-202.50 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidxnat(x, i)) + `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) - -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) } ;; 6-typing.watsup @@ -3012,14 +3012,14 @@ relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) ;; 6-typing.watsup:187.1-190.43 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidx(x)) + `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidx(x)) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) - -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) + -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) ;; 6-typing.watsup:192.1-194.49 rule rec2{C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) + `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(x, 0)) } ;; 6-typing.watsup @@ -3028,7 +3028,7 @@ relation Deftype_ok: `%|-%:_OK`(context, deftype) rule _{C : context, qt : rectype, i : nat, x : idx, st^n : subtype^n, n : n}: `%|-%:_OK`(C, DEF_deftype(qt, i)) -- Rectype_ok: `%|-%:%`(C, qt, OK_oktypeidx(x)) - -- if (qt = REC_rectype(st^n{st})) + -- if (qt = REC_rectype(st^n{st : subtype})) -- if (i < n) ;; 6-typing.watsup @@ -3087,18 +3087,18 @@ relation Externtype_ok: `%|-%:_OK`(context, externtype) relation Resulttype_sub: `%|-%*_<:%*`(context, valtype*, valtype*) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%*_<:%*`(C, t_1*{t_1}, t_2*{t_2}) - -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 t_2} + `%|-%*_<:%*`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) + -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 : valtype t_2 : valtype} ;; 6-typing.watsup relation Instrtype_sub: `%|-%<:%`(context, instrtype, instrtype) ;; 6-typing.watsup rule _{C : context, t_11* : valtype*, x_1* : idx*, t_12* : valtype*, t_21* : valtype*, x_2* : idx*, t_22* : valtype*, x* : idx*, t* : valtype*}: - `%|-%<:%`(C, `%->%*%`(t_11*{t_11}, x_1*{x_1}, t_12*{t_12}), `%->%*%`(t_21*{t_21}, x_2*{x_2}, t_22*{t_22})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21}, t_11*{t_11}) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12}, t_22*{t_22}) - -- if (x*{x} = $setminus(x_2*{x_2}, x_1*{x_1})) - -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t x} + `%|-%<:%`(C, `%->%*%`(t_11*{t_11 : valtype}, x_1*{x_1 : localidx}, t_12*{t_12 : valtype}), `%->%*%`(t_21*{t_21 : valtype}, x_2*{x_2 : localidx}, t_22*{t_22 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) + -- if (x*{x : idx} = $setminus(x_2*{x_2 : idx}, x_1*{x_1 : idx})) + -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t : valtype x : idx} ;; 6-typing.watsup relation Limits_sub: `%|-%<:%`(context, limits, limits) @@ -3181,7 +3181,7 @@ rec { relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:544.1-545.34 rule unreachable{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:547.1-548.24 rule nop{C : context}: @@ -3203,55 +3203,55 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:578.1-581.61 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:583.1-586.61 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:588.1-592.65 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_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_2*{x_2 : localidx}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:597.1-599.24 rule br{C : context, l : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.LABEL_context[l.`%`.0] = t*{t}) + `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) ;; 6-typing.watsup:601.1-603.24 rule br_if{C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) - -- if (C.LABEL_context[l.`%`.0] = t*{t}) + `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t : valtype} :: [I32_valtype], t*{t : valtype})) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) ;; 6-typing.watsup:605.1-608.44 rule br_table{C : context, l* : labelidx*, l' : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[l.`%`.0]))*{l} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[l'.`%`.0]) + `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0]))*{l : labelidx} + -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0]) ;; 6-typing.watsup:610.1-613.31 rule br_on_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t}) + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:615.1-618.31 rule br_on_non_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) - -- if (C.LABEL_context[l.`%`.0] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype})) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:620.1-626.34 rule br_on_cast{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 : reftype <: valtype)], t*{t} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -3259,8 +3259,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:628.1-634.49 rule br_on_cast_fail{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 : reftype <: valtype)], t*{t} :: [(rt_2 : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [(rt_2 : reftype <: valtype)])) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -3268,48 +3268,48 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:639.1-641.24 rule return{C : context, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.RETURN_context = ?(t*{t})) + `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + -- if (C.RETURN_context = ?(t*{t : valtype})) ;; 6-typing.watsup:643.1-645.46 rule call{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; 6-typing.watsup:647.1-649.46 rule call_ref{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2 : valtype})) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; 6-typing.watsup:651.1-655.46 rule call_indirect{C : context, x : idx, y : idx, t_1* : valtype*, t_2* : valtype*, lim : limits, rt : reftype}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; 6-typing.watsup:657.1-661.40 rule return_call{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}, t_4*{t_4 : valtype})) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:663.1-667.40 rule return_call_ref{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4 : valtype})) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:669.1-675.40 rule return_call_indirect{C : context, x : idx, y : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, lim : limits, rt : reftype, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype], t_4*{t_4 : valtype})) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:680.1-681.33 rule const{C : context, nt : numtype, c_nt : num_(nt)}: @@ -3339,9 +3339,9 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:701.1-704.50 rule convert-i{C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: - `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) -- if (inn_1 =/= inn_2) - -- if ((sx?{sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) + -- if ((sx?{sx : sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) ;; 6-typing.watsup:706.1-708.24 rule convert-f{C : context, fnn_1 : fnn, fnn_2 : fnn}: @@ -3395,27 +3395,27 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:756.1-758.43 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) ;; 6-typing.watsup:760.1-763.39 rule struct.new_default{C : context, x : idx, zt* : storagetype*, mut* : mut*, val* : val*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpack(zt)) = ?(val)))*{val zt} + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 6-typing.watsup:765.1-769.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: - `%|-%:%`(C, STRUCT.GET_instr(sx?{sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(mut, zt)) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + -- if (yt*{yt : fieldtype}[i] = `%%`(mut, zt)) + -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:771.1-774.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + -- if (yt*{yt : fieldtype}[i] = `%%`(`MUT%?`(?(())), zt)) ;; 6-typing.watsup:779.1-781.41 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: @@ -3448,9 +3448,9 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:803.1-806.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:808.1-810.41 rule array.set{C : context, x : idx, zt : storagetype}: @@ -3525,8 +3525,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:870.1-872.22 rule vshuffle{C : context, imm : imm, N : N, i* : nat*}: - `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) - -- (if (i < (N * 2)))*{i} + `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + -- (if (i < (N * 2)))*{i : nat} ;; 6-typing.watsup:874.1-875.48 rule vsplat{C : context, lnn : lnn, N : N}: @@ -3534,7 +3534,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:878.1-880.14 rule vextract_lane{C : context, lnn : lnn, N : N, sx? : sx?, i : nat}: - `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) + `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) -- if (i < N) ;; 6-typing.watsup:882.1-884.14 @@ -3564,7 +3564,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:902.1-903.55 rule vcvtop{C : context, sh : shape, vcvtop : vcvtop, hf? : half?, sx? : sx?, zero : zero}: - `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf}, sh, sx?{sx}, zero), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`([V128_valtype], [V128_valtype])) ;; 6-typing.watsup:905.1-906.44 rule vnarrow{C : context, sh : ishape, sx : sx}: @@ -3675,19 +3675,19 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1011.1-1016.29 rule load{C : context, nt : numtype, n? : n?, sx? : sx?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} + -- if ((n?{n : n} = ?()) \/ (nt = (inn : inn <: numtype))) ;; 6-typing.watsup:1018.1-1023.29 rule store{C : context, nt : numtype, n? : n?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) + `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} + -- if ((n?{n : n} = ?()) \/ (nt = (inn : inn <: numtype))) ;; 6-typing.watsup:1025.1-1028.30 rule vload{C : context, M : M, N : N, sx : sx, x : idx, n_A : n, n_O : n, mt : memtype}: @@ -3731,8 +3731,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) relation Instrf_ok: `%|-%:%`(context, instr, instrtype) ;; 6-typing.watsup:518.1-520.41 rule instr{C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1 : valtype}, [], t_2*{t_2 : valtype})) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:924.1-926.28 rule local.set{C : context, x : idx, t : valtype, init : init}: @@ -3752,30 +3752,30 @@ relation Instrs_ok: `%|-%*_:%`(context, instr*, instrtype) ;; 6-typing.watsup:525.1-530.52 rule seq{C : context, instr_1 : instr, instr_2* : instr*, t_1* : valtype*, x_1* : idx*, x_2* : idx*, t_3* : valtype*, init* : init*, t* : valtype*, C' : context, t_2* : valtype*}: - `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_1*{x_1} :: x_2*{x_2}, t_3*{t_3})) - -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init t x_1} - -- if (C' = $with_locals(C, x_1*{x_1}, `%%`(SET_init, t)*{t})) - -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2}, `%->%*%`(t_2*{t_2}, x_2*{x_2}, t_3*{t_3})) + `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init : init t : valtype x_1 : idx} + -- if (C' = $with_locals(C, x_1*{x_1 : localidx}, `%%`(SET_init, t)*{t : valtype})) + -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2 : instr}, `%->%*%`(t_2*{t_2 : valtype}, x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) ;; 6-typing.watsup:532.1-535.35 rule sub{C : context, instr* : instr*, it' : instrtype, it : instrtype}: - `%|-%*_:%`(C, instr*{instr}, it') - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, it) + `%|-%*_:%`(C, instr*{instr : instr}, it') + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, it) -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:537.1-539.47 rule frame{C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, x* : idx*, t_2* : valtype*}: - `%|-%*_:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t*{t : valtype} :: t_1*{t_1 : valtype}, x*{x : localidx}, t*{t : valtype} :: t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) } ;; 6-typing.watsup relation Expr_ok: `%|-%:%`(context, expr, resulttype) ;; 6-typing.watsup rule _{C : context, instr* : instr*, t* : valtype*}: - `%|-%:%`(C, instr*{instr}, t*{t}) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, `%->%*%`([], [], t*{t})) + `%|-%:%`(C, instr*{instr : instr}, t*{t : valtype}) + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`([], [], t*{t : valtype})) ;; 6-typing.watsup rec { @@ -3785,7 +3785,7 @@ def $in_binop(numtype : numtype, binop_ : binop_(numtype), binop_(numtype)*) : b ;; 6-typing.watsup:1087.1-1087.42 def $in_binop{nt : numtype, binop : binop_(nt), epsilon : binop_(nt)*}(nt, binop, epsilon) = false ;; 6-typing.watsup:1088.1-1088.99 - def $in_binop{nt : numtype, binop : binop_(nt), ibinop_1 : binop_(nt), ibinop'* : binop_(nt)*}(nt, binop, [ibinop_1] :: ibinop'*{ibinop'}) = ((binop = ibinop_1) \/ $in_binop(nt, binop, ibinop'*{ibinop'})) + def $in_binop{nt : numtype, binop : binop_(nt), ibinop_1 : binop_(nt), ibinop'* : binop_(nt)*}(nt, binop, [ibinop_1] :: ibinop'*{ibinop' : binop_(nt)}) = ((binop = ibinop_1) \/ $in_binop(nt, binop, ibinop'*{ibinop' : binop_(nt)})) } ;; 6-typing.watsup @@ -3796,7 +3796,7 @@ def $in_numtype(numtype : numtype, numtype*) : bool ;; 6-typing.watsup:1083.1-1083.37 def $in_numtype{nt : numtype, epsilon : numtype*}(nt, epsilon) = false ;; 6-typing.watsup:1084.1-1084.68 - def $in_numtype{nt : numtype, nt_1 : numtype, nt'* : numtype*}(nt, [nt_1] :: nt'*{nt'}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt'})) + def $in_numtype{nt : numtype, nt_1 : numtype, nt'* : numtype*}(nt, [nt_1] :: nt'*{nt' : numtype}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt' : numtype})) } ;; 6-typing.watsup @@ -3832,8 +3832,8 @@ relation Instr_const: `%|-%CONST`(context, instr) relation Expr_const: `%|-%CONST`(context, expr) ;; 6-typing.watsup rule _{C : context, instr* : instr*}: - `%|-%CONST`(C, instr*{instr}) - -- (Instr_const: `%|-%CONST`(C, instr))*{instr} + `%|-%CONST`(C, instr*{instr : instr}) + -- (Instr_const: `%|-%CONST`(C, instr))*{instr : instr} ;; 6-typing.watsup relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) @@ -3847,10 +3847,10 @@ relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) relation Type_ok: `%|-%:%*`(context, type, deftype*) ;; 6-typing.watsup rule _{C : context, rectype : rectype, dt* : deftype*, x : idx}: - `%|-%:%*`(C, TYPE(rectype), dt*{dt}) + `%|-%:%*`(C, TYPE(rectype), dt*{dt : deftype}) -- if (x = `%`(|C.TYPE_context|)) - -- if (dt*{dt} = $rolldt(x, rectype)) - -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt}], rectype, OK_oktypeidx(x)) + -- if (dt*{dt : deftype} = $rolldt(x, rectype)) + -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt : deftype}], rectype, OK_oktypeidx(x)) ;; 6-typing.watsup relation Local_ok: `%|-%:%`(context, local, localtype) @@ -3868,10 +3868,10 @@ relation Local_ok: `%|-%:%`(context, local, localtype) relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup rule _{C : context, x : idx, local* : local*, expr : expr, t_1* : valtype*, t_2* : valtype*, lt* : localtype*}: - `%|-%:%`(C, `FUNC%%*%`(x, local*{local}, expr), C.TYPE_context[x.`%`.0]) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- (Local_ok: `%|-%:%`(C, local, lt))*{local lt} - -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1} :: lt*{lt}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2})}, expr, t_2*{t_2}) + `%|-%:%`(C, `FUNC%%*%`(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- (Local_ok: `%|-%:%`(C, local, lt))*{local : local lt : localtype} + -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2 : valtype})}, expr, t_2*{t_2 : valtype}) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -3918,8 +3918,8 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup rule _{C : context, rt : reftype, expr* : expr*, elemmode : elemmode}: - `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr}, elemmode), rt) - -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr} + `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr : expr}, elemmode), rt) + -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr : expr} -- Elemmode_ok: `%|-%:%`(C, elemmode, rt) ;; 6-typing.watsup @@ -3938,7 +3938,7 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) relation Data_ok: `%|-%:_OK`(context, data) ;; 6-typing.watsup rule _{C : context, b* : byte*, datamode : datamode}: - `%|-%:_OK`(C, `DATA%*%`(b*{b}, datamode)) + `%|-%:_OK`(C, `DATA%*%`(b*{b : byte}, datamode)) -- Datamode_ok: `%|-%:_OK`(C, datamode) ;; 6-typing.watsup @@ -3995,9 +3995,9 @@ relation Globals_ok: `%|-%*_:%*`(context, global*, globaltype*) ;; 6-typing.watsup:1275.1-1278.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: - `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt}) + `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) - -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt}) + -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) } ;; 6-typing.watsup @@ -4011,32 +4011,32 @@ relation Types_ok: `%|-%*_:%*`(context, type*, deftype*) ;; 6-typing.watsup:1267.1-1270.49 rule cons{C : context, type_1 : type, type* : type*, dt_1 : deftype, dt* : deftype*}: - `%|-%*_:%*`(C, [type_1] :: type*{type}, dt_1*{} :: dt*{dt}) + `%|-%*_:%*`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, dt*{dt}) + -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) } ;; 6-typing.watsup relation Module_ok: `|-%:_OK`(module) ;; 6-typing.watsup rule _{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data^n : data^n, n : n, start? : start?, export* : export*, dt'* : deftype*, ixt* : externtype*, C' : context, gt* : globaltype*, tt* : tabletype*, mt* : memtype*, C : context, dt* : deftype*, rt* : reftype*, et* : externtype*, idt* : deftype*, igt* : globaltype*, itt* : tabletype*, imt* : memtype*}: - `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type}, import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data^n{data}, start?{start}, export*{export})) - -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type}, dt'*{dt'}) - -- (Import_ok: `%|-%:%`({TYPE dt'*{dt'}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import ixt} - -- Globals_ok: `%|-%*_:%*`(C', global*{global}, gt*{gt}) - -- (Table_ok: `%|-%:%`(C', table, tt))*{table tt} - -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem mt} - -- (Func_ok: `%|-%:%`(C, func, dt))*{dt func} - -- (Elem_ok: `%|-%:%`(C, elem, rt))*{elem rt} - -- (Data_ok: `%|-%:_OK`(C, data))^n{data} - -- (Start_ok: `%|-%:_OK`(C, start))?{start} - -- (Export_ok: `%|-%:%`(C, export, et))*{et export} - -- if (C = {TYPE dt'*{dt'}, REC [], FUNC idt*{idt} :: dt*{dt}, GLOBAL igt*{igt} :: gt*{gt}, TABLE itt*{itt} :: tt*{tt}, MEM imt*{imt} :: mt*{mt}, ELEM rt*{rt}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) - -- if (C' = {TYPE dt'*{dt'}, REC [], FUNC idt*{idt} :: dt*{dt}, GLOBAL igt*{igt}, TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}) - -- if (idt*{idt} = $funcsxt(ixt*{ixt})) - -- if (igt*{igt} = $globalsxt(ixt*{ixt})) - -- if (itt*{itt} = $tablesxt(ixt*{ixt})) - -- if (imt*{imt} = $memsxt(ixt*{ixt})) + `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) + -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) + -- (Import_ok: `%|-%:%`({TYPE dt'*{dt' : deftype}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import : import ixt : externtype} + -- Globals_ok: `%|-%*_:%*`(C', global*{global : global}, gt*{gt : globaltype}) + -- (Table_ok: `%|-%:%`(C', table, tt))*{table : table tt : tabletype} + -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem : mem mt : memtype} + -- (Func_ok: `%|-%:%`(C, func, dt))*{dt : deftype func : func} + -- (Elem_ok: `%|-%:%`(C, elem, rt))*{elem : elem rt : reftype} + -- (Data_ok: `%|-%:_OK`(C, data))^n{data : data} + -- (Start_ok: `%|-%:_OK`(C, start))?{start : start} + -- (Export_ok: `%|-%:%`(C, export, et))*{et : externtype export : export} + -- if (C = {TYPE dt'*{dt' : deftype}, REC [], FUNC idt*{idt : deftype} :: dt*{dt : deftype}, GLOBAL igt*{igt : globaltype} :: gt*{gt : globaltype}, TABLE itt*{itt : tabletype} :: tt*{tt : tabletype}, MEM imt*{imt : memtype} :: mt*{mt : memtype}, ELEM rt*{rt : elemtype}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) + -- if (C' = {TYPE dt'*{dt' : deftype}, REC [], FUNC idt*{idt : deftype} :: dt*{dt : deftype}, GLOBAL igt*{igt : globaltype}, TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}) + -- if (idt*{idt : deftype} = $funcsxt(ixt*{ixt : externtype})) + -- if (igt*{igt : globaltype} = $globalsxt(ixt*{ixt : externtype})) + -- if (itt*{itt : tabletype} = $tablesxt(ixt*{ixt : externtype})) + -- if (imt*{imt : memtype} = $memsxt(ixt*{ixt : externtype})) ;; 7-runtime-typing.watsup relation Ref_ok: `%|-%:%`(store, ref, reftype) @@ -4087,35 +4087,35 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule select-true{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_1 : val <: admininstr)]) + `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule select-false{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_2 : val <: admininstr)]) + `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule if-true{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) + `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule if-false{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) + `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule label-vals{n : n, instr* : instr*, val* : val*}: - `%*_~>%*`([LABEL__admininstr(n, instr*{instr}, (val : val <: admininstr)*{val})], (val : val <: admininstr)*{val}) + `%*_~>%*`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) ;; 8-reduction.watsup rule br-zero{n : n, instr'* : instr*, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)^n{val} :: (instr' : instr <: admininstr)*{instr'}) + `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule br-succ{n : n, instr'* : instr*, val* : val*, l : labelidx, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val : val <: admininstr)*{val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)*{val} :: [BR_admininstr(l)]) + `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) ;; 8-reduction.watsup rule br_if-true{c : num_(I32_numtype), l : labelidx}: @@ -4129,13 +4129,13 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule br_table-lt{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) - -- if (i < |l*{l}|) + `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) + -- if (i < |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_table-ge{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) - -- if (i >= |l*{l}|) + `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) + -- if (i >= |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_on_null-null{val : val, l : labelidx, ht : heaptype}: @@ -4167,15 +4167,15 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule frame-vals{n : n, f : frame, val^n : val^n}: - `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val})], (val : val <: admininstr)^n{val}) + `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-frame{n : n, f : frame, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)^n{val}) + `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-label{k : nat, instr'* : instr*, val* : val*, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(k, instr'*{instr'}, (val : val <: admininstr)*{val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)*{val} :: [RETURN_admininstr]) + `%*_~>%*`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) ;; 8-reduction.watsup rule unop-val{nt : numtype, c_1 : num_(nt), unop : unop_(nt), c : num_(nt)}: @@ -4209,13 +4209,13 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?, c : num_(nt_2)}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx}, c_1) = [c]) + `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) + -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = [c]) ;; 8-reduction.watsup rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx}, c_1) = []) + `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) + -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: @@ -4304,15 +4304,15 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vswizzle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn : inn, N : N, c' : vec_(V128_vnn), c : iN($size((inn : inn <: numtype))), ci* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*, k^N : nat^N}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) - -- if (ci*{ci} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) + -- if (ci*{ci : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) -- if (c*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: `%`(0)^(256 - N){}) - -- if (c' = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c*{}[ci*{ci}[k].`%`.0]^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i})], [VCONST_admininstr(V128_vectype, c)]) + `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) - -- if (c = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c'*{}[i*{i}[k]]^(k%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vshiftop{c_1 : vec_(V128_vnn), n : n, imm : imm, N : N, vshiftop : vshiftop_(`%X%`(imm, `%`(N))), c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) - -- if (c'*{c'} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1)) - -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c'})) + -- if (c'*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1)) + -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))})) ;; 8-reduction.watsup rule vtestop-true{c : vec_(V128_vnn), inn : inn, N : N, ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) - -- (if (ci_1 =/= `%`(0)))*{ci_1} + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) + -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), inn : inn, N : N}: @@ -4374,35 +4374,35 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vbitmask{c : vec_(V128_vnn), inn : inn, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) - -- if ($ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1}) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) + -- if ($ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($size((inn : inn <: numtype)))}) ;; 8-reduction.watsup rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn_1 : inn, N_1 : N, inn_2 : inn, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, cj_1* : iN($size((inn_2 : inn <: numtype)))*, cj_2* : iN($size((inn_2 : inn <: numtype)))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) - -- if (ci_2*{ci_2} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2)) - -- if (cj_1*{cj_1} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1}) - -- if (cj_2*{cj_2} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_2)*{ci_2}) - -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), cj_1*{cj_1} :: cj_2*{cj_2})) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) + -- if (ci_2*{ci_2 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2)) + -- if (cj_1*{cj_1 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1 : iN($size((inn_1 : inn <: numtype)))}) + -- if (cj_2*{cj_2 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_2)*{ci_2 : iN($size((inn_1 : inn <: numtype)))}) + -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), cj_1*{cj_1 : lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), `%`(N_2))))} :: cj_2*{cj_2 : lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), `%`(N_2))))})) ;; 8-reduction.watsup rule vcvtop-normal{c_1 : vec_(V128_vnn), lnn_2 : lnn, N_2 : N, vcvtop : vcvtop, lnn_1 : lnn, N_1 : N, sx : sx, c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- if (c'*{c'} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1)) - -- if (c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c'})) + -- if (c'*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1)) + -- if (c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-half{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, hf : half, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci*{ci} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) - -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx}, ci)*{ci})) + `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) + -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-zero{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci*{ci} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) - -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx}, ci)*{ci} :: `%`(0)^N_1{})) + `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) + -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} :: `%`(0)^N_1{})) ;; 8-reduction.watsup rule vextunop{c_1 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: @@ -4432,13 +4432,13 @@ def $blocktype(state : state, blocktype : blocktype) : functype relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule block{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, n : n, t_1^k : valtype^k, t_2^n : valtype^n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val} :: (instr : instr <: admininstr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) ;; 8-reduction.watsup rule loop{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, t_1^k : valtype^k, t_2^n : valtype^n, n : n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], (val : val <: admininstr)^k{val} :: (instr : instr <: admininstr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) ;; 8-reduction.watsup rule br_on_cast-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: @@ -4468,15 +4468,15 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule call_ref-null{z : state, ht : heaptype, x? : idx?}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule call_ref-func{z : state, val^n : val^n, n : n, a : addr, x? : idx?, m : m, f : frame, instr* : instr*, fi : funcinst, t_1^n : valtype^n, t_2^m : valtype^m, y : idx, t* : valtype*}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr})])]) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) -- if ($funcinst(z)[a] = fi) - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) - -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) + -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t : valtype}, instr*{instr : instr})) + -- if (f = {LOCAL ?(val)^n{val : val} :: $default(t)*{t : valtype}, MODULE fi.MODULE_funcinst}) ;; 8-reduction.watsup rule return_call{z : state, x : idx}: @@ -4484,16 +4484,16 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule return_call_ref-label{z : state, k : nat, instr'* : instr*, val* : val*, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, (val : val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), (val : val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) + `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) ;; 8-reduction.watsup rule return_call_ref-frame-addr{z : state, k : nat, f : frame, val'* : val*, val^n : val^n, n : n, a : addr, x? : idx?, instr* : instr*, t_1^n : valtype^n, t_2^m : valtype^m, m : m}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) ;; 8-reduction.watsup rule return_call_ref-frame-null{z : state, k : nat, f : frame, val* : val*, ht : heaptype, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule ref.func{z : state, x : idx}: @@ -4523,19 +4523,19 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule struct.new_default{z : state, x : idx, val* : val*, mut* : mut*, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val} :: [STRUCT.NEW_admininstr(x)]) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpack(zt)) = ?(val)))*{val zt} + `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 8-reduction.watsup rule struct.get-null{z : state, ht : heaptype, sx? : sx?, x : idx, i : nat}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, `%`(i))]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) ;; 8-reduction.watsup rule struct.get-struct{z : state, a : addr, sx? : sx?, x : idx, i : nat, zt* : storagetype*, si : structinst, mut* : mut*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, `%`(i))]), [($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]) : val <: admininstr)]) + `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) -- if ($structinst(z)[a] = si) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) ;; 8-reduction.watsup rule array.new{z : state, val : val, n : n, x : idx}: @@ -4554,8 +4554,8 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.new_elem-alloc{z : state, i : nat, n : n, x : idx, y : idx, ref^n : ref^n}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- if (ref^n{ref : ref} = $elem(z, y).ELEM_eleminst[i : n]) ;; 8-reduction.watsup rule array.new_data-oob{z : state, i : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: @@ -4565,30 +4565,30 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.new_data-num{z : state, i : nat, n : n, x : idx, y : idx, nt : numtype, c^n : num_(nt)^n, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (nt = $nunpack(zt)) - -- if ($concat_(syntax byte, $nbytes(nt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) + -- if ($concat_(syntax byte, $nbytes(nt, c)^n{c : num_(nt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) ;; 8-reduction.watsup rule array.new_data-vec{z : state, i : nat, n : n, x : idx, y : idx, vt : vectype, c^n : vec_(vt)^n, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (vt = $vunpack(zt)) - -- if ($concat_(syntax byte, $vbytes(vt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) + -- if ($concat_(syntax byte, $vbytes(vt, c)^n{c : vec_(vt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) ;; 8-reduction.watsup rule array.get-null{z : state, ht : heaptype, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.get-oob{z : state, a : addr, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.get-array{z : state, a : addr, i : nat, sx? : sx?, x : idx, zt : storagetype, fv : fieldval, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [($unpackval(zt, sx?{sx}, fv) : val <: admininstr)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) @@ -4647,18 +4647,18 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.copy-le{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) + -- if (sx?{sx : sx} = $sxfield(zt_2)) -- if (i_1 <= i_2) ;; 8-reduction.watsup rule array.copy-gt{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) + -- if (sx?{sx : sx} = $sxfield(zt_2)) ;; 8-reduction.watsup rule array.init_elem-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: @@ -4839,9 +4839,9 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule vload-shape-val{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop, c : vec_(V128_vnn), j^N : nat^N, k^N : nat^N, inn : inn}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) - -- (if ($ibytes(M, `%`(j)) = $mem(z, x).DATA_meminst[((i + mo.OFFSET_memop.`%`.0) + ((k * M) / 8)) : (M / 8)]))^(k%*`(config, admininstr*) relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule pure{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr'})) - -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr}, (instr' : instr <: admininstr)*{instr'}) + `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule read{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr'})) - -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), (instr' : instr <: admininstr)*{instr'}) + `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule struct.new{z : state, val^n : val^n, n : n, x : idx, si : structinst, mut^n : mut^n, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) - -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) + `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut : mut zt : storagetype})) + -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val zt : storagetype}}) ;; 8-reduction.watsup rule struct.set-null{z : state, ht : heaptype, val : val, x : idx, i : nat}: @@ -4964,14 +4964,14 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule struct.set-struct{z : state, a : addr, val : val, x : idx, i : nat, fv : fieldval, mut* : mut*, zt* : storagetype*}: `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`($with_struct(z, a, i, fv), [])) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- if (fv = $packval(zt*{zt}[i], val)) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- if (fv = $packval(zt*{zt : storagetype}[i], val)) ;; 8-reduction.watsup rule array.new_fixed{z : state, val^n : val^n, n : n, x : idx, ai : arrayinst, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) + -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val}}) ;; 8-reduction.watsup rule array.set-null{z : state, ht : heaptype, i : nat, val : val, x : idx}: @@ -5026,8 +5026,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule store-num-val{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b}), [])) - -- if (b*{b} = $nbytes(nt, c)) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) + -- if (b*{b : byte} = $nbytes(nt, c)) ;; 8-reduction.watsup rule store-pack-oob{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop}: @@ -5036,8 +5036,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule store-pack-val{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b}), [])) - -- if (b*{b} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c))) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) + -- if (b*{b : byte} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c))) ;; 8-reduction.watsup rule vstore-oob{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop}: @@ -5046,8 +5046,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule vstore-val{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b}), [])) - -- if (b*{b} = $vbytes(V128_vectype, c)) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) + -- if (b*{b : byte} = $vbytes(V128_vectype, c)) ;; 8-reduction.watsup rule vstore_lane-oob{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: @@ -5056,10 +5056,10 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule vstore_lane-val{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, b* : byte*, imm : imm, M : M}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b}), [])) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = (128 / N)) - -- if (b*{b} = $ibytes(N, `%`($lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)[j].`%`.0))) + -- if (b*{b : byte} = $ibytes(N, `%`($lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)[j].`%`.0))) ;; 8-reduction.watsup rule memory.grow-succeed{z : state, n : n, x : idx, mi : meminst}: @@ -5081,21 +5081,21 @@ rec { relation Steps: `%~>*%`(config, config) ;; 8-reduction.watsup:18.1-19.36 rule refl{z : state, admininstr* : admininstr*}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) + `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z, admininstr*{admininstr : admininstr})) ;; 8-reduction.watsup:21.1-24.53 rule trans{z : state, admininstr* : admininstr*, z'' : state, admininstr''* : admininstr*, z' : state, admininstr' : admininstr}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z'', admininstr''*{admininstr''})) - -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z', admininstr'*{})) - -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr''})) + `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) + -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z', admininstr'*{})) + -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) } ;; 8-reduction.watsup relation Eval_expr: `%;%~>*%;%*`(state, expr, state, val*) ;; 8-reduction.watsup rule _{z : state, instr* : instr*, z' : state, val* : val*}: - `%;%~>*%;%*`(z, instr*{instr}, z', val*{val}) - -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z', (val : val <: admininstr)*{val})) + `%;%~>*%;%*`(z, instr*{instr : instr}, z', val*{val : val}) + -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z', (val : val <: admininstr)*{val : val})) ;; 9-module.watsup rec { @@ -5105,18 +5105,18 @@ def $alloctypes(type*) : deftype* ;; 9-module.watsup:8.1-8.27 def $alloctypes([]) = [] ;; 9-module.watsup:9.1-13.24 - def $alloctypes{type'* : type*, type : type, deftype'* : deftype*, deftype* : deftype*, rectype : rectype, x : idx}(type'*{type'} :: [type]) = deftype'*{deftype'} :: deftype*{deftype} - -- if (deftype'*{deftype'} = $alloctypes(type'*{type'})) + def $alloctypes{type'* : type*, type : type, deftype'* : deftype*, deftype* : deftype*, rectype : rectype, x : idx}(type'*{type' : type} :: [type]) = deftype'*{deftype' : deftype} :: deftype*{deftype : deftype} + -- if (deftype'*{deftype' : deftype} = $alloctypes(type'*{type' : type})) -- if (type = TYPE(rectype)) - -- if (deftype*{deftype} = $subst_all_deftypes($rolldt(x, rectype), (deftype' : deftype <: heaptype)*{deftype'})) - -- if (x = `%`(|deftype'*{deftype'}|)) + -- if (deftype*{deftype : deftype} = $subst_all_deftypes($rolldt(x, rectype), (deftype' : deftype <: heaptype)*{deftype' : deftype})) + -- if (x = `%`(|deftype'*{deftype' : deftype}|)) } ;; 9-module.watsup def $allocfunc(store : store, moduleinst : moduleinst, func : func) : (store, funcaddr) ;; 9-module.watsup def $allocfunc{s : store, mm : moduleinst, func : func, fi : funcinst, x : idx, local* : local*, expr : expr}(s, mm, func) = (s[FUNC_store =.. [fi]], |s.FUNC_store|) - -- if (func = `FUNC%%*%`(x, local*{local}, expr)) + -- if (func = `FUNC%%*%`(x, local*{local : local}, expr)) -- if (fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func}) ;; 9-module.watsup @@ -5127,9 +5127,9 @@ def $allocfuncs(store : store, moduleinst : moduleinst, func*) : (store, funcadd ;; 9-module.watsup:21.1-21.39 def $allocfuncs{s : store, mm : moduleinst}(s, mm, []) = (s, []) ;; 9-module.watsup:22.1-24.51 - def $allocfuncs{s : store, mm : moduleinst, func : func, func'* : func*, s_2 : store, fa : funcaddr, fa'* : funcaddr*, s_1 : store}(s, mm, [func] :: func'*{func'}) = (s_2, [fa] :: fa'*{fa'}) + def $allocfuncs{s : store, mm : moduleinst, func : func, func'* : func*, s_2 : store, fa : funcaddr, fa'* : funcaddr*, s_1 : store}(s, mm, [func] :: func'*{func' : func}) = (s_2, [fa] :: fa'*{fa' : funcaddr}) -- if ((s_1, fa) = $allocfunc(s, mm, func)) - -- if ((s_2, fa'*{fa'}) = $allocfuncs(s_1, mm, func'*{func'})) + -- if ((s_2, fa'*{fa' : funcaddr}) = $allocfuncs(s_1, mm, func'*{func' : func})) } ;; 9-module.watsup @@ -5146,9 +5146,9 @@ def $allocglobals(store : store, globaltype*, val*) : (store, globaladdr*) ;; 9-module.watsup:31.1-31.42 def $allocglobals{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:32.1-34.62 - def $allocglobals{s : store, globaltype : globaltype, globaltype'* : globaltype*, val : val, val'* : val*, s_2 : store, ga : globaladdr, ga'* : globaladdr*, s_1 : store}(s, [globaltype] :: globaltype'*{globaltype'}, [val] :: val'*{val'}) = (s_2, [ga] :: ga'*{ga'}) + def $allocglobals{s : store, globaltype : globaltype, globaltype'* : globaltype*, val : val, val'* : val*, s_2 : store, ga : globaladdr, ga'* : globaladdr*, s_1 : store}(s, [globaltype] :: globaltype'*{globaltype' : globaltype}, [val] :: val'*{val' : val}) = (s_2, [ga] :: ga'*{ga' : globaladdr}) -- if ((s_1, ga) = $allocglobal(s, globaltype, val)) - -- if ((s_2, ga'*{ga'}) = $allocglobals(s_1, globaltype'*{globaltype'}, val'*{val'})) + -- if ((s_2, ga'*{ga' : globaladdr}) = $allocglobals(s_1, globaltype'*{globaltype' : globaltype}, val'*{val' : val})) } ;; 9-module.watsup @@ -5165,9 +5165,9 @@ def $alloctables(store : store, tabletype*, ref*) : (store, tableaddr*) ;; 9-module.watsup:41.1-41.41 def $alloctables{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:42.1-44.60 - def $alloctables{s : store, tabletype : tabletype, tabletype'* : tabletype*, ref : ref, ref'* : ref*, s_2 : store, ta : tableaddr, ta'* : tableaddr*, s_1 : store}(s, [tabletype] :: tabletype'*{tabletype'}, [ref] :: ref'*{ref'}) = (s_2, [ta] :: ta'*{ta'}) + def $alloctables{s : store, tabletype : tabletype, tabletype'* : tabletype*, ref : ref, ref'* : ref*, s_2 : store, ta : tableaddr, ta'* : tableaddr*, s_1 : store}(s, [tabletype] :: tabletype'*{tabletype' : tabletype}, [ref] :: ref'*{ref' : ref}) = (s_2, [ta] :: ta'*{ta' : tableaddr}) -- if ((s_1, ta) = $alloctable(s, tabletype, ref)) - -- if ((s_2, ta'*{ta'}) = $alloctables(s_1, tabletype'*{tabletype'}, ref'*{ref'})) + -- if ((s_2, ta'*{ta' : tableaddr}) = $alloctables(s_1, tabletype'*{tabletype' : tabletype}, ref'*{ref' : ref})) } ;; 9-module.watsup @@ -5184,16 +5184,16 @@ def $allocmems(store : store, memtype*) : (store, memaddr*) ;; 9-module.watsup:51.1-51.34 def $allocmems{s : store}(s, []) = (s, []) ;; 9-module.watsup:52.1-54.49 - def $allocmems{s : store, memtype : memtype, memtype'* : memtype*, s_2 : store, ma : memaddr, ma'* : memaddr*, s_1 : store}(s, [memtype] :: memtype'*{memtype'}) = (s_2, [ma] :: ma'*{ma'}) + def $allocmems{s : store, memtype : memtype, memtype'* : memtype*, s_2 : store, ma : memaddr, ma'* : memaddr*, s_1 : store}(s, [memtype] :: memtype'*{memtype' : memtype}) = (s_2, [ma] :: ma'*{ma' : memaddr}) -- if ((s_1, ma) = $allocmem(s, memtype)) - -- if ((s_2, ma'*{ma'}) = $allocmems(s_1, memtype'*{memtype'})) + -- if ((s_2, ma'*{ma' : memaddr}) = $allocmems(s_1, memtype'*{memtype' : memtype})) } ;; 9-module.watsup def $allocelem(store : store, reftype : reftype, ref*) : (store, elemaddr) ;; 9-module.watsup - def $allocelem{s : store, rt : reftype, ref* : ref*, ei : eleminst}(s, rt, ref*{ref}) = (s[ELEM_store =.. [ei]], |s.ELEM_store|) - -- if (ei = {TYPE rt, ELEM ref*{ref}}) + def $allocelem{s : store, rt : reftype, ref* : ref*, ei : eleminst}(s, rt, ref*{ref : ref}) = (s[ELEM_store =.. [ei]], |s.ELEM_store|) + -- if (ei = {TYPE rt, ELEM ref*{ref : ref}}) ;; 9-module.watsup rec { @@ -5203,16 +5203,16 @@ def $allocelems(store : store, reftype*, ref**) : (store, elemaddr*) ;; 9-module.watsup:61.1-61.40 def $allocelems{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:62.1-64.55 - def $allocelems{s : store, rt : reftype, rt'* : reftype*, ref* : ref*, ref'** : ref**, s_2 : store, ea : elemaddr, ea'* : elemaddr*, s_1 : store}(s, [rt] :: rt'*{rt'}, [ref*{ref}] :: ref'*{ref'}*{ref'}) = (s_2, [ea] :: ea'*{ea'}) - -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref})) - -- if ((s_2, ea'*{ea'}) = $allocelems(s_2, rt'*{rt'}, ref'*{ref'}*{ref'})) + def $allocelems{s : store, rt : reftype, rt'* : reftype*, ref* : ref*, ref'** : ref**, s_2 : store, ea : elemaddr, ea'* : elemaddr*, s_1 : store}(s, [rt] :: rt'*{rt' : reftype}, [ref*{ref : ref}] :: ref'*{ref' : ref}*{ref' : ref}) = (s_2, [ea] :: ea'*{ea' : elemaddr}) + -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref : ref})) + -- if ((s_2, ea'*{ea' : elemaddr}) = $allocelems(s_2, rt'*{rt' : reftype}, ref'*{ref' : ref}*{ref' : ref})) } ;; 9-module.watsup def $allocdata(store : store, byte*) : (store, dataaddr) ;; 9-module.watsup - def $allocdata{s : store, byte* : byte*, di : datainst}(s, byte*{byte}) = (s[DATA_store =.. [di]], |s.DATA_store|) - -- if (di = {DATA byte*{byte}}) + def $allocdata{s : store, byte* : byte*, di : datainst}(s, byte*{byte : byte}) = (s[DATA_store =.. [di]], |s.DATA_store|) + -- if (di = {DATA byte*{byte : byte}}) ;; 9-module.watsup rec { @@ -5222,92 +5222,92 @@ def $allocdatas(store : store, byte**) : (store, dataaddr*) ;; 9-module.watsup:71.1-71.35 def $allocdatas{s : store}(s, []) = (s, []) ;; 9-module.watsup:72.1-74.50 - def $allocdatas{s : store, byte* : byte*, byte'** : byte**, s_2 : store, da : dataaddr, da'* : dataaddr*, s_1 : store}(s, [byte*{byte}] :: byte'*{byte'}*{byte'}) = (s_2, [da] :: da'*{da'}) - -- if ((s_1, da) = $allocdata(s, byte*{byte})) - -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) + def $allocdatas{s : store, byte* : byte*, byte'** : byte**, s_2 : store, da : dataaddr, da'* : dataaddr*, s_1 : store}(s, [byte*{byte : byte}] :: byte'*{byte' : byte}*{byte' : byte}) = (s_2, [da] :: da'*{da' : dataaddr}) + -- if ((s_1, da) = $allocdata(s, byte*{byte : byte})) + -- if ((s_2, da'*{da' : dataaddr}) = $allocdatas(s_1, byte'*{byte' : byte}*{byte' : byte})) } ;; 9-module.watsup def $instexport(funcaddr*, globaladdr*, tableaddr*, memaddr*, export : export) : exportinst ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa : funcaddr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga : globaladdr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta : tableaddr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma : memaddr}[x.`%`.0])} ;; 9-module.watsup def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) : (store, moduleinst) ;; 9-module.watsup - def $allocmodule{s : store, module : module, externval* : externval*, val_g* : val*, ref_t* : ref*, ref_e** : ref**, s_6 : store, mm : moduleinst, type* : type*, import* : import*, func^n_f : func^n_f, n_f : n, globaltype^n_g : globaltype^n_g, expr_g^n_g : expr^n_g, n_g : n, tabletype^n_t : tabletype^n_t, expr_t^n_t : expr^n_t, n_t : n, memtype^n_m : memtype^n_m, n_m : n, reftype^n_e : reftype^n_e, expr_e*^n_e : expr*^n_e, elemmode^n_e : elemmode^n_e, n_e : n, byte*^n_d : byte*^n_d, datamode^n_d : datamode^n_d, n_d : n, start? : start?, export* : export*, fa_ex* : funcaddr*, ga_ex* : globaladdr*, ta_ex* : tableaddr*, ma_ex* : memaddr*, fa* : funcaddr*, i_f^n_f : nat^n_f, ga* : globaladdr*, i_g^n_g : nat^n_g, ta* : tableaddr*, i_t^n_t : nat^n_t, ma* : memaddr*, i_m^n_m : nat^n_m, ea* : elemaddr*, i_e^n_e : nat^n_e, da* : dataaddr*, i_d^n_d : nat^n_d, xi* : exportinst*, dt* : deftype*, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store}(s, module, externval*{externval}, val_g*{val_g}, ref_t*{ref_t}, ref_e*{ref_e}*{ref_e}) = (s_6, mm) - -- if (module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type}, import*{import}, func^n_f{func}, GLOBAL(globaltype, expr_g)^n_g{expr_g globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t tabletype}, MEMORY(memtype)^n_m{memtype}, `ELEM%%*%`(reftype, expr_e*{expr_e}, elemmode)^n_e{elemmode expr_e reftype}, `DATA%*%`(byte*{byte}, datamode)^n_d{byte datamode}, start?{start}, export*{export})) - -- if (fa_ex*{fa_ex} = $funcsxv(externval*{externval})) - -- if (ga_ex*{ga_ex} = $globalsxv(externval*{externval})) - -- if (ta_ex*{ta_ex} = $tablesxv(externval*{externval})) - -- if (ma_ex*{ma_ex} = $memsxv(externval*{externval})) - -- if (fa*{fa} = (|s.FUNC_store| + i_f)^(i_f*%;%*`(z, expr_G, z, [val_G]))*{expr_G val_G} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T ref_T} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E ref_E}*{expr_E ref_E} - -- if ((s', mm) = $allocmodule(s, module, externval*{externval}, val_G*{val_G}, ref_T*{ref_T}, ref_E*{ref_E}*{ref_E})) + -- (Eval_expr: `%;%~>*%;%*`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} + -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} + -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} + -- if ((s', mm) = $allocmodule(s, module, externval*{externval : externval}, val_G*{val_G : val}, ref_T*{ref_T : ref}, ref_E*{ref_E : ref}*{ref_E : ref})) -- if (f = {LOCAL [], MODULE mm}) - -- if (instr_E*{instr_E} = $concat_(syntax instr, $runelem(elem*{elem}[i], `%`(i))^(i%`(t_1^n{t_1}, t_2*{t_2}))) + -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = `FUNC%%*%`(x, local*{local : local}, expr)) + -- Expand: `%~~%`(s.FUNC_store[fa].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; A-binary.watsup rec { @@ -5327,7 +5327,7 @@ def $utf8(name : name) : byte* def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([`%`(ch)]) = [b_1 b_2 b_3 b_4] -- if (((65536 <= ch) /\ (ch < 69632)) /\ (ch = (((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128)))) ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(`%`(ch)*{ch}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch}) + def $utf8{ch* : nat*}(`%`(ch)*{ch : nat}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch : nat}) } ;; A-binary.watsup @@ -5347,14 +5347,14 @@ syntax B = nat ;; C-conventions.watsup syntax sym = - | _FIRST(A_1 : A) + | _FIRST{A_1 : A}(A_1 : A) | _DOTS - | _LAST(A_n : A) + | _LAST{A_n : A}(A_n : A) ;; C-conventions.watsup syntax symsplit = - | _FIRST(A_1 : A) - | _LAST(A_2 : A) + | _FIRST{A_1 : A}(A_1 : A) + | _LAST{A_2 : A}(A_2 : A) ;; C-conventions.watsup syntax recorddots = `...` @@ -5362,21 +5362,21 @@ syntax recorddots = `...` ;; C-conventions.watsup syntax record = { - FIELD_1 A, - FIELD_2 A, - DOTS recorddots + FIELD_1{A_1 : A} A, + FIELD_2{A_2 : A} A, + DOTS{recorddots : recorddots} recorddots } ;; C-conventions.watsup syntax recordstar = { - FIELD_1 A*, - FIELD_2 A*, - DOTS recorddots + FIELD_1{A_1* : A*} A*, + FIELD_2{A_2* : A*} A*, + DOTS{recorddots : recorddots} recorddots } ;; C-conventions.watsup -syntax recordeq = `%++%=%`(recordstar : recordstar, recordstar : recordstar, recordstar : recordstar) +syntax recordeq = `%++%=%`{recordstar : recordstar}(recordstar : recordstar, recordstar, recordstar) ;; C-conventions.watsup syntax pth = @@ -5432,7 +5432,7 @@ def $sum(nat*) : nat ;; 0-aux.watsup:33.1-33.18 def $sum([]) = 0 ;; 0-aux.watsup:34.1-34.35 - def $sum{n : n, n'* : n*}([n] :: n'*{n'}) = (n + $sum(n'*{n'})) + def $sum{n : n, n'* : n*}([n] :: n'*{n' : nat}) = (n + $sum(n'*{n' : nat})) } ;; 0-aux.watsup @@ -5443,7 +5443,7 @@ def $concat_(syntax X, X**) : X* ;; 0-aux.watsup:40.1-40.34 def $concat_{syntax X}(syntax X, []) = [] ;; 0-aux.watsup:41.1-41.61 - def $concat_{syntax X, w* : X*, w'** : X**}(syntax X, [w*{w}] :: w'*{w'}*{w'}) = w*{w} :: $concat_(syntax X, w'*{w'}*{w'}) + def $concat_{syntax X, w* : X*, w'** : X**}(syntax X, [w*{w : X}] :: w'*{w' : X}*{w' : X}) = w*{w : X} :: $concat_(syntax X, w'*{w' : X}*{w' : X}) } ;; 1-syntax.watsup @@ -5532,8 +5532,8 @@ syntax fNmag{N : N}(N) = ;; 1-syntax.watsup syntax fN{N : N}(N) = - | POS(fNmag : fNmag(N)) - | NEG(fNmag : fNmag(N)) + | POS{fNmag : fNmag(N)}(fNmag : fNmag(N)) + | NEG{fNmag : fNmag(N)}(fNmag : fNmag(N)) ;; 1-syntax.watsup syntax f32 = fN(32) @@ -5636,7 +5636,7 @@ syntax valtype = | F32 | F64 | V128 - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | BOT ;; 1-syntax.watsup:154.1-155.16 @@ -5650,15 +5650,15 @@ syntax storagetype = | F32 | F64 | V128 - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | I8 | I16 ;; 1-syntax.watsup:175.1-176.18 -syntax fieldtype = `%%`(mut : mut, storagetype : storagetype) +syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) ;; 1-syntax.watsup:178.1-178.70 -syntax functype = `%->%`(resulttype : resulttype, resulttype : resulttype) +syntax functype = `%->%`{resulttype : resulttype}(resulttype : resulttype, resulttype) ;; 1-syntax.watsup:179.1-179.64 syntax structtype = list(syntax fieldtype) @@ -5668,22 +5668,22 @@ syntax arraytype = fieldtype ;; 1-syntax.watsup:182.1-185.18 syntax comptype = - | STRUCT(structtype : structtype) - | ARRAY(arraytype : arraytype) - | FUNC(functype : functype) + | STRUCT{structtype : structtype}(structtype : structtype) + | ARRAY{arraytype : arraytype}(arraytype : arraytype) + | FUNC{functype : functype}(functype : functype) ;; 1-syntax.watsup:189.1-190.60 syntax subtype = - | SUB(fin : fin, typeidx*, comptype : comptype) - | SUBD(fin : fin, heaptype*, comptype : comptype) + | SUB{fin : fin, typeidx* : typeidx*, comptype : comptype}(fin : fin, typeidx*{typeidx : typeidx} : typeidx*, comptype : comptype) + | SUBD{fin : fin, heaptype* : heaptype*, comptype : comptype}(fin : fin, heaptype*{heaptype : heaptype} : heaptype*, comptype : comptype) ;; 1-syntax.watsup:192.1-193.22 syntax rectype = - | REC(list : list(syntax subtype)) + | REC{list : list(syntax subtype)}(list : list(syntax subtype)) ;; 1-syntax.watsup:198.1-199.26 syntax heaptype = - | _IDX(typeidx : typeidx) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY | EQ | I31 @@ -5695,13 +5695,13 @@ syntax heaptype = | EXTERN | NOEXTERN | BOT - | DEF(rectype : rectype, nat : nat) - | REC(n : n) + | DEF{rectype : rectype}(rectype : rectype, nat) + | REC{n : n}(n : n) } ;; 1-syntax.watsup syntax reftype = - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) ;; 1-syntax.watsup syntax inn = @@ -5754,19 +5754,19 @@ syntax imm = ;; 1-syntax.watsup syntax deftype = - | DEF(rectype : rectype, nat : nat) + | DEF{rectype : rectype}(rectype : rectype, nat) ;; 1-syntax.watsup -syntax limits = `[%..%]`(u32 : u32, u32 : u32) +syntax limits = `[%..%]`{u32 : u32}(u32 : u32, u32) ;; 1-syntax.watsup -syntax globaltype = `%%`(mut : mut, valtype : valtype) +syntax globaltype = `%%`{mut : mut, valtype : valtype}(mut : mut, valtype : valtype) ;; 1-syntax.watsup -syntax tabletype = `%%`(limits : limits, reftype : reftype) +syntax tabletype = `%%`{limits : limits, reftype : reftype}(limits : limits, reftype : reftype) ;; 1-syntax.watsup -syntax memtype = `%I8`(limits : limits) +syntax memtype = `%I8`{limits : limits}(limits : limits) ;; 1-syntax.watsup syntax elemtype = reftype @@ -5776,10 +5776,10 @@ syntax datatype = OK ;; 1-syntax.watsup syntax externtype = - | FUNC(deftype : deftype) - | GLOBAL(globaltype : globaltype) - | TABLE(tabletype : tabletype) - | MEM(memtype : memtype) + | FUNC{deftype : deftype}(deftype : deftype) + | GLOBAL{globaltype : globaltype}(globaltype : globaltype) + | TABLE{tabletype : tabletype}(tabletype : tabletype) + | MEM{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup def $size(numtype : numtype) : nat @@ -5825,7 +5825,7 @@ syntax dim = `%`{i : nat}(i : nat) -- if (((((i = 1) \/ (i = 2)) \/ (i = 4)) \/ (i = 8)) \/ (i = 16)) ;; 1-syntax.watsup -syntax shape = `%X%`(lanetype : lanetype, dim : dim) +syntax shape = `%X%`{lanetype : lanetype, dim : dim}(lanetype : lanetype, dim : dim) ;; 1-syntax.watsup def $lanetype(shape : shape) : lanetype @@ -5893,7 +5893,7 @@ syntax unop_(numtype : numtype) | CLZ | CTZ | POPCNT - | EXTEND(n : n) + | EXTEND{n : n}(n : n) ;; 1-syntax.watsup @@ -5914,13 +5914,13 @@ syntax binop_(numtype : numtype) | ADD | SUB | MUL - | DIV(sx : sx) - | REM(sx : sx) + | DIV{sx : sx}(sx : sx) + | REM{sx : sx}(sx : sx) | AND | OR | XOR | SHL - | SHR(sx : sx) + | SHR{sx : sx}(sx : sx) | ROTL | ROTR @@ -5946,10 +5946,10 @@ syntax relop_(numtype : numtype) syntax relop_{inn : inn}((inn : inn <: numtype)) = | EQ | NE - | LT(sx : sx) - | GT(sx : sx) - | LE(sx : sx) - | GE(sx : sx) + | LT{sx : sx}(sx : sx) + | GT{sx : sx}(sx : sx) + | LE{sx : sx}(sx : sx) + | GE{sx : sx}(sx : sx) ;; 1-syntax.watsup @@ -5969,13 +5969,13 @@ syntax cvtop = | REINTERPRET ;; 1-syntax.watsup -syntax ishape = `%X%`(imm : imm, dim : dim) +syntax ishape = `%X%`{imm : imm, dim : dim}(imm : imm, dim : dim) ;; 1-syntax.watsup -syntax fshape = `%X%`(fnn : fnn, dim : dim) +syntax fshape = `%X%`{fnn : fnn, dim : dim}(fnn : fnn, dim : dim) ;; 1-syntax.watsup -syntax pshape = `%X%`(pnn : pnn, dim : dim) +syntax pshape = `%X%`{pnn : pnn, dim : dim}(pnn : pnn, dim : dim) ;; 1-syntax.watsup def $dim(shape : shape) : dim @@ -6033,9 +6033,9 @@ syntax vbinop_(shape : shape) syntax vbinop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ADD | SUB - | ADD_SAT(sx : sx) + | ADD_SAT{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 16) - | SUB_SAT(sx : sx) + | SUB_SAT{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 16) | MUL -- if ($lsize((imm : imm <: lanetype)) >= 16) @@ -6043,9 +6043,9 @@ syntax vbinop_(shape : shape) -- if ($lsize((imm : imm <: lanetype)) <= 16) | Q15MULR_SAT_S{imm : imm} -- if ($lsize((imm : imm <: lanetype)) = 16) - | MIN(sx : sx) + | MIN{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 32) - | MAX(sx : sx) + | MAX{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 32) @@ -6071,10 +6071,10 @@ syntax vrelop_(shape : shape) syntax vrelop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | EQ | NE - | LT(sx : sx) - | GT(sx : sx) - | LE(sx : sx) - | GE(sx : sx) + | LT{sx : sx}(sx : sx) + | GT{sx : sx}(sx : sx) + | LE{sx : sx}(sx : sx) + | GE{sx : sx}(sx : sx) ;; 1-syntax.watsup @@ -6098,7 +6098,7 @@ syntax vcvtop = ;; 1-syntax.watsup syntax vshiftop_{imm : imm, N : N}(`%X%`(imm, `%`(N))) = | SHL - | SHR(sx : sx) + | SHR{sx : sx}(sx : sx) ;; 1-syntax.watsup syntax vextunop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = @@ -6112,27 +6112,27 @@ syntax half = ;; 1-syntax.watsup syntax vextbinop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = - | EXTMUL(half : half) + | EXTMUL{half : half}(half : half) | DOT{imm_1 : imm} -- if ($lsize((imm_1 : imm <: lanetype)) = 32) ;; 1-syntax.watsup syntax memop = { - ALIGN u32, - OFFSET u32 + ALIGN{u32 : u32} u32, + OFFSET{u32 : u32} u32 } ;; 1-syntax.watsup syntax vloadop = - | SHAPE(nat : nat, nat : nat, sx : sx) - | SPLAT(nat : nat) - | ZERO(nat : nat) + | SHAPE{sx : sx}(nat, nat, sx : sx) + | SPLAT(nat) + | ZERO(nat) ;; 1-syntax.watsup syntax blocktype = - | _RESULT(valtype?) - | _IDX(funcidx : funcidx) + | _RESULT{valtype? : valtype?}(valtype?{valtype : valtype} : valtype?) + | _IDX{funcidx : funcidx}(funcidx : funcidx) ;; 1-syntax.watsup syntax zero = `ZERO%?`(()?) @@ -6145,108 +6145,108 @@ syntax instr = | UNREACHABLE | NOP | DROP - | SELECT(valtype*?) - | BLOCK(blocktype : blocktype, instr*) - | LOOP(blocktype : blocktype, instr*) - | IF(blocktype : blocktype, instr*, instr*) - | BR(labelidx : labelidx) - | BR_IF(labelidx : labelidx) - | BR_TABLE(labelidx*, labelidx : labelidx) - | BR_ON_NULL(labelidx : labelidx) - | BR_ON_NON_NULL(labelidx : labelidx) - | BR_ON_CAST(labelidx : labelidx, reftype : reftype, reftype : reftype) - | BR_ON_CAST_FAIL(labelidx : labelidx, reftype : reftype, reftype : reftype) - | CALL(funcidx : funcidx) - | CALL_REF(typeidx?) - | CALL_INDIRECT(tableidx : tableidx, typeidx : typeidx) + | SELECT{valtype*? : valtype*?}(valtype*{valtype : valtype}?{valtype : valtype} : valtype*?) + | BLOCK{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*) + | LOOP{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*) + | IF{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*, instr*) + | BR{labelidx : labelidx}(labelidx : labelidx) + | BR_IF{labelidx : labelidx}(labelidx : labelidx) + | BR_TABLE{labelidx : labelidx}(labelidx*{} : labelidx*, labelidx) + | BR_ON_NULL{labelidx : labelidx}(labelidx : labelidx) + | BR_ON_NON_NULL{labelidx : labelidx}(labelidx : labelidx) + | BR_ON_CAST{labelidx : labelidx, reftype : reftype}(labelidx : labelidx, reftype : reftype, reftype) + | BR_ON_CAST_FAIL{labelidx : labelidx, reftype : reftype}(labelidx : labelidx, reftype : reftype, reftype) + | CALL{funcidx : funcidx}(funcidx : funcidx) + | CALL_REF{typeidx? : typeidx?}(typeidx?{typeidx : typeidx} : typeidx?) + | CALL_INDIRECT{tableidx : tableidx, typeidx : typeidx}(tableidx : tableidx, typeidx : typeidx) | RETURN - | RETURN_CALL(funcidx : funcidx) - | RETURN_CALL_REF(typeidx?) - | RETURN_CALL_INDIRECT(tableidx : tableidx, typeidx : typeidx) - | CONST(numtype : numtype, num_ : num_(numtype)) - | UNOP(numtype : numtype, unop_ : unop_(numtype)) - | BINOP(numtype : numtype, binop_ : binop_(numtype)) - | TESTOP(numtype : numtype, testop_ : testop_(numtype)) - | RELOP(numtype : numtype, relop_ : relop_(numtype)) - | CVTOP(numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx?) - | EXTEND(numtype : numtype, n : n) - | VCONST(vectype : vectype, vec_ : vec_(vectype)) - | VVUNOP(vectype : vectype, vvunop : vvunop) - | VVBINOP(vectype : vectype, vvbinop : vvbinop) - | VVTERNOP(vectype : vectype, vvternop : vvternop) - | VVTESTOP(vectype : vectype, vvtestop : vvtestop) + | RETURN_CALL{funcidx : funcidx}(funcidx : funcidx) + | RETURN_CALL_REF{typeidx? : typeidx?}(typeidx?{typeidx : typeidx} : typeidx?) + | RETURN_CALL_INDIRECT{tableidx : tableidx, typeidx : typeidx}(tableidx : tableidx, typeidx : typeidx) + | CONST{numtype : numtype, num_ : num_(numtype)}(numtype : numtype, num_ : num_(numtype)) + | UNOP{numtype : numtype, unop_ : unop_(numtype)}(numtype : numtype, unop_ : unop_(numtype)) + | BINOP{numtype : numtype, binop_ : binop_(numtype)}(numtype : numtype, binop_ : binop_(numtype)) + | TESTOP{numtype : numtype, testop_ : testop_(numtype)}(numtype : numtype, testop_ : testop_(numtype)) + | RELOP{numtype : numtype, relop_ : relop_(numtype)}(numtype : numtype, relop_ : relop_(numtype)) + | CVTOP{numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx? : sx?}(numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx?{sx : sx} : sx?) + | EXTEND{numtype : numtype, n : n}(numtype : numtype, n : n) + | VCONST{vectype : vectype, vec_ : vec_(vectype)}(vectype : vectype, vec_ : vec_(vectype)) + | VVUNOP{vectype : vectype, vvunop : vvunop}(vectype : vectype, vvunop : vvunop) + | VVBINOP{vectype : vectype, vvbinop : vvbinop}(vectype : vectype, vvbinop : vvbinop) + | VVTERNOP{vectype : vectype, vvternop : vvternop}(vectype : vectype, vvternop : vvternop) + | VVTESTOP{vectype : vectype, vvtestop : vvtestop}(vectype : vectype, vvtestop : vvtestop) | VSWIZZLE{ishape : ishape}(ishape : ishape) -- if (ishape = `%X%`(I8_imm, `%`(16))) - | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*) - -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) - | VSPLAT(shape : shape) - | VEXTRACT_LANE{shape : shape, numtype : numtype, sx? : sx?}(shape : shape, sx?, laneidx : laneidx) - -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx} = ?())) - | VREPLACE_LANE(shape : shape, laneidx : laneidx) - | VUNOP(shape : shape, vunop_ : vunop_(shape)) - | VBINOP(shape : shape, vbinop_ : vbinop_(shape)) - | VTESTOP(shape : shape, vtestop_ : vtestop_(shape)) - | VRELOP(shape : shape, vrelop_ : vrelop_(shape)) - | VSHIFTOP(ishape : ishape, vshiftop_ : vshiftop_(ishape)) - | VBITMASK(ishape : ishape) - | VCVTOP(shape : shape, vcvtop : vcvtop, half?, shape : shape, sx?, zero : zero) - | VNARROW(ishape : ishape, ishape : ishape, sx : sx) - | VEXTUNOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) + | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*{laneidx : laneidx} : laneidx*) + -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx : laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) + | VSPLAT{shape : shape}(shape : shape) + | VEXTRACT_LANE{shape : shape, sx? : sx?, laneidx : laneidx, numtype : numtype}(shape : shape, sx?{sx : sx} : sx?, laneidx : laneidx) + -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx : sx} = ?())) + | VREPLACE_LANE{shape : shape, laneidx : laneidx}(shape : shape, laneidx : laneidx) + | VUNOP{shape : shape, vunop_ : vunop_(shape)}(shape : shape, vunop_ : vunop_(shape)) + | VBINOP{shape : shape, vbinop_ : vbinop_(shape)}(shape : shape, vbinop_ : vbinop_(shape)) + | VTESTOP{shape : shape, vtestop_ : vtestop_(shape)}(shape : shape, vtestop_ : vtestop_(shape)) + | VRELOP{shape : shape, vrelop_ : vrelop_(shape)}(shape : shape, vrelop_ : vrelop_(shape)) + | VSHIFTOP{ishape : ishape, vshiftop_ : vshiftop_(ishape)}(ishape : ishape, vshiftop_ : vshiftop_(ishape)) + | VBITMASK{ishape : ishape}(ishape : ishape) + | VCVTOP{shape : shape, vcvtop : vcvtop, half? : half?, sx? : sx?, zero : zero}(shape : shape, vcvtop : vcvtop, half?{half : half} : half?, shape, sx?{sx : sx} : sx?, zero : zero) + | VNARROW{ishape : ishape, sx : sx}(ishape : ishape, ishape, sx : sx) + | VEXTUNOP{ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | VEXTBINOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) + | VEXTBINOP{ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | REF.NULL(heaptype : heaptype) + | REF.NULL{heaptype : heaptype}(heaptype : heaptype) | REF.I31 - | REF.FUNC(funcidx : funcidx) + | REF.FUNC{funcidx : funcidx}(funcidx : funcidx) | REF.IS_NULL | REF.AS_NON_NULL | REF.EQ - | REF.TEST(reftype : reftype) - | REF.CAST(reftype : reftype) - | I31.GET(sx : sx) - | STRUCT.NEW(typeidx : typeidx) - | STRUCT.NEW_DEFAULT(typeidx : typeidx) - | STRUCT.GET(sx?, typeidx : typeidx, u32 : u32) - | STRUCT.SET(typeidx : typeidx, u32 : u32) - | ARRAY.NEW(typeidx : typeidx) - | ARRAY.NEW_DEFAULT(typeidx : typeidx) - | ARRAY.NEW_FIXED(typeidx : typeidx, nat : nat) - | ARRAY.NEW_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.NEW_ELEM(typeidx : typeidx, elemidx : elemidx) - | ARRAY.GET(sx?, typeidx : typeidx) - | ARRAY.SET(typeidx : typeidx) + | REF.TEST{reftype : reftype}(reftype : reftype) + | REF.CAST{reftype : reftype}(reftype : reftype) + | I31.GET{sx : sx}(sx : sx) + | STRUCT.NEW{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.GET{sx? : sx?, typeidx : typeidx, u32 : u32}(sx?{sx : sx} : sx?, typeidx : typeidx, u32 : u32) + | STRUCT.SET{typeidx : typeidx, u32 : u32}(typeidx : typeidx, u32 : u32) + | ARRAY.NEW{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_FIXED{typeidx : typeidx}(typeidx : typeidx, nat) + | ARRAY.NEW_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.NEW_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) + | ARRAY.GET{sx? : sx?, typeidx : typeidx}(sx?{sx : sx} : sx?, typeidx : typeidx) + | ARRAY.SET{typeidx : typeidx}(typeidx : typeidx) | ARRAY.LEN - | ARRAY.FILL(typeidx : typeidx) - | ARRAY.COPY(typeidx : typeidx, typeidx : typeidx) - | ARRAY.INIT_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.INIT_ELEM(typeidx : typeidx, elemidx : elemidx) + | ARRAY.FILL{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.COPY{typeidx : typeidx}(typeidx : typeidx, typeidx) + | ARRAY.INIT_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.INIT_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) | EXTERN.CONVERT_ANY | ANY.CONVERT_EXTERN - | LOCAL.GET(localidx : localidx) - | LOCAL.SET(localidx : localidx) - | LOCAL.TEE(localidx : localidx) - | GLOBAL.GET(globalidx : globalidx) - | GLOBAL.SET(globalidx : globalidx) - | TABLE.GET(tableidx : tableidx) - | TABLE.SET(tableidx : tableidx) - | TABLE.SIZE(tableidx : tableidx) - | TABLE.GROW(tableidx : tableidx) - | TABLE.FILL(tableidx : tableidx) - | TABLE.COPY(tableidx : tableidx, tableidx : tableidx) - | TABLE.INIT(tableidx : tableidx, elemidx : elemidx) - | ELEM.DROP(elemidx : elemidx) - | MEMORY.SIZE(memidx : memidx) - | MEMORY.GROW(memidx : memidx) - | MEMORY.FILL(memidx : memidx) - | MEMORY.COPY(memidx : memidx, memidx : memidx) - | MEMORY.INIT(memidx : memidx, dataidx : dataidx) - | DATA.DROP(dataidx : dataidx) - | LOAD(numtype : numtype, (n, sx)?, memidx : memidx, memop : memop) - | STORE(numtype : numtype, n?, memidx : memidx, memop : memop) - | VLOAD(vloadop?, memidx : memidx, memop : memop) - | VLOAD_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | VSTORE(memidx : memidx, memop : memop) - | VSTORE_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | LOCAL.GET{localidx : localidx}(localidx : localidx) + | LOCAL.SET{localidx : localidx}(localidx : localidx) + | LOCAL.TEE{localidx : localidx}(localidx : localidx) + | GLOBAL.GET{globalidx : globalidx}(globalidx : globalidx) + | GLOBAL.SET{globalidx : globalidx}(globalidx : globalidx) + | TABLE.GET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SIZE{tableidx : tableidx}(tableidx : tableidx) + | TABLE.GROW{tableidx : tableidx}(tableidx : tableidx) + | TABLE.FILL{tableidx : tableidx}(tableidx : tableidx) + | TABLE.COPY{tableidx : tableidx}(tableidx : tableidx, tableidx) + | TABLE.INIT{tableidx : tableidx, elemidx : elemidx}(tableidx : tableidx, elemidx : elemidx) + | ELEM.DROP{elemidx : elemidx}(elemidx : elemidx) + | MEMORY.SIZE{memidx : memidx}(memidx : memidx) + | MEMORY.GROW{memidx : memidx}(memidx : memidx) + | MEMORY.FILL{memidx : memidx}(memidx : memidx) + | MEMORY.COPY{memidx : memidx}(memidx : memidx, memidx) + | MEMORY.INIT{memidx : memidx, dataidx : dataidx}(memidx : memidx, dataidx : dataidx) + | DATA.DROP{dataidx : dataidx}(dataidx : dataidx) + | LOAD{numtype : numtype, n? : n?, sx? : sx?, memidx : memidx, memop : memop}(numtype : numtype, (n, sx)?{n : n sx : sx} : (n, sx)?, memidx : memidx, memop : memop) + | STORE{numtype : numtype, n? : n?, memidx : memidx, memop : memop}(numtype : numtype, n?{n : n} : n?, memidx : memidx, memop : memop) + | VLOAD{vloadop? : vloadop?, memidx : memidx, memop : memop}(vloadop?{vloadop : vloadop} : vloadop?, memidx : memidx, memop : memop) + | VLOAD_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | VSTORE{memidx : memidx, memop : memop}(memidx : memidx, memop : memop) + | VSTORE_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) } ;; 1-syntax.watsup @@ -6254,57 +6254,57 @@ syntax expr = instr* ;; 1-syntax.watsup syntax elemmode = - | ACTIVE(tableidx : tableidx, expr : expr) + | ACTIVE{tableidx : tableidx, expr : expr}(tableidx : tableidx, expr : expr) | PASSIVE | DECLARE ;; 1-syntax.watsup syntax datamode = - | ACTIVE(memidx : memidx, expr : expr) + | ACTIVE{memidx : memidx, expr : expr}(memidx : memidx, expr : expr) | PASSIVE ;; 1-syntax.watsup -syntax type = TYPE(rectype : rectype) +syntax type = TYPE{rectype : rectype}(rectype : rectype) ;; 1-syntax.watsup -syntax local = LOCAL(valtype : valtype) +syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`(typeidx : typeidx, local*, expr : expr) +syntax func = `FUNC%%*%`{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) ;; 1-syntax.watsup -syntax global = GLOBAL(globaltype : globaltype, expr : expr) +syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) ;; 1-syntax.watsup -syntax table = TABLE(tabletype : tabletype, expr : expr) +syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, expr : expr) ;; 1-syntax.watsup -syntax mem = MEMORY(memtype : memtype) +syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`(reftype : reftype, expr*, elemmode : elemmode) +syntax elem = `ELEM%%*%`{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) ;; 1-syntax.watsup -syntax data = `DATA%*%`(byte*, datamode : datamode) +syntax data = `DATA%*%`{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup -syntax start = START(funcidx : funcidx) +syntax start = START{funcidx : funcidx}(funcidx : funcidx) ;; 1-syntax.watsup syntax externidx = - | FUNC(funcidx : funcidx) - | GLOBAL(globalidx : globalidx) - | TABLE(tableidx : tableidx) - | MEM(memidx : memidx) + | FUNC{funcidx : funcidx}(funcidx : funcidx) + | GLOBAL{globalidx : globalidx}(globalidx : globalidx) + | TABLE{tableidx : tableidx}(tableidx : tableidx) + | MEM{memidx : memidx}(memidx : memidx) ;; 1-syntax.watsup -syntax export = EXPORT(name : name, externidx : externidx) +syntax export = EXPORT{name : name, externidx : externidx}(name : name, externidx : externidx) ;; 1-syntax.watsup -syntax import = IMPORT(name : name, name : name, externtype : externtype) +syntax import = IMPORT{name : name, externtype : externtype}(name : name, name, externtype : externtype) ;; 1-syntax.watsup -syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*, import*, func*, global*, table*, mem*, elem*, data*, start*, export*) +syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) ;; 2-syntax-aux.watsup rec { @@ -6314,10 +6314,10 @@ def $setminus1(idx : idx, idx*) : idx* ;; 2-syntax-aux.watsup:13.1-13.27 def $setminus1{x : idx}(x, []) = [x] ;; 2-syntax-aux.watsup:14.1-14.61 - def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y}) = [] + def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y : idx}) = [] -- if (x = y_1) ;; 2-syntax-aux.watsup:15.1-15.60 - def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y}) = $setminus1(x, y*{y}) + def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y : idx}) = $setminus1(x, y*{y : idx}) -- otherwise } @@ -6327,9 +6327,9 @@ rec { ;; 2-syntax-aux.watsup:7.1-7.49 def $setminus(idx*, idx*) : idx* ;; 2-syntax-aux.watsup:10.1-10.29 - def $setminus{y* : idx*}([], y*{y}) = [] + def $setminus{y* : idx*}([], y*{y : idx}) = [] ;; 2-syntax-aux.watsup:11.1-11.66 - def $setminus{x_1 : idx, x* : idx*, y* : idx*}([x_1] :: x*{x}, y*{y}) = $setminus1(x_1, y*{y}) :: $setminus(x*{x}, y*{y}) + def $setminus{x_1 : idx, x* : idx*, y* : idx*}([x_1] :: x*{x : idx}, y*{y : idx}) = $setminus1(x_1, y*{y : idx}) :: $setminus(x*{x : idx}, y*{y : idx}) } ;; 2-syntax-aux.watsup @@ -6349,18 +6349,18 @@ def $free_dataidx_instrs(instr*) : dataidx* ;; 2-syntax-aux.watsup:26.1-26.36 def $free_dataidx_instrs([]) = [] ;; 2-syntax-aux.watsup:27.1-27.99 - def $free_dataidx_instrs{instr : instr, instr'* : instr*}([instr] :: instr'*{instr'}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr'}) + def $free_dataidx_instrs{instr : instr, instr'* : instr*}([instr] :: instr'*{instr' : instr}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr' : instr}) } ;; 2-syntax-aux.watsup def $free_dataidx_expr(expr : expr) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_expr{in* : instr*}(in*{in}) = $free_dataidx_instrs(in*{in}) + def $free_dataidx_expr{in* : instr*}(in*{in : instr}) = $free_dataidx_instrs(in*{in : instr}) ;; 2-syntax-aux.watsup def $free_dataidx_func(func : func) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc}, e)) = $free_dataidx_expr(e) + def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) ;; 2-syntax-aux.watsup rec { @@ -6370,7 +6370,7 @@ def $free_dataidx_funcs(func*) : dataidx* ;; 2-syntax-aux.watsup:36.1-36.35 def $free_dataidx_funcs([]) = [] ;; 2-syntax-aux.watsup:37.1-37.92 - def $free_dataidx_funcs{func : func, func'* : func*}([func] :: func'*{func'}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func'}) + def $free_dataidx_funcs{func : func, func'* : func*}([func] :: func'*{func' : func}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func' : func}) } ;; 2-syntax-aux.watsup @@ -6417,8 +6417,8 @@ def $diffrt(reftype : reftype, reftype : reftype) : reftype ;; 2-syntax-aux.watsup syntax typevar = - | _IDX(typeidx : typeidx) - | REC(nat : nat) + | _IDX{typeidx : typeidx}(typeidx : typeidx) + | REC(nat) ;; 2-syntax-aux.watsup def $idx(typeidx : typeidx) : typevar @@ -6433,27 +6433,27 @@ def $subst_typevar(typevar : typevar, typevar*, heaptype*) : heaptype ;; 2-syntax-aux.watsup:150.1-150.38 def $subst_typevar{xx : typevar}(xx, [], []) = (xx : typevar <: heaptype) ;; 2-syntax-aux.watsup:151.1-151.95 - def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 + def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = ht_1 -- if (xx = xx_1) ;; 2-syntax-aux.watsup:152.1-152.92 - def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = $subst_typevar(xx, xx'*{xx'}, ht'*{ht'}) + def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = $subst_typevar(xx, xx'*{xx' : typevar}, ht'*{ht' : heaptype}) -- otherwise } ;; 2-syntax-aux.watsup def $subst_numtype(numtype : numtype, typevar*, heaptype*) : numtype ;; 2-syntax-aux.watsup - def $subst_numtype{nt : numtype, xx* : typevar*, ht* : heaptype*}(nt, xx*{xx}, ht*{ht}) = nt + def $subst_numtype{nt : numtype, xx* : typevar*, ht* : heaptype*}(nt, xx*{xx : typevar}, ht*{ht : heaptype}) = nt ;; 2-syntax-aux.watsup def $subst_vectype(vectype : vectype, typevar*, heaptype*) : vectype ;; 2-syntax-aux.watsup - def $subst_vectype{vt : vectype, xx* : typevar*, ht* : heaptype*}(vt, xx*{xx}, ht*{ht}) = vt + def $subst_vectype{vt : vectype, xx* : typevar*, ht* : heaptype*}(vt, xx*{xx : typevar}, ht*{ht : heaptype}) = vt ;; 2-syntax-aux.watsup def $subst_packtype(packtype : packtype, typevar*, heaptype*) : packtype ;; 2-syntax-aux.watsup - def $subst_packtype{pt : packtype, xx* : typevar*, ht* : heaptype*}(pt, xx*{xx}, ht*{ht}) = pt + def $subst_packtype{pt : packtype, xx* : typevar*, ht* : heaptype*}(pt, xx*{xx : typevar}, ht*{ht : heaptype}) = pt ;; 2-syntax-aux.watsup rec { @@ -6461,108 +6461,108 @@ rec { ;; 2-syntax-aux.watsup:129.1-129.92 def $subst_heaptype(heaptype : heaptype, typevar*, heaptype*) : heaptype ;; 2-syntax-aux.watsup:157.1-157.67 - def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) + def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx : typevar}, ht*{ht : heaptype}) = $subst_typevar(xx', xx*{xx : typevar}, ht*{ht : heaptype}) ;; 2-syntax-aux.watsup:158.1-158.65 - def $subst_heaptype{dt : deftype, xx* : typevar*, ht* : heaptype*}((dt : deftype <: heaptype), xx*{xx}, ht*{ht}) = ($subst_deftype(dt, xx*{xx}, ht*{ht}) : deftype <: heaptype) + def $subst_heaptype{dt : deftype, xx* : typevar*, ht* : heaptype*}((dt : deftype <: heaptype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_deftype(dt, xx*{xx : typevar}, ht*{ht : heaptype}) : deftype <: heaptype) ;; 2-syntax-aux.watsup:159.1-159.55 - def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx}, ht*{ht}) = ht' + def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx : typevar}, ht*{ht : heaptype}) = ht' -- otherwise ;; 2-syntax-aux.watsup:130.1-130.92 def $subst_reftype(reftype : reftype, typevar*, heaptype*) : reftype ;; 2-syntax-aux.watsup:161.1-161.85 - def $subst_reftype{nul : nul, ht' : heaptype, xx* : typevar*, ht* : heaptype*}(REF_reftype(nul, ht'), xx*{xx}, ht*{ht}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx}, ht*{ht})) + def $subst_reftype{nul : nul, ht' : heaptype, xx* : typevar*, ht* : heaptype*}(REF_reftype(nul, ht'), xx*{xx : typevar}, ht*{ht : heaptype}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:131.1-131.92 def $subst_valtype(valtype : valtype, typevar*, heaptype*) : valtype ;; 2-syntax-aux.watsup:163.1-163.64 - def $subst_valtype{nt : numtype, xx* : typevar*, ht* : heaptype*}((nt : numtype <: valtype), xx*{xx}, ht*{ht}) = ($subst_numtype(nt, xx*{xx}, ht*{ht}) : numtype <: valtype) + def $subst_valtype{nt : numtype, xx* : typevar*, ht* : heaptype*}((nt : numtype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_numtype(nt, xx*{xx : typevar}, ht*{ht : heaptype}) : numtype <: valtype) ;; 2-syntax-aux.watsup:164.1-164.64 - def $subst_valtype{vt : vectype, xx* : typevar*, ht* : heaptype*}((vt : vectype <: valtype), xx*{xx}, ht*{ht}) = ($subst_vectype(vt, xx*{xx}, ht*{ht}) : vectype <: valtype) + def $subst_valtype{vt : vectype, xx* : typevar*, ht* : heaptype*}((vt : vectype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_vectype(vt, xx*{xx : typevar}, ht*{ht : heaptype}) : vectype <: valtype) ;; 2-syntax-aux.watsup:165.1-165.64 - def $subst_valtype{rt : reftype, xx* : typevar*, ht* : heaptype*}((rt : reftype <: valtype), xx*{xx}, ht*{ht}) = ($subst_reftype(rt, xx*{xx}, ht*{ht}) : reftype <: valtype) + def $subst_valtype{rt : reftype, xx* : typevar*, ht* : heaptype*}((rt : reftype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_reftype(rt, xx*{xx : typevar}, ht*{ht : heaptype}) : reftype <: valtype) ;; 2-syntax-aux.watsup:166.1-166.40 - def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx : typevar}, ht*{ht : heaptype}) = BOT_valtype ;; 2-syntax-aux.watsup:134.1-134.92 def $subst_storagetype(storagetype : storagetype, typevar*, heaptype*) : storagetype ;; 2-syntax-aux.watsup:170.1-170.66 - def $subst_storagetype{t : valtype, xx* : typevar*, ht* : heaptype*}((t : valtype <: storagetype), xx*{xx}, ht*{ht}) = ($subst_valtype(t, xx*{xx}, ht*{ht}) : valtype <: storagetype) + def $subst_storagetype{t : valtype, xx* : typevar*, ht* : heaptype*}((t : valtype <: storagetype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_valtype(t, xx*{xx : typevar}, ht*{ht : heaptype}) : valtype <: storagetype) ;; 2-syntax-aux.watsup:171.1-171.69 - def $subst_storagetype{pt : packtype, xx* : typevar*, ht* : heaptype*}((pt : packtype <: storagetype), xx*{xx}, ht*{ht}) = ($subst_packtype(pt, xx*{xx}, ht*{ht}) : packtype <: storagetype) + def $subst_storagetype{pt : packtype, xx* : typevar*, ht* : heaptype*}((pt : packtype <: storagetype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_packtype(pt, xx*{xx : typevar}, ht*{ht : heaptype}) : packtype <: storagetype) ;; 2-syntax-aux.watsup:135.1-135.92 def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype ;; 2-syntax-aux.watsup:173.1-173.80 - def $subst_fieldtype{mut : mut, zt : storagetype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, zt), xx*{xx}, ht*{ht}) = `%%`(mut, $subst_storagetype(zt, xx*{xx}, ht*{ht})) + def $subst_fieldtype{mut : mut, zt : storagetype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, zt), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(mut, $subst_storagetype(zt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype ;; 2-syntax-aux.watsup:175.1-175.85 - def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) + def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt : fieldtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype}) ;; 2-syntax-aux.watsup:176.1-176.81 - def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) + def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx : typevar}, ht*{ht : heaptype}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:177.1-177.78 - def $subst_comptype{ft : functype, xx* : typevar*, ht* : heaptype*}(FUNC_comptype(ft), xx*{xx}, ht*{ht}) = FUNC_comptype($subst_functype(ft, xx*{xx}, ht*{ht})) + def $subst_comptype{ft : functype, xx* : typevar*, ht* : heaptype*}(FUNC_comptype(ft), xx*{xx : typevar}, ht*{ht : heaptype}) = FUNC_comptype($subst_functype(ft, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:138.1-138.92 def $subst_subtype(subtype : subtype, typevar*, heaptype*) : subtype ;; 2-syntax-aux.watsup:179.1-180.76 - def $subst_subtype{fin : fin, y* : idx*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + def $subst_subtype{fin : fin, y* : idx*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUB_subtype(fin, y*{y : typeidx}, ct), xx*{xx : typevar}, ht*{ht : heaptype}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx : typevar}, ht*{ht : heaptype})*{y : typeidx}, $subst_comptype(ct, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:181.1-182.73 - def $subst_subtype{fin : fin, ht'* : heaptype*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUBD_subtype(fin, ht'*{ht'}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx}, ht*{ht})*{ht'}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + def $subst_subtype{fin : fin, ht'* : heaptype*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUBD_subtype(fin, ht'*{ht' : heaptype}, ct), xx*{xx : typevar}, ht*{ht : heaptype}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})*{ht' : heaptype}, $subst_comptype(ct, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype ;; 2-syntax-aux.watsup:184.1-184.76 - def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st}), xx*{xx}, ht*{ht}) = REC_rectype($subst_subtype(st, xx*{xx}, ht*{ht})*{st}) + def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st : subtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype}) ;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype ;; 2-syntax-aux.watsup:186.1-186.78 - def $subst_deftype{qt : rectype, i : nat, xx* : typevar*, ht* : heaptype*}(DEF_deftype(qt, i), xx*{xx}, ht*{ht}) = DEF_deftype($subst_rectype(qt, xx*{xx}, ht*{ht}), i) + def $subst_deftype{qt : rectype, i : nat, xx* : typevar*, ht* : heaptype*}(DEF_deftype(qt, i), xx*{xx : typevar}, ht*{ht : heaptype}) = DEF_deftype($subst_rectype(qt, xx*{xx : typevar}, ht*{ht : heaptype}), i) ;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype ;; 2-syntax-aux.watsup:189.1-189.113 - def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1}, t_2*{t_2}), xx*{xx}, ht*{ht}) = `%->%`($subst_valtype(t_1, xx*{xx}, ht*{ht})*{t_1}, $subst_valtype(t_2, xx*{xx}, ht*{ht})*{t_2}) + def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}, $subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype}) } ;; 2-syntax-aux.watsup def $subst_globaltype(globaltype : globaltype, typevar*, heaptype*) : globaltype ;; 2-syntax-aux.watsup - def $subst_globaltype{mut : mut, t : valtype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, t), xx*{xx}, ht*{ht}) = `%%`(mut, $subst_valtype(t, xx*{xx}, ht*{ht})) + def $subst_globaltype{mut : mut, t : valtype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, t), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(mut, $subst_valtype(t, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_tabletype(tabletype : tabletype, typevar*, heaptype*) : tabletype ;; 2-syntax-aux.watsup - def $subst_tabletype{lim : limits, rt : reftype, xx* : typevar*, ht* : heaptype*}(`%%`(lim, rt), xx*{xx}, ht*{ht}) = `%%`(lim, $subst_reftype(rt, xx*{xx}, ht*{ht})) + def $subst_tabletype{lim : limits, rt : reftype, xx* : typevar*, ht* : heaptype*}(`%%`(lim, rt), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(lim, $subst_reftype(rt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_memtype(memtype : memtype, typevar*, heaptype*) : memtype ;; 2-syntax-aux.watsup - def $subst_memtype{lim : limits, xx* : typevar*, ht* : heaptype*}(`%I8`(lim), xx*{xx}, ht*{ht}) = `%I8`(lim) + def $subst_memtype{lim : limits, xx* : typevar*, ht* : heaptype*}(`%I8`(lim), xx*{xx : typevar}, ht*{ht : heaptype}) = `%I8`(lim) ;; 2-syntax-aux.watsup def $subst_externtype(externtype : externtype, typevar*, heaptype*) : externtype ;; 2-syntax-aux.watsup - def $subst_externtype{dt : deftype, xx* : typevar*, ht* : heaptype*}(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) + def $subst_externtype{dt : deftype, xx* : typevar*, ht* : heaptype*}(FUNC_externtype(dt), xx*{xx : typevar}, ht*{ht : heaptype}) = FUNC_externtype($subst_deftype(dt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{gt : globaltype, xx* : typevar*, ht* : heaptype*}(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) + def $subst_externtype{gt : globaltype, xx* : typevar*, ht* : heaptype*}(GLOBAL_externtype(gt), xx*{xx : typevar}, ht*{ht : heaptype}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{tt : tabletype, xx* : typevar*, ht* : heaptype*}(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) + def $subst_externtype{tt : tabletype, xx* : typevar*, ht* : heaptype*}(TABLE_externtype(tt), xx*{xx : typevar}, ht*{ht : heaptype}) = TABLE_externtype($subst_tabletype(tt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{mt : memtype, xx* : typevar*, ht* : heaptype*}(MEM_externtype(mt), xx*{xx}, ht*{ht}) = MEM_externtype($subst_memtype(mt, xx*{xx}, ht*{ht})) + def $subst_externtype{mt : memtype, xx* : typevar*, ht* : heaptype*}(MEM_externtype(mt), xx*{xx : typevar}, ht*{ht : heaptype}) = MEM_externtype($subst_memtype(mt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_all_reftype(reftype : reftype, heaptype*) : reftype ;; 2-syntax-aux.watsup - def $subst_all_reftype{rt : reftype, ht^n : heaptype^n, n : n, i^n : nat^n}(rt, ht^n{ht}) = $subst_reftype(rt, $idx(`%`(i))^(i (sx?{sx} = ?())) - | VREPLACE_LANE(shape : shape, laneidx : laneidx) - | VUNOP(shape : shape, vunop_ : vunop_(shape)) - | VBINOP(shape : shape, vbinop_ : vbinop_(shape)) - | VTESTOP(shape : shape, vtestop_ : vtestop_(shape)) - | VRELOP(shape : shape, vrelop_ : vrelop_(shape)) - | VSHIFTOP(ishape : ishape, vshiftop_ : vshiftop_(ishape)) - | VBITMASK(ishape : ishape) - | VCVTOP(shape : shape, vcvtop : vcvtop, half?, shape : shape, sx?, zero : zero) - | VNARROW(ishape : ishape, ishape : ishape, sx : sx) - | VEXTUNOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) + | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*{laneidx : laneidx} : laneidx*) + -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx : laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) + | VSPLAT{shape : shape}(shape : shape) + | VEXTRACT_LANE{shape : shape, sx? : sx?, laneidx : laneidx, numtype : numtype}(shape : shape, sx?{sx : sx} : sx?, laneidx : laneidx) + -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx : sx} = ?())) + | VREPLACE_LANE{shape : shape, laneidx : laneidx}(shape : shape, laneidx : laneidx) + | VUNOP{shape : shape, vunop_ : vunop_(shape)}(shape : shape, vunop_ : vunop_(shape)) + | VBINOP{shape : shape, vbinop_ : vbinop_(shape)}(shape : shape, vbinop_ : vbinop_(shape)) + | VTESTOP{shape : shape, vtestop_ : vtestop_(shape)}(shape : shape, vtestop_ : vtestop_(shape)) + | VRELOP{shape : shape, vrelop_ : vrelop_(shape)}(shape : shape, vrelop_ : vrelop_(shape)) + | VSHIFTOP{ishape : ishape, vshiftop_ : vshiftop_(ishape)}(ishape : ishape, vshiftop_ : vshiftop_(ishape)) + | VBITMASK{ishape : ishape}(ishape : ishape) + | VCVTOP{shape : shape, vcvtop : vcvtop, half? : half?, sx? : sx?, zero : zero}(shape : shape, vcvtop : vcvtop, half?{half : half} : half?, shape, sx?{sx : sx} : sx?, zero : zero) + | VNARROW{ishape : ishape, sx : sx}(ishape : ishape, ishape, sx : sx) + | VEXTUNOP{ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | VEXTBINOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) + | VEXTBINOP{ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | REF.NULL(heaptype : heaptype) + | REF.NULL{heaptype : heaptype}(heaptype : heaptype) | REF.I31 - | REF.FUNC(funcidx : funcidx) + | REF.FUNC{funcidx : funcidx}(funcidx : funcidx) | REF.IS_NULL | REF.AS_NON_NULL | REF.EQ - | REF.TEST(reftype : reftype) - | REF.CAST(reftype : reftype) - | I31.GET(sx : sx) - | STRUCT.NEW(typeidx : typeidx) - | STRUCT.NEW_DEFAULT(typeidx : typeidx) - | STRUCT.GET(sx?, typeidx : typeidx, u32 : u32) - | STRUCT.SET(typeidx : typeidx, u32 : u32) - | ARRAY.NEW(typeidx : typeidx) - | ARRAY.NEW_DEFAULT(typeidx : typeidx) - | ARRAY.NEW_FIXED(typeidx : typeidx, nat : nat) - | ARRAY.NEW_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.NEW_ELEM(typeidx : typeidx, elemidx : elemidx) - | ARRAY.GET(sx?, typeidx : typeidx) - | ARRAY.SET(typeidx : typeidx) + | REF.TEST{reftype : reftype}(reftype : reftype) + | REF.CAST{reftype : reftype}(reftype : reftype) + | I31.GET{sx : sx}(sx : sx) + | STRUCT.NEW{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.GET{sx? : sx?, typeidx : typeidx, u32 : u32}(sx?{sx : sx} : sx?, typeidx : typeidx, u32 : u32) + | STRUCT.SET{typeidx : typeidx, u32 : u32}(typeidx : typeidx, u32 : u32) + | ARRAY.NEW{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_FIXED{typeidx : typeidx}(typeidx : typeidx, nat) + | ARRAY.NEW_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.NEW_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) + | ARRAY.GET{sx? : sx?, typeidx : typeidx}(sx?{sx : sx} : sx?, typeidx : typeidx) + | ARRAY.SET{typeidx : typeidx}(typeidx : typeidx) | ARRAY.LEN - | ARRAY.FILL(typeidx : typeidx) - | ARRAY.COPY(typeidx : typeidx, typeidx : typeidx) - | ARRAY.INIT_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.INIT_ELEM(typeidx : typeidx, elemidx : elemidx) + | ARRAY.FILL{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.COPY{typeidx : typeidx}(typeidx : typeidx, typeidx) + | ARRAY.INIT_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.INIT_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) | EXTERN.CONVERT_ANY | ANY.CONVERT_EXTERN - | LOCAL.GET(localidx : localidx) - | LOCAL.SET(localidx : localidx) - | LOCAL.TEE(localidx : localidx) - | GLOBAL.GET(globalidx : globalidx) - | GLOBAL.SET(globalidx : globalidx) - | TABLE.GET(tableidx : tableidx) - | TABLE.SET(tableidx : tableidx) - | TABLE.SIZE(tableidx : tableidx) - | TABLE.GROW(tableidx : tableidx) - | TABLE.FILL(tableidx : tableidx) - | TABLE.COPY(tableidx : tableidx, tableidx : tableidx) - | TABLE.INIT(tableidx : tableidx, elemidx : elemidx) - | ELEM.DROP(elemidx : elemidx) - | MEMORY.SIZE(memidx : memidx) - | MEMORY.GROW(memidx : memidx) - | MEMORY.FILL(memidx : memidx) - | MEMORY.COPY(memidx : memidx, memidx : memidx) - | MEMORY.INIT(memidx : memidx, dataidx : dataidx) - | DATA.DROP(dataidx : dataidx) - | LOAD(numtype : numtype, (n, sx)?, memidx : memidx, memop : memop) - | STORE(numtype : numtype, n?, memidx : memidx, memop : memop) - | VLOAD(vloadop?, memidx : memidx, memop : memop) - | VLOAD_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | VSTORE(memidx : memidx, memop : memop) - | VSTORE_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | REF.I31_NUM(u31 : u31) - | REF.STRUCT_ADDR(structaddr : structaddr) - | REF.ARRAY_ADDR(arrayaddr : arrayaddr) - | REF.FUNC_ADDR(funcaddr : funcaddr) - | REF.HOST_ADDR(hostaddr : hostaddr) - | REF.EXTERN(addrref : addrref) - | LABEL_(n : n, instr*, admininstr*) - | FRAME_(n : n, frame : frame, admininstr*) + | LOCAL.GET{localidx : localidx}(localidx : localidx) + | LOCAL.SET{localidx : localidx}(localidx : localidx) + | LOCAL.TEE{localidx : localidx}(localidx : localidx) + | GLOBAL.GET{globalidx : globalidx}(globalidx : globalidx) + | GLOBAL.SET{globalidx : globalidx}(globalidx : globalidx) + | TABLE.GET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SIZE{tableidx : tableidx}(tableidx : tableidx) + | TABLE.GROW{tableidx : tableidx}(tableidx : tableidx) + | TABLE.FILL{tableidx : tableidx}(tableidx : tableidx) + | TABLE.COPY{tableidx : tableidx}(tableidx : tableidx, tableidx) + | TABLE.INIT{tableidx : tableidx, elemidx : elemidx}(tableidx : tableidx, elemidx : elemidx) + | ELEM.DROP{elemidx : elemidx}(elemidx : elemidx) + | MEMORY.SIZE{memidx : memidx}(memidx : memidx) + | MEMORY.GROW{memidx : memidx}(memidx : memidx) + | MEMORY.FILL{memidx : memidx}(memidx : memidx) + | MEMORY.COPY{memidx : memidx}(memidx : memidx, memidx) + | MEMORY.INIT{memidx : memidx, dataidx : dataidx}(memidx : memidx, dataidx : dataidx) + | DATA.DROP{dataidx : dataidx}(dataidx : dataidx) + | LOAD{numtype : numtype, n? : n?, sx? : sx?, memidx : memidx, memop : memop}(numtype : numtype, (n, sx)?{n : n sx : sx} : (n, sx)?, memidx : memidx, memop : memop) + | STORE{numtype : numtype, n? : n?, memidx : memidx, memop : memop}(numtype : numtype, n?{n : n} : n?, memidx : memidx, memop : memop) + | VLOAD{vloadop? : vloadop?, memidx : memidx, memop : memop}(vloadop?{vloadop : vloadop} : vloadop?, memidx : memidx, memop : memop) + | VLOAD_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | VSTORE{memidx : memidx, memop : memop}(memidx : memidx, memop : memop) + | VSTORE_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | REF.I31_NUM{u31 : u31}(u31 : u31) + | REF.STRUCT_ADDR{structaddr : structaddr}(structaddr : structaddr) + | REF.ARRAY_ADDR{arrayaddr : arrayaddr}(arrayaddr : arrayaddr) + | REF.FUNC_ADDR{funcaddr : funcaddr}(funcaddr : funcaddr) + | REF.HOST_ADDR{hostaddr : hostaddr}(hostaddr : hostaddr) + | REF.EXTERN{addrref : addrref}(addrref : addrref) + | LABEL_{n : n, instr* : instr*, admininstr* : admininstr*}(n : n, instr*{instr : instr} : instr*, admininstr*{admininstr : admininstr} : admininstr*) + | FRAME_{n : n, frame : frame, admininstr* : admininstr*}(n : n, frame : frame, admininstr*{admininstr : admininstr} : admininstr*) | TRAP } ;; 4-runtime.watsup -syntax config = `%;%*`(state : state, admininstr*) +syntax config = `%;%*`{state : state, admininstr* : admininstr*}(state : state, admininstr*{admininstr : admininstr} : admininstr*) ;; 4-runtime.watsup rec { @@ -7676,15 +7676,15 @@ rec { ;; 4-runtime.watsup:165.1-168.25 syntax E = | _HOLE - | _SEQ(val*, E : E, instr*) - | LABEL_(n : n, instr*, E : E) + | _SEQ{val* : val*, E : E, instr* : instr*}(val*{val : val} : val*, E : E, instr*{instr : instr} : instr*) + | LABEL_{n : n, instr* : instr*, E : E}(n : n, instr*{instr : instr} : instr*, E : E) } ;; 5-runtime-aux.watsup def $inst_reftype(moduleinst : moduleinst, reftype : reftype) : reftype ;; 5-runtime-aux.watsup - def $inst_reftype{mm : moduleinst, rt : reftype, dt* : deftype*}(mm, rt) = $subst_all_reftype(rt, (dt : deftype <: heaptype)*{dt}) - -- if (dt*{dt} = mm.TYPE_moduleinst) + def $inst_reftype{mm : moduleinst, rt : reftype, dt* : deftype*}(mm, rt) = $subst_all_reftype(rt, (dt : deftype <: heaptype)*{dt : deftype}) + -- if (dt*{dt : deftype} = mm.TYPE_moduleinst) ;; 5-runtime-aux.watsup def $default(valtype : valtype) : val? @@ -7725,9 +7725,9 @@ def $funcsxv(externval*) : funcaddr* ;; 5-runtime-aux.watsup:49.1-49.24 def $funcsxv([]) = [] ;; 5-runtime-aux.watsup:50.1-50.47 - def $funcsxv{fa : funcaddr, xv* : externval*}([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) + def $funcsxv{fa : funcaddr, xv* : externval*}([FUNC_externval(fa)] :: xv*{xv : externval}) = [fa] :: $funcsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:51.1-51.58 - def $funcsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $funcsxv(xv*{xv}) + def $funcsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $funcsxv(xv*{xv : externval}) -- otherwise } @@ -7739,9 +7739,9 @@ def $globalsxv(externval*) : globaladdr* ;; 5-runtime-aux.watsup:53.1-53.26 def $globalsxv([]) = [] ;; 5-runtime-aux.watsup:54.1-54.53 - def $globalsxv{ga : globaladdr, xv* : externval*}([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) + def $globalsxv{ga : globaladdr, xv* : externval*}([GLOBAL_externval(ga)] :: xv*{xv : externval}) = [ga] :: $globalsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:55.1-55.62 - def $globalsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $globalsxv(xv*{xv}) + def $globalsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $globalsxv(xv*{xv : externval}) -- otherwise } @@ -7753,9 +7753,9 @@ def $tablesxv(externval*) : tableaddr* ;; 5-runtime-aux.watsup:57.1-57.25 def $tablesxv([]) = [] ;; 5-runtime-aux.watsup:58.1-58.50 - def $tablesxv{ta : tableaddr, xv* : externval*}([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) + def $tablesxv{ta : tableaddr, xv* : externval*}([TABLE_externval(ta)] :: xv*{xv : externval}) = [ta] :: $tablesxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:59.1-59.60 - def $tablesxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $tablesxv(xv*{xv}) + def $tablesxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $tablesxv(xv*{xv : externval}) -- otherwise } @@ -7767,9 +7767,9 @@ def $memsxv(externval*) : memaddr* ;; 5-runtime-aux.watsup:61.1-61.23 def $memsxv([]) = [] ;; 5-runtime-aux.watsup:62.1-62.44 - def $memsxv{ma : memaddr, xv* : externval*}([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) + def $memsxv{ma : memaddr, xv* : externval*}([MEM_externval(ma)] :: xv*{xv : externval}) = [ma] :: $memsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:63.1-63.56 - def $memsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $memsxv(xv*{xv}) + def $memsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $memsxv(xv*{xv : externval}) -- otherwise } @@ -7896,7 +7896,7 @@ def $with_tableinst(state : state, tableidx : tableidx, tableinst : tableinst) : ;; 5-runtime-aux.watsup def $with_mem(state : state, memidx : memidx, nat : nat, nat : nat, byte*) : state ;; 5-runtime-aux.watsup - def $with_mem{s : store, f : frame, x : idx, i : nat, j : nat, b* : byte*}(`%;%`(s, f), x, i, j, b*{b}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]].DATA_meminst[i : j] = b*{b}], f) + def $with_mem{s : store, f : frame, x : idx, i : nat, j : nat, b* : byte*}(`%;%`(s, f), x, i, j, b*{b : byte}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]].DATA_meminst[i : j] = b*{b : byte}], f) ;; 5-runtime-aux.watsup def $with_meminst(state : state, memidx : memidx, meminst : meminst) : state @@ -7906,12 +7906,12 @@ def $with_meminst(state : state, memidx : memidx, meminst : meminst) : state ;; 5-runtime-aux.watsup def $with_elem(state : state, elemidx : elemidx, ref*) : state ;; 5-runtime-aux.watsup - def $with_elem{s : store, f : frame, x : idx, r* : ref*}(`%;%`(s, f), x, r*{r}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]].ELEM_eleminst = r*{r}], f) + def $with_elem{s : store, f : frame, x : idx, r* : ref*}(`%;%`(s, f), x, r*{r : ref}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]].ELEM_eleminst = r*{r : ref}], f) ;; 5-runtime-aux.watsup def $with_data(state : state, dataidx : dataidx, byte*) : state ;; 5-runtime-aux.watsup - def $with_data{s : store, f : frame, x : idx, b* : byte*}(`%;%`(s, f), x, b*{b}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]].DATA_datainst = b*{b}], f) + def $with_data{s : store, f : frame, x : idx, b* : byte*}(`%;%`(s, f), x, b*{b : byte}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]].DATA_datainst = b*{b : byte}], f) ;; 5-runtime-aux.watsup def $with_struct(state : state, structaddr : structaddr, nat : nat, fieldval : fieldval) : state @@ -7926,20 +7926,20 @@ def $with_array(state : state, arrayaddr : arrayaddr, nat : nat, fieldval : fiel ;; 5-runtime-aux.watsup def $ext_structinst(state : state, structinst*) : state ;; 5-runtime-aux.watsup - def $ext_structinst{s : store, f : frame, si* : structinst*}(`%;%`(s, f), si*{si}) = `%;%`(s[STRUCT_store =.. si*{si}], f) + def $ext_structinst{s : store, f : frame, si* : structinst*}(`%;%`(s, f), si*{si : structinst}) = `%;%`(s[STRUCT_store =.. si*{si : structinst}], f) ;; 5-runtime-aux.watsup def $ext_arrayinst(state : state, arrayinst*) : state ;; 5-runtime-aux.watsup - def $ext_arrayinst{s : store, f : frame, ai* : arrayinst*}(`%;%`(s, f), ai*{ai}) = `%;%`(s[ARRAY_store =.. ai*{ai}], f) + def $ext_arrayinst{s : store, f : frame, ai* : arrayinst*}(`%;%`(s, f), ai*{ai : arrayinst}) = `%;%`(s[ARRAY_store =.. ai*{ai : arrayinst}], f) ;; 5-runtime-aux.watsup def $growtable(tableinst : tableinst, nat : nat, ref : ref) : tableinst? ;; 5-runtime-aux.watsup def $growtable{ti : tableinst, n : n, r : ref, ti' : tableinst, i : nat, j : nat, rt : reftype, r'* : ref*, i' : nat}(ti, n, r) = ?(ti') - -- if (ti = {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM r'*{r'}}) - -- if (i' = (|r'*{r'}| + n)) - -- if (ti' = {TYPE `%%`(`[%..%]`(`%`(i'), `%`(j)), rt), ELEM r'*{r'} :: r^n{}}) + -- if (ti = {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM r'*{r' : ref}}) + -- if (i' = (|r'*{r' : ref}| + n)) + -- if (ti' = {TYPE `%%`(`[%..%]`(`%`(i'), `%`(j)), rt), ELEM r'*{r' : ref} :: r^n{}}) -- if (i' <= j) def $growtable{x0 : tableinst, x1 : nat, x2 : ref}(x0, x1, x2) = ?() @@ -7947,9 +7947,9 @@ def $growtable(tableinst : tableinst, nat : nat, ref : ref) : tableinst? def $growmemory(meminst : meminst, nat : nat) : meminst? ;; 5-runtime-aux.watsup def $growmemory{mi : meminst, n : n, mi' : meminst, i : nat, j : nat, b* : byte*, i' : nat}(mi, n) = ?(mi') - -- if (mi = {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA b*{b}}) - -- if (i' = ((|b*{b}| / (64 * $Ki)) + n)) - -- if (mi' = {TYPE `%I8`(`[%..%]`(`%`(i'), `%`(j))), DATA b*{b} :: `%`(0)^((n * 64) * $Ki){}}) + -- if (mi = {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA b*{b : byte}}) + -- if (i' = ((|b*{b : byte}| / (64 * $Ki)) + n)) + -- if (mi' = {TYPE `%I8`(`[%..%]`(`%`(i'), `%`(j))), DATA b*{b : byte} :: `%`(0)^((n * 64) * $Ki){}}) -- if (i' <= j) def $growmemory{x0 : meminst, x1 : nat}(x0, x1) = ?() @@ -7959,25 +7959,25 @@ syntax init = | UNSET ;; 6-typing.watsup -syntax localtype = `%%`(init : init, valtype : valtype) +syntax localtype = `%%`{init : init, valtype : valtype}(init : init, valtype : valtype) ;; 6-typing.watsup -syntax instrtype = `%->%*%`(resulttype : resulttype, localidx*, resulttype : resulttype) +syntax instrtype = `%->%*%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) ;; 6-typing.watsup syntax context = { - TYPE deftype*, - REC subtype*, - FUNC deftype*, - GLOBAL globaltype*, - TABLE tabletype*, - MEM memtype*, - ELEM elemtype*, - DATA datatype*, - LOCAL localtype*, - LABEL resulttype*, - RETURN resulttype? + TYPE{deftype* : deftype*} deftype*, + REC{subtype* : subtype*} subtype*, + FUNC{deftype* : deftype*} deftype*, + GLOBAL{globaltype* : globaltype*} globaltype*, + TABLE{tabletype* : tabletype*} tabletype*, + MEM{memtype* : memtype*} memtype*, + ELEM{elemtype* : elemtype*} elemtype*, + DATA{datatype* : datatype*} datatype*, + LOCAL{localtype* : localtype*} localtype*, + LABEL{resulttype* : resulttype*} resulttype*, + RETURN{resulttype? : resulttype?} resulttype? } ;; 6-typing.watsup @@ -7988,7 +7988,7 @@ def $with_locals(context : context, localidx*, localtype*) : context ;; 6-typing.watsup:28.1-28.34 def $with_locals{C : context}(C, [], []) = C ;; 6-typing.watsup:29.1-29.85 - def $with_locals{C : context, x_1 : idx, x* : idx*, lt_1 : localtype, lt* : localtype*}(C, [x_1] :: x*{x}, [lt_1] :: lt*{lt}) = $with_locals(C[LOCAL_context[x_1.`%`.0] = lt_1], x*{x}, lt*{lt}) + def $with_locals{C : context, x_1 : idx, x* : idx*, lt_1 : localtype, lt* : localtype*}(C, [x_1] :: x*{x : localidx}, [lt_1] :: lt*{lt : localtype}) = $with_locals(C[LOCAL_context[x_1.`%`.0] = lt_1], x*{x : localidx}, lt*{lt : localtype}) } ;; 6-typing.watsup @@ -7999,15 +7999,15 @@ def $clostypes(deftype*) : deftype* ;; 6-typing.watsup:37.1-37.26 def $clostypes([]) = [] ;; 6-typing.watsup:38.1-38.93 - def $clostypes{dt* : deftype*, dt_N : deftype, dt'* : deftype*}(dt*{dt} :: [dt_N]) = dt'*{dt'} :: [$subst_all_deftype(dt_N, (dt' : deftype <: heaptype)*{dt'})] - -- if (dt'*{dt'} = $clostypes(dt*{dt})) + def $clostypes{dt* : deftype*, dt_N : deftype, dt'* : deftype*}(dt*{dt : deftype} :: [dt_N]) = dt'*{dt' : deftype} :: [$subst_all_deftype(dt_N, (dt' : deftype <: heaptype)*{dt' : deftype})] + -- if (dt'*{dt' : deftype} = $clostypes(dt*{dt : deftype})) } ;; 6-typing.watsup def $clostype(context : context, deftype : deftype) : deftype ;; 6-typing.watsup - def $clostype{C : context, dt : deftype, dt'* : deftype*}(C, dt) = $subst_all_deftype(dt, (dt' : deftype <: heaptype)*{dt'}) - -- if (dt'*{dt'} = $clostypes(C.TYPE_context)) + def $clostype{C : context, dt : deftype, dt'* : deftype*}(C, dt) = $subst_all_deftype(dt, (dt' : deftype <: heaptype)*{dt' : deftype}) + -- if (dt'*{dt' : deftype} = $clostypes(C.TYPE_context)) ;; 6-typing.watsup relation Numtype_ok: `%|-%:_OK`(context, numtype) @@ -8069,25 +8069,25 @@ relation Valtype_ok: `%|-%:_OK`(context, valtype) relation Resulttype_ok: `%|-%:_OK`(context, resulttype) ;; 6-typing.watsup rule _{C : context, t* : valtype*}: - `%|-%:_OK`(C, t*{t}) - -- (Valtype_ok: `%|-%:_OK`(C, t))*{t} + `%|-%:_OK`(C, t*{t : valtype}) + -- (Valtype_ok: `%|-%:_OK`(C, t))*{t : valtype} ;; 6-typing.watsup relation Instrtype_ok: `%|-%:_OK`(context, instrtype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, x* : idx*, t_2* : valtype*, lt* : localtype*}: - `%|-%:_OK`(C, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2}) - -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt x} + `%|-%:_OK`(C, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) + -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt : localtype x : idx} ;; 6-typing.watsup syntax oktypeidx = - | OK(typeidx : typeidx) + | OK{typeidx : typeidx}(typeidx : typeidx) ;; 6-typing.watsup syntax oktypeidxnat = - | OK(typeidx : typeidx, nat : nat) + | OK{typeidx : typeidx}(typeidx : typeidx, nat) ;; 6-typing.watsup relation Packtype_ok: `%|-%:_OK`(context, packtype) @@ -8118,16 +8118,16 @@ relation Fieldtype_ok: `%|-%:_OK`(context, fieldtype) relation Functype_ok: `%|-%:_OK`(context, functype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:_OK`(C, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2}) + `%|-%:_OK`(C, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) + -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) ;; 6-typing.watsup relation Comptype_ok: `%|-%:_OK`(context, comptype) ;; 6-typing.watsup rule struct{C : context, yt* : fieldtype*}: - `%|-%:_OK`(C, STRUCT_comptype(yt*{yt})) - -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt} + `%|-%:_OK`(C, STRUCT_comptype(yt*{yt : fieldtype})) + -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt : fieldtype} ;; 6-typing.watsup rule array{C : context, yt : fieldtype}: @@ -8164,7 +8164,7 @@ relation Deftype_sub: `%|-%<:%`(context, deftype, deftype) ;; 6-typing.watsup:438.1-441.40 rule super{C : context, deftype_1 : deftype, deftype_2 : deftype, fin : fin, ht_1* : heaptype*, ht : heaptype, ht_2* : heaptype*, ct : comptype}: `%|-%<:%`(C, deftype_1, deftype_2) - -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1 : heaptype} :: [ht] :: ht_2*{ht_2 : heaptype}, ct)) -- Heaptype_sub: `%|-%<:%`(C, ht, (deftype_2 : deftype <: heaptype)) ;; 6-typing.watsup:271.1-271.79 @@ -8199,7 +8199,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:303.1-305.35 rule struct{C : context, deftype : deftype, yt* : fieldtype*}: `%|-%<:%`(C, (deftype : deftype <: heaptype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) + -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt : fieldtype})) ;; 6-typing.watsup:307.1-309.33 rule array{C : context, deftype : deftype, yt : fieldtype}: @@ -8229,7 +8229,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:327.1-329.48 rule rec{C : context, i : nat, ht : heaptype, fin : fin, ht_1* : heaptype*, ht_2* : heaptype*, ct : comptype}: `%|-%<:%`(C, REC_heaptype(i), ht) - -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1 : heaptype} :: [ht] :: ht_2*{ht_2 : heaptype}, ct)) ;; 6-typing.watsup:331.1-333.40 rule none{C : context, heaptype : heaptype}: @@ -8325,8 +8325,8 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) ;; 6-typing.watsup rule struct{C : context, yt_1* : fieldtype*, yt'_1 : fieldtype, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) - -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} + `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1 : fieldtype} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2 : fieldtype})) + -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 : fieldtype yt_2 : fieldtype} ;; 6-typing.watsup rule array{C : context, yt_1 : fieldtype, yt_2 : fieldtype}: @@ -8342,12 +8342,12 @@ relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) ;; 6-typing.watsup rule _{C : context, fin : fin, y* : idx*, ct : comptype, x : idx, y'** : idx**, ct'* : comptype*}: - `%|-%:%`(C, SUB_subtype(fin, y*{y}, ct), OK_oktypeidx(x)) - -- if (|y*{y}| <= 1) - -- (if (y.`%`.0 < x.`%`.0))*{y} - -- (if ($unrolldt(C.TYPE_context[y.`%`.0]) = SUB_subtype(`FINAL%?`(?()), y'*{y'}, ct')))*{ct' y y'} + `%|-%:%`(C, SUB_subtype(fin, y*{y : typeidx}, ct), OK_oktypeidx(x)) + -- if (|y*{y : idx}| <= 1) + -- (if (y.`%`.0 < x.`%`.0))*{y : idx} + -- (if ($unrolldt(C.TYPE_context[y.`%`.0]) = SUB_subtype(`FINAL%?`(?()), y'*{y' : typeidx}, ct')))*{ct' : comptype y : idx y' : typeidx} -- Comptype_ok: `%|-%:_OK`(C, ct) - -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct'} + -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct' : comptype} ;; 6-typing.watsup def $before(heaptype : heaptype, typeidx : typeidx, nat : nat) : bool @@ -8371,12 +8371,12 @@ def $unrollht(context : context, heaptype : heaptype) : subtype relation Subtype_ok2: `%|-%:%`(context, subtype, oktypeidxnat) ;; 6-typing.watsup rule _{C : context, fin : fin, ht* : heaptype*, ct : comptype, x : idx, i : nat, ht'** : heaptype**, ct'* : comptype*}: - `%|-%:%`(C, SUBD_subtype(fin, ht*{ht}, ct), OK_oktypeidxnat(x, i)) - -- if (|ht*{ht}| <= 1) - -- (if $before(ht, x, i))*{ht} - -- (if ($unrollht(C, ht) = SUBD_subtype(`FINAL%?`(?()), ht'*{ht'}, ct')))*{ct' ht ht'} + `%|-%:%`(C, SUBD_subtype(fin, ht*{ht : heaptype}, ct), OK_oktypeidxnat(x, i)) + -- if (|ht*{ht : heaptype}| <= 1) + -- (if $before(ht, x, i))*{ht : heaptype} + -- (if ($unrollht(C, ht) = SUBD_subtype(`FINAL%?`(?()), ht'*{ht' : heaptype}, ct')))*{ct' : comptype ht : heaptype ht' : heaptype} -- Comptype_ok: `%|-%:_OK`(C, ct) - -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct'} + -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct' : comptype} ;; 6-typing.watsup rec { @@ -8389,9 +8389,9 @@ relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) ;; 6-typing.watsup:199.1-202.50 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidxnat(x, i)) + `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) - -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) } ;; 6-typing.watsup @@ -8405,14 +8405,14 @@ relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) ;; 6-typing.watsup:187.1-190.43 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidx(x)) + `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidx(x)) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) - -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) + -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) ;; 6-typing.watsup:192.1-194.49 rule rec2{C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) + `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(x, 0)) } ;; 6-typing.watsup @@ -8421,7 +8421,7 @@ relation Deftype_ok: `%|-%:_OK`(context, deftype) rule _{C : context, qt : rectype, i : nat, x : idx, st^n : subtype^n, n : n}: `%|-%:_OK`(C, DEF_deftype(qt, i)) -- Rectype_ok: `%|-%:%`(C, qt, OK_oktypeidx(x)) - -- if (qt = REC_rectype(st^n{st})) + -- if (qt = REC_rectype(st^n{st : subtype})) -- if (i < n) ;; 6-typing.watsup @@ -8480,18 +8480,18 @@ relation Externtype_ok: `%|-%:_OK`(context, externtype) relation Resulttype_sub: `%|-%*_<:%*`(context, valtype*, valtype*) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%*_<:%*`(C, t_1*{t_1}, t_2*{t_2}) - -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 t_2} + `%|-%*_<:%*`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) + -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 : valtype t_2 : valtype} ;; 6-typing.watsup relation Instrtype_sub: `%|-%<:%`(context, instrtype, instrtype) ;; 6-typing.watsup rule _{C : context, t_11* : valtype*, x_1* : idx*, t_12* : valtype*, t_21* : valtype*, x_2* : idx*, t_22* : valtype*, x* : idx*, t* : valtype*}: - `%|-%<:%`(C, `%->%*%`(t_11*{t_11}, x_1*{x_1}, t_12*{t_12}), `%->%*%`(t_21*{t_21}, x_2*{x_2}, t_22*{t_22})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21}, t_11*{t_11}) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12}, t_22*{t_22}) - -- if (x*{x} = $setminus(x_2*{x_2}, x_1*{x_1})) - -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t x} + `%|-%<:%`(C, `%->%*%`(t_11*{t_11 : valtype}, x_1*{x_1 : localidx}, t_12*{t_12 : valtype}), `%->%*%`(t_21*{t_21 : valtype}, x_2*{x_2 : localidx}, t_22*{t_22 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) + -- if (x*{x : idx} = $setminus(x_2*{x_2 : idx}, x_1*{x_1 : idx})) + -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t : valtype x : idx} ;; 6-typing.watsup relation Limits_sub: `%|-%<:%`(context, limits, limits) @@ -8574,7 +8574,7 @@ rec { relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:544.1-545.34 rule unreachable{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:547.1-548.24 rule nop{C : context}: @@ -8596,55 +8596,55 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:578.1-581.61 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:583.1-586.61 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:588.1-592.65 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_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_2*{x_2 : localidx}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:597.1-599.24 rule br{C : context, l : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.LABEL_context[l.`%`.0] = t*{t}) + `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) ;; 6-typing.watsup:601.1-603.24 rule br_if{C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) - -- if (C.LABEL_context[l.`%`.0] = t*{t}) + `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t : valtype} :: [I32_valtype], t*{t : valtype})) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) ;; 6-typing.watsup:605.1-608.44 rule br_table{C : context, l* : labelidx*, l' : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[l.`%`.0]))*{l} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[l'.`%`.0]) + `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0]))*{l : labelidx} + -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0]) ;; 6-typing.watsup:610.1-613.31 rule br_on_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t}) + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:615.1-618.31 rule br_on_non_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) - -- if (C.LABEL_context[l.`%`.0] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype})) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:620.1-626.34 rule br_on_cast{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 : reftype <: valtype)], t*{t} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -8652,8 +8652,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:628.1-634.49 rule br_on_cast_fail{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 : reftype <: valtype)], t*{t} :: [(rt_2 : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [(rt_2 : reftype <: valtype)])) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -8661,48 +8661,48 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:639.1-641.24 rule return{C : context, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.RETURN_context = ?(t*{t})) + `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + -- if (C.RETURN_context = ?(t*{t : valtype})) ;; 6-typing.watsup:643.1-645.46 rule call{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; 6-typing.watsup:647.1-649.46 rule call_ref{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2 : valtype})) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; 6-typing.watsup:651.1-655.46 rule call_indirect{C : context, x : idx, y : idx, t_1* : valtype*, t_2* : valtype*, lim : limits, rt : reftype}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; 6-typing.watsup:657.1-661.40 rule return_call{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}, t_4*{t_4 : valtype})) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:663.1-667.40 rule return_call_ref{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4 : valtype})) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:669.1-675.40 rule return_call_indirect{C : context, x : idx, y : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, lim : limits, rt : reftype, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype], t_4*{t_4 : valtype})) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:680.1-681.33 rule const{C : context, nt : numtype, c_nt : num_(nt)}: @@ -8732,9 +8732,9 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:701.1-704.50 rule convert-i{C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: - `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) -- if (inn_1 =/= inn_2) - -- if ((sx?{sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) + -- if ((sx?{sx : sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) ;; 6-typing.watsup:706.1-708.24 rule convert-f{C : context, fnn_1 : fnn, fnn_2 : fnn}: @@ -8788,27 +8788,27 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:756.1-758.43 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) ;; 6-typing.watsup:760.1-763.39 rule struct.new_default{C : context, x : idx, zt* : storagetype*, mut* : mut*, val* : val*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpack(zt)) = ?(val)))*{val zt} + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 6-typing.watsup:765.1-769.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: - `%|-%:%`(C, STRUCT.GET_instr(sx?{sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(mut, zt)) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + -- if (yt*{yt : fieldtype}[i] = `%%`(mut, zt)) + -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:771.1-774.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + -- if (yt*{yt : fieldtype}[i] = `%%`(`MUT%?`(?(())), zt)) ;; 6-typing.watsup:779.1-781.41 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: @@ -8841,9 +8841,9 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:803.1-806.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:808.1-810.41 rule array.set{C : context, x : idx, zt : storagetype}: @@ -8918,8 +8918,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:870.1-872.22 rule vshuffle{C : context, imm : imm, N : N, i* : nat*}: - `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) - -- (if (i < (N * 2)))*{i} + `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + -- (if (i < (N * 2)))*{i : nat} ;; 6-typing.watsup:874.1-875.48 rule vsplat{C : context, lnn : lnn, N : N}: @@ -8927,7 +8927,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:878.1-880.14 rule vextract_lane{C : context, lnn : lnn, N : N, sx? : sx?, i : nat}: - `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) + `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) -- if (i < N) ;; 6-typing.watsup:882.1-884.14 @@ -8957,7 +8957,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:902.1-903.55 rule vcvtop{C : context, sh : shape, vcvtop : vcvtop, hf? : half?, sx? : sx?, zero : zero}: - `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf}, sh, sx?{sx}, zero), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`([V128_valtype], [V128_valtype])) ;; 6-typing.watsup:905.1-906.44 rule vnarrow{C : context, sh : ishape, sx : sx}: @@ -9068,19 +9068,19 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1011.1-1016.29 rule load{C : context, nt : numtype, n? : n?, sx? : sx?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} + -- if ((n?{n : n} = ?()) \/ (nt = (inn : inn <: numtype))) ;; 6-typing.watsup:1018.1-1023.29 rule store{C : context, nt : numtype, n? : n?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) + `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} + -- if ((n?{n : n} = ?()) \/ (nt = (inn : inn <: numtype))) ;; 6-typing.watsup:1025.1-1028.30 rule vload{C : context, M : M, N : N, sx : sx, x : idx, n_A : n, n_O : n, mt : memtype}: @@ -9124,8 +9124,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) relation Instrf_ok: `%|-%:%`(context, instr, instrtype) ;; 6-typing.watsup:518.1-520.41 rule instr{C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1 : valtype}, [], t_2*{t_2 : valtype})) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:924.1-926.28 rule local.set{C : context, x : idx, t : valtype, init : init}: @@ -9145,30 +9145,30 @@ relation Instrs_ok: `%|-%*_:%`(context, instr*, instrtype) ;; 6-typing.watsup:525.1-530.52 rule seq{C : context, instr_1 : instr, instr_2* : instr*, t_1* : valtype*, x_1* : idx*, x_2* : idx*, t_3* : valtype*, init* : init*, t* : valtype*, C' : context, t_2* : valtype*}: - `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_1*{x_1} :: x_2*{x_2}, t_3*{t_3})) - -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init t x_1} - -- if (C' = $with_locals(C, x_1*{x_1}, `%%`(SET_init, t)*{t})) - -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2}, `%->%*%`(t_2*{t_2}, x_2*{x_2}, t_3*{t_3})) + `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init : init t : valtype x_1 : idx} + -- if (C' = $with_locals(C, x_1*{x_1 : localidx}, `%%`(SET_init, t)*{t : valtype})) + -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2 : instr}, `%->%*%`(t_2*{t_2 : valtype}, x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) ;; 6-typing.watsup:532.1-535.35 rule sub{C : context, instr* : instr*, it' : instrtype, it : instrtype}: - `%|-%*_:%`(C, instr*{instr}, it') - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, it) + `%|-%*_:%`(C, instr*{instr : instr}, it') + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, it) -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:537.1-539.47 rule frame{C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, x* : idx*, t_2* : valtype*}: - `%|-%*_:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t*{t : valtype} :: t_1*{t_1 : valtype}, x*{x : localidx}, t*{t : valtype} :: t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) } ;; 6-typing.watsup relation Expr_ok: `%|-%:%`(context, expr, resulttype) ;; 6-typing.watsup rule _{C : context, instr* : instr*, t* : valtype*}: - `%|-%:%`(C, instr*{instr}, t*{t}) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, `%->%*%`([], [], t*{t})) + `%|-%:%`(C, instr*{instr : instr}, t*{t : valtype}) + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`([], [], t*{t : valtype})) ;; 6-typing.watsup rec { @@ -9178,7 +9178,7 @@ def $in_binop(numtype : numtype, binop_ : binop_(numtype), binop_(numtype)*) : b ;; 6-typing.watsup:1087.1-1087.42 def $in_binop{nt : numtype, binop : binop_(nt), epsilon : binop_(nt)*}(nt, binop, epsilon) = false ;; 6-typing.watsup:1088.1-1088.99 - def $in_binop{nt : numtype, binop : binop_(nt), ibinop_1 : binop_(nt), ibinop'* : binop_(nt)*}(nt, binop, [ibinop_1] :: ibinop'*{ibinop'}) = ((binop = ibinop_1) \/ $in_binop(nt, binop, ibinop'*{ibinop'})) + def $in_binop{nt : numtype, binop : binop_(nt), ibinop_1 : binop_(nt), ibinop'* : binop_(nt)*}(nt, binop, [ibinop_1] :: ibinop'*{ibinop' : binop_(nt)}) = ((binop = ibinop_1) \/ $in_binop(nt, binop, ibinop'*{ibinop' : binop_(nt)})) } ;; 6-typing.watsup @@ -9189,7 +9189,7 @@ def $in_numtype(numtype : numtype, numtype*) : bool ;; 6-typing.watsup:1083.1-1083.37 def $in_numtype{nt : numtype, epsilon : numtype*}(nt, epsilon) = false ;; 6-typing.watsup:1084.1-1084.68 - def $in_numtype{nt : numtype, nt_1 : numtype, nt'* : numtype*}(nt, [nt_1] :: nt'*{nt'}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt'})) + def $in_numtype{nt : numtype, nt_1 : numtype, nt'* : numtype*}(nt, [nt_1] :: nt'*{nt' : numtype}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt' : numtype})) } ;; 6-typing.watsup @@ -9225,8 +9225,8 @@ relation Instr_const: `%|-%CONST`(context, instr) relation Expr_const: `%|-%CONST`(context, expr) ;; 6-typing.watsup rule _{C : context, instr* : instr*}: - `%|-%CONST`(C, instr*{instr}) - -- (Instr_const: `%|-%CONST`(C, instr))*{instr} + `%|-%CONST`(C, instr*{instr : instr}) + -- (Instr_const: `%|-%CONST`(C, instr))*{instr : instr} ;; 6-typing.watsup relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) @@ -9240,10 +9240,10 @@ relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) relation Type_ok: `%|-%:%*`(context, type, deftype*) ;; 6-typing.watsup rule _{C : context, rectype : rectype, dt* : deftype*, x : idx}: - `%|-%:%*`(C, TYPE(rectype), dt*{dt}) + `%|-%:%*`(C, TYPE(rectype), dt*{dt : deftype}) -- if (x = `%`(|C.TYPE_context|)) - -- if (dt*{dt} = $rolldt(x, rectype)) - -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt}], rectype, OK_oktypeidx(x)) + -- if (dt*{dt : deftype} = $rolldt(x, rectype)) + -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt : deftype}], rectype, OK_oktypeidx(x)) ;; 6-typing.watsup relation Local_ok: `%|-%:%`(context, local, localtype) @@ -9261,10 +9261,10 @@ relation Local_ok: `%|-%:%`(context, local, localtype) relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup rule _{C : context, x : idx, local* : local*, expr : expr, t_1* : valtype*, t_2* : valtype*, lt* : localtype*}: - `%|-%:%`(C, `FUNC%%*%`(x, local*{local}, expr), C.TYPE_context[x.`%`.0]) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- (Local_ok: `%|-%:%`(C, local, lt))*{local lt} - -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1} :: lt*{lt}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2})}, expr, t_2*{t_2}) + `%|-%:%`(C, `FUNC%%*%`(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- (Local_ok: `%|-%:%`(C, local, lt))*{local : local lt : localtype} + -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2 : valtype})}, expr, t_2*{t_2 : valtype}) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -9311,8 +9311,8 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup rule _{C : context, rt : reftype, expr* : expr*, elemmode : elemmode}: - `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr}, elemmode), rt) - -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr} + `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr : expr}, elemmode), rt) + -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr : expr} -- Elemmode_ok: `%|-%:%`(C, elemmode, rt) ;; 6-typing.watsup @@ -9331,7 +9331,7 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) relation Data_ok: `%|-%:_OK`(context, data) ;; 6-typing.watsup rule _{C : context, b* : byte*, datamode : datamode}: - `%|-%:_OK`(C, `DATA%*%`(b*{b}, datamode)) + `%|-%:_OK`(C, `DATA%*%`(b*{b : byte}, datamode)) -- Datamode_ok: `%|-%:_OK`(C, datamode) ;; 6-typing.watsup @@ -9388,9 +9388,9 @@ relation Globals_ok: `%|-%*_:%*`(context, global*, globaltype*) ;; 6-typing.watsup:1275.1-1278.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: - `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt}) + `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) - -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt}) + -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) } ;; 6-typing.watsup @@ -9404,32 +9404,32 @@ relation Types_ok: `%|-%*_:%*`(context, type*, deftype*) ;; 6-typing.watsup:1267.1-1270.49 rule cons{C : context, type_1 : type, type* : type*, dt_1 : deftype, dt* : deftype*}: - `%|-%*_:%*`(C, [type_1] :: type*{type}, dt_1*{} :: dt*{dt}) + `%|-%*_:%*`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, dt*{dt}) + -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) } ;; 6-typing.watsup relation Module_ok: `|-%:_OK`(module) ;; 6-typing.watsup rule _{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data^n : data^n, n : n, start? : start?, export* : export*, dt'* : deftype*, ixt* : externtype*, C' : context, gt* : globaltype*, tt* : tabletype*, mt* : memtype*, C : context, dt* : deftype*, rt* : reftype*, et* : externtype*, idt* : deftype*, igt* : globaltype*, itt* : tabletype*, imt* : memtype*}: - `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type}, import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data^n{data}, start?{start}, export*{export})) - -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type}, dt'*{dt'}) - -- (Import_ok: `%|-%:%`({TYPE dt'*{dt'}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import ixt} - -- Globals_ok: `%|-%*_:%*`(C', global*{global}, gt*{gt}) - -- (Table_ok: `%|-%:%`(C', table, tt))*{table tt} - -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem mt} - -- (Func_ok: `%|-%:%`(C, func, dt))*{dt func} - -- (Elem_ok: `%|-%:%`(C, elem, rt))*{elem rt} - -- (Data_ok: `%|-%:_OK`(C, data))^n{data} - -- (Start_ok: `%|-%:_OK`(C, start))?{start} - -- (Export_ok: `%|-%:%`(C, export, et))*{et export} - -- if (C = {TYPE dt'*{dt'}, REC [], FUNC idt*{idt} :: dt*{dt}, GLOBAL igt*{igt} :: gt*{gt}, TABLE itt*{itt} :: tt*{tt}, MEM imt*{imt} :: mt*{mt}, ELEM rt*{rt}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) - -- if (C' = {TYPE dt'*{dt'}, REC [], FUNC idt*{idt} :: dt*{dt}, GLOBAL igt*{igt}, TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}) - -- if (idt*{idt} = $funcsxt(ixt*{ixt})) - -- if (igt*{igt} = $globalsxt(ixt*{ixt})) - -- if (itt*{itt} = $tablesxt(ixt*{ixt})) - -- if (imt*{imt} = $memsxt(ixt*{ixt})) + `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) + -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) + -- (Import_ok: `%|-%:%`({TYPE dt'*{dt' : deftype}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import : import ixt : externtype} + -- Globals_ok: `%|-%*_:%*`(C', global*{global : global}, gt*{gt : globaltype}) + -- (Table_ok: `%|-%:%`(C', table, tt))*{table : table tt : tabletype} + -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem : mem mt : memtype} + -- (Func_ok: `%|-%:%`(C, func, dt))*{dt : deftype func : func} + -- (Elem_ok: `%|-%:%`(C, elem, rt))*{elem : elem rt : reftype} + -- (Data_ok: `%|-%:_OK`(C, data))^n{data : data} + -- (Start_ok: `%|-%:_OK`(C, start))?{start : start} + -- (Export_ok: `%|-%:%`(C, export, et))*{et : externtype export : export} + -- if (C = {TYPE dt'*{dt' : deftype}, REC [], FUNC idt*{idt : deftype} :: dt*{dt : deftype}, GLOBAL igt*{igt : globaltype} :: gt*{gt : globaltype}, TABLE itt*{itt : tabletype} :: tt*{tt : tabletype}, MEM imt*{imt : memtype} :: mt*{mt : memtype}, ELEM rt*{rt : elemtype}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) + -- if (C' = {TYPE dt'*{dt' : deftype}, REC [], FUNC idt*{idt : deftype} :: dt*{dt : deftype}, GLOBAL igt*{igt : globaltype}, TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}) + -- if (idt*{idt : deftype} = $funcsxt(ixt*{ixt : externtype})) + -- if (igt*{igt : globaltype} = $globalsxt(ixt*{ixt : externtype})) + -- if (itt*{itt : tabletype} = $tablesxt(ixt*{ixt : externtype})) + -- if (imt*{imt : memtype} = $memsxt(ixt*{ixt : externtype})) ;; 7-runtime-typing.watsup relation Ref_ok: `%|-%:%`(store, ref, reftype) @@ -9480,35 +9480,35 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule select-true{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_1 : val <: admininstr)]) + `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule select-false{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_2 : val <: admininstr)]) + `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule if-true{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) + `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule if-false{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) + `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule label-vals{n : n, instr* : instr*, val* : val*}: - `%*_~>%*`([LABEL__admininstr(n, instr*{instr}, (val : val <: admininstr)*{val})], (val : val <: admininstr)*{val}) + `%*_~>%*`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) ;; 8-reduction.watsup rule br-zero{n : n, instr'* : instr*, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)^n{val} :: (instr' : instr <: admininstr)*{instr'}) + `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule br-succ{n : n, instr'* : instr*, val* : val*, l : labelidx, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val : val <: admininstr)*{val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)*{val} :: [BR_admininstr(l)]) + `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) ;; 8-reduction.watsup rule br_if-true{c : num_(I32_numtype), l : labelidx}: @@ -9522,13 +9522,13 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule br_table-lt{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) - -- if (i < |l*{l}|) + `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) + -- if (i < |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_table-ge{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) - -- if (i >= |l*{l}|) + `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) + -- if (i >= |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_on_null-null{val : val, l : labelidx, ht : heaptype}: @@ -9560,15 +9560,15 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule frame-vals{n : n, f : frame, val^n : val^n}: - `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val})], (val : val <: admininstr)^n{val}) + `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-frame{n : n, f : frame, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)^n{val}) + `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-label{k : nat, instr'* : instr*, val* : val*, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(k, instr'*{instr'}, (val : val <: admininstr)*{val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)*{val} :: [RETURN_admininstr]) + `%*_~>%*`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) ;; 8-reduction.watsup rule unop-val{nt : numtype, c_1 : num_(nt), unop : unop_(nt), c : num_(nt)}: @@ -9602,13 +9602,13 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?, c : num_(nt_2)}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx}, c_1) = [c]) + `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) + -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = [c]) ;; 8-reduction.watsup rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx}, c_1) = []) + `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) + -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: @@ -9697,15 +9697,15 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vswizzle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn : inn, N : N, c' : vec_(V128_vnn), c : iN($size((inn : inn <: numtype))), ci* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*, k^N : nat^N}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) - -- if (ci*{ci} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) + -- if (ci*{ci : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) -- if (c*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: `%`(0)^(256 - N){}) - -- if (c' = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c*{}[ci*{ci}[k].`%`.0]^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i})], [VCONST_admininstr(V128_vectype, c)]) + `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) - -- if (c = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c'*{}[i*{i}[k]]^(k%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vshiftop{c_1 : vec_(V128_vnn), n : n, imm : imm, N : N, vshiftop : vshiftop_(`%X%`(imm, `%`(N))), c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) - -- if (c'*{c'} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1)) - -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c'})) + -- if (c'*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1)) + -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))})) ;; 8-reduction.watsup rule vtestop-true{c : vec_(V128_vnn), inn : inn, N : N, ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) - -- (if (ci_1 =/= `%`(0)))*{ci_1} + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) + -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), inn : inn, N : N}: @@ -9767,35 +9767,35 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vbitmask{c : vec_(V128_vnn), inn : inn, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) - -- if ($ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1}) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) + -- if ($ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($size((inn : inn <: numtype)))}) ;; 8-reduction.watsup rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn_1 : inn, N_1 : N, inn_2 : inn, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, cj_1* : iN($size((inn_2 : inn <: numtype)))*, cj_2* : iN($size((inn_2 : inn <: numtype)))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) - -- if (ci_2*{ci_2} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2)) - -- if (cj_1*{cj_1} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1}) - -- if (cj_2*{cj_2} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_2)*{ci_2}) - -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), cj_1*{cj_1} :: cj_2*{cj_2})) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) + -- if (ci_2*{ci_2 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2)) + -- if (cj_1*{cj_1 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1 : iN($size((inn_1 : inn <: numtype)))}) + -- if (cj_2*{cj_2 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_2)*{ci_2 : iN($size((inn_1 : inn <: numtype)))}) + -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), cj_1*{cj_1 : lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), `%`(N_2))))} :: cj_2*{cj_2 : lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), `%`(N_2))))})) ;; 8-reduction.watsup rule vcvtop-normal{c_1 : vec_(V128_vnn), lnn_2 : lnn, N_2 : N, vcvtop : vcvtop, lnn_1 : lnn, N_1 : N, sx : sx, c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- if (c'*{c'} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1)) - -- if (c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c'})) + -- if (c'*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1)) + -- if (c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-half{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, hf : half, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci*{ci} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) - -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx}, ci)*{ci})) + `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) + -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-zero{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci*{ci} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) - -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx}, ci)*{ci} :: `%`(0)^N_1{})) + `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) + -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} :: `%`(0)^N_1{})) ;; 8-reduction.watsup rule vextunop{c_1 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: @@ -9825,13 +9825,13 @@ def $blocktype(state : state, blocktype : blocktype) : functype relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule block{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, n : n, t_1^k : valtype^k, t_2^n : valtype^n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val} :: (instr : instr <: admininstr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) ;; 8-reduction.watsup rule loop{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, t_1^k : valtype^k, t_2^n : valtype^n, n : n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], (val : val <: admininstr)^k{val} :: (instr : instr <: admininstr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) ;; 8-reduction.watsup rule br_on_cast-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: @@ -9861,15 +9861,15 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule call_ref-null{z : state, ht : heaptype, x? : idx?}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule call_ref-func{z : state, val^n : val^n, n : n, a : addr, x? : idx?, m : m, f : frame, instr* : instr*, fi : funcinst, t_1^n : valtype^n, t_2^m : valtype^m, y : idx, t* : valtype*}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr})])]) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) -- if ($funcinst(z)[a] = fi) - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) - -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) + -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t : valtype}, instr*{instr : instr})) + -- if (f = {LOCAL ?(val)^n{val : val} :: $default(t)*{t : valtype}, MODULE fi.MODULE_funcinst}) ;; 8-reduction.watsup rule return_call{z : state, x : idx}: @@ -9877,16 +9877,16 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule return_call_ref-label{z : state, k : nat, instr'* : instr*, val* : val*, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, (val : val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), (val : val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) + `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) ;; 8-reduction.watsup rule return_call_ref-frame-addr{z : state, k : nat, f : frame, val'* : val*, val^n : val^n, n : n, a : addr, x? : idx?, instr* : instr*, t_1^n : valtype^n, t_2^m : valtype^m, m : m}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) ;; 8-reduction.watsup rule return_call_ref-frame-null{z : state, k : nat, f : frame, val* : val*, ht : heaptype, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule ref.func{z : state, x : idx}: @@ -9916,19 +9916,19 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule struct.new_default{z : state, x : idx, val* : val*, mut* : mut*, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val} :: [STRUCT.NEW_admininstr(x)]) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpack(zt)) = ?(val)))*{val zt} + `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 8-reduction.watsup rule struct.get-null{z : state, ht : heaptype, sx? : sx?, x : idx, i : nat}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, `%`(i))]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) ;; 8-reduction.watsup rule struct.get-struct{z : state, a : addr, sx? : sx?, x : idx, i : nat, zt* : storagetype*, si : structinst, mut* : mut*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, `%`(i))]), [($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]) : val <: admininstr)]) + `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) -- if ($structinst(z)[a] = si) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) ;; 8-reduction.watsup rule array.new{z : state, val : val, n : n, x : idx}: @@ -9947,8 +9947,8 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.new_elem-alloc{z : state, i : nat, n : n, x : idx, y : idx, ref^n : ref^n}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- if (ref^n{ref : ref} = $elem(z, y).ELEM_eleminst[i : n]) ;; 8-reduction.watsup rule array.new_data-oob{z : state, i : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: @@ -9958,30 +9958,30 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.new_data-num{z : state, i : nat, n : n, x : idx, y : idx, nt : numtype, c^n : num_(nt)^n, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (nt = !($nunpack(zt))) - -- if ($concat_(syntax byte, $nbytes(nt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) + -- if ($concat_(syntax byte, $nbytes(nt, c)^n{c : num_(nt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) ;; 8-reduction.watsup rule array.new_data-vec{z : state, i : nat, n : n, x : idx, y : idx, vt : vectype, c^n : vec_(vt)^n, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (vt = !($vunpack(zt))) - -- if ($concat_(syntax byte, $vbytes(vt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) + -- if ($concat_(syntax byte, $vbytes(vt, c)^n{c : vec_(vt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) ;; 8-reduction.watsup rule array.get-null{z : state, ht : heaptype, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.get-oob{z : state, a : addr, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.get-array{z : state, a : addr, i : nat, sx? : sx?, x : idx, zt : storagetype, fv : fieldval, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [($unpackval(zt, sx?{sx}, fv) : val <: admininstr)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) @@ -10040,18 +10040,18 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.copy-le{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) + -- if (sx?{sx : sx} = $sxfield(zt_2)) -- if (i_1 <= i_2) ;; 8-reduction.watsup rule array.copy-gt{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) + -- if (sx?{sx : sx} = $sxfield(zt_2)) ;; 8-reduction.watsup rule array.init_elem-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: @@ -10232,9 +10232,9 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule vload-shape-val{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop, c : vec_(V128_vnn), j^N : nat^N, k^N : nat^N, inn : inn}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) - -- (if ($ibytes(M, `%`(j)) = $mem(z, x).DATA_meminst[((i + mo.OFFSET_memop.`%`.0) + ((k * M) / 8)) : (M / 8)]))^(k%*`(config, admininstr*) relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule pure{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr'})) - -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr}, (instr' : instr <: admininstr)*{instr'}) + `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule read{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr'})) - -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), (instr' : instr <: admininstr)*{instr'}) + `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule struct.new{z : state, val^n : val^n, n : n, x : idx, si : structinst, mut^n : mut^n, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) - -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) + `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut : mut zt : storagetype})) + -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val zt : storagetype}}) ;; 8-reduction.watsup rule struct.set-null{z : state, ht : heaptype, val : val, x : idx, i : nat}: @@ -10357,14 +10357,14 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule struct.set-struct{z : state, a : addr, val : val, x : idx, i : nat, fv : fieldval, mut* : mut*, zt* : storagetype*}: `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`($with_struct(z, a, i, fv), [])) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- if (fv = $packval(zt*{zt}[i], val)) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- if (fv = $packval(zt*{zt : storagetype}[i], val)) ;; 8-reduction.watsup rule array.new_fixed{z : state, val^n : val^n, n : n, x : idx, ai : arrayinst, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) + -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val}}) ;; 8-reduction.watsup rule array.set-null{z : state, ht : heaptype, i : nat, val : val, x : idx}: @@ -10419,8 +10419,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule store-num-val{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b}), [])) - -- if (b*{b} = $nbytes(nt, c)) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) + -- if (b*{b : byte} = $nbytes(nt, c)) ;; 8-reduction.watsup rule store-pack-oob{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop}: @@ -10429,8 +10429,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule store-pack-val{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b}), [])) - -- if (b*{b} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c))) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) + -- if (b*{b : byte} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c))) ;; 8-reduction.watsup rule vstore-oob{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop}: @@ -10439,8 +10439,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule vstore-val{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b}), [])) - -- if (b*{b} = $vbytes(V128_vectype, c)) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) + -- if (b*{b : byte} = $vbytes(V128_vectype, c)) ;; 8-reduction.watsup rule vstore_lane-oob{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: @@ -10449,10 +10449,10 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule vstore_lane-val{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, b* : byte*, imm : imm, M : M}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b}), [])) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = (128 / N)) - -- if (b*{b} = $ibytes(N, `%`($lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)[j].`%`.0))) + -- if (b*{b : byte} = $ibytes(N, `%`($lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)[j].`%`.0))) ;; 8-reduction.watsup rule memory.grow-succeed{z : state, n : n, x : idx, mi : meminst}: @@ -10474,21 +10474,21 @@ rec { relation Steps: `%~>*%`(config, config) ;; 8-reduction.watsup:18.1-19.36 rule refl{z : state, admininstr* : admininstr*}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) + `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z, admininstr*{admininstr : admininstr})) ;; 8-reduction.watsup:21.1-24.53 rule trans{z : state, admininstr* : admininstr*, z'' : state, admininstr''* : admininstr*, z' : state, admininstr' : admininstr}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z'', admininstr''*{admininstr''})) - -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z', admininstr'*{})) - -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr''})) + `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) + -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z', admininstr'*{})) + -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) } ;; 8-reduction.watsup relation Eval_expr: `%;%~>*%;%*`(state, expr, state, val*) ;; 8-reduction.watsup rule _{z : state, instr* : instr*, z' : state, val* : val*}: - `%;%~>*%;%*`(z, instr*{instr}, z', val*{val}) - -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z', (val : val <: admininstr)*{val})) + `%;%~>*%;%*`(z, instr*{instr : instr}, z', val*{val : val}) + -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z', (val : val <: admininstr)*{val : val})) ;; 9-module.watsup rec { @@ -10498,18 +10498,18 @@ def $alloctypes(type*) : deftype* ;; 9-module.watsup:8.1-8.27 def $alloctypes([]) = [] ;; 9-module.watsup:9.1-13.24 - def $alloctypes{type'* : type*, type : type, deftype'* : deftype*, deftype* : deftype*, rectype : rectype, x : idx}(type'*{type'} :: [type]) = deftype'*{deftype'} :: deftype*{deftype} - -- if (deftype'*{deftype'} = $alloctypes(type'*{type'})) + def $alloctypes{type'* : type*, type : type, deftype'* : deftype*, deftype* : deftype*, rectype : rectype, x : idx}(type'*{type' : type} :: [type]) = deftype'*{deftype' : deftype} :: deftype*{deftype : deftype} + -- if (deftype'*{deftype' : deftype} = $alloctypes(type'*{type' : type})) -- if (type = TYPE(rectype)) - -- if (deftype*{deftype} = $subst_all_deftypes($rolldt(x, rectype), (deftype' : deftype <: heaptype)*{deftype'})) - -- if (x = `%`(|deftype'*{deftype'}|)) + -- if (deftype*{deftype : deftype} = $subst_all_deftypes($rolldt(x, rectype), (deftype' : deftype <: heaptype)*{deftype' : deftype})) + -- if (x = `%`(|deftype'*{deftype' : deftype}|)) } ;; 9-module.watsup def $allocfunc(store : store, moduleinst : moduleinst, func : func) : (store, funcaddr) ;; 9-module.watsup def $allocfunc{s : store, mm : moduleinst, func : func, fi : funcinst, x : idx, local* : local*, expr : expr}(s, mm, func) = (s[FUNC_store =.. [fi]], |s.FUNC_store|) - -- if (func = `FUNC%%*%`(x, local*{local}, expr)) + -- if (func = `FUNC%%*%`(x, local*{local : local}, expr)) -- if (fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func}) ;; 9-module.watsup @@ -10520,9 +10520,9 @@ def $allocfuncs(store : store, moduleinst : moduleinst, func*) : (store, funcadd ;; 9-module.watsup:21.1-21.39 def $allocfuncs{s : store, mm : moduleinst}(s, mm, []) = (s, []) ;; 9-module.watsup:22.1-24.51 - def $allocfuncs{s : store, mm : moduleinst, func : func, func'* : func*, s_2 : store, fa : funcaddr, fa'* : funcaddr*, s_1 : store}(s, mm, [func] :: func'*{func'}) = (s_2, [fa] :: fa'*{fa'}) + def $allocfuncs{s : store, mm : moduleinst, func : func, func'* : func*, s_2 : store, fa : funcaddr, fa'* : funcaddr*, s_1 : store}(s, mm, [func] :: func'*{func' : func}) = (s_2, [fa] :: fa'*{fa' : funcaddr}) -- if ((s_1, fa) = $allocfunc(s, mm, func)) - -- if ((s_2, fa'*{fa'}) = $allocfuncs(s_1, mm, func'*{func'})) + -- if ((s_2, fa'*{fa' : funcaddr}) = $allocfuncs(s_1, mm, func'*{func' : func})) } ;; 9-module.watsup @@ -10539,9 +10539,9 @@ def $allocglobals(store : store, globaltype*, val*) : (store, globaladdr*) ;; 9-module.watsup:31.1-31.42 def $allocglobals{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:32.1-34.62 - def $allocglobals{s : store, globaltype : globaltype, globaltype'* : globaltype*, val : val, val'* : val*, s_2 : store, ga : globaladdr, ga'* : globaladdr*, s_1 : store}(s, [globaltype] :: globaltype'*{globaltype'}, [val] :: val'*{val'}) = (s_2, [ga] :: ga'*{ga'}) + def $allocglobals{s : store, globaltype : globaltype, globaltype'* : globaltype*, val : val, val'* : val*, s_2 : store, ga : globaladdr, ga'* : globaladdr*, s_1 : store}(s, [globaltype] :: globaltype'*{globaltype' : globaltype}, [val] :: val'*{val' : val}) = (s_2, [ga] :: ga'*{ga' : globaladdr}) -- if ((s_1, ga) = $allocglobal(s, globaltype, val)) - -- if ((s_2, ga'*{ga'}) = $allocglobals(s_1, globaltype'*{globaltype'}, val'*{val'})) + -- if ((s_2, ga'*{ga' : globaladdr}) = $allocglobals(s_1, globaltype'*{globaltype' : globaltype}, val'*{val' : val})) } ;; 9-module.watsup @@ -10558,9 +10558,9 @@ def $alloctables(store : store, tabletype*, ref*) : (store, tableaddr*) ;; 9-module.watsup:41.1-41.41 def $alloctables{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:42.1-44.60 - def $alloctables{s : store, tabletype : tabletype, tabletype'* : tabletype*, ref : ref, ref'* : ref*, s_2 : store, ta : tableaddr, ta'* : tableaddr*, s_1 : store}(s, [tabletype] :: tabletype'*{tabletype'}, [ref] :: ref'*{ref'}) = (s_2, [ta] :: ta'*{ta'}) + def $alloctables{s : store, tabletype : tabletype, tabletype'* : tabletype*, ref : ref, ref'* : ref*, s_2 : store, ta : tableaddr, ta'* : tableaddr*, s_1 : store}(s, [tabletype] :: tabletype'*{tabletype' : tabletype}, [ref] :: ref'*{ref' : ref}) = (s_2, [ta] :: ta'*{ta' : tableaddr}) -- if ((s_1, ta) = $alloctable(s, tabletype, ref)) - -- if ((s_2, ta'*{ta'}) = $alloctables(s_1, tabletype'*{tabletype'}, ref'*{ref'})) + -- if ((s_2, ta'*{ta' : tableaddr}) = $alloctables(s_1, tabletype'*{tabletype' : tabletype}, ref'*{ref' : ref})) } ;; 9-module.watsup @@ -10577,16 +10577,16 @@ def $allocmems(store : store, memtype*) : (store, memaddr*) ;; 9-module.watsup:51.1-51.34 def $allocmems{s : store}(s, []) = (s, []) ;; 9-module.watsup:52.1-54.49 - def $allocmems{s : store, memtype : memtype, memtype'* : memtype*, s_2 : store, ma : memaddr, ma'* : memaddr*, s_1 : store}(s, [memtype] :: memtype'*{memtype'}) = (s_2, [ma] :: ma'*{ma'}) + def $allocmems{s : store, memtype : memtype, memtype'* : memtype*, s_2 : store, ma : memaddr, ma'* : memaddr*, s_1 : store}(s, [memtype] :: memtype'*{memtype' : memtype}) = (s_2, [ma] :: ma'*{ma' : memaddr}) -- if ((s_1, ma) = $allocmem(s, memtype)) - -- if ((s_2, ma'*{ma'}) = $allocmems(s_1, memtype'*{memtype'})) + -- if ((s_2, ma'*{ma' : memaddr}) = $allocmems(s_1, memtype'*{memtype' : memtype})) } ;; 9-module.watsup def $allocelem(store : store, reftype : reftype, ref*) : (store, elemaddr) ;; 9-module.watsup - def $allocelem{s : store, rt : reftype, ref* : ref*, ei : eleminst}(s, rt, ref*{ref}) = (s[ELEM_store =.. [ei]], |s.ELEM_store|) - -- if (ei = {TYPE rt, ELEM ref*{ref}}) + def $allocelem{s : store, rt : reftype, ref* : ref*, ei : eleminst}(s, rt, ref*{ref : ref}) = (s[ELEM_store =.. [ei]], |s.ELEM_store|) + -- if (ei = {TYPE rt, ELEM ref*{ref : ref}}) ;; 9-module.watsup rec { @@ -10596,16 +10596,16 @@ def $allocelems(store : store, reftype*, ref**) : (store, elemaddr*) ;; 9-module.watsup:61.1-61.40 def $allocelems{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:62.1-64.55 - def $allocelems{s : store, rt : reftype, rt'* : reftype*, ref* : ref*, ref'** : ref**, s_2 : store, ea : elemaddr, ea'* : elemaddr*, s_1 : store}(s, [rt] :: rt'*{rt'}, [ref*{ref}] :: ref'*{ref'}*{ref'}) = (s_2, [ea] :: ea'*{ea'}) - -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref})) - -- if ((s_2, ea'*{ea'}) = $allocelems(s_2, rt'*{rt'}, ref'*{ref'}*{ref'})) + def $allocelems{s : store, rt : reftype, rt'* : reftype*, ref* : ref*, ref'** : ref**, s_2 : store, ea : elemaddr, ea'* : elemaddr*, s_1 : store}(s, [rt] :: rt'*{rt' : reftype}, [ref*{ref : ref}] :: ref'*{ref' : ref}*{ref' : ref}) = (s_2, [ea] :: ea'*{ea' : elemaddr}) + -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref : ref})) + -- if ((s_2, ea'*{ea' : elemaddr}) = $allocelems(s_2, rt'*{rt' : reftype}, ref'*{ref' : ref}*{ref' : ref})) } ;; 9-module.watsup def $allocdata(store : store, byte*) : (store, dataaddr) ;; 9-module.watsup - def $allocdata{s : store, byte* : byte*, di : datainst}(s, byte*{byte}) = (s[DATA_store =.. [di]], |s.DATA_store|) - -- if (di = {DATA byte*{byte}}) + def $allocdata{s : store, byte* : byte*, di : datainst}(s, byte*{byte : byte}) = (s[DATA_store =.. [di]], |s.DATA_store|) + -- if (di = {DATA byte*{byte : byte}}) ;; 9-module.watsup rec { @@ -10615,92 +10615,92 @@ def $allocdatas(store : store, byte**) : (store, dataaddr*) ;; 9-module.watsup:71.1-71.35 def $allocdatas{s : store}(s, []) = (s, []) ;; 9-module.watsup:72.1-74.50 - def $allocdatas{s : store, byte* : byte*, byte'** : byte**, s_2 : store, da : dataaddr, da'* : dataaddr*, s_1 : store}(s, [byte*{byte}] :: byte'*{byte'}*{byte'}) = (s_2, [da] :: da'*{da'}) - -- if ((s_1, da) = $allocdata(s, byte*{byte})) - -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) + def $allocdatas{s : store, byte* : byte*, byte'** : byte**, s_2 : store, da : dataaddr, da'* : dataaddr*, s_1 : store}(s, [byte*{byte : byte}] :: byte'*{byte' : byte}*{byte' : byte}) = (s_2, [da] :: da'*{da' : dataaddr}) + -- if ((s_1, da) = $allocdata(s, byte*{byte : byte})) + -- if ((s_2, da'*{da' : dataaddr}) = $allocdatas(s_1, byte'*{byte' : byte}*{byte' : byte})) } ;; 9-module.watsup def $instexport(funcaddr*, globaladdr*, tableaddr*, memaddr*, export : export) : exportinst ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa : funcaddr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga : globaladdr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta : tableaddr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma : memaddr}[x.`%`.0])} ;; 9-module.watsup def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) : (store, moduleinst) ;; 9-module.watsup - def $allocmodule{s : store, module : module, externval* : externval*, val_g* : val*, ref_t* : ref*, ref_e** : ref**, s_6 : store, mm : moduleinst, type* : type*, import* : import*, func^n_f : func^n_f, n_f : n, globaltype^n_g : globaltype^n_g, expr_g^n_g : expr^n_g, n_g : n, tabletype^n_t : tabletype^n_t, expr_t^n_t : expr^n_t, n_t : n, memtype^n_m : memtype^n_m, n_m : n, reftype^n_e : reftype^n_e, expr_e*^n_e : expr*^n_e, elemmode^n_e : elemmode^n_e, n_e : n, byte*^n_d : byte*^n_d, datamode^n_d : datamode^n_d, n_d : n, start? : start?, export* : export*, fa_ex* : funcaddr*, ga_ex* : globaladdr*, ta_ex* : tableaddr*, ma_ex* : memaddr*, fa* : funcaddr*, i_f^n_f : nat^n_f, ga* : globaladdr*, i_g^n_g : nat^n_g, ta* : tableaddr*, i_t^n_t : nat^n_t, ma* : memaddr*, i_m^n_m : nat^n_m, ea* : elemaddr*, i_e^n_e : nat^n_e, da* : dataaddr*, i_d^n_d : nat^n_d, xi* : exportinst*, dt* : deftype*, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store}(s, module, externval*{externval}, val_g*{val_g}, ref_t*{ref_t}, ref_e*{ref_e}*{ref_e}) = (s_6, mm) - -- if (module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type}, import*{import}, func^n_f{func}, GLOBAL(globaltype, expr_g)^n_g{expr_g globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t tabletype}, MEMORY(memtype)^n_m{memtype}, `ELEM%%*%`(reftype, expr_e*{expr_e}, elemmode)^n_e{elemmode expr_e reftype}, `DATA%*%`(byte*{byte}, datamode)^n_d{byte datamode}, start?{start}, export*{export})) - -- if (fa_ex*{fa_ex} = $funcsxv(externval*{externval})) - -- if (ga_ex*{ga_ex} = $globalsxv(externval*{externval})) - -- if (ta_ex*{ta_ex} = $tablesxv(externval*{externval})) - -- if (ma_ex*{ma_ex} = $memsxv(externval*{externval})) - -- if (fa*{fa} = (|s.FUNC_store| + i_f)^(i_f*%;%*`(z, expr_G, z, [val_G]))*{expr_G val_G} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T ref_T} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E ref_E}*{expr_E ref_E} - -- if ((s', mm) = $allocmodule(s, module, externval*{externval}, val_G*{val_G}, ref_T*{ref_T}, ref_E*{ref_E}*{ref_E})) + -- (Eval_expr: `%;%~>*%;%*`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} + -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} + -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} + -- if ((s', mm) = $allocmodule(s, module, externval*{externval : externval}, val_G*{val_G : val}, ref_T*{ref_T : ref}, ref_E*{ref_E : ref}*{ref_E : ref})) -- if (f = {LOCAL [], MODULE mm}) - -- if (instr_E*{instr_E} = $concat_(syntax instr, $runelem(elem*{elem}[i], `%`(i))^(i%`(t_1^n{t_1}, t_2*{t_2}))) + -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = `FUNC%%*%`(x, local*{local : local}, expr)) + -- Expand: `%~~%`(s.FUNC_store[fa].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; A-binary.watsup rec { @@ -10720,7 +10720,7 @@ def $utf8(name : name) : byte* def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([`%`(ch)]) = [b_1 b_2 b_3 b_4] -- if (((65536 <= ch) /\ (ch < 69632)) /\ (ch = (((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128)))) ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(`%`(ch)*{ch}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch}) + def $utf8{ch* : nat*}(`%`(ch)*{ch : nat}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch : nat}) } ;; A-binary.watsup @@ -10740,14 +10740,14 @@ syntax B = nat ;; C-conventions.watsup syntax sym = - | _FIRST(A_1 : A) + | _FIRST{A_1 : A}(A_1 : A) | _DOTS - | _LAST(A_n : A) + | _LAST{A_n : A}(A_n : A) ;; C-conventions.watsup syntax symsplit = - | _FIRST(A_1 : A) - | _LAST(A_2 : A) + | _FIRST{A_1 : A}(A_1 : A) + | _LAST{A_2 : A}(A_2 : A) ;; C-conventions.watsup syntax recorddots = `...` @@ -10755,21 +10755,21 @@ syntax recorddots = `...` ;; C-conventions.watsup syntax record = { - FIELD_1 A, - FIELD_2 A, - DOTS recorddots + FIELD_1{A_1 : A} A, + FIELD_2{A_2 : A} A, + DOTS{recorddots : recorddots} recorddots } ;; C-conventions.watsup syntax recordstar = { - FIELD_1 A*, - FIELD_2 A*, - DOTS recorddots + FIELD_1{A_1* : A*} A*, + FIELD_2{A_2* : A*} A*, + DOTS{recorddots : recorddots} recorddots } ;; C-conventions.watsup -syntax recordeq = `%++%=%`(recordstar : recordstar, recordstar : recordstar, recordstar : recordstar) +syntax recordeq = `%++%=%`{recordstar : recordstar}(recordstar : recordstar, recordstar, recordstar) ;; C-conventions.watsup syntax pth = @@ -10825,7 +10825,7 @@ def $sum(nat*) : nat ;; 0-aux.watsup:33.1-33.18 def $sum([]) = 0 ;; 0-aux.watsup:34.1-34.35 - def $sum{n : n, n'* : n*}([n] :: n'*{n'}) = (n + $sum(n'*{n'})) + def $sum{n : n, n'* : n*}([n] :: n'*{n' : nat}) = (n + $sum(n'*{n' : nat})) } ;; 0-aux.watsup @@ -10836,7 +10836,7 @@ def $concat_(syntax X, X**) : X* ;; 0-aux.watsup:40.1-40.34 def $concat_{syntax X}(syntax X, []) = [] ;; 0-aux.watsup:41.1-41.61 - def $concat_{syntax X, w* : X*, w'** : X**}(syntax X, [w*{w}] :: w'*{w'}*{w'}) = w*{w} :: $concat_(syntax X, w'*{w'}*{w'}) + def $concat_{syntax X, w* : X*, w'** : X**}(syntax X, [w*{w : X}] :: w'*{w' : X}*{w' : X}) = w*{w : X} :: $concat_(syntax X, w'*{w' : X}*{w' : X}) } ;; 1-syntax.watsup @@ -10925,8 +10925,8 @@ syntax fNmag{N : N}(N) = ;; 1-syntax.watsup syntax fN{N : N}(N) = - | POS(fNmag : fNmag(N)) - | NEG(fNmag : fNmag(N)) + | POS{fNmag : fNmag(N)}(fNmag : fNmag(N)) + | NEG{fNmag : fNmag(N)}(fNmag : fNmag(N)) ;; 1-syntax.watsup syntax f32 = fN(32) @@ -11029,7 +11029,7 @@ syntax valtype = | F32 | F64 | V128 - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | BOT ;; 1-syntax.watsup:154.1-155.16 @@ -11043,15 +11043,15 @@ syntax storagetype = | F32 | F64 | V128 - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | I8 | I16 ;; 1-syntax.watsup:175.1-176.18 -syntax fieldtype = `%%`(mut : mut, storagetype : storagetype) +syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) ;; 1-syntax.watsup:178.1-178.70 -syntax functype = `%->%`(resulttype : resulttype, resulttype : resulttype) +syntax functype = `%->%`{resulttype : resulttype}(resulttype : resulttype, resulttype) ;; 1-syntax.watsup:179.1-179.64 syntax structtype = list(syntax fieldtype) @@ -11061,22 +11061,22 @@ syntax arraytype = fieldtype ;; 1-syntax.watsup:182.1-185.18 syntax comptype = - | STRUCT(structtype : structtype) - | ARRAY(arraytype : arraytype) - | FUNC(functype : functype) + | STRUCT{structtype : structtype}(structtype : structtype) + | ARRAY{arraytype : arraytype}(arraytype : arraytype) + | FUNC{functype : functype}(functype : functype) ;; 1-syntax.watsup:189.1-190.60 syntax subtype = - | SUB(fin : fin, typeidx*, comptype : comptype) - | SUBD(fin : fin, heaptype*, comptype : comptype) + | SUB{fin : fin, typeidx* : typeidx*, comptype : comptype}(fin : fin, typeidx*{typeidx : typeidx} : typeidx*, comptype : comptype) + | SUBD{fin : fin, heaptype* : heaptype*, comptype : comptype}(fin : fin, heaptype*{heaptype : heaptype} : heaptype*, comptype : comptype) ;; 1-syntax.watsup:192.1-193.22 syntax rectype = - | REC(list : list(syntax subtype)) + | REC{list : list(syntax subtype)}(list : list(syntax subtype)) ;; 1-syntax.watsup:198.1-199.26 syntax heaptype = - | _IDX(typeidx : typeidx) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY | EQ | I31 @@ -11088,13 +11088,13 @@ syntax heaptype = | EXTERN | NOEXTERN | BOT - | DEF(rectype : rectype, nat : nat) - | REC(n : n) + | DEF{rectype : rectype}(rectype : rectype, nat) + | REC{n : n}(n : n) } ;; 1-syntax.watsup syntax reftype = - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) ;; 1-syntax.watsup syntax inn = @@ -11147,19 +11147,19 @@ syntax imm = ;; 1-syntax.watsup syntax deftype = - | DEF(rectype : rectype, nat : nat) + | DEF{rectype : rectype}(rectype : rectype, nat) ;; 1-syntax.watsup -syntax limits = `[%..%]`(u32 : u32, u32 : u32) +syntax limits = `[%..%]`{u32 : u32}(u32 : u32, u32) ;; 1-syntax.watsup -syntax globaltype = `%%`(mut : mut, valtype : valtype) +syntax globaltype = `%%`{mut : mut, valtype : valtype}(mut : mut, valtype : valtype) ;; 1-syntax.watsup -syntax tabletype = `%%`(limits : limits, reftype : reftype) +syntax tabletype = `%%`{limits : limits, reftype : reftype}(limits : limits, reftype : reftype) ;; 1-syntax.watsup -syntax memtype = `%I8`(limits : limits) +syntax memtype = `%I8`{limits : limits}(limits : limits) ;; 1-syntax.watsup syntax elemtype = reftype @@ -11169,10 +11169,10 @@ syntax datatype = OK ;; 1-syntax.watsup syntax externtype = - | FUNC(deftype : deftype) - | GLOBAL(globaltype : globaltype) - | TABLE(tabletype : tabletype) - | MEM(memtype : memtype) + | FUNC{deftype : deftype}(deftype : deftype) + | GLOBAL{globaltype : globaltype}(globaltype : globaltype) + | TABLE{tabletype : tabletype}(tabletype : tabletype) + | MEM{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup def $size(numtype : numtype) : nat @@ -11218,7 +11218,7 @@ syntax dim = `%`{i : nat}(i : nat) -- if (((((i = 1) \/ (i = 2)) \/ (i = 4)) \/ (i = 8)) \/ (i = 16)) ;; 1-syntax.watsup -syntax shape = `%X%`(lanetype : lanetype, dim : dim) +syntax shape = `%X%`{lanetype : lanetype, dim : dim}(lanetype : lanetype, dim : dim) ;; 1-syntax.watsup def $lanetype(shape : shape) : lanetype @@ -11286,7 +11286,7 @@ syntax unop_(numtype : numtype) | CLZ | CTZ | POPCNT - | EXTEND(n : n) + | EXTEND{n : n}(n : n) ;; 1-syntax.watsup @@ -11307,13 +11307,13 @@ syntax binop_(numtype : numtype) | ADD | SUB | MUL - | DIV(sx : sx) - | REM(sx : sx) + | DIV{sx : sx}(sx : sx) + | REM{sx : sx}(sx : sx) | AND | OR | XOR | SHL - | SHR(sx : sx) + | SHR{sx : sx}(sx : sx) | ROTL | ROTR @@ -11339,10 +11339,10 @@ syntax relop_(numtype : numtype) syntax relop_{inn : inn}((inn : inn <: numtype)) = | EQ | NE - | LT(sx : sx) - | GT(sx : sx) - | LE(sx : sx) - | GE(sx : sx) + | LT{sx : sx}(sx : sx) + | GT{sx : sx}(sx : sx) + | LE{sx : sx}(sx : sx) + | GE{sx : sx}(sx : sx) ;; 1-syntax.watsup @@ -11362,13 +11362,13 @@ syntax cvtop = | REINTERPRET ;; 1-syntax.watsup -syntax ishape = `%X%`(imm : imm, dim : dim) +syntax ishape = `%X%`{imm : imm, dim : dim}(imm : imm, dim : dim) ;; 1-syntax.watsup -syntax fshape = `%X%`(fnn : fnn, dim : dim) +syntax fshape = `%X%`{fnn : fnn, dim : dim}(fnn : fnn, dim : dim) ;; 1-syntax.watsup -syntax pshape = `%X%`(pnn : pnn, dim : dim) +syntax pshape = `%X%`{pnn : pnn, dim : dim}(pnn : pnn, dim : dim) ;; 1-syntax.watsup def $dim(shape : shape) : dim @@ -11426,9 +11426,9 @@ syntax vbinop_(shape : shape) syntax vbinop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ADD | SUB - | ADD_SAT(sx : sx) + | ADD_SAT{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 16) - | SUB_SAT(sx : sx) + | SUB_SAT{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 16) | MUL -- if ($lsize((imm : imm <: lanetype)) >= 16) @@ -11436,9 +11436,9 @@ syntax vbinop_(shape : shape) -- if ($lsize((imm : imm <: lanetype)) <= 16) | Q15MULR_SAT_S{imm : imm} -- if ($lsize((imm : imm <: lanetype)) = 16) - | MIN(sx : sx) + | MIN{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 32) - | MAX(sx : sx) + | MAX{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 32) @@ -11464,10 +11464,10 @@ syntax vrelop_(shape : shape) syntax vrelop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | EQ | NE - | LT(sx : sx) - | GT(sx : sx) - | LE(sx : sx) - | GE(sx : sx) + | LT{sx : sx}(sx : sx) + | GT{sx : sx}(sx : sx) + | LE{sx : sx}(sx : sx) + | GE{sx : sx}(sx : sx) ;; 1-syntax.watsup @@ -11491,7 +11491,7 @@ syntax vcvtop = ;; 1-syntax.watsup syntax vshiftop_{imm : imm, N : N}(`%X%`(imm, `%`(N))) = | SHL - | SHR(sx : sx) + | SHR{sx : sx}(sx : sx) ;; 1-syntax.watsup syntax vextunop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = @@ -11505,27 +11505,27 @@ syntax half = ;; 1-syntax.watsup syntax vextbinop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = - | EXTMUL(half : half) + | EXTMUL{half : half}(half : half) | DOT{imm_1 : imm} -- if ($lsize((imm_1 : imm <: lanetype)) = 32) ;; 1-syntax.watsup syntax memop = { - ALIGN u32, - OFFSET u32 + ALIGN{u32 : u32} u32, + OFFSET{u32 : u32} u32 } ;; 1-syntax.watsup syntax vloadop = - | SHAPE(nat : nat, nat : nat, sx : sx) - | SPLAT(nat : nat) - | ZERO(nat : nat) + | SHAPE{sx : sx}(nat, nat, sx : sx) + | SPLAT(nat) + | ZERO(nat) ;; 1-syntax.watsup syntax blocktype = - | _RESULT(valtype?) - | _IDX(funcidx : funcidx) + | _RESULT{valtype? : valtype?}(valtype?{valtype : valtype} : valtype?) + | _IDX{funcidx : funcidx}(funcidx : funcidx) ;; 1-syntax.watsup syntax zero = `ZERO%?`(()?) @@ -11538,108 +11538,108 @@ syntax instr = | UNREACHABLE | NOP | DROP - | SELECT(valtype*?) - | BLOCK(blocktype : blocktype, instr*) - | LOOP(blocktype : blocktype, instr*) - | IF(blocktype : blocktype, instr*, instr*) - | BR(labelidx : labelidx) - | BR_IF(labelidx : labelidx) - | BR_TABLE(labelidx*, labelidx : labelidx) - | BR_ON_NULL(labelidx : labelidx) - | BR_ON_NON_NULL(labelidx : labelidx) - | BR_ON_CAST(labelidx : labelidx, reftype : reftype, reftype : reftype) - | BR_ON_CAST_FAIL(labelidx : labelidx, reftype : reftype, reftype : reftype) - | CALL(funcidx : funcidx) - | CALL_REF(typeidx?) - | CALL_INDIRECT(tableidx : tableidx, typeidx : typeidx) + | SELECT{valtype*? : valtype*?}(valtype*{valtype : valtype}?{valtype : valtype} : valtype*?) + | BLOCK{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*) + | LOOP{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*) + | IF{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*, instr*) + | BR{labelidx : labelidx}(labelidx : labelidx) + | BR_IF{labelidx : labelidx}(labelidx : labelidx) + | BR_TABLE{labelidx : labelidx}(labelidx*{} : labelidx*, labelidx) + | BR_ON_NULL{labelidx : labelidx}(labelidx : labelidx) + | BR_ON_NON_NULL{labelidx : labelidx}(labelidx : labelidx) + | BR_ON_CAST{labelidx : labelidx, reftype : reftype}(labelidx : labelidx, reftype : reftype, reftype) + | BR_ON_CAST_FAIL{labelidx : labelidx, reftype : reftype}(labelidx : labelidx, reftype : reftype, reftype) + | CALL{funcidx : funcidx}(funcidx : funcidx) + | CALL_REF{typeidx? : typeidx?}(typeidx?{typeidx : typeidx} : typeidx?) + | CALL_INDIRECT{tableidx : tableidx, typeidx : typeidx}(tableidx : tableidx, typeidx : typeidx) | RETURN - | RETURN_CALL(funcidx : funcidx) - | RETURN_CALL_REF(typeidx?) - | RETURN_CALL_INDIRECT(tableidx : tableidx, typeidx : typeidx) - | CONST(numtype : numtype, num_ : num_(numtype)) - | UNOP(numtype : numtype, unop_ : unop_(numtype)) - | BINOP(numtype : numtype, binop_ : binop_(numtype)) - | TESTOP(numtype : numtype, testop_ : testop_(numtype)) - | RELOP(numtype : numtype, relop_ : relop_(numtype)) - | CVTOP(numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx?) - | EXTEND(numtype : numtype, n : n) - | VCONST(vectype : vectype, vec_ : vec_(vectype)) - | VVUNOP(vectype : vectype, vvunop : vvunop) - | VVBINOP(vectype : vectype, vvbinop : vvbinop) - | VVTERNOP(vectype : vectype, vvternop : vvternop) - | VVTESTOP(vectype : vectype, vvtestop : vvtestop) + | RETURN_CALL{funcidx : funcidx}(funcidx : funcidx) + | RETURN_CALL_REF{typeidx? : typeidx?}(typeidx?{typeidx : typeidx} : typeidx?) + | RETURN_CALL_INDIRECT{tableidx : tableidx, typeidx : typeidx}(tableidx : tableidx, typeidx : typeidx) + | CONST{numtype : numtype, num_ : num_(numtype)}(numtype : numtype, num_ : num_(numtype)) + | UNOP{numtype : numtype, unop_ : unop_(numtype)}(numtype : numtype, unop_ : unop_(numtype)) + | BINOP{numtype : numtype, binop_ : binop_(numtype)}(numtype : numtype, binop_ : binop_(numtype)) + | TESTOP{numtype : numtype, testop_ : testop_(numtype)}(numtype : numtype, testop_ : testop_(numtype)) + | RELOP{numtype : numtype, relop_ : relop_(numtype)}(numtype : numtype, relop_ : relop_(numtype)) + | CVTOP{numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx? : sx?}(numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx?{sx : sx} : sx?) + | EXTEND{numtype : numtype, n : n}(numtype : numtype, n : n) + | VCONST{vectype : vectype, vec_ : vec_(vectype)}(vectype : vectype, vec_ : vec_(vectype)) + | VVUNOP{vectype : vectype, vvunop : vvunop}(vectype : vectype, vvunop : vvunop) + | VVBINOP{vectype : vectype, vvbinop : vvbinop}(vectype : vectype, vvbinop : vvbinop) + | VVTERNOP{vectype : vectype, vvternop : vvternop}(vectype : vectype, vvternop : vvternop) + | VVTESTOP{vectype : vectype, vvtestop : vvtestop}(vectype : vectype, vvtestop : vvtestop) | VSWIZZLE{ishape : ishape}(ishape : ishape) -- if (ishape = `%X%`(I8_imm, `%`(16))) - | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*) - -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) - | VSPLAT(shape : shape) - | VEXTRACT_LANE{shape : shape, numtype : numtype, sx? : sx?}(shape : shape, sx?, laneidx : laneidx) - -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx} = ?())) - | VREPLACE_LANE(shape : shape, laneidx : laneidx) - | VUNOP(shape : shape, vunop_ : vunop_(shape)) - | VBINOP(shape : shape, vbinop_ : vbinop_(shape)) - | VTESTOP(shape : shape, vtestop_ : vtestop_(shape)) - | VRELOP(shape : shape, vrelop_ : vrelop_(shape)) - | VSHIFTOP(ishape : ishape, vshiftop_ : vshiftop_(ishape)) - | VBITMASK(ishape : ishape) - | VCVTOP(shape : shape, vcvtop : vcvtop, half?, shape : shape, sx?, zero : zero) - | VNARROW(ishape : ishape, ishape : ishape, sx : sx) - | VEXTUNOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) + | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*{laneidx : laneidx} : laneidx*) + -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx : laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) + | VSPLAT{shape : shape}(shape : shape) + | VEXTRACT_LANE{shape : shape, sx? : sx?, laneidx : laneidx, numtype : numtype}(shape : shape, sx?{sx : sx} : sx?, laneidx : laneidx) + -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx : sx} = ?())) + | VREPLACE_LANE{shape : shape, laneidx : laneidx}(shape : shape, laneidx : laneidx) + | VUNOP{shape : shape, vunop_ : vunop_(shape)}(shape : shape, vunop_ : vunop_(shape)) + | VBINOP{shape : shape, vbinop_ : vbinop_(shape)}(shape : shape, vbinop_ : vbinop_(shape)) + | VTESTOP{shape : shape, vtestop_ : vtestop_(shape)}(shape : shape, vtestop_ : vtestop_(shape)) + | VRELOP{shape : shape, vrelop_ : vrelop_(shape)}(shape : shape, vrelop_ : vrelop_(shape)) + | VSHIFTOP{ishape : ishape, vshiftop_ : vshiftop_(ishape)}(ishape : ishape, vshiftop_ : vshiftop_(ishape)) + | VBITMASK{ishape : ishape}(ishape : ishape) + | VCVTOP{shape : shape, vcvtop : vcvtop, half? : half?, sx? : sx?, zero : zero}(shape : shape, vcvtop : vcvtop, half?{half : half} : half?, shape, sx?{sx : sx} : sx?, zero : zero) + | VNARROW{ishape : ishape, sx : sx}(ishape : ishape, ishape, sx : sx) + | VEXTUNOP{ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | VEXTBINOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) + | VEXTBINOP{ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | REF.NULL(heaptype : heaptype) + | REF.NULL{heaptype : heaptype}(heaptype : heaptype) | REF.I31 - | REF.FUNC(funcidx : funcidx) + | REF.FUNC{funcidx : funcidx}(funcidx : funcidx) | REF.IS_NULL | REF.AS_NON_NULL | REF.EQ - | REF.TEST(reftype : reftype) - | REF.CAST(reftype : reftype) - | I31.GET(sx : sx) - | STRUCT.NEW(typeidx : typeidx) - | STRUCT.NEW_DEFAULT(typeidx : typeidx) - | STRUCT.GET(sx?, typeidx : typeidx, u32 : u32) - | STRUCT.SET(typeidx : typeidx, u32 : u32) - | ARRAY.NEW(typeidx : typeidx) - | ARRAY.NEW_DEFAULT(typeidx : typeidx) - | ARRAY.NEW_FIXED(typeidx : typeidx, nat : nat) - | ARRAY.NEW_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.NEW_ELEM(typeidx : typeidx, elemidx : elemidx) - | ARRAY.GET(sx?, typeidx : typeidx) - | ARRAY.SET(typeidx : typeidx) + | REF.TEST{reftype : reftype}(reftype : reftype) + | REF.CAST{reftype : reftype}(reftype : reftype) + | I31.GET{sx : sx}(sx : sx) + | STRUCT.NEW{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.GET{sx? : sx?, typeidx : typeidx, u32 : u32}(sx?{sx : sx} : sx?, typeidx : typeidx, u32 : u32) + | STRUCT.SET{typeidx : typeidx, u32 : u32}(typeidx : typeidx, u32 : u32) + | ARRAY.NEW{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_FIXED{typeidx : typeidx}(typeidx : typeidx, nat) + | ARRAY.NEW_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.NEW_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) + | ARRAY.GET{sx? : sx?, typeidx : typeidx}(sx?{sx : sx} : sx?, typeidx : typeidx) + | ARRAY.SET{typeidx : typeidx}(typeidx : typeidx) | ARRAY.LEN - | ARRAY.FILL(typeidx : typeidx) - | ARRAY.COPY(typeidx : typeidx, typeidx : typeidx) - | ARRAY.INIT_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.INIT_ELEM(typeidx : typeidx, elemidx : elemidx) + | ARRAY.FILL{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.COPY{typeidx : typeidx}(typeidx : typeidx, typeidx) + | ARRAY.INIT_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.INIT_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) | EXTERN.CONVERT_ANY | ANY.CONVERT_EXTERN - | LOCAL.GET(localidx : localidx) - | LOCAL.SET(localidx : localidx) - | LOCAL.TEE(localidx : localidx) - | GLOBAL.GET(globalidx : globalidx) - | GLOBAL.SET(globalidx : globalidx) - | TABLE.GET(tableidx : tableidx) - | TABLE.SET(tableidx : tableidx) - | TABLE.SIZE(tableidx : tableidx) - | TABLE.GROW(tableidx : tableidx) - | TABLE.FILL(tableidx : tableidx) - | TABLE.COPY(tableidx : tableidx, tableidx : tableidx) - | TABLE.INIT(tableidx : tableidx, elemidx : elemidx) - | ELEM.DROP(elemidx : elemidx) - | MEMORY.SIZE(memidx : memidx) - | MEMORY.GROW(memidx : memidx) - | MEMORY.FILL(memidx : memidx) - | MEMORY.COPY(memidx : memidx, memidx : memidx) - | MEMORY.INIT(memidx : memidx, dataidx : dataidx) - | DATA.DROP(dataidx : dataidx) - | LOAD(numtype : numtype, (n, sx)?, memidx : memidx, memop : memop) - | STORE(numtype : numtype, n?, memidx : memidx, memop : memop) - | VLOAD(vloadop?, memidx : memidx, memop : memop) - | VLOAD_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | VSTORE(memidx : memidx, memop : memop) - | VSTORE_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | LOCAL.GET{localidx : localidx}(localidx : localidx) + | LOCAL.SET{localidx : localidx}(localidx : localidx) + | LOCAL.TEE{localidx : localidx}(localidx : localidx) + | GLOBAL.GET{globalidx : globalidx}(globalidx : globalidx) + | GLOBAL.SET{globalidx : globalidx}(globalidx : globalidx) + | TABLE.GET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SIZE{tableidx : tableidx}(tableidx : tableidx) + | TABLE.GROW{tableidx : tableidx}(tableidx : tableidx) + | TABLE.FILL{tableidx : tableidx}(tableidx : tableidx) + | TABLE.COPY{tableidx : tableidx}(tableidx : tableidx, tableidx) + | TABLE.INIT{tableidx : tableidx, elemidx : elemidx}(tableidx : tableidx, elemidx : elemidx) + | ELEM.DROP{elemidx : elemidx}(elemidx : elemidx) + | MEMORY.SIZE{memidx : memidx}(memidx : memidx) + | MEMORY.GROW{memidx : memidx}(memidx : memidx) + | MEMORY.FILL{memidx : memidx}(memidx : memidx) + | MEMORY.COPY{memidx : memidx}(memidx : memidx, memidx) + | MEMORY.INIT{memidx : memidx, dataidx : dataidx}(memidx : memidx, dataidx : dataidx) + | DATA.DROP{dataidx : dataidx}(dataidx : dataidx) + | LOAD{numtype : numtype, n? : n?, sx? : sx?, memidx : memidx, memop : memop}(numtype : numtype, (n, sx)?{n : n sx : sx} : (n, sx)?, memidx : memidx, memop : memop) + | STORE{numtype : numtype, n? : n?, memidx : memidx, memop : memop}(numtype : numtype, n?{n : n} : n?, memidx : memidx, memop : memop) + | VLOAD{vloadop? : vloadop?, memidx : memidx, memop : memop}(vloadop?{vloadop : vloadop} : vloadop?, memidx : memidx, memop : memop) + | VLOAD_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | VSTORE{memidx : memidx, memop : memop}(memidx : memidx, memop : memop) + | VSTORE_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) } ;; 1-syntax.watsup @@ -11647,57 +11647,57 @@ syntax expr = instr* ;; 1-syntax.watsup syntax elemmode = - | ACTIVE(tableidx : tableidx, expr : expr) + | ACTIVE{tableidx : tableidx, expr : expr}(tableidx : tableidx, expr : expr) | PASSIVE | DECLARE ;; 1-syntax.watsup syntax datamode = - | ACTIVE(memidx : memidx, expr : expr) + | ACTIVE{memidx : memidx, expr : expr}(memidx : memidx, expr : expr) | PASSIVE ;; 1-syntax.watsup -syntax type = TYPE(rectype : rectype) +syntax type = TYPE{rectype : rectype}(rectype : rectype) ;; 1-syntax.watsup -syntax local = LOCAL(valtype : valtype) +syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`(typeidx : typeidx, local*, expr : expr) +syntax func = `FUNC%%*%`{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) ;; 1-syntax.watsup -syntax global = GLOBAL(globaltype : globaltype, expr : expr) +syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) ;; 1-syntax.watsup -syntax table = TABLE(tabletype : tabletype, expr : expr) +syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, expr : expr) ;; 1-syntax.watsup -syntax mem = MEMORY(memtype : memtype) +syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`(reftype : reftype, expr*, elemmode : elemmode) +syntax elem = `ELEM%%*%`{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) ;; 1-syntax.watsup -syntax data = `DATA%*%`(byte*, datamode : datamode) +syntax data = `DATA%*%`{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup -syntax start = START(funcidx : funcidx) +syntax start = START{funcidx : funcidx}(funcidx : funcidx) ;; 1-syntax.watsup syntax externidx = - | FUNC(funcidx : funcidx) - | GLOBAL(globalidx : globalidx) - | TABLE(tableidx : tableidx) - | MEM(memidx : memidx) + | FUNC{funcidx : funcidx}(funcidx : funcidx) + | GLOBAL{globalidx : globalidx}(globalidx : globalidx) + | TABLE{tableidx : tableidx}(tableidx : tableidx) + | MEM{memidx : memidx}(memidx : memidx) ;; 1-syntax.watsup -syntax export = EXPORT(name : name, externidx : externidx) +syntax export = EXPORT{name : name, externidx : externidx}(name : name, externidx : externidx) ;; 1-syntax.watsup -syntax import = IMPORT(name : name, name : name, externtype : externtype) +syntax import = IMPORT{name : name, externtype : externtype}(name : name, name, externtype : externtype) ;; 1-syntax.watsup -syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*, import*, func*, global*, table*, mem*, elem*, data*, start*, export*) +syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) ;; 2-syntax-aux.watsup rec { @@ -11707,10 +11707,10 @@ def $setminus1(idx : idx, idx*) : idx* ;; 2-syntax-aux.watsup:13.1-13.27 def $setminus1{x : idx}(x, []) = [x] ;; 2-syntax-aux.watsup:14.1-14.61 - def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y}) = [] + def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y : idx}) = [] -- if (x = y_1) ;; 2-syntax-aux.watsup:15.1-15.60 - def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y}) = $setminus1(x, y*{y}) + def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y : idx}) = $setminus1(x, y*{y : idx}) -- otherwise } @@ -11720,9 +11720,9 @@ rec { ;; 2-syntax-aux.watsup:7.1-7.49 def $setminus(idx*, idx*) : idx* ;; 2-syntax-aux.watsup:10.1-10.29 - def $setminus{y* : idx*}([], y*{y}) = [] + def $setminus{y* : idx*}([], y*{y : idx}) = [] ;; 2-syntax-aux.watsup:11.1-11.66 - def $setminus{x_1 : idx, x* : idx*, y* : idx*}([x_1] :: x*{x}, y*{y}) = $setminus1(x_1, y*{y}) :: $setminus(x*{x}, y*{y}) + def $setminus{x_1 : idx, x* : idx*, y* : idx*}([x_1] :: x*{x : idx}, y*{y : idx}) = $setminus1(x_1, y*{y : idx}) :: $setminus(x*{x : idx}, y*{y : idx}) } ;; 2-syntax-aux.watsup @@ -11742,18 +11742,18 @@ def $free_dataidx_instrs(instr*) : dataidx* ;; 2-syntax-aux.watsup:26.1-26.36 def $free_dataidx_instrs([]) = [] ;; 2-syntax-aux.watsup:27.1-27.99 - def $free_dataidx_instrs{instr : instr, instr'* : instr*}([instr] :: instr'*{instr'}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr'}) + def $free_dataidx_instrs{instr : instr, instr'* : instr*}([instr] :: instr'*{instr' : instr}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr' : instr}) } ;; 2-syntax-aux.watsup def $free_dataidx_expr(expr : expr) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_expr{in* : instr*}(in*{in}) = $free_dataidx_instrs(in*{in}) + def $free_dataidx_expr{in* : instr*}(in*{in : instr}) = $free_dataidx_instrs(in*{in : instr}) ;; 2-syntax-aux.watsup def $free_dataidx_func(func : func) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc}, e)) = $free_dataidx_expr(e) + def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) ;; 2-syntax-aux.watsup rec { @@ -11763,7 +11763,7 @@ def $free_dataidx_funcs(func*) : dataidx* ;; 2-syntax-aux.watsup:36.1-36.35 def $free_dataidx_funcs([]) = [] ;; 2-syntax-aux.watsup:37.1-37.92 - def $free_dataidx_funcs{func : func, func'* : func*}([func] :: func'*{func'}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func'}) + def $free_dataidx_funcs{func : func, func'* : func*}([func] :: func'*{func' : func}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func' : func}) } ;; 2-syntax-aux.watsup @@ -11810,8 +11810,8 @@ def $diffrt(reftype : reftype, reftype : reftype) : reftype ;; 2-syntax-aux.watsup syntax typevar = - | _IDX(typeidx : typeidx) - | REC(nat : nat) + | _IDX{typeidx : typeidx}(typeidx : typeidx) + | REC(nat) ;; 2-syntax-aux.watsup def $idx(typeidx : typeidx) : typevar @@ -11826,27 +11826,27 @@ def $subst_typevar(typevar : typevar, typevar*, heaptype*) : heaptype ;; 2-syntax-aux.watsup:150.1-150.38 def $subst_typevar{xx : typevar}(xx, [], []) = (xx : typevar <: heaptype) ;; 2-syntax-aux.watsup:151.1-151.95 - def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 + def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = ht_1 -- if (xx = xx_1) ;; 2-syntax-aux.watsup:152.1-152.92 - def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = $subst_typevar(xx, xx'*{xx'}, ht'*{ht'}) + def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = $subst_typevar(xx, xx'*{xx' : typevar}, ht'*{ht' : heaptype}) -- otherwise } ;; 2-syntax-aux.watsup def $subst_numtype(numtype : numtype, typevar*, heaptype*) : numtype ;; 2-syntax-aux.watsup - def $subst_numtype{nt : numtype, xx* : typevar*, ht* : heaptype*}(nt, xx*{xx}, ht*{ht}) = nt + def $subst_numtype{nt : numtype, xx* : typevar*, ht* : heaptype*}(nt, xx*{xx : typevar}, ht*{ht : heaptype}) = nt ;; 2-syntax-aux.watsup def $subst_vectype(vectype : vectype, typevar*, heaptype*) : vectype ;; 2-syntax-aux.watsup - def $subst_vectype{vt : vectype, xx* : typevar*, ht* : heaptype*}(vt, xx*{xx}, ht*{ht}) = vt + def $subst_vectype{vt : vectype, xx* : typevar*, ht* : heaptype*}(vt, xx*{xx : typevar}, ht*{ht : heaptype}) = vt ;; 2-syntax-aux.watsup def $subst_packtype(packtype : packtype, typevar*, heaptype*) : packtype ;; 2-syntax-aux.watsup - def $subst_packtype{pt : packtype, xx* : typevar*, ht* : heaptype*}(pt, xx*{xx}, ht*{ht}) = pt + def $subst_packtype{pt : packtype, xx* : typevar*, ht* : heaptype*}(pt, xx*{xx : typevar}, ht*{ht : heaptype}) = pt ;; 2-syntax-aux.watsup rec { @@ -11854,108 +11854,108 @@ rec { ;; 2-syntax-aux.watsup:129.1-129.92 def $subst_heaptype(heaptype : heaptype, typevar*, heaptype*) : heaptype ;; 2-syntax-aux.watsup:157.1-157.67 - def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) + def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx : typevar}, ht*{ht : heaptype}) = $subst_typevar(xx', xx*{xx : typevar}, ht*{ht : heaptype}) ;; 2-syntax-aux.watsup:158.1-158.65 - def $subst_heaptype{dt : deftype, xx* : typevar*, ht* : heaptype*}((dt : deftype <: heaptype), xx*{xx}, ht*{ht}) = ($subst_deftype(dt, xx*{xx}, ht*{ht}) : deftype <: heaptype) + def $subst_heaptype{dt : deftype, xx* : typevar*, ht* : heaptype*}((dt : deftype <: heaptype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_deftype(dt, xx*{xx : typevar}, ht*{ht : heaptype}) : deftype <: heaptype) ;; 2-syntax-aux.watsup:159.1-159.55 - def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx}, ht*{ht}) = ht' + def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx : typevar}, ht*{ht : heaptype}) = ht' -- otherwise ;; 2-syntax-aux.watsup:130.1-130.92 def $subst_reftype(reftype : reftype, typevar*, heaptype*) : reftype ;; 2-syntax-aux.watsup:161.1-161.85 - def $subst_reftype{nul : nul, ht' : heaptype, xx* : typevar*, ht* : heaptype*}(REF_reftype(nul, ht'), xx*{xx}, ht*{ht}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx}, ht*{ht})) + def $subst_reftype{nul : nul, ht' : heaptype, xx* : typevar*, ht* : heaptype*}(REF_reftype(nul, ht'), xx*{xx : typevar}, ht*{ht : heaptype}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:131.1-131.92 def $subst_valtype(valtype : valtype, typevar*, heaptype*) : valtype ;; 2-syntax-aux.watsup:163.1-163.64 - def $subst_valtype{nt : numtype, xx* : typevar*, ht* : heaptype*}((nt : numtype <: valtype), xx*{xx}, ht*{ht}) = ($subst_numtype(nt, xx*{xx}, ht*{ht}) : numtype <: valtype) + def $subst_valtype{nt : numtype, xx* : typevar*, ht* : heaptype*}((nt : numtype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_numtype(nt, xx*{xx : typevar}, ht*{ht : heaptype}) : numtype <: valtype) ;; 2-syntax-aux.watsup:164.1-164.64 - def $subst_valtype{vt : vectype, xx* : typevar*, ht* : heaptype*}((vt : vectype <: valtype), xx*{xx}, ht*{ht}) = ($subst_vectype(vt, xx*{xx}, ht*{ht}) : vectype <: valtype) + def $subst_valtype{vt : vectype, xx* : typevar*, ht* : heaptype*}((vt : vectype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_vectype(vt, xx*{xx : typevar}, ht*{ht : heaptype}) : vectype <: valtype) ;; 2-syntax-aux.watsup:165.1-165.64 - def $subst_valtype{rt : reftype, xx* : typevar*, ht* : heaptype*}((rt : reftype <: valtype), xx*{xx}, ht*{ht}) = ($subst_reftype(rt, xx*{xx}, ht*{ht}) : reftype <: valtype) + def $subst_valtype{rt : reftype, xx* : typevar*, ht* : heaptype*}((rt : reftype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_reftype(rt, xx*{xx : typevar}, ht*{ht : heaptype}) : reftype <: valtype) ;; 2-syntax-aux.watsup:166.1-166.40 - def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx : typevar}, ht*{ht : heaptype}) = BOT_valtype ;; 2-syntax-aux.watsup:134.1-134.92 def $subst_storagetype(storagetype : storagetype, typevar*, heaptype*) : storagetype ;; 2-syntax-aux.watsup:170.1-170.66 - def $subst_storagetype{t : valtype, xx* : typevar*, ht* : heaptype*}((t : valtype <: storagetype), xx*{xx}, ht*{ht}) = ($subst_valtype(t, xx*{xx}, ht*{ht}) : valtype <: storagetype) + def $subst_storagetype{t : valtype, xx* : typevar*, ht* : heaptype*}((t : valtype <: storagetype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_valtype(t, xx*{xx : typevar}, ht*{ht : heaptype}) : valtype <: storagetype) ;; 2-syntax-aux.watsup:171.1-171.69 - def $subst_storagetype{pt : packtype, xx* : typevar*, ht* : heaptype*}((pt : packtype <: storagetype), xx*{xx}, ht*{ht}) = ($subst_packtype(pt, xx*{xx}, ht*{ht}) : packtype <: storagetype) + def $subst_storagetype{pt : packtype, xx* : typevar*, ht* : heaptype*}((pt : packtype <: storagetype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_packtype(pt, xx*{xx : typevar}, ht*{ht : heaptype}) : packtype <: storagetype) ;; 2-syntax-aux.watsup:135.1-135.92 def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype ;; 2-syntax-aux.watsup:173.1-173.80 - def $subst_fieldtype{mut : mut, zt : storagetype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, zt), xx*{xx}, ht*{ht}) = `%%`(mut, $subst_storagetype(zt, xx*{xx}, ht*{ht})) + def $subst_fieldtype{mut : mut, zt : storagetype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, zt), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(mut, $subst_storagetype(zt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype ;; 2-syntax-aux.watsup:175.1-175.85 - def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) + def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt : fieldtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype}) ;; 2-syntax-aux.watsup:176.1-176.81 - def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) + def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx : typevar}, ht*{ht : heaptype}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:177.1-177.78 - def $subst_comptype{ft : functype, xx* : typevar*, ht* : heaptype*}(FUNC_comptype(ft), xx*{xx}, ht*{ht}) = FUNC_comptype($subst_functype(ft, xx*{xx}, ht*{ht})) + def $subst_comptype{ft : functype, xx* : typevar*, ht* : heaptype*}(FUNC_comptype(ft), xx*{xx : typevar}, ht*{ht : heaptype}) = FUNC_comptype($subst_functype(ft, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:138.1-138.92 def $subst_subtype(subtype : subtype, typevar*, heaptype*) : subtype ;; 2-syntax-aux.watsup:179.1-180.76 - def $subst_subtype{fin : fin, y* : idx*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + def $subst_subtype{fin : fin, y* : idx*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUB_subtype(fin, y*{y : typeidx}, ct), xx*{xx : typevar}, ht*{ht : heaptype}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx : typevar}, ht*{ht : heaptype})*{y : typeidx}, $subst_comptype(ct, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:181.1-182.73 - def $subst_subtype{fin : fin, ht'* : heaptype*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUBD_subtype(fin, ht'*{ht'}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx}, ht*{ht})*{ht'}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + def $subst_subtype{fin : fin, ht'* : heaptype*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUBD_subtype(fin, ht'*{ht' : heaptype}, ct), xx*{xx : typevar}, ht*{ht : heaptype}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})*{ht' : heaptype}, $subst_comptype(ct, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype ;; 2-syntax-aux.watsup:184.1-184.76 - def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st}), xx*{xx}, ht*{ht}) = REC_rectype($subst_subtype(st, xx*{xx}, ht*{ht})*{st}) + def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st : subtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype}) ;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype ;; 2-syntax-aux.watsup:186.1-186.78 - def $subst_deftype{qt : rectype, i : nat, xx* : typevar*, ht* : heaptype*}(DEF_deftype(qt, i), xx*{xx}, ht*{ht}) = DEF_deftype($subst_rectype(qt, xx*{xx}, ht*{ht}), i) + def $subst_deftype{qt : rectype, i : nat, xx* : typevar*, ht* : heaptype*}(DEF_deftype(qt, i), xx*{xx : typevar}, ht*{ht : heaptype}) = DEF_deftype($subst_rectype(qt, xx*{xx : typevar}, ht*{ht : heaptype}), i) ;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype ;; 2-syntax-aux.watsup:189.1-189.113 - def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1}, t_2*{t_2}), xx*{xx}, ht*{ht}) = `%->%`($subst_valtype(t_1, xx*{xx}, ht*{ht})*{t_1}, $subst_valtype(t_2, xx*{xx}, ht*{ht})*{t_2}) + def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}, $subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype}) } ;; 2-syntax-aux.watsup def $subst_globaltype(globaltype : globaltype, typevar*, heaptype*) : globaltype ;; 2-syntax-aux.watsup - def $subst_globaltype{mut : mut, t : valtype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, t), xx*{xx}, ht*{ht}) = `%%`(mut, $subst_valtype(t, xx*{xx}, ht*{ht})) + def $subst_globaltype{mut : mut, t : valtype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, t), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(mut, $subst_valtype(t, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_tabletype(tabletype : tabletype, typevar*, heaptype*) : tabletype ;; 2-syntax-aux.watsup - def $subst_tabletype{lim : limits, rt : reftype, xx* : typevar*, ht* : heaptype*}(`%%`(lim, rt), xx*{xx}, ht*{ht}) = `%%`(lim, $subst_reftype(rt, xx*{xx}, ht*{ht})) + def $subst_tabletype{lim : limits, rt : reftype, xx* : typevar*, ht* : heaptype*}(`%%`(lim, rt), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(lim, $subst_reftype(rt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_memtype(memtype : memtype, typevar*, heaptype*) : memtype ;; 2-syntax-aux.watsup - def $subst_memtype{lim : limits, xx* : typevar*, ht* : heaptype*}(`%I8`(lim), xx*{xx}, ht*{ht}) = `%I8`(lim) + def $subst_memtype{lim : limits, xx* : typevar*, ht* : heaptype*}(`%I8`(lim), xx*{xx : typevar}, ht*{ht : heaptype}) = `%I8`(lim) ;; 2-syntax-aux.watsup def $subst_externtype(externtype : externtype, typevar*, heaptype*) : externtype ;; 2-syntax-aux.watsup - def $subst_externtype{dt : deftype, xx* : typevar*, ht* : heaptype*}(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) + def $subst_externtype{dt : deftype, xx* : typevar*, ht* : heaptype*}(FUNC_externtype(dt), xx*{xx : typevar}, ht*{ht : heaptype}) = FUNC_externtype($subst_deftype(dt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{gt : globaltype, xx* : typevar*, ht* : heaptype*}(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) + def $subst_externtype{gt : globaltype, xx* : typevar*, ht* : heaptype*}(GLOBAL_externtype(gt), xx*{xx : typevar}, ht*{ht : heaptype}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{tt : tabletype, xx* : typevar*, ht* : heaptype*}(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) + def $subst_externtype{tt : tabletype, xx* : typevar*, ht* : heaptype*}(TABLE_externtype(tt), xx*{xx : typevar}, ht*{ht : heaptype}) = TABLE_externtype($subst_tabletype(tt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{mt : memtype, xx* : typevar*, ht* : heaptype*}(MEM_externtype(mt), xx*{xx}, ht*{ht}) = MEM_externtype($subst_memtype(mt, xx*{xx}, ht*{ht})) + def $subst_externtype{mt : memtype, xx* : typevar*, ht* : heaptype*}(MEM_externtype(mt), xx*{xx : typevar}, ht*{ht : heaptype}) = MEM_externtype($subst_memtype(mt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_all_reftype(reftype : reftype, heaptype*) : reftype ;; 2-syntax-aux.watsup - def $subst_all_reftype{rt : reftype, ht^n : heaptype^n, n : n, i^n : nat^n}(rt, ht^n{ht}) = $subst_reftype(rt, $idx(`%`(i))^(i (sx?{sx} = ?())) - | VREPLACE_LANE(shape : shape, laneidx : laneidx) - | VUNOP(shape : shape, vunop_ : vunop_(shape)) - | VBINOP(shape : shape, vbinop_ : vbinop_(shape)) - | VTESTOP(shape : shape, vtestop_ : vtestop_(shape)) - | VRELOP(shape : shape, vrelop_ : vrelop_(shape)) - | VSHIFTOP(ishape : ishape, vshiftop_ : vshiftop_(ishape)) - | VBITMASK(ishape : ishape) - | VCVTOP(shape : shape, vcvtop : vcvtop, half?, shape : shape, sx?, zero : zero) - | VNARROW(ishape : ishape, ishape : ishape, sx : sx) - | VEXTUNOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) + | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*{laneidx : laneidx} : laneidx*) + -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx : laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) + | VSPLAT{shape : shape}(shape : shape) + | VEXTRACT_LANE{shape : shape, sx? : sx?, laneidx : laneidx, numtype : numtype}(shape : shape, sx?{sx : sx} : sx?, laneidx : laneidx) + -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx : sx} = ?())) + | VREPLACE_LANE{shape : shape, laneidx : laneidx}(shape : shape, laneidx : laneidx) + | VUNOP{shape : shape, vunop_ : vunop_(shape)}(shape : shape, vunop_ : vunop_(shape)) + | VBINOP{shape : shape, vbinop_ : vbinop_(shape)}(shape : shape, vbinop_ : vbinop_(shape)) + | VTESTOP{shape : shape, vtestop_ : vtestop_(shape)}(shape : shape, vtestop_ : vtestop_(shape)) + | VRELOP{shape : shape, vrelop_ : vrelop_(shape)}(shape : shape, vrelop_ : vrelop_(shape)) + | VSHIFTOP{ishape : ishape, vshiftop_ : vshiftop_(ishape)}(ishape : ishape, vshiftop_ : vshiftop_(ishape)) + | VBITMASK{ishape : ishape}(ishape : ishape) + | VCVTOP{shape : shape, vcvtop : vcvtop, half? : half?, sx? : sx?, zero : zero}(shape : shape, vcvtop : vcvtop, half?{half : half} : half?, shape, sx?{sx : sx} : sx?, zero : zero) + | VNARROW{ishape : ishape, sx : sx}(ishape : ishape, ishape, sx : sx) + | VEXTUNOP{ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | VEXTBINOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) + | VEXTBINOP{ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | REF.NULL(heaptype : heaptype) + | REF.NULL{heaptype : heaptype}(heaptype : heaptype) | REF.I31 - | REF.FUNC(funcidx : funcidx) + | REF.FUNC{funcidx : funcidx}(funcidx : funcidx) | REF.IS_NULL | REF.AS_NON_NULL | REF.EQ - | REF.TEST(reftype : reftype) - | REF.CAST(reftype : reftype) - | I31.GET(sx : sx) - | STRUCT.NEW(typeidx : typeidx) - | STRUCT.NEW_DEFAULT(typeidx : typeidx) - | STRUCT.GET(sx?, typeidx : typeidx, u32 : u32) - | STRUCT.SET(typeidx : typeidx, u32 : u32) - | ARRAY.NEW(typeidx : typeidx) - | ARRAY.NEW_DEFAULT(typeidx : typeidx) - | ARRAY.NEW_FIXED(typeidx : typeidx, nat : nat) - | ARRAY.NEW_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.NEW_ELEM(typeidx : typeidx, elemidx : elemidx) - | ARRAY.GET(sx?, typeidx : typeidx) - | ARRAY.SET(typeidx : typeidx) + | REF.TEST{reftype : reftype}(reftype : reftype) + | REF.CAST{reftype : reftype}(reftype : reftype) + | I31.GET{sx : sx}(sx : sx) + | STRUCT.NEW{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.GET{sx? : sx?, typeidx : typeidx, u32 : u32}(sx?{sx : sx} : sx?, typeidx : typeidx, u32 : u32) + | STRUCT.SET{typeidx : typeidx, u32 : u32}(typeidx : typeidx, u32 : u32) + | ARRAY.NEW{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_FIXED{typeidx : typeidx}(typeidx : typeidx, nat) + | ARRAY.NEW_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.NEW_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) + | ARRAY.GET{sx? : sx?, typeidx : typeidx}(sx?{sx : sx} : sx?, typeidx : typeidx) + | ARRAY.SET{typeidx : typeidx}(typeidx : typeidx) | ARRAY.LEN - | ARRAY.FILL(typeidx : typeidx) - | ARRAY.COPY(typeidx : typeidx, typeidx : typeidx) - | ARRAY.INIT_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.INIT_ELEM(typeidx : typeidx, elemidx : elemidx) + | ARRAY.FILL{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.COPY{typeidx : typeidx}(typeidx : typeidx, typeidx) + | ARRAY.INIT_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.INIT_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) | EXTERN.CONVERT_ANY | ANY.CONVERT_EXTERN - | LOCAL.GET(localidx : localidx) - | LOCAL.SET(localidx : localidx) - | LOCAL.TEE(localidx : localidx) - | GLOBAL.GET(globalidx : globalidx) - | GLOBAL.SET(globalidx : globalidx) - | TABLE.GET(tableidx : tableidx) - | TABLE.SET(tableidx : tableidx) - | TABLE.SIZE(tableidx : tableidx) - | TABLE.GROW(tableidx : tableidx) - | TABLE.FILL(tableidx : tableidx) - | TABLE.COPY(tableidx : tableidx, tableidx : tableidx) - | TABLE.INIT(tableidx : tableidx, elemidx : elemidx) - | ELEM.DROP(elemidx : elemidx) - | MEMORY.SIZE(memidx : memidx) - | MEMORY.GROW(memidx : memidx) - | MEMORY.FILL(memidx : memidx) - | MEMORY.COPY(memidx : memidx, memidx : memidx) - | MEMORY.INIT(memidx : memidx, dataidx : dataidx) - | DATA.DROP(dataidx : dataidx) - | LOAD(numtype : numtype, (n, sx)?, memidx : memidx, memop : memop) - | STORE(numtype : numtype, n?, memidx : memidx, memop : memop) - | VLOAD(vloadop?, memidx : memidx, memop : memop) - | VLOAD_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | VSTORE(memidx : memidx, memop : memop) - | VSTORE_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | REF.I31_NUM(u31 : u31) - | REF.STRUCT_ADDR(structaddr : structaddr) - | REF.ARRAY_ADDR(arrayaddr : arrayaddr) - | REF.FUNC_ADDR(funcaddr : funcaddr) - | REF.HOST_ADDR(hostaddr : hostaddr) - | REF.EXTERN(addrref : addrref) - | LABEL_(n : n, instr*, admininstr*) - | FRAME_(n : n, frame : frame, admininstr*) + | LOCAL.GET{localidx : localidx}(localidx : localidx) + | LOCAL.SET{localidx : localidx}(localidx : localidx) + | LOCAL.TEE{localidx : localidx}(localidx : localidx) + | GLOBAL.GET{globalidx : globalidx}(globalidx : globalidx) + | GLOBAL.SET{globalidx : globalidx}(globalidx : globalidx) + | TABLE.GET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SIZE{tableidx : tableidx}(tableidx : tableidx) + | TABLE.GROW{tableidx : tableidx}(tableidx : tableidx) + | TABLE.FILL{tableidx : tableidx}(tableidx : tableidx) + | TABLE.COPY{tableidx : tableidx}(tableidx : tableidx, tableidx) + | TABLE.INIT{tableidx : tableidx, elemidx : elemidx}(tableidx : tableidx, elemidx : elemidx) + | ELEM.DROP{elemidx : elemidx}(elemidx : elemidx) + | MEMORY.SIZE{memidx : memidx}(memidx : memidx) + | MEMORY.GROW{memidx : memidx}(memidx : memidx) + | MEMORY.FILL{memidx : memidx}(memidx : memidx) + | MEMORY.COPY{memidx : memidx}(memidx : memidx, memidx) + | MEMORY.INIT{memidx : memidx, dataidx : dataidx}(memidx : memidx, dataidx : dataidx) + | DATA.DROP{dataidx : dataidx}(dataidx : dataidx) + | LOAD{numtype : numtype, n? : n?, sx? : sx?, memidx : memidx, memop : memop}(numtype : numtype, (n, sx)?{n : n sx : sx} : (n, sx)?, memidx : memidx, memop : memop) + | STORE{numtype : numtype, n? : n?, memidx : memidx, memop : memop}(numtype : numtype, n?{n : n} : n?, memidx : memidx, memop : memop) + | VLOAD{vloadop? : vloadop?, memidx : memidx, memop : memop}(vloadop?{vloadop : vloadop} : vloadop?, memidx : memidx, memop : memop) + | VLOAD_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | VSTORE{memidx : memidx, memop : memop}(memidx : memidx, memop : memop) + | VSTORE_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | REF.I31_NUM{u31 : u31}(u31 : u31) + | REF.STRUCT_ADDR{structaddr : structaddr}(structaddr : structaddr) + | REF.ARRAY_ADDR{arrayaddr : arrayaddr}(arrayaddr : arrayaddr) + | REF.FUNC_ADDR{funcaddr : funcaddr}(funcaddr : funcaddr) + | REF.HOST_ADDR{hostaddr : hostaddr}(hostaddr : hostaddr) + | REF.EXTERN{addrref : addrref}(addrref : addrref) + | LABEL_{n : n, instr* : instr*, admininstr* : admininstr*}(n : n, instr*{instr : instr} : instr*, admininstr*{admininstr : admininstr} : admininstr*) + | FRAME_{n : n, frame : frame, admininstr* : admininstr*}(n : n, frame : frame, admininstr*{admininstr : admininstr} : admininstr*) | TRAP } ;; 4-runtime.watsup -syntax config = `%;%*`(state : state, admininstr*) +syntax config = `%;%*`{state : state, admininstr* : admininstr*}(state : state, admininstr*{admininstr : admininstr} : admininstr*) ;; 4-runtime.watsup rec { @@ -13069,15 +13069,15 @@ rec { ;; 4-runtime.watsup:165.1-168.25 syntax E = | _HOLE - | _SEQ(val*, E : E, instr*) - | LABEL_(n : n, instr*, E : E) + | _SEQ{val* : val*, E : E, instr* : instr*}(val*{val : val} : val*, E : E, instr*{instr : instr} : instr*) + | LABEL_{n : n, instr* : instr*, E : E}(n : n, instr*{instr : instr} : instr*, E : E) } ;; 5-runtime-aux.watsup def $inst_reftype(moduleinst : moduleinst, reftype : reftype) : reftype ;; 5-runtime-aux.watsup - def $inst_reftype{mm : moduleinst, rt : reftype, dt* : deftype*}(mm, rt) = $subst_all_reftype(rt, (dt : deftype <: heaptype)*{dt}) - -- if (dt*{dt} = mm.TYPE_moduleinst) + def $inst_reftype{mm : moduleinst, rt : reftype, dt* : deftype*}(mm, rt) = $subst_all_reftype(rt, (dt : deftype <: heaptype)*{dt : deftype}) + -- if (dt*{dt : deftype} = mm.TYPE_moduleinst) ;; 5-runtime-aux.watsup def $default(valtype : valtype) : val? @@ -13118,9 +13118,9 @@ def $funcsxv(externval*) : funcaddr* ;; 5-runtime-aux.watsup:49.1-49.24 def $funcsxv([]) = [] ;; 5-runtime-aux.watsup:50.1-50.47 - def $funcsxv{fa : funcaddr, xv* : externval*}([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) + def $funcsxv{fa : funcaddr, xv* : externval*}([FUNC_externval(fa)] :: xv*{xv : externval}) = [fa] :: $funcsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:51.1-51.58 - def $funcsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $funcsxv(xv*{xv}) + def $funcsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $funcsxv(xv*{xv : externval}) -- otherwise } @@ -13132,9 +13132,9 @@ def $globalsxv(externval*) : globaladdr* ;; 5-runtime-aux.watsup:53.1-53.26 def $globalsxv([]) = [] ;; 5-runtime-aux.watsup:54.1-54.53 - def $globalsxv{ga : globaladdr, xv* : externval*}([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) + def $globalsxv{ga : globaladdr, xv* : externval*}([GLOBAL_externval(ga)] :: xv*{xv : externval}) = [ga] :: $globalsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:55.1-55.62 - def $globalsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $globalsxv(xv*{xv}) + def $globalsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $globalsxv(xv*{xv : externval}) -- otherwise } @@ -13146,9 +13146,9 @@ def $tablesxv(externval*) : tableaddr* ;; 5-runtime-aux.watsup:57.1-57.25 def $tablesxv([]) = [] ;; 5-runtime-aux.watsup:58.1-58.50 - def $tablesxv{ta : tableaddr, xv* : externval*}([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) + def $tablesxv{ta : tableaddr, xv* : externval*}([TABLE_externval(ta)] :: xv*{xv : externval}) = [ta] :: $tablesxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:59.1-59.60 - def $tablesxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $tablesxv(xv*{xv}) + def $tablesxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $tablesxv(xv*{xv : externval}) -- otherwise } @@ -13160,9 +13160,9 @@ def $memsxv(externval*) : memaddr* ;; 5-runtime-aux.watsup:61.1-61.23 def $memsxv([]) = [] ;; 5-runtime-aux.watsup:62.1-62.44 - def $memsxv{ma : memaddr, xv* : externval*}([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) + def $memsxv{ma : memaddr, xv* : externval*}([MEM_externval(ma)] :: xv*{xv : externval}) = [ma] :: $memsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:63.1-63.56 - def $memsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $memsxv(xv*{xv}) + def $memsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $memsxv(xv*{xv : externval}) -- otherwise } @@ -13289,7 +13289,7 @@ def $with_tableinst(state : state, tableidx : tableidx, tableinst : tableinst) : ;; 5-runtime-aux.watsup def $with_mem(state : state, memidx : memidx, nat : nat, nat : nat, byte*) : state ;; 5-runtime-aux.watsup - def $with_mem{s : store, f : frame, x : idx, i : nat, j : nat, b* : byte*}(`%;%`(s, f), x, i, j, b*{b}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]].DATA_meminst[i : j] = b*{b}], f) + def $with_mem{s : store, f : frame, x : idx, i : nat, j : nat, b* : byte*}(`%;%`(s, f), x, i, j, b*{b : byte}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]].DATA_meminst[i : j] = b*{b : byte}], f) ;; 5-runtime-aux.watsup def $with_meminst(state : state, memidx : memidx, meminst : meminst) : state @@ -13299,12 +13299,12 @@ def $with_meminst(state : state, memidx : memidx, meminst : meminst) : state ;; 5-runtime-aux.watsup def $with_elem(state : state, elemidx : elemidx, ref*) : state ;; 5-runtime-aux.watsup - def $with_elem{s : store, f : frame, x : idx, r* : ref*}(`%;%`(s, f), x, r*{r}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]].ELEM_eleminst = r*{r}], f) + def $with_elem{s : store, f : frame, x : idx, r* : ref*}(`%;%`(s, f), x, r*{r : ref}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]].ELEM_eleminst = r*{r : ref}], f) ;; 5-runtime-aux.watsup def $with_data(state : state, dataidx : dataidx, byte*) : state ;; 5-runtime-aux.watsup - def $with_data{s : store, f : frame, x : idx, b* : byte*}(`%;%`(s, f), x, b*{b}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]].DATA_datainst = b*{b}], f) + def $with_data{s : store, f : frame, x : idx, b* : byte*}(`%;%`(s, f), x, b*{b : byte}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]].DATA_datainst = b*{b : byte}], f) ;; 5-runtime-aux.watsup def $with_struct(state : state, structaddr : structaddr, nat : nat, fieldval : fieldval) : state @@ -13319,20 +13319,20 @@ def $with_array(state : state, arrayaddr : arrayaddr, nat : nat, fieldval : fiel ;; 5-runtime-aux.watsup def $ext_structinst(state : state, structinst*) : state ;; 5-runtime-aux.watsup - def $ext_structinst{s : store, f : frame, si* : structinst*}(`%;%`(s, f), si*{si}) = `%;%`(s[STRUCT_store =.. si*{si}], f) + def $ext_structinst{s : store, f : frame, si* : structinst*}(`%;%`(s, f), si*{si : structinst}) = `%;%`(s[STRUCT_store =.. si*{si : structinst}], f) ;; 5-runtime-aux.watsup def $ext_arrayinst(state : state, arrayinst*) : state ;; 5-runtime-aux.watsup - def $ext_arrayinst{s : store, f : frame, ai* : arrayinst*}(`%;%`(s, f), ai*{ai}) = `%;%`(s[ARRAY_store =.. ai*{ai}], f) + def $ext_arrayinst{s : store, f : frame, ai* : arrayinst*}(`%;%`(s, f), ai*{ai : arrayinst}) = `%;%`(s[ARRAY_store =.. ai*{ai : arrayinst}], f) ;; 5-runtime-aux.watsup def $growtable(tableinst : tableinst, nat : nat, ref : ref) : tableinst? ;; 5-runtime-aux.watsup def $growtable{ti : tableinst, n : n, r : ref, ti' : tableinst, i : nat, j : nat, rt : reftype, r'* : ref*, i' : nat}(ti, n, r) = ?(ti') - -- if (ti = {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM r'*{r'}}) - -- if (i' = (|r'*{r'}| + n)) - -- if (ti' = {TYPE `%%`(`[%..%]`(`%`(i'), `%`(j)), rt), ELEM r'*{r'} :: r^n{}}) + -- if (ti = {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM r'*{r' : ref}}) + -- if (i' = (|r'*{r' : ref}| + n)) + -- if (ti' = {TYPE `%%`(`[%..%]`(`%`(i'), `%`(j)), rt), ELEM r'*{r' : ref} :: r^n{}}) -- if (i' <= j) def $growtable{x0 : tableinst, x1 : nat, x2 : ref}(x0, x1, x2) = ?() @@ -13340,9 +13340,9 @@ def $growtable(tableinst : tableinst, nat : nat, ref : ref) : tableinst? def $growmemory(meminst : meminst, nat : nat) : meminst? ;; 5-runtime-aux.watsup def $growmemory{mi : meminst, n : n, mi' : meminst, i : nat, j : nat, b* : byte*, i' : nat}(mi, n) = ?(mi') - -- if (mi = {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA b*{b}}) - -- if (i' = ((|b*{b}| / (64 * $Ki)) + n)) - -- if (mi' = {TYPE `%I8`(`[%..%]`(`%`(i'), `%`(j))), DATA b*{b} :: `%`(0)^((n * 64) * $Ki){}}) + -- if (mi = {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA b*{b : byte}}) + -- if (i' = ((|b*{b : byte}| / (64 * $Ki)) + n)) + -- if (mi' = {TYPE `%I8`(`[%..%]`(`%`(i'), `%`(j))), DATA b*{b : byte} :: `%`(0)^((n * 64) * $Ki){}}) -- if (i' <= j) def $growmemory{x0 : meminst, x1 : nat}(x0, x1) = ?() @@ -13352,25 +13352,25 @@ syntax init = | UNSET ;; 6-typing.watsup -syntax localtype = `%%`(init : init, valtype : valtype) +syntax localtype = `%%`{init : init, valtype : valtype}(init : init, valtype : valtype) ;; 6-typing.watsup -syntax instrtype = `%->%*%`(resulttype : resulttype, localidx*, resulttype : resulttype) +syntax instrtype = `%->%*%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) ;; 6-typing.watsup syntax context = { - TYPE deftype*, - REC subtype*, - FUNC deftype*, - GLOBAL globaltype*, - TABLE tabletype*, - MEM memtype*, - ELEM elemtype*, - DATA datatype*, - LOCAL localtype*, - LABEL resulttype*, - RETURN resulttype? + TYPE{deftype* : deftype*} deftype*, + REC{subtype* : subtype*} subtype*, + FUNC{deftype* : deftype*} deftype*, + GLOBAL{globaltype* : globaltype*} globaltype*, + TABLE{tabletype* : tabletype*} tabletype*, + MEM{memtype* : memtype*} memtype*, + ELEM{elemtype* : elemtype*} elemtype*, + DATA{datatype* : datatype*} datatype*, + LOCAL{localtype* : localtype*} localtype*, + LABEL{resulttype* : resulttype*} resulttype*, + RETURN{resulttype? : resulttype?} resulttype? } ;; 6-typing.watsup @@ -13381,7 +13381,7 @@ def $with_locals(context : context, localidx*, localtype*) : context ;; 6-typing.watsup:28.1-28.34 def $with_locals{C : context}(C, [], []) = C ;; 6-typing.watsup:29.1-29.85 - def $with_locals{C : context, x_1 : idx, x* : idx*, lt_1 : localtype, lt* : localtype*}(C, [x_1] :: x*{x}, [lt_1] :: lt*{lt}) = $with_locals(C[LOCAL_context[x_1.`%`.0] = lt_1], x*{x}, lt*{lt}) + def $with_locals{C : context, x_1 : idx, x* : idx*, lt_1 : localtype, lt* : localtype*}(C, [x_1] :: x*{x : localidx}, [lt_1] :: lt*{lt : localtype}) = $with_locals(C[LOCAL_context[x_1.`%`.0] = lt_1], x*{x : localidx}, lt*{lt : localtype}) } ;; 6-typing.watsup @@ -13392,15 +13392,15 @@ def $clostypes(deftype*) : deftype* ;; 6-typing.watsup:37.1-37.26 def $clostypes([]) = [] ;; 6-typing.watsup:38.1-38.93 - def $clostypes{dt* : deftype*, dt_N : deftype, dt'* : deftype*}(dt*{dt} :: [dt_N]) = dt'*{dt'} :: [$subst_all_deftype(dt_N, (dt' : deftype <: heaptype)*{dt'})] - -- if (dt'*{dt'} = $clostypes(dt*{dt})) + def $clostypes{dt* : deftype*, dt_N : deftype, dt'* : deftype*}(dt*{dt : deftype} :: [dt_N]) = dt'*{dt' : deftype} :: [$subst_all_deftype(dt_N, (dt' : deftype <: heaptype)*{dt' : deftype})] + -- if (dt'*{dt' : deftype} = $clostypes(dt*{dt : deftype})) } ;; 6-typing.watsup def $clostype(context : context, deftype : deftype) : deftype ;; 6-typing.watsup - def $clostype{C : context, dt : deftype, dt'* : deftype*}(C, dt) = $subst_all_deftype(dt, (dt' : deftype <: heaptype)*{dt'}) - -- if (dt'*{dt'} = $clostypes(C.TYPE_context)) + def $clostype{C : context, dt : deftype, dt'* : deftype*}(C, dt) = $subst_all_deftype(dt, (dt' : deftype <: heaptype)*{dt' : deftype}) + -- if (dt'*{dt' : deftype} = $clostypes(C.TYPE_context)) ;; 6-typing.watsup relation Numtype_ok: `%|-%:_OK`(context, numtype) @@ -13462,25 +13462,25 @@ relation Valtype_ok: `%|-%:_OK`(context, valtype) relation Resulttype_ok: `%|-%:_OK`(context, resulttype) ;; 6-typing.watsup rule _{C : context, t* : valtype*}: - `%|-%:_OK`(C, t*{t}) - -- (Valtype_ok: `%|-%:_OK`(C, t))*{t} + `%|-%:_OK`(C, t*{t : valtype}) + -- (Valtype_ok: `%|-%:_OK`(C, t))*{t : valtype} ;; 6-typing.watsup relation Instrtype_ok: `%|-%:_OK`(context, instrtype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, x* : idx*, t_2* : valtype*, lt* : localtype*}: - `%|-%:_OK`(C, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2}) - -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt x} + `%|-%:_OK`(C, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) + -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt : localtype x : idx} ;; 6-typing.watsup syntax oktypeidx = - | OK(typeidx : typeidx) + | OK{typeidx : typeidx}(typeidx : typeidx) ;; 6-typing.watsup syntax oktypeidxnat = - | OK(typeidx : typeidx, nat : nat) + | OK{typeidx : typeidx}(typeidx : typeidx, nat) ;; 6-typing.watsup relation Packtype_ok: `%|-%:_OK`(context, packtype) @@ -13511,16 +13511,16 @@ relation Fieldtype_ok: `%|-%:_OK`(context, fieldtype) relation Functype_ok: `%|-%:_OK`(context, functype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:_OK`(C, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2}) + `%|-%:_OK`(C, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) + -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) ;; 6-typing.watsup relation Comptype_ok: `%|-%:_OK`(context, comptype) ;; 6-typing.watsup rule struct{C : context, yt* : fieldtype*}: - `%|-%:_OK`(C, STRUCT_comptype(yt*{yt})) - -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt} + `%|-%:_OK`(C, STRUCT_comptype(yt*{yt : fieldtype})) + -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt : fieldtype} ;; 6-typing.watsup rule array{C : context, yt : fieldtype}: @@ -13557,7 +13557,7 @@ relation Deftype_sub: `%|-%<:%`(context, deftype, deftype) ;; 6-typing.watsup:438.1-441.40 rule super{C : context, deftype_1 : deftype, deftype_2 : deftype, fin : fin, ht_1* : heaptype*, ht : heaptype, ht_2* : heaptype*, ct : comptype}: `%|-%<:%`(C, deftype_1, deftype_2) - -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1 : heaptype} :: [ht] :: ht_2*{ht_2 : heaptype}, ct)) -- Heaptype_sub: `%|-%<:%`(C, ht, (deftype_2 : deftype <: heaptype)) ;; 6-typing.watsup:271.1-271.79 @@ -13592,7 +13592,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:303.1-305.35 rule struct{C : context, deftype : deftype, yt* : fieldtype*}: `%|-%<:%`(C, (deftype : deftype <: heaptype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) + -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt : fieldtype})) ;; 6-typing.watsup:307.1-309.33 rule array{C : context, deftype : deftype, yt : fieldtype}: @@ -13622,7 +13622,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:327.1-329.48 rule rec{C : context, i : nat, ht : heaptype, fin : fin, ht_1* : heaptype*, ht_2* : heaptype*, ct : comptype}: `%|-%<:%`(C, REC_heaptype(i), ht) - -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1 : heaptype} :: [ht] :: ht_2*{ht_2 : heaptype}, ct)) ;; 6-typing.watsup:331.1-333.40 rule none{C : context, heaptype : heaptype}: @@ -13718,8 +13718,8 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) ;; 6-typing.watsup rule struct{C : context, yt_1* : fieldtype*, yt'_1 : fieldtype, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) - -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} + `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1 : fieldtype} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2 : fieldtype})) + -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 : fieldtype yt_2 : fieldtype} ;; 6-typing.watsup rule array{C : context, yt_1 : fieldtype, yt_2 : fieldtype}: @@ -13735,12 +13735,12 @@ relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) ;; 6-typing.watsup rule _{C : context, fin : fin, y* : idx*, ct : comptype, x : idx, y'** : idx**, ct'* : comptype*}: - `%|-%:%`(C, SUB_subtype(fin, y*{y}, ct), OK_oktypeidx(x)) - -- if (|y*{y}| <= 1) - -- (if (y.`%`.0 < x.`%`.0))*{y} - -- (if ($unrolldt(C.TYPE_context[y.`%`.0]) = SUB_subtype(`FINAL%?`(?()), y'*{y'}, ct')))*{ct' y y'} + `%|-%:%`(C, SUB_subtype(fin, y*{y : typeidx}, ct), OK_oktypeidx(x)) + -- if (|y*{y : idx}| <= 1) + -- (if (y.`%`.0 < x.`%`.0))*{y : idx} + -- (if ($unrolldt(C.TYPE_context[y.`%`.0]) = SUB_subtype(`FINAL%?`(?()), y'*{y' : typeidx}, ct')))*{ct' : comptype y : idx y' : typeidx} -- Comptype_ok: `%|-%:_OK`(C, ct) - -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct'} + -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct' : comptype} ;; 6-typing.watsup def $before(heaptype : heaptype, typeidx : typeidx, nat : nat) : bool @@ -13764,12 +13764,12 @@ def $unrollht(context : context, heaptype : heaptype) : subtype relation Subtype_ok2: `%|-%:%`(context, subtype, oktypeidxnat) ;; 6-typing.watsup rule _{C : context, fin : fin, ht* : heaptype*, ct : comptype, x : idx, i : nat, ht'** : heaptype**, ct'* : comptype*}: - `%|-%:%`(C, SUBD_subtype(fin, ht*{ht}, ct), OK_oktypeidxnat(x, i)) - -- if (|ht*{ht}| <= 1) - -- (if $before(ht, x, i))*{ht} - -- (if ($unrollht(C, ht) = SUBD_subtype(`FINAL%?`(?()), ht'*{ht'}, ct')))*{ct' ht ht'} + `%|-%:%`(C, SUBD_subtype(fin, ht*{ht : heaptype}, ct), OK_oktypeidxnat(x, i)) + -- if (|ht*{ht : heaptype}| <= 1) + -- (if $before(ht, x, i))*{ht : heaptype} + -- (if ($unrollht(C, ht) = SUBD_subtype(`FINAL%?`(?()), ht'*{ht' : heaptype}, ct')))*{ct' : comptype ht : heaptype ht' : heaptype} -- Comptype_ok: `%|-%:_OK`(C, ct) - -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct'} + -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct' : comptype} ;; 6-typing.watsup rec { @@ -13782,9 +13782,9 @@ relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) ;; 6-typing.watsup:199.1-202.50 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidxnat(x, i)) + `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) - -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) } ;; 6-typing.watsup @@ -13798,14 +13798,14 @@ relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) ;; 6-typing.watsup:187.1-190.43 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidx(x)) + `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidx(x)) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) - -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) + -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) ;; 6-typing.watsup:192.1-194.49 rule rec2{C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) + `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(x, 0)) } ;; 6-typing.watsup @@ -13814,7 +13814,7 @@ relation Deftype_ok: `%|-%:_OK`(context, deftype) rule _{C : context, qt : rectype, i : nat, x : idx, st^n : subtype^n, n : n}: `%|-%:_OK`(C, DEF_deftype(qt, i)) -- Rectype_ok: `%|-%:%`(C, qt, OK_oktypeidx(x)) - -- if (qt = REC_rectype(st^n{st})) + -- if (qt = REC_rectype(st^n{st : subtype})) -- if (i < n) ;; 6-typing.watsup @@ -13873,18 +13873,18 @@ relation Externtype_ok: `%|-%:_OK`(context, externtype) relation Resulttype_sub: `%|-%*_<:%*`(context, valtype*, valtype*) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%*_<:%*`(C, t_1*{t_1}, t_2*{t_2}) - -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 t_2} + `%|-%*_<:%*`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) + -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 : valtype t_2 : valtype} ;; 6-typing.watsup relation Instrtype_sub: `%|-%<:%`(context, instrtype, instrtype) ;; 6-typing.watsup rule _{C : context, t_11* : valtype*, x_1* : idx*, t_12* : valtype*, t_21* : valtype*, x_2* : idx*, t_22* : valtype*, x* : idx*, t* : valtype*}: - `%|-%<:%`(C, `%->%*%`(t_11*{t_11}, x_1*{x_1}, t_12*{t_12}), `%->%*%`(t_21*{t_21}, x_2*{x_2}, t_22*{t_22})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21}, t_11*{t_11}) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12}, t_22*{t_22}) - -- if (x*{x} = $setminus(x_2*{x_2}, x_1*{x_1})) - -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t x} + `%|-%<:%`(C, `%->%*%`(t_11*{t_11 : valtype}, x_1*{x_1 : localidx}, t_12*{t_12 : valtype}), `%->%*%`(t_21*{t_21 : valtype}, x_2*{x_2 : localidx}, t_22*{t_22 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) + -- if (x*{x : idx} = $setminus(x_2*{x_2 : idx}, x_1*{x_1 : idx})) + -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t : valtype x : idx} ;; 6-typing.watsup relation Limits_sub: `%|-%<:%`(context, limits, limits) @@ -13967,7 +13967,7 @@ rec { relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:544.1-545.34 rule unreachable{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:547.1-548.24 rule nop{C : context}: @@ -13989,55 +13989,55 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:578.1-581.61 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:583.1-586.61 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:588.1-592.65 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_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_2*{x_2 : localidx}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:597.1-599.24 rule br{C : context, l : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.LABEL_context[l.`%`.0] = t*{t}) + `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) ;; 6-typing.watsup:601.1-603.24 rule br_if{C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) - -- if (C.LABEL_context[l.`%`.0] = t*{t}) + `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t : valtype} :: [I32_valtype], t*{t : valtype})) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) ;; 6-typing.watsup:605.1-608.44 rule br_table{C : context, l* : labelidx*, l' : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[l.`%`.0]))*{l} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[l'.`%`.0]) + `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0]))*{l : labelidx} + -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0]) ;; 6-typing.watsup:610.1-613.31 rule br_on_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t}) + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:615.1-618.31 rule br_on_non_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) - -- if (C.LABEL_context[l.`%`.0] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype})) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:620.1-626.34 rule br_on_cast{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 : reftype <: valtype)], t*{t} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -14045,8 +14045,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:628.1-634.49 rule br_on_cast_fail{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 : reftype <: valtype)], t*{t} :: [(rt_2 : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [(rt_2 : reftype <: valtype)])) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -14054,48 +14054,48 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:639.1-641.24 rule return{C : context, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.RETURN_context = ?(t*{t})) + `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + -- if (C.RETURN_context = ?(t*{t : valtype})) ;; 6-typing.watsup:643.1-645.46 rule call{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; 6-typing.watsup:647.1-649.46 rule call_ref{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2 : valtype})) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; 6-typing.watsup:651.1-655.46 rule call_indirect{C : context, x : idx, y : idx, t_1* : valtype*, t_2* : valtype*, lim : limits, rt : reftype}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; 6-typing.watsup:657.1-661.40 rule return_call{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}, t_4*{t_4 : valtype})) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:663.1-667.40 rule return_call_ref{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4 : valtype})) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:669.1-675.40 rule return_call_indirect{C : context, x : idx, y : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, lim : limits, rt : reftype, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype], t_4*{t_4 : valtype})) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:680.1-681.33 rule const{C : context, nt : numtype, c_nt : num_(nt)}: @@ -14125,9 +14125,9 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:701.1-704.50 rule convert-i{C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: - `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) -- if (inn_1 =/= inn_2) - -- if ((sx?{sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) + -- if ((sx?{sx : sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) ;; 6-typing.watsup:706.1-708.24 rule convert-f{C : context, fnn_1 : fnn, fnn_2 : fnn}: @@ -14181,27 +14181,27 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:756.1-758.43 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) ;; 6-typing.watsup:760.1-763.39 rule struct.new_default{C : context, x : idx, zt* : storagetype*, mut* : mut*, val* : val*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpack(zt)) = ?(val)))*{val zt} + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 6-typing.watsup:765.1-769.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: - `%|-%:%`(C, STRUCT.GET_instr(sx?{sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(mut, zt)) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + -- if (yt*{yt : fieldtype}[i] = `%%`(mut, zt)) + -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:771.1-774.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + -- if (yt*{yt : fieldtype}[i] = `%%`(`MUT%?`(?(())), zt)) ;; 6-typing.watsup:779.1-781.41 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: @@ -14234,9 +14234,9 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:803.1-806.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:808.1-810.41 rule array.set{C : context, x : idx, zt : storagetype}: @@ -14311,8 +14311,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:870.1-872.22 rule vshuffle{C : context, imm : imm, N : N, i* : nat*}: - `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) - -- (if (i < (N * 2)))*{i} + `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + -- (if (i < (N * 2)))*{i : nat} ;; 6-typing.watsup:874.1-875.48 rule vsplat{C : context, lnn : lnn, N : N}: @@ -14320,7 +14320,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:878.1-880.14 rule vextract_lane{C : context, lnn : lnn, N : N, sx? : sx?, i : nat}: - `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) + `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) -- if (i < N) ;; 6-typing.watsup:882.1-884.14 @@ -14350,7 +14350,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:902.1-903.55 rule vcvtop{C : context, sh : shape, vcvtop : vcvtop, hf? : half?, sx? : sx?, zero : zero}: - `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf}, sh, sx?{sx}, zero), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`([V128_valtype], [V128_valtype])) ;; 6-typing.watsup:905.1-906.44 rule vnarrow{C : context, sh : ishape, sx : sx}: @@ -14461,19 +14461,19 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1011.1-1016.29 rule load{C : context, nt : numtype, n? : n?, sx? : sx?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} + -- if ((n?{n : n} = ?()) \/ (nt = (inn : inn <: numtype))) ;; 6-typing.watsup:1018.1-1023.29 rule store{C : context, nt : numtype, n? : n?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) + `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} + -- if ((n?{n : n} = ?()) \/ (nt = (inn : inn <: numtype))) ;; 6-typing.watsup:1025.1-1028.30 rule vload{C : context, M : M, N : N, sx : sx, x : idx, n_A : n, n_O : n, mt : memtype}: @@ -14517,8 +14517,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) relation Instrf_ok: `%|-%:%`(context, instr, instrtype) ;; 6-typing.watsup:518.1-520.41 rule instr{C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1 : valtype}, [], t_2*{t_2 : valtype})) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:924.1-926.28 rule local.set{C : context, x : idx, t : valtype, init : init}: @@ -14538,30 +14538,30 @@ relation Instrs_ok: `%|-%*_:%`(context, instr*, instrtype) ;; 6-typing.watsup:525.1-530.52 rule seq{C : context, instr_1 : instr, instr_2* : instr*, t_1* : valtype*, x_1* : idx*, x_2* : idx*, t_3* : valtype*, init* : init*, t* : valtype*, C' : context, t_2* : valtype*}: - `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_1*{x_1} :: x_2*{x_2}, t_3*{t_3})) - -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init t x_1} - -- if (C' = $with_locals(C, x_1*{x_1}, `%%`(SET_init, t)*{t})) - -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2}, `%->%*%`(t_2*{t_2}, x_2*{x_2}, t_3*{t_3})) + `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init : init t : valtype x_1 : idx} + -- if (C' = $with_locals(C, x_1*{x_1 : localidx}, `%%`(SET_init, t)*{t : valtype})) + -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2 : instr}, `%->%*%`(t_2*{t_2 : valtype}, x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) ;; 6-typing.watsup:532.1-535.35 rule sub{C : context, instr* : instr*, it' : instrtype, it : instrtype}: - `%|-%*_:%`(C, instr*{instr}, it') - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, it) + `%|-%*_:%`(C, instr*{instr : instr}, it') + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, it) -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:537.1-539.47 rule frame{C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, x* : idx*, t_2* : valtype*}: - `%|-%*_:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t*{t : valtype} :: t_1*{t_1 : valtype}, x*{x : localidx}, t*{t : valtype} :: t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) } ;; 6-typing.watsup relation Expr_ok: `%|-%:%`(context, expr, resulttype) ;; 6-typing.watsup rule _{C : context, instr* : instr*, t* : valtype*}: - `%|-%:%`(C, instr*{instr}, t*{t}) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, `%->%*%`([], [], t*{t})) + `%|-%:%`(C, instr*{instr : instr}, t*{t : valtype}) + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`([], [], t*{t : valtype})) ;; 6-typing.watsup rec { @@ -14571,7 +14571,7 @@ def $in_binop(numtype : numtype, binop_ : binop_(numtype), binop_(numtype)*) : b ;; 6-typing.watsup:1087.1-1087.42 def $in_binop{nt : numtype, binop : binop_(nt), epsilon : binop_(nt)*}(nt, binop, epsilon) = false ;; 6-typing.watsup:1088.1-1088.99 - def $in_binop{nt : numtype, binop : binop_(nt), ibinop_1 : binop_(nt), ibinop'* : binop_(nt)*}(nt, binop, [ibinop_1] :: ibinop'*{ibinop'}) = ((binop = ibinop_1) \/ $in_binop(nt, binop, ibinop'*{ibinop'})) + def $in_binop{nt : numtype, binop : binop_(nt), ibinop_1 : binop_(nt), ibinop'* : binop_(nt)*}(nt, binop, [ibinop_1] :: ibinop'*{ibinop' : binop_(nt)}) = ((binop = ibinop_1) \/ $in_binop(nt, binop, ibinop'*{ibinop' : binop_(nt)})) } ;; 6-typing.watsup @@ -14582,7 +14582,7 @@ def $in_numtype(numtype : numtype, numtype*) : bool ;; 6-typing.watsup:1083.1-1083.37 def $in_numtype{nt : numtype, epsilon : numtype*}(nt, epsilon) = false ;; 6-typing.watsup:1084.1-1084.68 - def $in_numtype{nt : numtype, nt_1 : numtype, nt'* : numtype*}(nt, [nt_1] :: nt'*{nt'}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt'})) + def $in_numtype{nt : numtype, nt_1 : numtype, nt'* : numtype*}(nt, [nt_1] :: nt'*{nt' : numtype}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt' : numtype})) } ;; 6-typing.watsup @@ -14618,8 +14618,8 @@ relation Instr_const: `%|-%CONST`(context, instr) relation Expr_const: `%|-%CONST`(context, expr) ;; 6-typing.watsup rule _{C : context, instr* : instr*}: - `%|-%CONST`(C, instr*{instr}) - -- (Instr_const: `%|-%CONST`(C, instr))*{instr} + `%|-%CONST`(C, instr*{instr : instr}) + -- (Instr_const: `%|-%CONST`(C, instr))*{instr : instr} ;; 6-typing.watsup relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) @@ -14633,10 +14633,10 @@ relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) relation Type_ok: `%|-%:%*`(context, type, deftype*) ;; 6-typing.watsup rule _{C : context, rectype : rectype, dt* : deftype*, x : idx}: - `%|-%:%*`(C, TYPE(rectype), dt*{dt}) + `%|-%:%*`(C, TYPE(rectype), dt*{dt : deftype}) -- if (x = `%`(|C.TYPE_context|)) - -- if (dt*{dt} = $rolldt(x, rectype)) - -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt}], rectype, OK_oktypeidx(x)) + -- if (dt*{dt : deftype} = $rolldt(x, rectype)) + -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt : deftype}], rectype, OK_oktypeidx(x)) ;; 6-typing.watsup relation Local_ok: `%|-%:%`(context, local, localtype) @@ -14654,10 +14654,10 @@ relation Local_ok: `%|-%:%`(context, local, localtype) relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup rule _{C : context, x : idx, local* : local*, expr : expr, t_1* : valtype*, t_2* : valtype*, lt* : localtype*}: - `%|-%:%`(C, `FUNC%%*%`(x, local*{local}, expr), C.TYPE_context[x.`%`.0]) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- (Local_ok: `%|-%:%`(C, local, lt))*{local lt} - -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1} :: lt*{lt}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2})}, expr, t_2*{t_2}) + `%|-%:%`(C, `FUNC%%*%`(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- (Local_ok: `%|-%:%`(C, local, lt))*{local : local lt : localtype} + -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2 : valtype})}, expr, t_2*{t_2 : valtype}) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -14704,8 +14704,8 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup rule _{C : context, rt : reftype, expr* : expr*, elemmode : elemmode}: - `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr}, elemmode), rt) - -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr} + `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr : expr}, elemmode), rt) + -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr : expr} -- Elemmode_ok: `%|-%:%`(C, elemmode, rt) ;; 6-typing.watsup @@ -14724,7 +14724,7 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) relation Data_ok: `%|-%:_OK`(context, data) ;; 6-typing.watsup rule _{C : context, b* : byte*, datamode : datamode}: - `%|-%:_OK`(C, `DATA%*%`(b*{b}, datamode)) + `%|-%:_OK`(C, `DATA%*%`(b*{b : byte}, datamode)) -- Datamode_ok: `%|-%:_OK`(C, datamode) ;; 6-typing.watsup @@ -14781,9 +14781,9 @@ relation Globals_ok: `%|-%*_:%*`(context, global*, globaltype*) ;; 6-typing.watsup:1275.1-1278.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: - `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt}) + `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) - -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt}) + -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) } ;; 6-typing.watsup @@ -14797,32 +14797,32 @@ relation Types_ok: `%|-%*_:%*`(context, type*, deftype*) ;; 6-typing.watsup:1267.1-1270.49 rule cons{C : context, type_1 : type, type* : type*, dt_1 : deftype, dt* : deftype*}: - `%|-%*_:%*`(C, [type_1] :: type*{type}, dt_1*{} :: dt*{dt}) + `%|-%*_:%*`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, dt*{dt}) + -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) } ;; 6-typing.watsup relation Module_ok: `|-%:_OK`(module) ;; 6-typing.watsup rule _{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data^n : data^n, n : n, start? : start?, export* : export*, dt'* : deftype*, ixt* : externtype*, C' : context, gt* : globaltype*, tt* : tabletype*, mt* : memtype*, C : context, dt* : deftype*, rt* : reftype*, et* : externtype*, idt* : deftype*, igt* : globaltype*, itt* : tabletype*, imt* : memtype*}: - `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type}, import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data^n{data}, start?{start}, export*{export})) - -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type}, dt'*{dt'}) - -- (Import_ok: `%|-%:%`({TYPE dt'*{dt'}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import ixt} - -- Globals_ok: `%|-%*_:%*`(C', global*{global}, gt*{gt}) - -- (Table_ok: `%|-%:%`(C', table, tt))*{table tt} - -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem mt} - -- (Func_ok: `%|-%:%`(C, func, dt))*{dt func} - -- (Elem_ok: `%|-%:%`(C, elem, rt))*{elem rt} - -- (Data_ok: `%|-%:_OK`(C, data))^n{data} - -- (Start_ok: `%|-%:_OK`(C, start))?{start} - -- (Export_ok: `%|-%:%`(C, export, et))*{et export} - -- if (C = {TYPE dt'*{dt'}, REC [], FUNC idt*{idt} :: dt*{dt}, GLOBAL igt*{igt} :: gt*{gt}, TABLE itt*{itt} :: tt*{tt}, MEM imt*{imt} :: mt*{mt}, ELEM rt*{rt}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) - -- if (C' = {TYPE dt'*{dt'}, REC [], FUNC idt*{idt} :: dt*{dt}, GLOBAL igt*{igt}, TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}) - -- if (idt*{idt} = $funcsxt(ixt*{ixt})) - -- if (igt*{igt} = $globalsxt(ixt*{ixt})) - -- if (itt*{itt} = $tablesxt(ixt*{ixt})) - -- if (imt*{imt} = $memsxt(ixt*{ixt})) + `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) + -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) + -- (Import_ok: `%|-%:%`({TYPE dt'*{dt' : deftype}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import : import ixt : externtype} + -- Globals_ok: `%|-%*_:%*`(C', global*{global : global}, gt*{gt : globaltype}) + -- (Table_ok: `%|-%:%`(C', table, tt))*{table : table tt : tabletype} + -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem : mem mt : memtype} + -- (Func_ok: `%|-%:%`(C, func, dt))*{dt : deftype func : func} + -- (Elem_ok: `%|-%:%`(C, elem, rt))*{elem : elem rt : reftype} + -- (Data_ok: `%|-%:_OK`(C, data))^n{data : data} + -- (Start_ok: `%|-%:_OK`(C, start))?{start : start} + -- (Export_ok: `%|-%:%`(C, export, et))*{et : externtype export : export} + -- if (C = {TYPE dt'*{dt' : deftype}, REC [], FUNC idt*{idt : deftype} :: dt*{dt : deftype}, GLOBAL igt*{igt : globaltype} :: gt*{gt : globaltype}, TABLE itt*{itt : tabletype} :: tt*{tt : tabletype}, MEM imt*{imt : memtype} :: mt*{mt : memtype}, ELEM rt*{rt : elemtype}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) + -- if (C' = {TYPE dt'*{dt' : deftype}, REC [], FUNC idt*{idt : deftype} :: dt*{dt : deftype}, GLOBAL igt*{igt : globaltype}, TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}) + -- if (idt*{idt : deftype} = $funcsxt(ixt*{ixt : externtype})) + -- if (igt*{igt : globaltype} = $globalsxt(ixt*{ixt : externtype})) + -- if (itt*{itt : tabletype} = $tablesxt(ixt*{ixt : externtype})) + -- if (imt*{imt : memtype} = $memsxt(ixt*{ixt : externtype})) ;; 7-runtime-typing.watsup relation Ref_ok: `%|-%:%`(store, ref, reftype) @@ -14873,35 +14873,35 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule select-true{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_1 : val <: admininstr)]) + `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule select-false{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_2 : val <: admininstr)]) + `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule if-true{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) + `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule if-false{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) + `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule label-vals{n : n, instr* : instr*, val* : val*}: - `%*_~>%*`([LABEL__admininstr(n, instr*{instr}, (val : val <: admininstr)*{val})], (val : val <: admininstr)*{val}) + `%*_~>%*`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) ;; 8-reduction.watsup rule br-zero{n : n, instr'* : instr*, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)^n{val} :: (instr' : instr <: admininstr)*{instr'}) + `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule br-succ{n : n, instr'* : instr*, val* : val*, l : labelidx, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val : val <: admininstr)*{val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)*{val} :: [BR_admininstr(l)]) + `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) ;; 8-reduction.watsup rule br_if-true{c : num_(I32_numtype), l : labelidx}: @@ -14915,13 +14915,13 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule br_table-lt{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) - -- if (i < |l*{l}|) + `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) + -- if (i < |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_table-ge{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) - -- if (i >= |l*{l}|) + `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) + -- if (i >= |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_on_null-null{val : val, l : labelidx, ht : heaptype}: @@ -14953,15 +14953,15 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule frame-vals{n : n, f : frame, val^n : val^n}: - `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val})], (val : val <: admininstr)^n{val}) + `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-frame{n : n, f : frame, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)^n{val}) + `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-label{k : nat, instr'* : instr*, val* : val*, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(k, instr'*{instr'}, (val : val <: admininstr)*{val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)*{val} :: [RETURN_admininstr]) + `%*_~>%*`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) ;; 8-reduction.watsup rule unop-val{nt : numtype, c_1 : num_(nt), unop : unop_(nt), c : num_(nt)}: @@ -14995,13 +14995,13 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?, c : num_(nt_2)}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx}, c_1) = [c]) + `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) + -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = [c]) ;; 8-reduction.watsup rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx}, c_1) = []) + `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) + -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: @@ -15090,15 +15090,15 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vswizzle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn : inn, N : N, c' : vec_(V128_vnn), c : iN($size((inn : inn <: numtype))), ci* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*, k^N : nat^N}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) - -- if (ci*{ci} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) + -- if (ci*{ci : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) -- if (c*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: `%`(0)^(256 - N){}) - -- if (c' = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c*{}[ci*{ci}[k].`%`.0]^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i})], [VCONST_admininstr(V128_vectype, c)]) + `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) - -- if (c = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c'*{}[i*{i}[k]]^(k%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vshiftop{c_1 : vec_(V128_vnn), n : n, imm : imm, N : N, vshiftop : vshiftop_(`%X%`(imm, `%`(N))), c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) - -- if (c'*{c'} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1)) - -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c'})) + -- if (c'*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1)) + -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))})) ;; 8-reduction.watsup rule vtestop-true{c : vec_(V128_vnn), inn : inn, N : N, ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) - -- (if (ci_1 =/= `%`(0)))*{ci_1} + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) + -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), inn : inn, N : N}: @@ -15160,35 +15160,35 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vbitmask{c : vec_(V128_vnn), inn : inn, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) - -- if ($ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1}) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) + -- if ($ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($size((inn : inn <: numtype)))}) ;; 8-reduction.watsup rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn_1 : inn, N_1 : N, inn_2 : inn, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, cj_1* : iN($size((inn_2 : inn <: numtype)))*, cj_2* : iN($size((inn_2 : inn <: numtype)))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) - -- if (ci_2*{ci_2} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2)) - -- if (cj_1*{cj_1} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1}) - -- if (cj_2*{cj_2} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_2)*{ci_2}) - -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), cj_1*{cj_1} :: cj_2*{cj_2})) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) + -- if (ci_2*{ci_2 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2)) + -- if (cj_1*{cj_1 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1 : iN($size((inn_1 : inn <: numtype)))}) + -- if (cj_2*{cj_2 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_2)*{ci_2 : iN($size((inn_1 : inn <: numtype)))}) + -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), cj_1*{cj_1 : lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), `%`(N_2))))} :: cj_2*{cj_2 : lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), `%`(N_2))))})) ;; 8-reduction.watsup rule vcvtop-normal{c_1 : vec_(V128_vnn), lnn_2 : lnn, N_2 : N, vcvtop : vcvtop, lnn_1 : lnn, N_1 : N, sx : sx, c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- if (c'*{c'} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1)) - -- if (c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c'})) + -- if (c'*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1)) + -- if (c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-half{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, hf : half, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci*{ci} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) - -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx}, ci)*{ci})) + `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) + -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-zero{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci*{ci} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) - -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx}, ci)*{ci} :: `%`(0)^N_1{})) + `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) + -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} :: `%`(0)^N_1{})) ;; 8-reduction.watsup rule vextunop{c_1 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: @@ -15218,13 +15218,13 @@ def $blocktype(state : state, blocktype : blocktype) : functype relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule block{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, n : n, t_1^k : valtype^k, t_2^n : valtype^n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val} :: (instr : instr <: admininstr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) ;; 8-reduction.watsup rule loop{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, t_1^k : valtype^k, t_2^n : valtype^n, n : n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], (val : val <: admininstr)^k{val} :: (instr : instr <: admininstr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) ;; 8-reduction.watsup rule br_on_cast-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: @@ -15254,15 +15254,15 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule call_ref-null{z : state, ht : heaptype, x? : idx?}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule call_ref-func{z : state, val^n : val^n, n : n, a : addr, x? : idx?, m : m, f : frame, instr* : instr*, fi : funcinst, t_1^n : valtype^n, t_2^m : valtype^m, y : idx, t* : valtype*}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr})])]) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) -- if ($funcinst(z)[a] = fi) - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) - -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) + -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t : valtype}, instr*{instr : instr})) + -- if (f = {LOCAL ?(val)^n{val : val} :: $default(t)*{t : valtype}, MODULE fi.MODULE_funcinst}) ;; 8-reduction.watsup rule return_call{z : state, x : idx}: @@ -15270,16 +15270,16 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule return_call_ref-label{z : state, k : nat, instr'* : instr*, val* : val*, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, (val : val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), (val : val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) + `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) ;; 8-reduction.watsup rule return_call_ref-frame-addr{z : state, k : nat, f : frame, val'* : val*, val^n : val^n, n : n, a : addr, x? : idx?, instr* : instr*, t_1^n : valtype^n, t_2^m : valtype^m, m : m}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) ;; 8-reduction.watsup rule return_call_ref-frame-null{z : state, k : nat, f : frame, val* : val*, ht : heaptype, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule ref.func{z : state, x : idx}: @@ -15309,19 +15309,19 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule struct.new_default{z : state, x : idx, val* : val*, mut* : mut*, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val} :: [STRUCT.NEW_admininstr(x)]) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpack(zt)) = ?(val)))*{val zt} + `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 8-reduction.watsup rule struct.get-null{z : state, ht : heaptype, sx? : sx?, x : idx, i : nat}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, `%`(i))]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) ;; 8-reduction.watsup rule struct.get-struct{z : state, a : addr, sx? : sx?, x : idx, i : nat, zt* : storagetype*, si : structinst, mut* : mut*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, `%`(i))]), [($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]) : val <: admininstr)]) + `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) -- if ($structinst(z)[a] = si) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) ;; 8-reduction.watsup rule array.new{z : state, val : val, n : n, x : idx}: @@ -15340,8 +15340,8 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.new_elem-alloc{z : state, i : nat, n : n, x : idx, y : idx, ref^n : ref^n}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- if (ref^n{ref : ref} = $elem(z, y).ELEM_eleminst[i : n]) ;; 8-reduction.watsup rule array.new_data-oob{z : state, i : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: @@ -15351,32 +15351,32 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.new_data-num{z : state, i : nat, n : n, x : idx, y : idx, nt : numtype, c^n : num_(nt)^n, mut : mut, zt : storagetype, o0 : numtype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- if ($nunpack(zt) = ?(o0)) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (nt = o0) - -- if ($concat_(syntax byte, $nbytes(nt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) + -- if ($concat_(syntax byte, $nbytes(nt, c)^n{c : num_(nt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) ;; 8-reduction.watsup rule array.new_data-vec{z : state, i : nat, n : n, x : idx, y : idx, vt : vectype, c^n : vec_(vt)^n, mut : mut, zt : storagetype, o0 : vectype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- if ($vunpack(zt) = ?(o0)) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (vt = o0) - -- if ($concat_(syntax byte, $vbytes(vt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) + -- if ($concat_(syntax byte, $vbytes(vt, c)^n{c : vec_(vt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) ;; 8-reduction.watsup rule array.get-null{z : state, ht : heaptype, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.get-oob{z : state, a : addr, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.get-array{z : state, a : addr, i : nat, sx? : sx?, x : idx, zt : storagetype, fv : fieldval, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [($unpackval(zt, sx?{sx}, fv) : val <: admininstr)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) @@ -15435,18 +15435,18 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.copy-le{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) + -- if (sx?{sx : sx} = $sxfield(zt_2)) -- if (i_1 <= i_2) ;; 8-reduction.watsup rule array.copy-gt{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) + -- if (sx?{sx : sx} = $sxfield(zt_2)) ;; 8-reduction.watsup rule array.init_elem-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: @@ -15629,9 +15629,9 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule vload-shape-val{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop, c : vec_(V128_vnn), j^N : nat^N, k^N : nat^N, inn : inn}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) - -- (if ($ibytes(M, `%`(j)) = $mem(z, x).DATA_meminst[((i + mo.OFFSET_memop.`%`.0) + ((k * M) / 8)) : (M / 8)]))^(k%*`(config, admininstr*) relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule pure{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr'})) - -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr}, (instr' : instr <: admininstr)*{instr'}) + `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule read{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr'})) - -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), (instr' : instr <: admininstr)*{instr'}) + `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule struct.new{z : state, val^n : val^n, n : n, x : idx, si : structinst, mut^n : mut^n, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) - -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) + `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut : mut zt : storagetype})) + -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val zt : storagetype}}) ;; 8-reduction.watsup rule struct.set-null{z : state, ht : heaptype, val : val, x : idx, i : nat}: @@ -15754,14 +15754,14 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule struct.set-struct{z : state, a : addr, val : val, x : idx, i : nat, fv : fieldval, mut* : mut*, zt* : storagetype*}: `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`($with_struct(z, a, i, fv), [])) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- if (fv = $packval(zt*{zt}[i], val)) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- if (fv = $packval(zt*{zt : storagetype}[i], val)) ;; 8-reduction.watsup rule array.new_fixed{z : state, val^n : val^n, n : n, x : idx, ai : arrayinst, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) + -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val}}) ;; 8-reduction.watsup rule array.set-null{z : state, ht : heaptype, i : nat, val : val, x : idx}: @@ -15817,8 +15817,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule store-num-val{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b}), [])) - -- if (b*{b} = $nbytes(nt, c)) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) + -- if (b*{b : byte} = $nbytes(nt, c)) ;; 8-reduction.watsup rule store-pack-oob{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop}: @@ -15827,8 +15827,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule store-pack-val{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b}), [])) - -- if (b*{b} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c))) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) + -- if (b*{b : byte} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c))) ;; 8-reduction.watsup rule vstore-oob{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop}: @@ -15837,8 +15837,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule vstore-val{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b}), [])) - -- if (b*{b} = $vbytes(V128_vectype, c)) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) + -- if (b*{b : byte} = $vbytes(V128_vectype, c)) ;; 8-reduction.watsup rule vstore_lane-oob{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: @@ -15847,10 +15847,10 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule vstore_lane-val{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, b* : byte*, imm : imm, M : M}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b}), [])) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = (128 / N)) - -- if (b*{b} = $ibytes(N, `%`($lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)[j].`%`.0))) + -- if (b*{b : byte} = $ibytes(N, `%`($lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)[j].`%`.0))) ;; 8-reduction.watsup rule memory.grow-succeed{z : state, n : n, x : idx, mi : meminst, o0 : meminst}: @@ -15873,21 +15873,21 @@ rec { relation Steps: `%~>*%`(config, config) ;; 8-reduction.watsup:18.1-19.36 rule refl{z : state, admininstr* : admininstr*}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) + `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z, admininstr*{admininstr : admininstr})) ;; 8-reduction.watsup:21.1-24.53 rule trans{z : state, admininstr* : admininstr*, z'' : state, admininstr''* : admininstr*, z' : state, admininstr' : admininstr}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z'', admininstr''*{admininstr''})) - -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z', admininstr'*{})) - -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr''})) + `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) + -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z', admininstr'*{})) + -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) } ;; 8-reduction.watsup relation Eval_expr: `%;%~>*%;%*`(state, expr, state, val*) ;; 8-reduction.watsup rule _{z : state, instr* : instr*, z' : state, val* : val*}: - `%;%~>*%;%*`(z, instr*{instr}, z', val*{val}) - -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z', (val : val <: admininstr)*{val})) + `%;%~>*%;%*`(z, instr*{instr : instr}, z', val*{val : val}) + -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z', (val : val <: admininstr)*{val : val})) ;; 9-module.watsup rec { @@ -15897,18 +15897,18 @@ def $alloctypes(type*) : deftype* ;; 9-module.watsup:8.1-8.27 def $alloctypes([]) = [] ;; 9-module.watsup:9.1-13.24 - def $alloctypes{type'* : type*, type : type, deftype'* : deftype*, deftype* : deftype*, rectype : rectype, x : idx}(type'*{type'} :: [type]) = deftype'*{deftype'} :: deftype*{deftype} - -- if (deftype'*{deftype'} = $alloctypes(type'*{type'})) + def $alloctypes{type'* : type*, type : type, deftype'* : deftype*, deftype* : deftype*, rectype : rectype, x : idx}(type'*{type' : type} :: [type]) = deftype'*{deftype' : deftype} :: deftype*{deftype : deftype} + -- if (deftype'*{deftype' : deftype} = $alloctypes(type'*{type' : type})) -- if (type = TYPE(rectype)) - -- if (deftype*{deftype} = $subst_all_deftypes($rolldt(x, rectype), (deftype' : deftype <: heaptype)*{deftype'})) - -- if (x = `%`(|deftype'*{deftype'}|)) + -- if (deftype*{deftype : deftype} = $subst_all_deftypes($rolldt(x, rectype), (deftype' : deftype <: heaptype)*{deftype' : deftype})) + -- if (x = `%`(|deftype'*{deftype' : deftype}|)) } ;; 9-module.watsup def $allocfunc(store : store, moduleinst : moduleinst, func : func) : (store, funcaddr) ;; 9-module.watsup def $allocfunc{s : store, mm : moduleinst, func : func, fi : funcinst, x : idx, local* : local*, expr : expr}(s, mm, func) = (s[FUNC_store =.. [fi]], |s.FUNC_store|) - -- if (func = `FUNC%%*%`(x, local*{local}, expr)) + -- if (func = `FUNC%%*%`(x, local*{local : local}, expr)) -- if (fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func}) ;; 9-module.watsup @@ -15919,9 +15919,9 @@ def $allocfuncs(store : store, moduleinst : moduleinst, func*) : (store, funcadd ;; 9-module.watsup:21.1-21.39 def $allocfuncs{s : store, mm : moduleinst}(s, mm, []) = (s, []) ;; 9-module.watsup:22.1-24.51 - def $allocfuncs{s : store, mm : moduleinst, func : func, func'* : func*, s_2 : store, fa : funcaddr, fa'* : funcaddr*, s_1 : store}(s, mm, [func] :: func'*{func'}) = (s_2, [fa] :: fa'*{fa'}) + def $allocfuncs{s : store, mm : moduleinst, func : func, func'* : func*, s_2 : store, fa : funcaddr, fa'* : funcaddr*, s_1 : store}(s, mm, [func] :: func'*{func' : func}) = (s_2, [fa] :: fa'*{fa' : funcaddr}) -- if ((s_1, fa) = $allocfunc(s, mm, func)) - -- if ((s_2, fa'*{fa'}) = $allocfuncs(s_1, mm, func'*{func'})) + -- if ((s_2, fa'*{fa' : funcaddr}) = $allocfuncs(s_1, mm, func'*{func' : func})) } ;; 9-module.watsup @@ -15938,9 +15938,9 @@ def $allocglobals(store : store, globaltype*, val*) : (store, globaladdr*) ;; 9-module.watsup:31.1-31.42 def $allocglobals{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:32.1-34.62 - def $allocglobals{s : store, globaltype : globaltype, globaltype'* : globaltype*, val : val, val'* : val*, s_2 : store, ga : globaladdr, ga'* : globaladdr*, s_1 : store}(s, [globaltype] :: globaltype'*{globaltype'}, [val] :: val'*{val'}) = (s_2, [ga] :: ga'*{ga'}) + def $allocglobals{s : store, globaltype : globaltype, globaltype'* : globaltype*, val : val, val'* : val*, s_2 : store, ga : globaladdr, ga'* : globaladdr*, s_1 : store}(s, [globaltype] :: globaltype'*{globaltype' : globaltype}, [val] :: val'*{val' : val}) = (s_2, [ga] :: ga'*{ga' : globaladdr}) -- if ((s_1, ga) = $allocglobal(s, globaltype, val)) - -- if ((s_2, ga'*{ga'}) = $allocglobals(s_1, globaltype'*{globaltype'}, val'*{val'})) + -- if ((s_2, ga'*{ga' : globaladdr}) = $allocglobals(s_1, globaltype'*{globaltype' : globaltype}, val'*{val' : val})) } ;; 9-module.watsup @@ -15957,9 +15957,9 @@ def $alloctables(store : store, tabletype*, ref*) : (store, tableaddr*) ;; 9-module.watsup:41.1-41.41 def $alloctables{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:42.1-44.60 - def $alloctables{s : store, tabletype : tabletype, tabletype'* : tabletype*, ref : ref, ref'* : ref*, s_2 : store, ta : tableaddr, ta'* : tableaddr*, s_1 : store}(s, [tabletype] :: tabletype'*{tabletype'}, [ref] :: ref'*{ref'}) = (s_2, [ta] :: ta'*{ta'}) + def $alloctables{s : store, tabletype : tabletype, tabletype'* : tabletype*, ref : ref, ref'* : ref*, s_2 : store, ta : tableaddr, ta'* : tableaddr*, s_1 : store}(s, [tabletype] :: tabletype'*{tabletype' : tabletype}, [ref] :: ref'*{ref' : ref}) = (s_2, [ta] :: ta'*{ta' : tableaddr}) -- if ((s_1, ta) = $alloctable(s, tabletype, ref)) - -- if ((s_2, ta'*{ta'}) = $alloctables(s_1, tabletype'*{tabletype'}, ref'*{ref'})) + -- if ((s_2, ta'*{ta' : tableaddr}) = $alloctables(s_1, tabletype'*{tabletype' : tabletype}, ref'*{ref' : ref})) } ;; 9-module.watsup @@ -15976,16 +15976,16 @@ def $allocmems(store : store, memtype*) : (store, memaddr*) ;; 9-module.watsup:51.1-51.34 def $allocmems{s : store}(s, []) = (s, []) ;; 9-module.watsup:52.1-54.49 - def $allocmems{s : store, memtype : memtype, memtype'* : memtype*, s_2 : store, ma : memaddr, ma'* : memaddr*, s_1 : store}(s, [memtype] :: memtype'*{memtype'}) = (s_2, [ma] :: ma'*{ma'}) + def $allocmems{s : store, memtype : memtype, memtype'* : memtype*, s_2 : store, ma : memaddr, ma'* : memaddr*, s_1 : store}(s, [memtype] :: memtype'*{memtype' : memtype}) = (s_2, [ma] :: ma'*{ma' : memaddr}) -- if ((s_1, ma) = $allocmem(s, memtype)) - -- if ((s_2, ma'*{ma'}) = $allocmems(s_1, memtype'*{memtype'})) + -- if ((s_2, ma'*{ma' : memaddr}) = $allocmems(s_1, memtype'*{memtype' : memtype})) } ;; 9-module.watsup def $allocelem(store : store, reftype : reftype, ref*) : (store, elemaddr) ;; 9-module.watsup - def $allocelem{s : store, rt : reftype, ref* : ref*, ei : eleminst}(s, rt, ref*{ref}) = (s[ELEM_store =.. [ei]], |s.ELEM_store|) - -- if (ei = {TYPE rt, ELEM ref*{ref}}) + def $allocelem{s : store, rt : reftype, ref* : ref*, ei : eleminst}(s, rt, ref*{ref : ref}) = (s[ELEM_store =.. [ei]], |s.ELEM_store|) + -- if (ei = {TYPE rt, ELEM ref*{ref : ref}}) ;; 9-module.watsup rec { @@ -15995,16 +15995,16 @@ def $allocelems(store : store, reftype*, ref**) : (store, elemaddr*) ;; 9-module.watsup:61.1-61.40 def $allocelems{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:62.1-64.55 - def $allocelems{s : store, rt : reftype, rt'* : reftype*, ref* : ref*, ref'** : ref**, s_2 : store, ea : elemaddr, ea'* : elemaddr*, s_1 : store}(s, [rt] :: rt'*{rt'}, [ref*{ref}] :: ref'*{ref'}*{ref'}) = (s_2, [ea] :: ea'*{ea'}) - -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref})) - -- if ((s_2, ea'*{ea'}) = $allocelems(s_2, rt'*{rt'}, ref'*{ref'}*{ref'})) + def $allocelems{s : store, rt : reftype, rt'* : reftype*, ref* : ref*, ref'** : ref**, s_2 : store, ea : elemaddr, ea'* : elemaddr*, s_1 : store}(s, [rt] :: rt'*{rt' : reftype}, [ref*{ref : ref}] :: ref'*{ref' : ref}*{ref' : ref}) = (s_2, [ea] :: ea'*{ea' : elemaddr}) + -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref : ref})) + -- if ((s_2, ea'*{ea' : elemaddr}) = $allocelems(s_2, rt'*{rt' : reftype}, ref'*{ref' : ref}*{ref' : ref})) } ;; 9-module.watsup def $allocdata(store : store, byte*) : (store, dataaddr) ;; 9-module.watsup - def $allocdata{s : store, byte* : byte*, di : datainst}(s, byte*{byte}) = (s[DATA_store =.. [di]], |s.DATA_store|) - -- if (di = {DATA byte*{byte}}) + def $allocdata{s : store, byte* : byte*, di : datainst}(s, byte*{byte : byte}) = (s[DATA_store =.. [di]], |s.DATA_store|) + -- if (di = {DATA byte*{byte : byte}}) ;; 9-module.watsup rec { @@ -16014,92 +16014,92 @@ def $allocdatas(store : store, byte**) : (store, dataaddr*) ;; 9-module.watsup:71.1-71.35 def $allocdatas{s : store}(s, []) = (s, []) ;; 9-module.watsup:72.1-74.50 - def $allocdatas{s : store, byte* : byte*, byte'** : byte**, s_2 : store, da : dataaddr, da'* : dataaddr*, s_1 : store}(s, [byte*{byte}] :: byte'*{byte'}*{byte'}) = (s_2, [da] :: da'*{da'}) - -- if ((s_1, da) = $allocdata(s, byte*{byte})) - -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) + def $allocdatas{s : store, byte* : byte*, byte'** : byte**, s_2 : store, da : dataaddr, da'* : dataaddr*, s_1 : store}(s, [byte*{byte : byte}] :: byte'*{byte' : byte}*{byte' : byte}) = (s_2, [da] :: da'*{da' : dataaddr}) + -- if ((s_1, da) = $allocdata(s, byte*{byte : byte})) + -- if ((s_2, da'*{da' : dataaddr}) = $allocdatas(s_1, byte'*{byte' : byte}*{byte' : byte})) } ;; 9-module.watsup def $instexport(funcaddr*, globaladdr*, tableaddr*, memaddr*, export : export) : exportinst ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa : funcaddr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga : globaladdr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta : tableaddr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma : memaddr}[x.`%`.0])} ;; 9-module.watsup def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) : (store, moduleinst) ;; 9-module.watsup - def $allocmodule{s : store, module : module, externval* : externval*, val_g* : val*, ref_t* : ref*, ref_e** : ref**, s_6 : store, mm : moduleinst, type* : type*, import* : import*, func^n_f : func^n_f, n_f : n, globaltype^n_g : globaltype^n_g, expr_g^n_g : expr^n_g, n_g : n, tabletype^n_t : tabletype^n_t, expr_t^n_t : expr^n_t, n_t : n, memtype^n_m : memtype^n_m, n_m : n, reftype^n_e : reftype^n_e, expr_e*^n_e : expr*^n_e, elemmode^n_e : elemmode^n_e, n_e : n, byte*^n_d : byte*^n_d, datamode^n_d : datamode^n_d, n_d : n, start? : start?, export* : export*, fa_ex* : funcaddr*, ga_ex* : globaladdr*, ta_ex* : tableaddr*, ma_ex* : memaddr*, fa* : funcaddr*, i_f^n_f : nat^n_f, ga* : globaladdr*, i_g^n_g : nat^n_g, ta* : tableaddr*, i_t^n_t : nat^n_t, ma* : memaddr*, i_m^n_m : nat^n_m, ea* : elemaddr*, i_e^n_e : nat^n_e, da* : dataaddr*, i_d^n_d : nat^n_d, xi* : exportinst*, dt* : deftype*, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store}(s, module, externval*{externval}, val_g*{val_g}, ref_t*{ref_t}, ref_e*{ref_e}*{ref_e}) = (s_6, mm) - -- if (module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type}, import*{import}, func^n_f{func}, GLOBAL(globaltype, expr_g)^n_g{expr_g globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t tabletype}, MEMORY(memtype)^n_m{memtype}, `ELEM%%*%`(reftype, expr_e*{expr_e}, elemmode)^n_e{elemmode expr_e reftype}, `DATA%*%`(byte*{byte}, datamode)^n_d{byte datamode}, start?{start}, export*{export})) - -- if (fa_ex*{fa_ex} = $funcsxv(externval*{externval})) - -- if (ga_ex*{ga_ex} = $globalsxv(externval*{externval})) - -- if (ta_ex*{ta_ex} = $tablesxv(externval*{externval})) - -- if (ma_ex*{ma_ex} = $memsxv(externval*{externval})) - -- if (fa*{fa} = (|s.FUNC_store| + i_f)^(i_f*%;%*`(z, expr_G, z, [val_G]))*{expr_G val_G} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T ref_T} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E ref_E}*{expr_E ref_E} - -- if ((s', mm) = $allocmodule(s, module, externval*{externval}, val_G*{val_G}, ref_T*{ref_T}, ref_E*{ref_E}*{ref_E})) + -- (Eval_expr: `%;%~>*%;%*`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} + -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} + -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} + -- if ((s', mm) = $allocmodule(s, module, externval*{externval : externval}, val_G*{val_G : val}, ref_T*{ref_T : ref}, ref_E*{ref_E : ref}*{ref_E : ref})) -- if (f = {LOCAL [], MODULE mm}) - -- if (instr_E*{instr_E} = $concat_(syntax instr, $runelem(elem*{elem}[i], `%`(i))^(i%`(t_1^n{t_1}, t_2*{t_2}))) + -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = `FUNC%%*%`(x, local*{local : local}, expr)) + -- Expand: `%~~%`(s.FUNC_store[fa].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; A-binary.watsup rec { @@ -16119,7 +16119,7 @@ def $utf8(name : name) : byte* def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([`%`(ch)]) = [b_1 b_2 b_3 b_4] -- if (((65536 <= ch) /\ (ch < 69632)) /\ (ch = (((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128)))) ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(`%`(ch)*{ch}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch}) + def $utf8{ch* : nat*}(`%`(ch)*{ch : nat}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch : nat}) } ;; A-binary.watsup @@ -16139,14 +16139,14 @@ syntax B = nat ;; C-conventions.watsup syntax sym = - | _FIRST(A_1 : A) + | _FIRST{A_1 : A}(A_1 : A) | _DOTS - | _LAST(A_n : A) + | _LAST{A_n : A}(A_n : A) ;; C-conventions.watsup syntax symsplit = - | _FIRST(A_1 : A) - | _LAST(A_2 : A) + | _FIRST{A_1 : A}(A_1 : A) + | _LAST{A_2 : A}(A_2 : A) ;; C-conventions.watsup syntax recorddots = `...` @@ -16154,21 +16154,21 @@ syntax recorddots = `...` ;; C-conventions.watsup syntax record = { - FIELD_1 A, - FIELD_2 A, - DOTS recorddots + FIELD_1{A_1 : A} A, + FIELD_2{A_2 : A} A, + DOTS{recorddots : recorddots} recorddots } ;; C-conventions.watsup syntax recordstar = { - FIELD_1 A*, - FIELD_2 A*, - DOTS recorddots + FIELD_1{A_1* : A*} A*, + FIELD_2{A_2* : A*} A*, + DOTS{recorddots : recorddots} recorddots } ;; C-conventions.watsup -syntax recordeq = `%++%=%`(recordstar : recordstar, recordstar : recordstar, recordstar : recordstar) +syntax recordeq = `%++%=%`{recordstar : recordstar}(recordstar : recordstar, recordstar, recordstar) ;; C-conventions.watsup syntax pth = @@ -16224,7 +16224,7 @@ def $sum(nat*) : nat ;; 0-aux.watsup:33.1-33.18 def $sum([]) = 0 ;; 0-aux.watsup:34.1-34.35 - def $sum{n : n, n'* : n*}([n] :: n'*{n'}) = (n + $sum(n'*{n'})) + def $sum{n : n, n'* : n*}([n] :: n'*{n' : nat}) = (n + $sum(n'*{n' : nat})) } ;; 0-aux.watsup @@ -16235,7 +16235,7 @@ def $concat_(syntax X, X**) : X* ;; 0-aux.watsup:40.1-40.34 def $concat_{syntax X}(syntax X, []) = [] ;; 0-aux.watsup:41.1-41.61 - def $concat_{syntax X, w* : X*, w'** : X**}(syntax X, [w*{w}] :: w'*{w'}*{w'}) = w*{w} :: $concat_(syntax X, w'*{w'}*{w'}) + def $concat_{syntax X, w* : X*, w'** : X**}(syntax X, [w*{w : X}] :: w'*{w' : X}*{w' : X}) = w*{w : X} :: $concat_(syntax X, w'*{w' : X}*{w' : X}) } ;; 1-syntax.watsup @@ -16324,8 +16324,8 @@ syntax fNmag{N : N}(N) = ;; 1-syntax.watsup syntax fN{N : N}(N) = - | POS(fNmag : fNmag(N)) - | NEG(fNmag : fNmag(N)) + | POS{fNmag : fNmag(N)}(fNmag : fNmag(N)) + | NEG{fNmag : fNmag(N)}(fNmag : fNmag(N)) ;; 1-syntax.watsup syntax f32 = fN(32) @@ -16428,7 +16428,7 @@ syntax valtype = | F32 | F64 | V128 - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | BOT ;; 1-syntax.watsup:154.1-155.16 @@ -16442,15 +16442,15 @@ syntax storagetype = | F32 | F64 | V128 - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | I8 | I16 ;; 1-syntax.watsup:175.1-176.18 -syntax fieldtype = `%%`(mut : mut, storagetype : storagetype) +syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) ;; 1-syntax.watsup:178.1-178.70 -syntax functype = `%->%`(resulttype : resulttype, resulttype : resulttype) +syntax functype = `%->%`{resulttype : resulttype}(resulttype : resulttype, resulttype) ;; 1-syntax.watsup:179.1-179.64 syntax structtype = list(syntax fieldtype) @@ -16460,22 +16460,22 @@ syntax arraytype = fieldtype ;; 1-syntax.watsup:182.1-185.18 syntax comptype = - | STRUCT(structtype : structtype) - | ARRAY(arraytype : arraytype) - | FUNC(functype : functype) + | STRUCT{structtype : structtype}(structtype : structtype) + | ARRAY{arraytype : arraytype}(arraytype : arraytype) + | FUNC{functype : functype}(functype : functype) ;; 1-syntax.watsup:189.1-190.60 syntax subtype = - | SUB(fin : fin, typeidx*, comptype : comptype) - | SUBD(fin : fin, heaptype*, comptype : comptype) + | SUB{fin : fin, typeidx* : typeidx*, comptype : comptype}(fin : fin, typeidx*{typeidx : typeidx} : typeidx*, comptype : comptype) + | SUBD{fin : fin, heaptype* : heaptype*, comptype : comptype}(fin : fin, heaptype*{heaptype : heaptype} : heaptype*, comptype : comptype) ;; 1-syntax.watsup:192.1-193.22 syntax rectype = - | REC(list : list(syntax subtype)) + | REC{list : list(syntax subtype)}(list : list(syntax subtype)) ;; 1-syntax.watsup:198.1-199.26 syntax heaptype = - | _IDX(typeidx : typeidx) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY | EQ | I31 @@ -16487,13 +16487,13 @@ syntax heaptype = | EXTERN | NOEXTERN | BOT - | DEF(rectype : rectype, nat : nat) - | REC(n : n) + | DEF{rectype : rectype}(rectype : rectype, nat) + | REC{n : n}(n : n) } ;; 1-syntax.watsup syntax reftype = - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) ;; 1-syntax.watsup syntax inn = @@ -16546,19 +16546,19 @@ syntax imm = ;; 1-syntax.watsup syntax deftype = - | DEF(rectype : rectype, nat : nat) + | DEF{rectype : rectype}(rectype : rectype, nat) ;; 1-syntax.watsup -syntax limits = `[%..%]`(u32 : u32, u32 : u32) +syntax limits = `[%..%]`{u32 : u32}(u32 : u32, u32) ;; 1-syntax.watsup -syntax globaltype = `%%`(mut : mut, valtype : valtype) +syntax globaltype = `%%`{mut : mut, valtype : valtype}(mut : mut, valtype : valtype) ;; 1-syntax.watsup -syntax tabletype = `%%`(limits : limits, reftype : reftype) +syntax tabletype = `%%`{limits : limits, reftype : reftype}(limits : limits, reftype : reftype) ;; 1-syntax.watsup -syntax memtype = `%I8`(limits : limits) +syntax memtype = `%I8`{limits : limits}(limits : limits) ;; 1-syntax.watsup syntax elemtype = reftype @@ -16568,10 +16568,10 @@ syntax datatype = OK ;; 1-syntax.watsup syntax externtype = - | FUNC(deftype : deftype) - | GLOBAL(globaltype : globaltype) - | TABLE(tabletype : tabletype) - | MEM(memtype : memtype) + | FUNC{deftype : deftype}(deftype : deftype) + | GLOBAL{globaltype : globaltype}(globaltype : globaltype) + | TABLE{tabletype : tabletype}(tabletype : tabletype) + | MEM{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup def $size(numtype : numtype) : nat @@ -16617,7 +16617,7 @@ syntax dim = `%`{i : nat}(i : nat) -- if (((((i = 1) \/ (i = 2)) \/ (i = 4)) \/ (i = 8)) \/ (i = 16)) ;; 1-syntax.watsup -syntax shape = `%X%`(lanetype : lanetype, dim : dim) +syntax shape = `%X%`{lanetype : lanetype, dim : dim}(lanetype : lanetype, dim : dim) ;; 1-syntax.watsup def $lanetype(shape : shape) : lanetype @@ -16685,7 +16685,7 @@ syntax unop_(numtype : numtype) | CLZ | CTZ | POPCNT - | EXTEND(n : n) + | EXTEND{n : n}(n : n) ;; 1-syntax.watsup @@ -16706,13 +16706,13 @@ syntax binop_(numtype : numtype) | ADD | SUB | MUL - | DIV(sx : sx) - | REM(sx : sx) + | DIV{sx : sx}(sx : sx) + | REM{sx : sx}(sx : sx) | AND | OR | XOR | SHL - | SHR(sx : sx) + | SHR{sx : sx}(sx : sx) | ROTL | ROTR @@ -16738,10 +16738,10 @@ syntax relop_(numtype : numtype) syntax relop_{inn : inn}((inn : inn <: numtype)) = | EQ | NE - | LT(sx : sx) - | GT(sx : sx) - | LE(sx : sx) - | GE(sx : sx) + | LT{sx : sx}(sx : sx) + | GT{sx : sx}(sx : sx) + | LE{sx : sx}(sx : sx) + | GE{sx : sx}(sx : sx) ;; 1-syntax.watsup @@ -16761,13 +16761,13 @@ syntax cvtop = | REINTERPRET ;; 1-syntax.watsup -syntax ishape = `%X%`(imm : imm, dim : dim) +syntax ishape = `%X%`{imm : imm, dim : dim}(imm : imm, dim : dim) ;; 1-syntax.watsup -syntax fshape = `%X%`(fnn : fnn, dim : dim) +syntax fshape = `%X%`{fnn : fnn, dim : dim}(fnn : fnn, dim : dim) ;; 1-syntax.watsup -syntax pshape = `%X%`(pnn : pnn, dim : dim) +syntax pshape = `%X%`{pnn : pnn, dim : dim}(pnn : pnn, dim : dim) ;; 1-syntax.watsup def $dim(shape : shape) : dim @@ -16825,9 +16825,9 @@ syntax vbinop_(shape : shape) syntax vbinop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ADD | SUB - | ADD_SAT(sx : sx) + | ADD_SAT{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 16) - | SUB_SAT(sx : sx) + | SUB_SAT{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 16) | MUL -- if ($lsize((imm : imm <: lanetype)) >= 16) @@ -16835,9 +16835,9 @@ syntax vbinop_(shape : shape) -- if ($lsize((imm : imm <: lanetype)) <= 16) | Q15MULR_SAT_S{imm : imm} -- if ($lsize((imm : imm <: lanetype)) = 16) - | MIN(sx : sx) + | MIN{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 32) - | MAX(sx : sx) + | MAX{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 32) @@ -16863,10 +16863,10 @@ syntax vrelop_(shape : shape) syntax vrelop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | EQ | NE - | LT(sx : sx) - | GT(sx : sx) - | LE(sx : sx) - | GE(sx : sx) + | LT{sx : sx}(sx : sx) + | GT{sx : sx}(sx : sx) + | LE{sx : sx}(sx : sx) + | GE{sx : sx}(sx : sx) ;; 1-syntax.watsup @@ -16890,7 +16890,7 @@ syntax vcvtop = ;; 1-syntax.watsup syntax vshiftop_{imm : imm, N : N}(`%X%`(imm, `%`(N))) = | SHL - | SHR(sx : sx) + | SHR{sx : sx}(sx : sx) ;; 1-syntax.watsup syntax vextunop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = @@ -16904,27 +16904,27 @@ syntax half = ;; 1-syntax.watsup syntax vextbinop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = - | EXTMUL(half : half) + | EXTMUL{half : half}(half : half) | DOT{imm_1 : imm} -- if ($lsize((imm_1 : imm <: lanetype)) = 32) ;; 1-syntax.watsup syntax memop = { - ALIGN u32, - OFFSET u32 + ALIGN{u32 : u32} u32, + OFFSET{u32 : u32} u32 } ;; 1-syntax.watsup syntax vloadop = - | SHAPE(nat : nat, nat : nat, sx : sx) - | SPLAT(nat : nat) - | ZERO(nat : nat) + | SHAPE{sx : sx}(nat, nat, sx : sx) + | SPLAT(nat) + | ZERO(nat) ;; 1-syntax.watsup syntax blocktype = - | _RESULT(valtype?) - | _IDX(funcidx : funcidx) + | _RESULT{valtype? : valtype?}(valtype?{valtype : valtype} : valtype?) + | _IDX{funcidx : funcidx}(funcidx : funcidx) ;; 1-syntax.watsup syntax zero = `ZERO%?`(()?) @@ -16937,108 +16937,108 @@ syntax instr = | UNREACHABLE | NOP | DROP - | SELECT(valtype*?) - | BLOCK(blocktype : blocktype, instr*) - | LOOP(blocktype : blocktype, instr*) - | IF(blocktype : blocktype, instr*, instr*) - | BR(labelidx : labelidx) - | BR_IF(labelidx : labelidx) - | BR_TABLE(labelidx*, labelidx : labelidx) - | BR_ON_NULL(labelidx : labelidx) - | BR_ON_NON_NULL(labelidx : labelidx) - | BR_ON_CAST(labelidx : labelidx, reftype : reftype, reftype : reftype) - | BR_ON_CAST_FAIL(labelidx : labelidx, reftype : reftype, reftype : reftype) - | CALL(funcidx : funcidx) - | CALL_REF(typeidx?) - | CALL_INDIRECT(tableidx : tableidx, typeidx : typeidx) + | SELECT{valtype*? : valtype*?}(valtype*{valtype : valtype}?{valtype : valtype} : valtype*?) + | BLOCK{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*) + | LOOP{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*) + | IF{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*, instr*) + | BR{labelidx : labelidx}(labelidx : labelidx) + | BR_IF{labelidx : labelidx}(labelidx : labelidx) + | BR_TABLE{labelidx : labelidx}(labelidx*{} : labelidx*, labelidx) + | BR_ON_NULL{labelidx : labelidx}(labelidx : labelidx) + | BR_ON_NON_NULL{labelidx : labelidx}(labelidx : labelidx) + | BR_ON_CAST{labelidx : labelidx, reftype : reftype}(labelidx : labelidx, reftype : reftype, reftype) + | BR_ON_CAST_FAIL{labelidx : labelidx, reftype : reftype}(labelidx : labelidx, reftype : reftype, reftype) + | CALL{funcidx : funcidx}(funcidx : funcidx) + | CALL_REF{typeidx? : typeidx?}(typeidx?{typeidx : typeidx} : typeidx?) + | CALL_INDIRECT{tableidx : tableidx, typeidx : typeidx}(tableidx : tableidx, typeidx : typeidx) | RETURN - | RETURN_CALL(funcidx : funcidx) - | RETURN_CALL_REF(typeidx?) - | RETURN_CALL_INDIRECT(tableidx : tableidx, typeidx : typeidx) - | CONST(numtype : numtype, num_ : num_(numtype)) - | UNOP(numtype : numtype, unop_ : unop_(numtype)) - | BINOP(numtype : numtype, binop_ : binop_(numtype)) - | TESTOP(numtype : numtype, testop_ : testop_(numtype)) - | RELOP(numtype : numtype, relop_ : relop_(numtype)) - | CVTOP(numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx?) - | EXTEND(numtype : numtype, n : n) - | VCONST(vectype : vectype, vec_ : vec_(vectype)) - | VVUNOP(vectype : vectype, vvunop : vvunop) - | VVBINOP(vectype : vectype, vvbinop : vvbinop) - | VVTERNOP(vectype : vectype, vvternop : vvternop) - | VVTESTOP(vectype : vectype, vvtestop : vvtestop) + | RETURN_CALL{funcidx : funcidx}(funcidx : funcidx) + | RETURN_CALL_REF{typeidx? : typeidx?}(typeidx?{typeidx : typeidx} : typeidx?) + | RETURN_CALL_INDIRECT{tableidx : tableidx, typeidx : typeidx}(tableidx : tableidx, typeidx : typeidx) + | CONST{numtype : numtype, num_ : num_(numtype)}(numtype : numtype, num_ : num_(numtype)) + | UNOP{numtype : numtype, unop_ : unop_(numtype)}(numtype : numtype, unop_ : unop_(numtype)) + | BINOP{numtype : numtype, binop_ : binop_(numtype)}(numtype : numtype, binop_ : binop_(numtype)) + | TESTOP{numtype : numtype, testop_ : testop_(numtype)}(numtype : numtype, testop_ : testop_(numtype)) + | RELOP{numtype : numtype, relop_ : relop_(numtype)}(numtype : numtype, relop_ : relop_(numtype)) + | CVTOP{numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx? : sx?}(numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx?{sx : sx} : sx?) + | EXTEND{numtype : numtype, n : n}(numtype : numtype, n : n) + | VCONST{vectype : vectype, vec_ : vec_(vectype)}(vectype : vectype, vec_ : vec_(vectype)) + | VVUNOP{vectype : vectype, vvunop : vvunop}(vectype : vectype, vvunop : vvunop) + | VVBINOP{vectype : vectype, vvbinop : vvbinop}(vectype : vectype, vvbinop : vvbinop) + | VVTERNOP{vectype : vectype, vvternop : vvternop}(vectype : vectype, vvternop : vvternop) + | VVTESTOP{vectype : vectype, vvtestop : vvtestop}(vectype : vectype, vvtestop : vvtestop) | VSWIZZLE{ishape : ishape}(ishape : ishape) -- if (ishape = `%X%`(I8_imm, `%`(16))) - | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*) - -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) - | VSPLAT(shape : shape) - | VEXTRACT_LANE{shape : shape, numtype : numtype, sx? : sx?}(shape : shape, sx?, laneidx : laneidx) - -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx} = ?())) - | VREPLACE_LANE(shape : shape, laneidx : laneidx) - | VUNOP(shape : shape, vunop_ : vunop_(shape)) - | VBINOP(shape : shape, vbinop_ : vbinop_(shape)) - | VTESTOP(shape : shape, vtestop_ : vtestop_(shape)) - | VRELOP(shape : shape, vrelop_ : vrelop_(shape)) - | VSHIFTOP(ishape : ishape, vshiftop_ : vshiftop_(ishape)) - | VBITMASK(ishape : ishape) - | VCVTOP(shape : shape, vcvtop : vcvtop, half?, shape : shape, sx?, zero : zero) - | VNARROW(ishape : ishape, ishape : ishape, sx : sx) - | VEXTUNOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) + | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*{laneidx : laneidx} : laneidx*) + -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx : laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) + | VSPLAT{shape : shape}(shape : shape) + | VEXTRACT_LANE{shape : shape, sx? : sx?, laneidx : laneidx, numtype : numtype}(shape : shape, sx?{sx : sx} : sx?, laneidx : laneidx) + -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx : sx} = ?())) + | VREPLACE_LANE{shape : shape, laneidx : laneidx}(shape : shape, laneidx : laneidx) + | VUNOP{shape : shape, vunop_ : vunop_(shape)}(shape : shape, vunop_ : vunop_(shape)) + | VBINOP{shape : shape, vbinop_ : vbinop_(shape)}(shape : shape, vbinop_ : vbinop_(shape)) + | VTESTOP{shape : shape, vtestop_ : vtestop_(shape)}(shape : shape, vtestop_ : vtestop_(shape)) + | VRELOP{shape : shape, vrelop_ : vrelop_(shape)}(shape : shape, vrelop_ : vrelop_(shape)) + | VSHIFTOP{ishape : ishape, vshiftop_ : vshiftop_(ishape)}(ishape : ishape, vshiftop_ : vshiftop_(ishape)) + | VBITMASK{ishape : ishape}(ishape : ishape) + | VCVTOP{shape : shape, vcvtop : vcvtop, half? : half?, sx? : sx?, zero : zero}(shape : shape, vcvtop : vcvtop, half?{half : half} : half?, shape, sx?{sx : sx} : sx?, zero : zero) + | VNARROW{ishape : ishape, sx : sx}(ishape : ishape, ishape, sx : sx) + | VEXTUNOP{ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | VEXTBINOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) + | VEXTBINOP{ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | REF.NULL(heaptype : heaptype) + | REF.NULL{heaptype : heaptype}(heaptype : heaptype) | REF.I31 - | REF.FUNC(funcidx : funcidx) + | REF.FUNC{funcidx : funcidx}(funcidx : funcidx) | REF.IS_NULL | REF.AS_NON_NULL | REF.EQ - | REF.TEST(reftype : reftype) - | REF.CAST(reftype : reftype) - | I31.GET(sx : sx) - | STRUCT.NEW(typeidx : typeidx) - | STRUCT.NEW_DEFAULT(typeidx : typeidx) - | STRUCT.GET(sx?, typeidx : typeidx, u32 : u32) - | STRUCT.SET(typeidx : typeidx, u32 : u32) - | ARRAY.NEW(typeidx : typeidx) - | ARRAY.NEW_DEFAULT(typeidx : typeidx) - | ARRAY.NEW_FIXED(typeidx : typeidx, nat : nat) - | ARRAY.NEW_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.NEW_ELEM(typeidx : typeidx, elemidx : elemidx) - | ARRAY.GET(sx?, typeidx : typeidx) - | ARRAY.SET(typeidx : typeidx) + | REF.TEST{reftype : reftype}(reftype : reftype) + | REF.CAST{reftype : reftype}(reftype : reftype) + | I31.GET{sx : sx}(sx : sx) + | STRUCT.NEW{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.GET{sx? : sx?, typeidx : typeidx, u32 : u32}(sx?{sx : sx} : sx?, typeidx : typeidx, u32 : u32) + | STRUCT.SET{typeidx : typeidx, u32 : u32}(typeidx : typeidx, u32 : u32) + | ARRAY.NEW{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_FIXED{typeidx : typeidx}(typeidx : typeidx, nat) + | ARRAY.NEW_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.NEW_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) + | ARRAY.GET{sx? : sx?, typeidx : typeidx}(sx?{sx : sx} : sx?, typeidx : typeidx) + | ARRAY.SET{typeidx : typeidx}(typeidx : typeidx) | ARRAY.LEN - | ARRAY.FILL(typeidx : typeidx) - | ARRAY.COPY(typeidx : typeidx, typeidx : typeidx) - | ARRAY.INIT_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.INIT_ELEM(typeidx : typeidx, elemidx : elemidx) + | ARRAY.FILL{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.COPY{typeidx : typeidx}(typeidx : typeidx, typeidx) + | ARRAY.INIT_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.INIT_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) | EXTERN.CONVERT_ANY | ANY.CONVERT_EXTERN - | LOCAL.GET(localidx : localidx) - | LOCAL.SET(localidx : localidx) - | LOCAL.TEE(localidx : localidx) - | GLOBAL.GET(globalidx : globalidx) - | GLOBAL.SET(globalidx : globalidx) - | TABLE.GET(tableidx : tableidx) - | TABLE.SET(tableidx : tableidx) - | TABLE.SIZE(tableidx : tableidx) - | TABLE.GROW(tableidx : tableidx) - | TABLE.FILL(tableidx : tableidx) - | TABLE.COPY(tableidx : tableidx, tableidx : tableidx) - | TABLE.INIT(tableidx : tableidx, elemidx : elemidx) - | ELEM.DROP(elemidx : elemidx) - | MEMORY.SIZE(memidx : memidx) - | MEMORY.GROW(memidx : memidx) - | MEMORY.FILL(memidx : memidx) - | MEMORY.COPY(memidx : memidx, memidx : memidx) - | MEMORY.INIT(memidx : memidx, dataidx : dataidx) - | DATA.DROP(dataidx : dataidx) - | LOAD(numtype : numtype, (n, sx)?, memidx : memidx, memop : memop) - | STORE(numtype : numtype, n?, memidx : memidx, memop : memop) - | VLOAD(vloadop?, memidx : memidx, memop : memop) - | VLOAD_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | VSTORE(memidx : memidx, memop : memop) - | VSTORE_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | LOCAL.GET{localidx : localidx}(localidx : localidx) + | LOCAL.SET{localidx : localidx}(localidx : localidx) + | LOCAL.TEE{localidx : localidx}(localidx : localidx) + | GLOBAL.GET{globalidx : globalidx}(globalidx : globalidx) + | GLOBAL.SET{globalidx : globalidx}(globalidx : globalidx) + | TABLE.GET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SIZE{tableidx : tableidx}(tableidx : tableidx) + | TABLE.GROW{tableidx : tableidx}(tableidx : tableidx) + | TABLE.FILL{tableidx : tableidx}(tableidx : tableidx) + | TABLE.COPY{tableidx : tableidx}(tableidx : tableidx, tableidx) + | TABLE.INIT{tableidx : tableidx, elemidx : elemidx}(tableidx : tableidx, elemidx : elemidx) + | ELEM.DROP{elemidx : elemidx}(elemidx : elemidx) + | MEMORY.SIZE{memidx : memidx}(memidx : memidx) + | MEMORY.GROW{memidx : memidx}(memidx : memidx) + | MEMORY.FILL{memidx : memidx}(memidx : memidx) + | MEMORY.COPY{memidx : memidx}(memidx : memidx, memidx) + | MEMORY.INIT{memidx : memidx, dataidx : dataidx}(memidx : memidx, dataidx : dataidx) + | DATA.DROP{dataidx : dataidx}(dataidx : dataidx) + | LOAD{numtype : numtype, n? : n?, sx? : sx?, memidx : memidx, memop : memop}(numtype : numtype, (n, sx)?{n : n sx : sx} : (n, sx)?, memidx : memidx, memop : memop) + | STORE{numtype : numtype, n? : n?, memidx : memidx, memop : memop}(numtype : numtype, n?{n : n} : n?, memidx : memidx, memop : memop) + | VLOAD{vloadop? : vloadop?, memidx : memidx, memop : memop}(vloadop?{vloadop : vloadop} : vloadop?, memidx : memidx, memop : memop) + | VLOAD_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | VSTORE{memidx : memidx, memop : memop}(memidx : memidx, memop : memop) + | VSTORE_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) } ;; 1-syntax.watsup @@ -17046,57 +17046,57 @@ syntax expr = instr* ;; 1-syntax.watsup syntax elemmode = - | ACTIVE(tableidx : tableidx, expr : expr) + | ACTIVE{tableidx : tableidx, expr : expr}(tableidx : tableidx, expr : expr) | PASSIVE | DECLARE ;; 1-syntax.watsup syntax datamode = - | ACTIVE(memidx : memidx, expr : expr) + | ACTIVE{memidx : memidx, expr : expr}(memidx : memidx, expr : expr) | PASSIVE ;; 1-syntax.watsup -syntax type = TYPE(rectype : rectype) +syntax type = TYPE{rectype : rectype}(rectype : rectype) ;; 1-syntax.watsup -syntax local = LOCAL(valtype : valtype) +syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`(typeidx : typeidx, local*, expr : expr) +syntax func = `FUNC%%*%`{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) ;; 1-syntax.watsup -syntax global = GLOBAL(globaltype : globaltype, expr : expr) +syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) ;; 1-syntax.watsup -syntax table = TABLE(tabletype : tabletype, expr : expr) +syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, expr : expr) ;; 1-syntax.watsup -syntax mem = MEMORY(memtype : memtype) +syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`(reftype : reftype, expr*, elemmode : elemmode) +syntax elem = `ELEM%%*%`{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) ;; 1-syntax.watsup -syntax data = `DATA%*%`(byte*, datamode : datamode) +syntax data = `DATA%*%`{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup -syntax start = START(funcidx : funcidx) +syntax start = START{funcidx : funcidx}(funcidx : funcidx) ;; 1-syntax.watsup syntax externidx = - | FUNC(funcidx : funcidx) - | GLOBAL(globalidx : globalidx) - | TABLE(tableidx : tableidx) - | MEM(memidx : memidx) + | FUNC{funcidx : funcidx}(funcidx : funcidx) + | GLOBAL{globalidx : globalidx}(globalidx : globalidx) + | TABLE{tableidx : tableidx}(tableidx : tableidx) + | MEM{memidx : memidx}(memidx : memidx) ;; 1-syntax.watsup -syntax export = EXPORT(name : name, externidx : externidx) +syntax export = EXPORT{name : name, externidx : externidx}(name : name, externidx : externidx) ;; 1-syntax.watsup -syntax import = IMPORT(name : name, name : name, externtype : externtype) +syntax import = IMPORT{name : name, externtype : externtype}(name : name, name, externtype : externtype) ;; 1-syntax.watsup -syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*, import*, func*, global*, table*, mem*, elem*, data*, start*, export*) +syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) ;; 2-syntax-aux.watsup rec { @@ -17106,10 +17106,10 @@ def $setminus1(idx : idx, idx*) : idx* ;; 2-syntax-aux.watsup:13.1-13.27 def $setminus1{x : idx}(x, []) = [x] ;; 2-syntax-aux.watsup:14.1-14.61 - def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y}) = [] + def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y : idx}) = [] -- if (x = y_1) ;; 2-syntax-aux.watsup:15.1-15.60 - def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y}) = $setminus1(x, y*{y}) + def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y : idx}) = $setminus1(x, y*{y : idx}) -- otherwise } @@ -17119,9 +17119,9 @@ rec { ;; 2-syntax-aux.watsup:7.1-7.49 def $setminus(idx*, idx*) : idx* ;; 2-syntax-aux.watsup:10.1-10.29 - def $setminus{y* : idx*}([], y*{y}) = [] + def $setminus{y* : idx*}([], y*{y : idx}) = [] ;; 2-syntax-aux.watsup:11.1-11.66 - def $setminus{x_1 : idx, x* : idx*, y* : idx*}([x_1] :: x*{x}, y*{y}) = $setminus1(x_1, y*{y}) :: $setminus(x*{x}, y*{y}) + def $setminus{x_1 : idx, x* : idx*, y* : idx*}([x_1] :: x*{x : idx}, y*{y : idx}) = $setminus1(x_1, y*{y : idx}) :: $setminus(x*{x : idx}, y*{y : idx}) } ;; 2-syntax-aux.watsup @@ -17141,18 +17141,18 @@ def $free_dataidx_instrs(instr*) : dataidx* ;; 2-syntax-aux.watsup:26.1-26.36 def $free_dataidx_instrs([]) = [] ;; 2-syntax-aux.watsup:27.1-27.99 - def $free_dataidx_instrs{instr : instr, instr'* : instr*}([instr] :: instr'*{instr'}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr'}) + def $free_dataidx_instrs{instr : instr, instr'* : instr*}([instr] :: instr'*{instr' : instr}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr' : instr}) } ;; 2-syntax-aux.watsup def $free_dataidx_expr(expr : expr) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_expr{in* : instr*}(in*{in}) = $free_dataidx_instrs(in*{in}) + def $free_dataidx_expr{in* : instr*}(in*{in : instr}) = $free_dataidx_instrs(in*{in : instr}) ;; 2-syntax-aux.watsup def $free_dataidx_func(func : func) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc}, e)) = $free_dataidx_expr(e) + def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) ;; 2-syntax-aux.watsup rec { @@ -17162,7 +17162,7 @@ def $free_dataidx_funcs(func*) : dataidx* ;; 2-syntax-aux.watsup:36.1-36.35 def $free_dataidx_funcs([]) = [] ;; 2-syntax-aux.watsup:37.1-37.92 - def $free_dataidx_funcs{func : func, func'* : func*}([func] :: func'*{func'}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func'}) + def $free_dataidx_funcs{func : func, func'* : func*}([func] :: func'*{func' : func}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func' : func}) } ;; 2-syntax-aux.watsup @@ -17209,8 +17209,8 @@ def $diffrt(reftype : reftype, reftype : reftype) : reftype ;; 2-syntax-aux.watsup syntax typevar = - | _IDX(typeidx : typeidx) - | REC(nat : nat) + | _IDX{typeidx : typeidx}(typeidx : typeidx) + | REC(nat) ;; 2-syntax-aux.watsup def $idx(typeidx : typeidx) : typevar @@ -17225,27 +17225,27 @@ def $subst_typevar(typevar : typevar, typevar*, heaptype*) : heaptype ;; 2-syntax-aux.watsup:150.1-150.38 def $subst_typevar{xx : typevar}(xx, [], []) = (xx : typevar <: heaptype) ;; 2-syntax-aux.watsup:151.1-151.95 - def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 + def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = ht_1 -- if (xx = xx_1) ;; 2-syntax-aux.watsup:152.1-152.92 - def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = $subst_typevar(xx, xx'*{xx'}, ht'*{ht'}) + def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = $subst_typevar(xx, xx'*{xx' : typevar}, ht'*{ht' : heaptype}) -- otherwise } ;; 2-syntax-aux.watsup def $subst_numtype(numtype : numtype, typevar*, heaptype*) : numtype ;; 2-syntax-aux.watsup - def $subst_numtype{nt : numtype, xx* : typevar*, ht* : heaptype*}(nt, xx*{xx}, ht*{ht}) = nt + def $subst_numtype{nt : numtype, xx* : typevar*, ht* : heaptype*}(nt, xx*{xx : typevar}, ht*{ht : heaptype}) = nt ;; 2-syntax-aux.watsup def $subst_vectype(vectype : vectype, typevar*, heaptype*) : vectype ;; 2-syntax-aux.watsup - def $subst_vectype{vt : vectype, xx* : typevar*, ht* : heaptype*}(vt, xx*{xx}, ht*{ht}) = vt + def $subst_vectype{vt : vectype, xx* : typevar*, ht* : heaptype*}(vt, xx*{xx : typevar}, ht*{ht : heaptype}) = vt ;; 2-syntax-aux.watsup def $subst_packtype(packtype : packtype, typevar*, heaptype*) : packtype ;; 2-syntax-aux.watsup - def $subst_packtype{pt : packtype, xx* : typevar*, ht* : heaptype*}(pt, xx*{xx}, ht*{ht}) = pt + def $subst_packtype{pt : packtype, xx* : typevar*, ht* : heaptype*}(pt, xx*{xx : typevar}, ht*{ht : heaptype}) = pt ;; 2-syntax-aux.watsup rec { @@ -17253,108 +17253,108 @@ rec { ;; 2-syntax-aux.watsup:129.1-129.92 def $subst_heaptype(heaptype : heaptype, typevar*, heaptype*) : heaptype ;; 2-syntax-aux.watsup:157.1-157.67 - def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) + def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx : typevar}, ht*{ht : heaptype}) = $subst_typevar(xx', xx*{xx : typevar}, ht*{ht : heaptype}) ;; 2-syntax-aux.watsup:158.1-158.65 - def $subst_heaptype{dt : deftype, xx* : typevar*, ht* : heaptype*}((dt : deftype <: heaptype), xx*{xx}, ht*{ht}) = ($subst_deftype(dt, xx*{xx}, ht*{ht}) : deftype <: heaptype) + def $subst_heaptype{dt : deftype, xx* : typevar*, ht* : heaptype*}((dt : deftype <: heaptype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_deftype(dt, xx*{xx : typevar}, ht*{ht : heaptype}) : deftype <: heaptype) ;; 2-syntax-aux.watsup:159.1-159.55 - def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx}, ht*{ht}) = ht' + def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx : typevar}, ht*{ht : heaptype}) = ht' -- otherwise ;; 2-syntax-aux.watsup:130.1-130.92 def $subst_reftype(reftype : reftype, typevar*, heaptype*) : reftype ;; 2-syntax-aux.watsup:161.1-161.85 - def $subst_reftype{nul : nul, ht' : heaptype, xx* : typevar*, ht* : heaptype*}(REF_reftype(nul, ht'), xx*{xx}, ht*{ht}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx}, ht*{ht})) + def $subst_reftype{nul : nul, ht' : heaptype, xx* : typevar*, ht* : heaptype*}(REF_reftype(nul, ht'), xx*{xx : typevar}, ht*{ht : heaptype}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:131.1-131.92 def $subst_valtype(valtype : valtype, typevar*, heaptype*) : valtype ;; 2-syntax-aux.watsup:163.1-163.64 - def $subst_valtype{nt : numtype, xx* : typevar*, ht* : heaptype*}((nt : numtype <: valtype), xx*{xx}, ht*{ht}) = ($subst_numtype(nt, xx*{xx}, ht*{ht}) : numtype <: valtype) + def $subst_valtype{nt : numtype, xx* : typevar*, ht* : heaptype*}((nt : numtype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_numtype(nt, xx*{xx : typevar}, ht*{ht : heaptype}) : numtype <: valtype) ;; 2-syntax-aux.watsup:164.1-164.64 - def $subst_valtype{vt : vectype, xx* : typevar*, ht* : heaptype*}((vt : vectype <: valtype), xx*{xx}, ht*{ht}) = ($subst_vectype(vt, xx*{xx}, ht*{ht}) : vectype <: valtype) + def $subst_valtype{vt : vectype, xx* : typevar*, ht* : heaptype*}((vt : vectype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_vectype(vt, xx*{xx : typevar}, ht*{ht : heaptype}) : vectype <: valtype) ;; 2-syntax-aux.watsup:165.1-165.64 - def $subst_valtype{rt : reftype, xx* : typevar*, ht* : heaptype*}((rt : reftype <: valtype), xx*{xx}, ht*{ht}) = ($subst_reftype(rt, xx*{xx}, ht*{ht}) : reftype <: valtype) + def $subst_valtype{rt : reftype, xx* : typevar*, ht* : heaptype*}((rt : reftype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_reftype(rt, xx*{xx : typevar}, ht*{ht : heaptype}) : reftype <: valtype) ;; 2-syntax-aux.watsup:166.1-166.40 - def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx : typevar}, ht*{ht : heaptype}) = BOT_valtype ;; 2-syntax-aux.watsup:134.1-134.92 def $subst_storagetype(storagetype : storagetype, typevar*, heaptype*) : storagetype ;; 2-syntax-aux.watsup:170.1-170.66 - def $subst_storagetype{t : valtype, xx* : typevar*, ht* : heaptype*}((t : valtype <: storagetype), xx*{xx}, ht*{ht}) = ($subst_valtype(t, xx*{xx}, ht*{ht}) : valtype <: storagetype) + def $subst_storagetype{t : valtype, xx* : typevar*, ht* : heaptype*}((t : valtype <: storagetype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_valtype(t, xx*{xx : typevar}, ht*{ht : heaptype}) : valtype <: storagetype) ;; 2-syntax-aux.watsup:171.1-171.69 - def $subst_storagetype{pt : packtype, xx* : typevar*, ht* : heaptype*}((pt : packtype <: storagetype), xx*{xx}, ht*{ht}) = ($subst_packtype(pt, xx*{xx}, ht*{ht}) : packtype <: storagetype) + def $subst_storagetype{pt : packtype, xx* : typevar*, ht* : heaptype*}((pt : packtype <: storagetype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_packtype(pt, xx*{xx : typevar}, ht*{ht : heaptype}) : packtype <: storagetype) ;; 2-syntax-aux.watsup:135.1-135.92 def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype ;; 2-syntax-aux.watsup:173.1-173.80 - def $subst_fieldtype{mut : mut, zt : storagetype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, zt), xx*{xx}, ht*{ht}) = `%%`(mut, $subst_storagetype(zt, xx*{xx}, ht*{ht})) + def $subst_fieldtype{mut : mut, zt : storagetype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, zt), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(mut, $subst_storagetype(zt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype ;; 2-syntax-aux.watsup:175.1-175.85 - def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) + def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt : fieldtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype}) ;; 2-syntax-aux.watsup:176.1-176.81 - def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) + def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx : typevar}, ht*{ht : heaptype}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:177.1-177.78 - def $subst_comptype{ft : functype, xx* : typevar*, ht* : heaptype*}(FUNC_comptype(ft), xx*{xx}, ht*{ht}) = FUNC_comptype($subst_functype(ft, xx*{xx}, ht*{ht})) + def $subst_comptype{ft : functype, xx* : typevar*, ht* : heaptype*}(FUNC_comptype(ft), xx*{xx : typevar}, ht*{ht : heaptype}) = FUNC_comptype($subst_functype(ft, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:138.1-138.92 def $subst_subtype(subtype : subtype, typevar*, heaptype*) : subtype ;; 2-syntax-aux.watsup:179.1-180.76 - def $subst_subtype{fin : fin, y* : idx*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + def $subst_subtype{fin : fin, y* : idx*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUB_subtype(fin, y*{y : typeidx}, ct), xx*{xx : typevar}, ht*{ht : heaptype}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx : typevar}, ht*{ht : heaptype})*{y : typeidx}, $subst_comptype(ct, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:181.1-182.73 - def $subst_subtype{fin : fin, ht'* : heaptype*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUBD_subtype(fin, ht'*{ht'}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx}, ht*{ht})*{ht'}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + def $subst_subtype{fin : fin, ht'* : heaptype*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUBD_subtype(fin, ht'*{ht' : heaptype}, ct), xx*{xx : typevar}, ht*{ht : heaptype}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})*{ht' : heaptype}, $subst_comptype(ct, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype ;; 2-syntax-aux.watsup:184.1-184.76 - def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st}), xx*{xx}, ht*{ht}) = REC_rectype($subst_subtype(st, xx*{xx}, ht*{ht})*{st}) + def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st : subtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype}) ;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype ;; 2-syntax-aux.watsup:186.1-186.78 - def $subst_deftype{qt : rectype, i : nat, xx* : typevar*, ht* : heaptype*}(DEF_deftype(qt, i), xx*{xx}, ht*{ht}) = DEF_deftype($subst_rectype(qt, xx*{xx}, ht*{ht}), i) + def $subst_deftype{qt : rectype, i : nat, xx* : typevar*, ht* : heaptype*}(DEF_deftype(qt, i), xx*{xx : typevar}, ht*{ht : heaptype}) = DEF_deftype($subst_rectype(qt, xx*{xx : typevar}, ht*{ht : heaptype}), i) ;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype ;; 2-syntax-aux.watsup:189.1-189.113 - def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1}, t_2*{t_2}), xx*{xx}, ht*{ht}) = `%->%`($subst_valtype(t_1, xx*{xx}, ht*{ht})*{t_1}, $subst_valtype(t_2, xx*{xx}, ht*{ht})*{t_2}) + def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}, $subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype}) } ;; 2-syntax-aux.watsup def $subst_globaltype(globaltype : globaltype, typevar*, heaptype*) : globaltype ;; 2-syntax-aux.watsup - def $subst_globaltype{mut : mut, t : valtype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, t), xx*{xx}, ht*{ht}) = `%%`(mut, $subst_valtype(t, xx*{xx}, ht*{ht})) + def $subst_globaltype{mut : mut, t : valtype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, t), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(mut, $subst_valtype(t, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_tabletype(tabletype : tabletype, typevar*, heaptype*) : tabletype ;; 2-syntax-aux.watsup - def $subst_tabletype{lim : limits, rt : reftype, xx* : typevar*, ht* : heaptype*}(`%%`(lim, rt), xx*{xx}, ht*{ht}) = `%%`(lim, $subst_reftype(rt, xx*{xx}, ht*{ht})) + def $subst_tabletype{lim : limits, rt : reftype, xx* : typevar*, ht* : heaptype*}(`%%`(lim, rt), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(lim, $subst_reftype(rt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_memtype(memtype : memtype, typevar*, heaptype*) : memtype ;; 2-syntax-aux.watsup - def $subst_memtype{lim : limits, xx* : typevar*, ht* : heaptype*}(`%I8`(lim), xx*{xx}, ht*{ht}) = `%I8`(lim) + def $subst_memtype{lim : limits, xx* : typevar*, ht* : heaptype*}(`%I8`(lim), xx*{xx : typevar}, ht*{ht : heaptype}) = `%I8`(lim) ;; 2-syntax-aux.watsup def $subst_externtype(externtype : externtype, typevar*, heaptype*) : externtype ;; 2-syntax-aux.watsup - def $subst_externtype{dt : deftype, xx* : typevar*, ht* : heaptype*}(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) + def $subst_externtype{dt : deftype, xx* : typevar*, ht* : heaptype*}(FUNC_externtype(dt), xx*{xx : typevar}, ht*{ht : heaptype}) = FUNC_externtype($subst_deftype(dt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{gt : globaltype, xx* : typevar*, ht* : heaptype*}(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) + def $subst_externtype{gt : globaltype, xx* : typevar*, ht* : heaptype*}(GLOBAL_externtype(gt), xx*{xx : typevar}, ht*{ht : heaptype}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{tt : tabletype, xx* : typevar*, ht* : heaptype*}(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) + def $subst_externtype{tt : tabletype, xx* : typevar*, ht* : heaptype*}(TABLE_externtype(tt), xx*{xx : typevar}, ht*{ht : heaptype}) = TABLE_externtype($subst_tabletype(tt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{mt : memtype, xx* : typevar*, ht* : heaptype*}(MEM_externtype(mt), xx*{xx}, ht*{ht}) = MEM_externtype($subst_memtype(mt, xx*{xx}, ht*{ht})) + def $subst_externtype{mt : memtype, xx* : typevar*, ht* : heaptype*}(MEM_externtype(mt), xx*{xx : typevar}, ht*{ht : heaptype}) = MEM_externtype($subst_memtype(mt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_all_reftype(reftype : reftype, heaptype*) : reftype ;; 2-syntax-aux.watsup - def $subst_all_reftype{rt : reftype, ht^n : heaptype^n, n : n, i^n : nat^n}(rt, ht^n{ht}) = $subst_reftype(rt, $idx(`%`(i))^(i (sx?{sx} = ?())) - | VREPLACE_LANE(shape : shape, laneidx : laneidx) - | VUNOP(shape : shape, vunop_ : vunop_(shape)) - | VBINOP(shape : shape, vbinop_ : vbinop_(shape)) - | VTESTOP(shape : shape, vtestop_ : vtestop_(shape)) - | VRELOP(shape : shape, vrelop_ : vrelop_(shape)) - | VSHIFTOP(ishape : ishape, vshiftop_ : vshiftop_(ishape)) - | VBITMASK(ishape : ishape) - | VCVTOP(shape : shape, vcvtop : vcvtop, half?, shape : shape, sx?, zero : zero) - | VNARROW(ishape : ishape, ishape : ishape, sx : sx) - | VEXTUNOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) + | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*{laneidx : laneidx} : laneidx*) + -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx : laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) + | VSPLAT{shape : shape}(shape : shape) + | VEXTRACT_LANE{shape : shape, sx? : sx?, laneidx : laneidx, numtype : numtype}(shape : shape, sx?{sx : sx} : sx?, laneidx : laneidx) + -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx : sx} = ?())) + | VREPLACE_LANE{shape : shape, laneidx : laneidx}(shape : shape, laneidx : laneidx) + | VUNOP{shape : shape, vunop_ : vunop_(shape)}(shape : shape, vunop_ : vunop_(shape)) + | VBINOP{shape : shape, vbinop_ : vbinop_(shape)}(shape : shape, vbinop_ : vbinop_(shape)) + | VTESTOP{shape : shape, vtestop_ : vtestop_(shape)}(shape : shape, vtestop_ : vtestop_(shape)) + | VRELOP{shape : shape, vrelop_ : vrelop_(shape)}(shape : shape, vrelop_ : vrelop_(shape)) + | VSHIFTOP{ishape : ishape, vshiftop_ : vshiftop_(ishape)}(ishape : ishape, vshiftop_ : vshiftop_(ishape)) + | VBITMASK{ishape : ishape}(ishape : ishape) + | VCVTOP{shape : shape, vcvtop : vcvtop, half? : half?, sx? : sx?, zero : zero}(shape : shape, vcvtop : vcvtop, half?{half : half} : half?, shape, sx?{sx : sx} : sx?, zero : zero) + | VNARROW{ishape : ishape, sx : sx}(ishape : ishape, ishape, sx : sx) + | VEXTUNOP{ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | VEXTBINOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) + | VEXTBINOP{ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | REF.NULL(heaptype : heaptype) + | REF.NULL{heaptype : heaptype}(heaptype : heaptype) | REF.I31 - | REF.FUNC(funcidx : funcidx) + | REF.FUNC{funcidx : funcidx}(funcidx : funcidx) | REF.IS_NULL | REF.AS_NON_NULL | REF.EQ - | REF.TEST(reftype : reftype) - | REF.CAST(reftype : reftype) - | I31.GET(sx : sx) - | STRUCT.NEW(typeidx : typeidx) - | STRUCT.NEW_DEFAULT(typeidx : typeidx) - | STRUCT.GET(sx?, typeidx : typeidx, u32 : u32) - | STRUCT.SET(typeidx : typeidx, u32 : u32) - | ARRAY.NEW(typeidx : typeidx) - | ARRAY.NEW_DEFAULT(typeidx : typeidx) - | ARRAY.NEW_FIXED(typeidx : typeidx, nat : nat) - | ARRAY.NEW_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.NEW_ELEM(typeidx : typeidx, elemidx : elemidx) - | ARRAY.GET(sx?, typeidx : typeidx) - | ARRAY.SET(typeidx : typeidx) + | REF.TEST{reftype : reftype}(reftype : reftype) + | REF.CAST{reftype : reftype}(reftype : reftype) + | I31.GET{sx : sx}(sx : sx) + | STRUCT.NEW{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.GET{sx? : sx?, typeidx : typeidx, u32 : u32}(sx?{sx : sx} : sx?, typeidx : typeidx, u32 : u32) + | STRUCT.SET{typeidx : typeidx, u32 : u32}(typeidx : typeidx, u32 : u32) + | ARRAY.NEW{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_FIXED{typeidx : typeidx}(typeidx : typeidx, nat) + | ARRAY.NEW_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.NEW_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) + | ARRAY.GET{sx? : sx?, typeidx : typeidx}(sx?{sx : sx} : sx?, typeidx : typeidx) + | ARRAY.SET{typeidx : typeidx}(typeidx : typeidx) | ARRAY.LEN - | ARRAY.FILL(typeidx : typeidx) - | ARRAY.COPY(typeidx : typeidx, typeidx : typeidx) - | ARRAY.INIT_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.INIT_ELEM(typeidx : typeidx, elemidx : elemidx) + | ARRAY.FILL{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.COPY{typeidx : typeidx}(typeidx : typeidx, typeidx) + | ARRAY.INIT_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.INIT_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) | EXTERN.CONVERT_ANY | ANY.CONVERT_EXTERN - | LOCAL.GET(localidx : localidx) - | LOCAL.SET(localidx : localidx) - | LOCAL.TEE(localidx : localidx) - | GLOBAL.GET(globalidx : globalidx) - | GLOBAL.SET(globalidx : globalidx) - | TABLE.GET(tableidx : tableidx) - | TABLE.SET(tableidx : tableidx) - | TABLE.SIZE(tableidx : tableidx) - | TABLE.GROW(tableidx : tableidx) - | TABLE.FILL(tableidx : tableidx) - | TABLE.COPY(tableidx : tableidx, tableidx : tableidx) - | TABLE.INIT(tableidx : tableidx, elemidx : elemidx) - | ELEM.DROP(elemidx : elemidx) - | MEMORY.SIZE(memidx : memidx) - | MEMORY.GROW(memidx : memidx) - | MEMORY.FILL(memidx : memidx) - | MEMORY.COPY(memidx : memidx, memidx : memidx) - | MEMORY.INIT(memidx : memidx, dataidx : dataidx) - | DATA.DROP(dataidx : dataidx) - | LOAD(numtype : numtype, (n, sx)?, memidx : memidx, memop : memop) - | STORE(numtype : numtype, n?, memidx : memidx, memop : memop) - | VLOAD(vloadop?, memidx : memidx, memop : memop) - | VLOAD_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | VSTORE(memidx : memidx, memop : memop) - | VSTORE_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | REF.I31_NUM(u31 : u31) - | REF.STRUCT_ADDR(structaddr : structaddr) - | REF.ARRAY_ADDR(arrayaddr : arrayaddr) - | REF.FUNC_ADDR(funcaddr : funcaddr) - | REF.HOST_ADDR(hostaddr : hostaddr) - | REF.EXTERN(addrref : addrref) - | LABEL_(n : n, instr*, admininstr*) - | FRAME_(n : n, frame : frame, admininstr*) + | LOCAL.GET{localidx : localidx}(localidx : localidx) + | LOCAL.SET{localidx : localidx}(localidx : localidx) + | LOCAL.TEE{localidx : localidx}(localidx : localidx) + | GLOBAL.GET{globalidx : globalidx}(globalidx : globalidx) + | GLOBAL.SET{globalidx : globalidx}(globalidx : globalidx) + | TABLE.GET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SIZE{tableidx : tableidx}(tableidx : tableidx) + | TABLE.GROW{tableidx : tableidx}(tableidx : tableidx) + | TABLE.FILL{tableidx : tableidx}(tableidx : tableidx) + | TABLE.COPY{tableidx : tableidx}(tableidx : tableidx, tableidx) + | TABLE.INIT{tableidx : tableidx, elemidx : elemidx}(tableidx : tableidx, elemidx : elemidx) + | ELEM.DROP{elemidx : elemidx}(elemidx : elemidx) + | MEMORY.SIZE{memidx : memidx}(memidx : memidx) + | MEMORY.GROW{memidx : memidx}(memidx : memidx) + | MEMORY.FILL{memidx : memidx}(memidx : memidx) + | MEMORY.COPY{memidx : memidx}(memidx : memidx, memidx) + | MEMORY.INIT{memidx : memidx, dataidx : dataidx}(memidx : memidx, dataidx : dataidx) + | DATA.DROP{dataidx : dataidx}(dataidx : dataidx) + | LOAD{numtype : numtype, n? : n?, sx? : sx?, memidx : memidx, memop : memop}(numtype : numtype, (n, sx)?{n : n sx : sx} : (n, sx)?, memidx : memidx, memop : memop) + | STORE{numtype : numtype, n? : n?, memidx : memidx, memop : memop}(numtype : numtype, n?{n : n} : n?, memidx : memidx, memop : memop) + | VLOAD{vloadop? : vloadop?, memidx : memidx, memop : memop}(vloadop?{vloadop : vloadop} : vloadop?, memidx : memidx, memop : memop) + | VLOAD_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | VSTORE{memidx : memidx, memop : memop}(memidx : memidx, memop : memop) + | VSTORE_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | REF.I31_NUM{u31 : u31}(u31 : u31) + | REF.STRUCT_ADDR{structaddr : structaddr}(structaddr : structaddr) + | REF.ARRAY_ADDR{arrayaddr : arrayaddr}(arrayaddr : arrayaddr) + | REF.FUNC_ADDR{funcaddr : funcaddr}(funcaddr : funcaddr) + | REF.HOST_ADDR{hostaddr : hostaddr}(hostaddr : hostaddr) + | REF.EXTERN{addrref : addrref}(addrref : addrref) + | LABEL_{n : n, instr* : instr*, admininstr* : admininstr*}(n : n, instr*{instr : instr} : instr*, admininstr*{admininstr : admininstr} : admininstr*) + | FRAME_{n : n, frame : frame, admininstr* : admininstr*}(n : n, frame : frame, admininstr*{admininstr : admininstr} : admininstr*) | TRAP } ;; 4-runtime.watsup -syntax config = `%;%*`(state : state, admininstr*) +syntax config = `%;%*`{state : state, admininstr* : admininstr*}(state : state, admininstr*{admininstr : admininstr} : admininstr*) ;; 4-runtime.watsup rec { @@ -18468,15 +18468,15 @@ rec { ;; 4-runtime.watsup:165.1-168.25 syntax E = | _HOLE - | _SEQ(val*, E : E, instr*) - | LABEL_(n : n, instr*, E : E) + | _SEQ{val* : val*, E : E, instr* : instr*}(val*{val : val} : val*, E : E, instr*{instr : instr} : instr*) + | LABEL_{n : n, instr* : instr*, E : E}(n : n, instr*{instr : instr} : instr*, E : E) } ;; 5-runtime-aux.watsup def $inst_reftype(moduleinst : moduleinst, reftype : reftype) : reftype ;; 5-runtime-aux.watsup - def $inst_reftype{mm : moduleinst, rt : reftype, dt* : deftype*}(mm, rt) = $subst_all_reftype(rt, (dt : deftype <: heaptype)*{dt}) - -- if (dt*{dt} = mm.TYPE_moduleinst) + def $inst_reftype{mm : moduleinst, rt : reftype, dt* : deftype*}(mm, rt) = $subst_all_reftype(rt, (dt : deftype <: heaptype)*{dt : deftype}) + -- if (dt*{dt : deftype} = mm.TYPE_moduleinst) ;; 5-runtime-aux.watsup def $default(valtype : valtype) : val? @@ -18517,9 +18517,9 @@ def $funcsxv(externval*) : funcaddr* ;; 5-runtime-aux.watsup:49.1-49.24 def $funcsxv([]) = [] ;; 5-runtime-aux.watsup:50.1-50.47 - def $funcsxv{fa : funcaddr, xv* : externval*}([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) + def $funcsxv{fa : funcaddr, xv* : externval*}([FUNC_externval(fa)] :: xv*{xv : externval}) = [fa] :: $funcsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:51.1-51.58 - def $funcsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $funcsxv(xv*{xv}) + def $funcsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $funcsxv(xv*{xv : externval}) -- otherwise } @@ -18531,9 +18531,9 @@ def $globalsxv(externval*) : globaladdr* ;; 5-runtime-aux.watsup:53.1-53.26 def $globalsxv([]) = [] ;; 5-runtime-aux.watsup:54.1-54.53 - def $globalsxv{ga : globaladdr, xv* : externval*}([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) + def $globalsxv{ga : globaladdr, xv* : externval*}([GLOBAL_externval(ga)] :: xv*{xv : externval}) = [ga] :: $globalsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:55.1-55.62 - def $globalsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $globalsxv(xv*{xv}) + def $globalsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $globalsxv(xv*{xv : externval}) -- otherwise } @@ -18545,9 +18545,9 @@ def $tablesxv(externval*) : tableaddr* ;; 5-runtime-aux.watsup:57.1-57.25 def $tablesxv([]) = [] ;; 5-runtime-aux.watsup:58.1-58.50 - def $tablesxv{ta : tableaddr, xv* : externval*}([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) + def $tablesxv{ta : tableaddr, xv* : externval*}([TABLE_externval(ta)] :: xv*{xv : externval}) = [ta] :: $tablesxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:59.1-59.60 - def $tablesxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $tablesxv(xv*{xv}) + def $tablesxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $tablesxv(xv*{xv : externval}) -- otherwise } @@ -18559,9 +18559,9 @@ def $memsxv(externval*) : memaddr* ;; 5-runtime-aux.watsup:61.1-61.23 def $memsxv([]) = [] ;; 5-runtime-aux.watsup:62.1-62.44 - def $memsxv{ma : memaddr, xv* : externval*}([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) + def $memsxv{ma : memaddr, xv* : externval*}([MEM_externval(ma)] :: xv*{xv : externval}) = [ma] :: $memsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:63.1-63.56 - def $memsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $memsxv(xv*{xv}) + def $memsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $memsxv(xv*{xv : externval}) -- otherwise } @@ -18688,7 +18688,7 @@ def $with_tableinst(state : state, tableidx : tableidx, tableinst : tableinst) : ;; 5-runtime-aux.watsup def $with_mem(state : state, memidx : memidx, nat : nat, nat : nat, byte*) : state ;; 5-runtime-aux.watsup - def $with_mem{s : store, f : frame, x : idx, i : nat, j : nat, b* : byte*}(`%;%`(s, f), x, i, j, b*{b}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]].DATA_meminst[i : j] = b*{b}], f) + def $with_mem{s : store, f : frame, x : idx, i : nat, j : nat, b* : byte*}(`%;%`(s, f), x, i, j, b*{b : byte}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]].DATA_meminst[i : j] = b*{b : byte}], f) ;; 5-runtime-aux.watsup def $with_meminst(state : state, memidx : memidx, meminst : meminst) : state @@ -18698,12 +18698,12 @@ def $with_meminst(state : state, memidx : memidx, meminst : meminst) : state ;; 5-runtime-aux.watsup def $with_elem(state : state, elemidx : elemidx, ref*) : state ;; 5-runtime-aux.watsup - def $with_elem{s : store, f : frame, x : idx, r* : ref*}(`%;%`(s, f), x, r*{r}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]].ELEM_eleminst = r*{r}], f) + def $with_elem{s : store, f : frame, x : idx, r* : ref*}(`%;%`(s, f), x, r*{r : ref}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]].ELEM_eleminst = r*{r : ref}], f) ;; 5-runtime-aux.watsup def $with_data(state : state, dataidx : dataidx, byte*) : state ;; 5-runtime-aux.watsup - def $with_data{s : store, f : frame, x : idx, b* : byte*}(`%;%`(s, f), x, b*{b}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]].DATA_datainst = b*{b}], f) + def $with_data{s : store, f : frame, x : idx, b* : byte*}(`%;%`(s, f), x, b*{b : byte}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]].DATA_datainst = b*{b : byte}], f) ;; 5-runtime-aux.watsup def $with_struct(state : state, structaddr : structaddr, nat : nat, fieldval : fieldval) : state @@ -18718,20 +18718,20 @@ def $with_array(state : state, arrayaddr : arrayaddr, nat : nat, fieldval : fiel ;; 5-runtime-aux.watsup def $ext_structinst(state : state, structinst*) : state ;; 5-runtime-aux.watsup - def $ext_structinst{s : store, f : frame, si* : structinst*}(`%;%`(s, f), si*{si}) = `%;%`(s[STRUCT_store =.. si*{si}], f) + def $ext_structinst{s : store, f : frame, si* : structinst*}(`%;%`(s, f), si*{si : structinst}) = `%;%`(s[STRUCT_store =.. si*{si : structinst}], f) ;; 5-runtime-aux.watsup def $ext_arrayinst(state : state, arrayinst*) : state ;; 5-runtime-aux.watsup - def $ext_arrayinst{s : store, f : frame, ai* : arrayinst*}(`%;%`(s, f), ai*{ai}) = `%;%`(s[ARRAY_store =.. ai*{ai}], f) + def $ext_arrayinst{s : store, f : frame, ai* : arrayinst*}(`%;%`(s, f), ai*{ai : arrayinst}) = `%;%`(s[ARRAY_store =.. ai*{ai : arrayinst}], f) ;; 5-runtime-aux.watsup def $growtable(tableinst : tableinst, nat : nat, ref : ref) : tableinst? ;; 5-runtime-aux.watsup def $growtable{ti : tableinst, n : n, r : ref, ti' : tableinst, i : nat, j : nat, rt : reftype, r'* : ref*, i' : nat}(ti, n, r) = ?(ti') - -- if (ti = {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM r'*{r'}}) - -- if (i' = (|r'*{r'}| + n)) - -- if (ti' = {TYPE `%%`(`[%..%]`(`%`(i'), `%`(j)), rt), ELEM r'*{r'} :: r^n{}}) + -- if (ti = {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM r'*{r' : ref}}) + -- if (i' = (|r'*{r' : ref}| + n)) + -- if (ti' = {TYPE `%%`(`[%..%]`(`%`(i'), `%`(j)), rt), ELEM r'*{r' : ref} :: r^n{}}) -- if (i' <= j) def $growtable{x0 : tableinst, x1 : nat, x2 : ref}(x0, x1, x2) = ?() @@ -18739,9 +18739,9 @@ def $growtable(tableinst : tableinst, nat : nat, ref : ref) : tableinst? def $growmemory(meminst : meminst, nat : nat) : meminst? ;; 5-runtime-aux.watsup def $growmemory{mi : meminst, n : n, mi' : meminst, i : nat, j : nat, b* : byte*, i' : nat}(mi, n) = ?(mi') - -- if (mi = {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA b*{b}}) - -- if (i' = ((|b*{b}| / (64 * $Ki)) + n)) - -- if (mi' = {TYPE `%I8`(`[%..%]`(`%`(i'), `%`(j))), DATA b*{b} :: `%`(0)^((n * 64) * $Ki){}}) + -- if (mi = {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA b*{b : byte}}) + -- if (i' = ((|b*{b : byte}| / (64 * $Ki)) + n)) + -- if (mi' = {TYPE `%I8`(`[%..%]`(`%`(i'), `%`(j))), DATA b*{b : byte} :: `%`(0)^((n * 64) * $Ki){}}) -- if (i' <= j) def $growmemory{x0 : meminst, x1 : nat}(x0, x1) = ?() @@ -18751,25 +18751,25 @@ syntax init = | UNSET ;; 6-typing.watsup -syntax localtype = `%%`(init : init, valtype : valtype) +syntax localtype = `%%`{init : init, valtype : valtype}(init : init, valtype : valtype) ;; 6-typing.watsup -syntax instrtype = `%->%*%`(resulttype : resulttype, localidx*, resulttype : resulttype) +syntax instrtype = `%->%*%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) ;; 6-typing.watsup syntax context = { - TYPE deftype*, - REC subtype*, - FUNC deftype*, - GLOBAL globaltype*, - TABLE tabletype*, - MEM memtype*, - ELEM elemtype*, - DATA datatype*, - LOCAL localtype*, - LABEL resulttype*, - RETURN resulttype? + TYPE{deftype* : deftype*} deftype*, + REC{subtype* : subtype*} subtype*, + FUNC{deftype* : deftype*} deftype*, + GLOBAL{globaltype* : globaltype*} globaltype*, + TABLE{tabletype* : tabletype*} tabletype*, + MEM{memtype* : memtype*} memtype*, + ELEM{elemtype* : elemtype*} elemtype*, + DATA{datatype* : datatype*} datatype*, + LOCAL{localtype* : localtype*} localtype*, + LABEL{resulttype* : resulttype*} resulttype*, + RETURN{resulttype? : resulttype?} resulttype? } ;; 6-typing.watsup @@ -18780,7 +18780,7 @@ def $with_locals(context : context, localidx*, localtype*) : context ;; 6-typing.watsup:28.1-28.34 def $with_locals{C : context}(C, [], []) = C ;; 6-typing.watsup:29.1-29.85 - def $with_locals{C : context, x_1 : idx, x* : idx*, lt_1 : localtype, lt* : localtype*}(C, [x_1] :: x*{x}, [lt_1] :: lt*{lt}) = $with_locals(C[LOCAL_context[x_1.`%`.0] = lt_1], x*{x}, lt*{lt}) + def $with_locals{C : context, x_1 : idx, x* : idx*, lt_1 : localtype, lt* : localtype*}(C, [x_1] :: x*{x : localidx}, [lt_1] :: lt*{lt : localtype}) = $with_locals(C[LOCAL_context[x_1.`%`.0] = lt_1], x*{x : localidx}, lt*{lt : localtype}) } ;; 6-typing.watsup @@ -18791,15 +18791,15 @@ def $clostypes(deftype*) : deftype* ;; 6-typing.watsup:37.1-37.26 def $clostypes([]) = [] ;; 6-typing.watsup:38.1-38.93 - def $clostypes{dt* : deftype*, dt_N : deftype, dt'* : deftype*}(dt*{dt} :: [dt_N]) = dt'*{dt'} :: [$subst_all_deftype(dt_N, (dt' : deftype <: heaptype)*{dt'})] - -- if (dt'*{dt'} = $clostypes(dt*{dt})) + def $clostypes{dt* : deftype*, dt_N : deftype, dt'* : deftype*}(dt*{dt : deftype} :: [dt_N]) = dt'*{dt' : deftype} :: [$subst_all_deftype(dt_N, (dt' : deftype <: heaptype)*{dt' : deftype})] + -- if (dt'*{dt' : deftype} = $clostypes(dt*{dt : deftype})) } ;; 6-typing.watsup def $clostype(context : context, deftype : deftype) : deftype ;; 6-typing.watsup - def $clostype{C : context, dt : deftype, dt'* : deftype*}(C, dt) = $subst_all_deftype(dt, (dt' : deftype <: heaptype)*{dt'}) - -- if (dt'*{dt'} = $clostypes(C.TYPE_context)) + def $clostype{C : context, dt : deftype, dt'* : deftype*}(C, dt) = $subst_all_deftype(dt, (dt' : deftype <: heaptype)*{dt' : deftype}) + -- if (dt'*{dt' : deftype} = $clostypes(C.TYPE_context)) ;; 6-typing.watsup relation Numtype_ok: `%|-%:_OK`(context, numtype) @@ -18861,25 +18861,25 @@ relation Valtype_ok: `%|-%:_OK`(context, valtype) relation Resulttype_ok: `%|-%:_OK`(context, resulttype) ;; 6-typing.watsup rule _{C : context, t* : valtype*}: - `%|-%:_OK`(C, t*{t}) - -- (Valtype_ok: `%|-%:_OK`(C, t))*{t} + `%|-%:_OK`(C, t*{t : valtype}) + -- (Valtype_ok: `%|-%:_OK`(C, t))*{t : valtype} ;; 6-typing.watsup relation Instrtype_ok: `%|-%:_OK`(context, instrtype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, x* : idx*, t_2* : valtype*, lt* : localtype*}: - `%|-%:_OK`(C, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2}) - -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt x} + `%|-%:_OK`(C, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) + -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt : localtype x : idx} ;; 6-typing.watsup syntax oktypeidx = - | OK(typeidx : typeidx) + | OK{typeidx : typeidx}(typeidx : typeidx) ;; 6-typing.watsup syntax oktypeidxnat = - | OK(typeidx : typeidx, nat : nat) + | OK{typeidx : typeidx}(typeidx : typeidx, nat) ;; 6-typing.watsup relation Packtype_ok: `%|-%:_OK`(context, packtype) @@ -18910,16 +18910,16 @@ relation Fieldtype_ok: `%|-%:_OK`(context, fieldtype) relation Functype_ok: `%|-%:_OK`(context, functype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:_OK`(C, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2}) + `%|-%:_OK`(C, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) + -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) ;; 6-typing.watsup relation Comptype_ok: `%|-%:_OK`(context, comptype) ;; 6-typing.watsup rule struct{C : context, yt* : fieldtype*}: - `%|-%:_OK`(C, STRUCT_comptype(yt*{yt})) - -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt} + `%|-%:_OK`(C, STRUCT_comptype(yt*{yt : fieldtype})) + -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt : fieldtype} ;; 6-typing.watsup rule array{C : context, yt : fieldtype}: @@ -18956,7 +18956,7 @@ relation Deftype_sub: `%|-%<:%`(context, deftype, deftype) ;; 6-typing.watsup:438.1-441.40 rule super{C : context, deftype_1 : deftype, deftype_2 : deftype, fin : fin, ht_1* : heaptype*, ht : heaptype, ht_2* : heaptype*, ct : comptype}: `%|-%<:%`(C, deftype_1, deftype_2) - -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1 : heaptype} :: [ht] :: ht_2*{ht_2 : heaptype}, ct)) -- Heaptype_sub: `%|-%<:%`(C, ht, (deftype_2 : deftype <: heaptype)) ;; 6-typing.watsup:271.1-271.79 @@ -18991,7 +18991,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:303.1-305.35 rule struct{C : context, deftype : deftype, yt* : fieldtype*}: `%|-%<:%`(C, (deftype : deftype <: heaptype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) + -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt : fieldtype})) ;; 6-typing.watsup:307.1-309.33 rule array{C : context, deftype : deftype, yt : fieldtype}: @@ -19021,7 +19021,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:327.1-329.48 rule rec{C : context, i : nat, ht : heaptype, fin : fin, ht_1* : heaptype*, ht_2* : heaptype*, ct : comptype}: `%|-%<:%`(C, REC_heaptype(i), ht) - -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1 : heaptype} :: [ht] :: ht_2*{ht_2 : heaptype}, ct)) ;; 6-typing.watsup:331.1-333.40 rule none{C : context, heaptype : heaptype}: @@ -19117,8 +19117,8 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) ;; 6-typing.watsup rule struct{C : context, yt_1* : fieldtype*, yt'_1 : fieldtype, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) - -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} + `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1 : fieldtype} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2 : fieldtype})) + -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 : fieldtype yt_2 : fieldtype} ;; 6-typing.watsup rule array{C : context, yt_1 : fieldtype, yt_2 : fieldtype}: @@ -19134,12 +19134,12 @@ relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) ;; 6-typing.watsup rule _{C : context, fin : fin, y* : idx*, ct : comptype, x : idx, y'** : idx**, ct'* : comptype*}: - `%|-%:%`(C, SUB_subtype(fin, y*{y}, ct), OK_oktypeidx(x)) - -- if (|y*{y}| <= 1) - -- (if (y.`%`.0 < x.`%`.0))*{y} - -- (if ($unrolldt(C.TYPE_context[y.`%`.0]) = SUB_subtype(`FINAL%?`(?()), y'*{y'}, ct')))*{ct' y y'} + `%|-%:%`(C, SUB_subtype(fin, y*{y : typeidx}, ct), OK_oktypeidx(x)) + -- if (|y*{y : idx}| <= 1) + -- (if (y.`%`.0 < x.`%`.0))*{y : idx} + -- (if ($unrolldt(C.TYPE_context[y.`%`.0]) = SUB_subtype(`FINAL%?`(?()), y'*{y' : typeidx}, ct')))*{ct' : comptype y : idx y' : typeidx} -- Comptype_ok: `%|-%:_OK`(C, ct) - -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct'} + -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct' : comptype} ;; 6-typing.watsup def $before(heaptype : heaptype, typeidx : typeidx, nat : nat) : bool @@ -19163,12 +19163,12 @@ def $unrollht(context : context, heaptype : heaptype) : subtype relation Subtype_ok2: `%|-%:%`(context, subtype, oktypeidxnat) ;; 6-typing.watsup rule _{C : context, fin : fin, ht* : heaptype*, ct : comptype, x : idx, i : nat, ht'** : heaptype**, ct'* : comptype*}: - `%|-%:%`(C, SUBD_subtype(fin, ht*{ht}, ct), OK_oktypeidxnat(x, i)) - -- if (|ht*{ht}| <= 1) - -- (if $before(ht, x, i))*{ht} - -- (if ($unrollht(C, ht) = SUBD_subtype(`FINAL%?`(?()), ht'*{ht'}, ct')))*{ct' ht ht'} + `%|-%:%`(C, SUBD_subtype(fin, ht*{ht : heaptype}, ct), OK_oktypeidxnat(x, i)) + -- if (|ht*{ht : heaptype}| <= 1) + -- (if $before(ht, x, i))*{ht : heaptype} + -- (if ($unrollht(C, ht) = SUBD_subtype(`FINAL%?`(?()), ht'*{ht' : heaptype}, ct')))*{ct' : comptype ht : heaptype ht' : heaptype} -- Comptype_ok: `%|-%:_OK`(C, ct) - -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct'} + -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct' : comptype} ;; 6-typing.watsup rec { @@ -19181,9 +19181,9 @@ relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) ;; 6-typing.watsup:199.1-202.50 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidxnat(x, i)) + `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) - -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) } ;; 6-typing.watsup @@ -19197,14 +19197,14 @@ relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) ;; 6-typing.watsup:187.1-190.43 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidx(x)) + `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidx(x)) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) - -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) + -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) ;; 6-typing.watsup:192.1-194.49 rule rec2{C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) + `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(x, 0)) } ;; 6-typing.watsup @@ -19213,7 +19213,7 @@ relation Deftype_ok: `%|-%:_OK`(context, deftype) rule _{C : context, qt : rectype, i : nat, x : idx, st^n : subtype^n, n : n}: `%|-%:_OK`(C, DEF_deftype(qt, i)) -- Rectype_ok: `%|-%:%`(C, qt, OK_oktypeidx(x)) - -- if (qt = REC_rectype(st^n{st})) + -- if (qt = REC_rectype(st^n{st : subtype})) -- if (i < n) ;; 6-typing.watsup @@ -19272,18 +19272,18 @@ relation Externtype_ok: `%|-%:_OK`(context, externtype) relation Resulttype_sub: `%|-%*_<:%*`(context, valtype*, valtype*) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%*_<:%*`(C, t_1*{t_1}, t_2*{t_2}) - -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 t_2} + `%|-%*_<:%*`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) + -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 : valtype t_2 : valtype} ;; 6-typing.watsup relation Instrtype_sub: `%|-%<:%`(context, instrtype, instrtype) ;; 6-typing.watsup rule _{C : context, t_11* : valtype*, x_1* : idx*, t_12* : valtype*, t_21* : valtype*, x_2* : idx*, t_22* : valtype*, x* : idx*, t* : valtype*}: - `%|-%<:%`(C, `%->%*%`(t_11*{t_11}, x_1*{x_1}, t_12*{t_12}), `%->%*%`(t_21*{t_21}, x_2*{x_2}, t_22*{t_22})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21}, t_11*{t_11}) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12}, t_22*{t_22}) - -- if (x*{x} = $setminus(x_2*{x_2}, x_1*{x_1})) - -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t x} + `%|-%<:%`(C, `%->%*%`(t_11*{t_11 : valtype}, x_1*{x_1 : localidx}, t_12*{t_12 : valtype}), `%->%*%`(t_21*{t_21 : valtype}, x_2*{x_2 : localidx}, t_22*{t_22 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) + -- if (x*{x : idx} = $setminus(x_2*{x_2 : idx}, x_1*{x_1 : idx})) + -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t : valtype x : idx} ;; 6-typing.watsup relation Limits_sub: `%|-%<:%`(context, limits, limits) @@ -19366,7 +19366,7 @@ rec { relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:544.1-545.34 rule unreachable{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:547.1-548.24 rule nop{C : context}: @@ -19388,55 +19388,55 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:578.1-581.61 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:583.1-586.61 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:588.1-592.65 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_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_2*{x_2 : localidx}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:597.1-599.24 rule br{C : context, l : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.LABEL_context[l.`%`.0] = t*{t}) + `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) ;; 6-typing.watsup:601.1-603.24 rule br_if{C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) - -- if (C.LABEL_context[l.`%`.0] = t*{t}) + `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t : valtype} :: [I32_valtype], t*{t : valtype})) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) ;; 6-typing.watsup:605.1-608.44 rule br_table{C : context, l* : labelidx*, l' : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[l.`%`.0]))*{l} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[l'.`%`.0]) + `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0]))*{l : labelidx} + -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0]) ;; 6-typing.watsup:610.1-613.31 rule br_on_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t}) + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:615.1-618.31 rule br_on_non_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) - -- if (C.LABEL_context[l.`%`.0] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype})) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:620.1-626.34 rule br_on_cast{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 : reftype <: valtype)], t*{t} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -19444,8 +19444,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:628.1-634.49 rule br_on_cast_fail{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 : reftype <: valtype)], t*{t} :: [(rt_2 : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [(rt_2 : reftype <: valtype)])) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -19453,48 +19453,48 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:639.1-641.24 rule return{C : context, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.RETURN_context = ?(t*{t})) + `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + -- if (C.RETURN_context = ?(t*{t : valtype})) ;; 6-typing.watsup:643.1-645.46 rule call{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; 6-typing.watsup:647.1-649.46 rule call_ref{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2 : valtype})) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; 6-typing.watsup:651.1-655.46 rule call_indirect{C : context, x : idx, y : idx, t_1* : valtype*, t_2* : valtype*, lim : limits, rt : reftype}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; 6-typing.watsup:657.1-661.40 rule return_call{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}, t_4*{t_4 : valtype})) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:663.1-667.40 rule return_call_ref{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4 : valtype})) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:669.1-675.40 rule return_call_indirect{C : context, x : idx, y : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, lim : limits, rt : reftype, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype], t_4*{t_4 : valtype})) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:680.1-681.33 rule const{C : context, nt : numtype, c_nt : num_(nt)}: @@ -19524,9 +19524,9 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:701.1-704.50 rule convert-i{C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: - `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) -- if (inn_1 =/= inn_2) - -- if ((sx?{sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) + -- if ((sx?{sx : sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) ;; 6-typing.watsup:706.1-708.24 rule convert-f{C : context, fnn_1 : fnn, fnn_2 : fnn}: @@ -19580,27 +19580,27 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:756.1-758.43 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) ;; 6-typing.watsup:760.1-763.39 rule struct.new_default{C : context, x : idx, zt* : storagetype*, mut* : mut*, val* : val*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpack(zt)) = ?(val)))*{val zt} + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 6-typing.watsup:765.1-769.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: - `%|-%:%`(C, STRUCT.GET_instr(sx?{sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(mut, zt)) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + -- if (yt*{yt : fieldtype}[i] = `%%`(mut, zt)) + -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:771.1-774.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + -- if (yt*{yt : fieldtype}[i] = `%%`(`MUT%?`(?(())), zt)) ;; 6-typing.watsup:779.1-781.41 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: @@ -19633,9 +19633,9 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:803.1-806.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:808.1-810.41 rule array.set{C : context, x : idx, zt : storagetype}: @@ -19710,8 +19710,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:870.1-872.22 rule vshuffle{C : context, imm : imm, N : N, i* : nat*}: - `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) - -- (if (i < (N * 2)))*{i} + `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + -- (if (i < (N * 2)))*{i : nat} ;; 6-typing.watsup:874.1-875.48 rule vsplat{C : context, lnn : lnn, N : N}: @@ -19719,7 +19719,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:878.1-880.14 rule vextract_lane{C : context, lnn : lnn, N : N, sx? : sx?, i : nat}: - `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) + `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) -- if (i < N) ;; 6-typing.watsup:882.1-884.14 @@ -19749,7 +19749,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:902.1-903.55 rule vcvtop{C : context, sh : shape, vcvtop : vcvtop, hf? : half?, sx? : sx?, zero : zero}: - `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf}, sh, sx?{sx}, zero), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`([V128_valtype], [V128_valtype])) ;; 6-typing.watsup:905.1-906.44 rule vnarrow{C : context, sh : ishape, sx : sx}: @@ -19860,19 +19860,19 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1011.1-1016.29 rule load{C : context, nt : numtype, n? : n?, sx? : sx?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} + -- if ((n?{n : n} = ?()) \/ (nt = (inn : inn <: numtype))) ;; 6-typing.watsup:1018.1-1023.29 rule store{C : context, nt : numtype, n? : n?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) + `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} + -- if ((n?{n : n} = ?()) \/ (nt = (inn : inn <: numtype))) ;; 6-typing.watsup:1025.1-1028.30 rule vload{C : context, M : M, N : N, sx : sx, x : idx, n_A : n, n_O : n, mt : memtype}: @@ -19916,8 +19916,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) relation Instrf_ok: `%|-%:%`(context, instr, instrtype) ;; 6-typing.watsup:518.1-520.41 rule instr{C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1 : valtype}, [], t_2*{t_2 : valtype})) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:924.1-926.28 rule local.set{C : context, x : idx, t : valtype, init : init}: @@ -19937,30 +19937,30 @@ relation Instrs_ok: `%|-%*_:%`(context, instr*, instrtype) ;; 6-typing.watsup:525.1-530.52 rule seq{C : context, instr_1 : instr, instr_2* : instr*, t_1* : valtype*, x_1* : idx*, x_2* : idx*, t_3* : valtype*, init* : init*, t* : valtype*, C' : context, t_2* : valtype*}: - `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_1*{x_1} :: x_2*{x_2}, t_3*{t_3})) - -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init t x_1} - -- if (C' = $with_locals(C, x_1*{x_1}, `%%`(SET_init, t)*{t})) - -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2}, `%->%*%`(t_2*{t_2}, x_2*{x_2}, t_3*{t_3})) + `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init : init t : valtype x_1 : idx} + -- if (C' = $with_locals(C, x_1*{x_1 : localidx}, `%%`(SET_init, t)*{t : valtype})) + -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2 : instr}, `%->%*%`(t_2*{t_2 : valtype}, x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) ;; 6-typing.watsup:532.1-535.35 rule sub{C : context, instr* : instr*, it' : instrtype, it : instrtype}: - `%|-%*_:%`(C, instr*{instr}, it') - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, it) + `%|-%*_:%`(C, instr*{instr : instr}, it') + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, it) -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:537.1-539.47 rule frame{C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, x* : idx*, t_2* : valtype*}: - `%|-%*_:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t*{t : valtype} :: t_1*{t_1 : valtype}, x*{x : localidx}, t*{t : valtype} :: t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) } ;; 6-typing.watsup relation Expr_ok: `%|-%:%`(context, expr, resulttype) ;; 6-typing.watsup rule _{C : context, instr* : instr*, t* : valtype*}: - `%|-%:%`(C, instr*{instr}, t*{t}) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, `%->%*%`([], [], t*{t})) + `%|-%:%`(C, instr*{instr : instr}, t*{t : valtype}) + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`([], [], t*{t : valtype})) ;; 6-typing.watsup rec { @@ -19970,7 +19970,7 @@ def $in_binop(numtype : numtype, binop_ : binop_(numtype), binop_(numtype)*) : b ;; 6-typing.watsup:1087.1-1087.42 def $in_binop{nt : numtype, binop : binop_(nt), epsilon : binop_(nt)*}(nt, binop, epsilon) = false ;; 6-typing.watsup:1088.1-1088.99 - def $in_binop{nt : numtype, binop : binop_(nt), ibinop_1 : binop_(nt), ibinop'* : binop_(nt)*}(nt, binop, [ibinop_1] :: ibinop'*{ibinop'}) = ((binop = ibinop_1) \/ $in_binop(nt, binop, ibinop'*{ibinop'})) + def $in_binop{nt : numtype, binop : binop_(nt), ibinop_1 : binop_(nt), ibinop'* : binop_(nt)*}(nt, binop, [ibinop_1] :: ibinop'*{ibinop' : binop_(nt)}) = ((binop = ibinop_1) \/ $in_binop(nt, binop, ibinop'*{ibinop' : binop_(nt)})) } ;; 6-typing.watsup @@ -19981,7 +19981,7 @@ def $in_numtype(numtype : numtype, numtype*) : bool ;; 6-typing.watsup:1083.1-1083.37 def $in_numtype{nt : numtype, epsilon : numtype*}(nt, epsilon) = false ;; 6-typing.watsup:1084.1-1084.68 - def $in_numtype{nt : numtype, nt_1 : numtype, nt'* : numtype*}(nt, [nt_1] :: nt'*{nt'}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt'})) + def $in_numtype{nt : numtype, nt_1 : numtype, nt'* : numtype*}(nt, [nt_1] :: nt'*{nt' : numtype}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt' : numtype})) } ;; 6-typing.watsup @@ -20017,8 +20017,8 @@ relation Instr_const: `%|-%CONST`(context, instr) relation Expr_const: `%|-%CONST`(context, expr) ;; 6-typing.watsup rule _{C : context, instr* : instr*}: - `%|-%CONST`(C, instr*{instr}) - -- (Instr_const: `%|-%CONST`(C, instr))*{instr} + `%|-%CONST`(C, instr*{instr : instr}) + -- (Instr_const: `%|-%CONST`(C, instr))*{instr : instr} ;; 6-typing.watsup relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) @@ -20032,10 +20032,10 @@ relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) relation Type_ok: `%|-%:%*`(context, type, deftype*) ;; 6-typing.watsup rule _{C : context, rectype : rectype, dt* : deftype*, x : idx}: - `%|-%:%*`(C, TYPE(rectype), dt*{dt}) + `%|-%:%*`(C, TYPE(rectype), dt*{dt : deftype}) -- if (x = `%`(|C.TYPE_context|)) - -- if (dt*{dt} = $rolldt(x, rectype)) - -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt}], rectype, OK_oktypeidx(x)) + -- if (dt*{dt : deftype} = $rolldt(x, rectype)) + -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt : deftype}], rectype, OK_oktypeidx(x)) ;; 6-typing.watsup relation Local_ok: `%|-%:%`(context, local, localtype) @@ -20053,10 +20053,10 @@ relation Local_ok: `%|-%:%`(context, local, localtype) relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup rule _{C : context, x : idx, local* : local*, expr : expr, t_1* : valtype*, t_2* : valtype*, lt* : localtype*}: - `%|-%:%`(C, `FUNC%%*%`(x, local*{local}, expr), C.TYPE_context[x.`%`.0]) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- (Local_ok: `%|-%:%`(C, local, lt))*{local lt} - -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1} :: lt*{lt}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2})}, expr, t_2*{t_2}) + `%|-%:%`(C, `FUNC%%*%`(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- (Local_ok: `%|-%:%`(C, local, lt))*{local : local lt : localtype} + -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2 : valtype})}, expr, t_2*{t_2 : valtype}) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -20103,8 +20103,8 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup rule _{C : context, rt : reftype, expr* : expr*, elemmode : elemmode}: - `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr}, elemmode), rt) - -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr} + `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr : expr}, elemmode), rt) + -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr : expr} -- Elemmode_ok: `%|-%:%`(C, elemmode, rt) ;; 6-typing.watsup @@ -20123,7 +20123,7 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) relation Data_ok: `%|-%:_OK`(context, data) ;; 6-typing.watsup rule _{C : context, b* : byte*, datamode : datamode}: - `%|-%:_OK`(C, `DATA%*%`(b*{b}, datamode)) + `%|-%:_OK`(C, `DATA%*%`(b*{b : byte}, datamode)) -- Datamode_ok: `%|-%:_OK`(C, datamode) ;; 6-typing.watsup @@ -20180,9 +20180,9 @@ relation Globals_ok: `%|-%*_:%*`(context, global*, globaltype*) ;; 6-typing.watsup:1275.1-1278.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: - `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt}) + `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) - -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt}) + -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) } ;; 6-typing.watsup @@ -20196,32 +20196,32 @@ relation Types_ok: `%|-%*_:%*`(context, type*, deftype*) ;; 6-typing.watsup:1267.1-1270.49 rule cons{C : context, type_1 : type, type* : type*, dt_1 : deftype, dt* : deftype*}: - `%|-%*_:%*`(C, [type_1] :: type*{type}, dt_1*{} :: dt*{dt}) + `%|-%*_:%*`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, dt*{dt}) + -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) } ;; 6-typing.watsup relation Module_ok: `|-%:_OK`(module) ;; 6-typing.watsup rule _{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data^n : data^n, n : n, start? : start?, export* : export*, dt'* : deftype*, ixt* : externtype*, C' : context, gt* : globaltype*, tt* : tabletype*, mt* : memtype*, C : context, dt* : deftype*, rt* : reftype*, et* : externtype*, idt* : deftype*, igt* : globaltype*, itt* : tabletype*, imt* : memtype*}: - `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type}, import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data^n{data}, start?{start}, export*{export})) - -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type}, dt'*{dt'}) - -- (Import_ok: `%|-%:%`({TYPE dt'*{dt'}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import ixt} - -- Globals_ok: `%|-%*_:%*`(C', global*{global}, gt*{gt}) - -- (Table_ok: `%|-%:%`(C', table, tt))*{table tt} - -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem mt} - -- (Func_ok: `%|-%:%`(C, func, dt))*{dt func} - -- (Elem_ok: `%|-%:%`(C, elem, rt))*{elem rt} - -- (Data_ok: `%|-%:_OK`(C, data))^n{data} - -- (Start_ok: `%|-%:_OK`(C, start))?{start} - -- (Export_ok: `%|-%:%`(C, export, et))*{et export} - -- if (C = {TYPE dt'*{dt'}, REC [], FUNC idt*{idt} :: dt*{dt}, GLOBAL igt*{igt} :: gt*{gt}, TABLE itt*{itt} :: tt*{tt}, MEM imt*{imt} :: mt*{mt}, ELEM rt*{rt}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) - -- if (C' = {TYPE dt'*{dt'}, REC [], FUNC idt*{idt} :: dt*{dt}, GLOBAL igt*{igt}, TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}) - -- if (idt*{idt} = $funcsxt(ixt*{ixt})) - -- if (igt*{igt} = $globalsxt(ixt*{ixt})) - -- if (itt*{itt} = $tablesxt(ixt*{ixt})) - -- if (imt*{imt} = $memsxt(ixt*{ixt})) + `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) + -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) + -- (Import_ok: `%|-%:%`({TYPE dt'*{dt' : deftype}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import : import ixt : externtype} + -- Globals_ok: `%|-%*_:%*`(C', global*{global : global}, gt*{gt : globaltype}) + -- (Table_ok: `%|-%:%`(C', table, tt))*{table : table tt : tabletype} + -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem : mem mt : memtype} + -- (Func_ok: `%|-%:%`(C, func, dt))*{dt : deftype func : func} + -- (Elem_ok: `%|-%:%`(C, elem, rt))*{elem : elem rt : reftype} + -- (Data_ok: `%|-%:_OK`(C, data))^n{data : data} + -- (Start_ok: `%|-%:_OK`(C, start))?{start : start} + -- (Export_ok: `%|-%:%`(C, export, et))*{et : externtype export : export} + -- if (C = {TYPE dt'*{dt' : deftype}, REC [], FUNC idt*{idt : deftype} :: dt*{dt : deftype}, GLOBAL igt*{igt : globaltype} :: gt*{gt : globaltype}, TABLE itt*{itt : tabletype} :: tt*{tt : tabletype}, MEM imt*{imt : memtype} :: mt*{mt : memtype}, ELEM rt*{rt : elemtype}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) + -- if (C' = {TYPE dt'*{dt' : deftype}, REC [], FUNC idt*{idt : deftype} :: dt*{dt : deftype}, GLOBAL igt*{igt : globaltype}, TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}) + -- if (idt*{idt : deftype} = $funcsxt(ixt*{ixt : externtype})) + -- if (igt*{igt : globaltype} = $globalsxt(ixt*{ixt : externtype})) + -- if (itt*{itt : tabletype} = $tablesxt(ixt*{ixt : externtype})) + -- if (imt*{imt : memtype} = $memsxt(ixt*{ixt : externtype})) ;; 7-runtime-typing.watsup relation Ref_ok: `%|-%:%`(store, ref, reftype) @@ -20272,35 +20272,35 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule select-true{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_1 : val <: admininstr)]) + `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule select-false{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_2 : val <: admininstr)]) + `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule if-true{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) + `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule if-false{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) + `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule label-vals{n : n, instr* : instr*, val* : val*}: - `%*_~>%*`([LABEL__admininstr(n, instr*{instr}, (val : val <: admininstr)*{val})], (val : val <: admininstr)*{val}) + `%*_~>%*`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) ;; 8-reduction.watsup rule br-zero{n : n, instr'* : instr*, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)^n{val} :: (instr' : instr <: admininstr)*{instr'}) + `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule br-succ{n : n, instr'* : instr*, val* : val*, l : labelidx, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val : val <: admininstr)*{val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)*{val} :: [BR_admininstr(l)]) + `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) ;; 8-reduction.watsup rule br_if-true{c : num_(I32_numtype), l : labelidx}: @@ -20314,13 +20314,13 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule br_table-lt{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) - -- if (i < |l*{l}|) + `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) + -- if (i < |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_table-ge{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) - -- if (i >= |l*{l}|) + `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) + -- if (i >= |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_on_null-null{val : val, l : labelidx, ht : heaptype}: @@ -20352,15 +20352,15 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule frame-vals{n : n, f : frame, val^n : val^n}: - `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val})], (val : val <: admininstr)^n{val}) + `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-frame{n : n, f : frame, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)^n{val}) + `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-label{k : nat, instr'* : instr*, val* : val*, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(k, instr'*{instr'}, (val : val <: admininstr)*{val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)*{val} :: [RETURN_admininstr]) + `%*_~>%*`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) ;; 8-reduction.watsup rule unop-val{nt : numtype, c_1 : num_(nt), unop : unop_(nt), c : num_(nt)}: @@ -20394,13 +20394,13 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?, c : num_(nt_2)}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx}, c_1) = [c]) + `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) + -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = [c]) ;; 8-reduction.watsup rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx}, c_1) = []) + `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) + -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: @@ -20489,15 +20489,15 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vswizzle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn : inn, N : N, c' : vec_(V128_vnn), c : iN($size((inn : inn <: numtype))), ci* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*, k^N : nat^N}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) - -- if (ci*{ci} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) + -- if (ci*{ci : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) -- if (c*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: `%`(0)^(256 - N){}) - -- if (c' = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c*{}[ci*{ci}[k].`%`.0]^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i})], [VCONST_admininstr(V128_vectype, c)]) + `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) - -- if (c = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c'*{}[i*{i}[k]]^(k%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vshiftop{c_1 : vec_(V128_vnn), n : n, imm : imm, N : N, vshiftop : vshiftop_(`%X%`(imm, `%`(N))), c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) - -- if (c'*{c'} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1)) - -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c'})) + -- if (c'*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1)) + -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))})) ;; 8-reduction.watsup rule vtestop-true{c : vec_(V128_vnn), inn : inn, N : N, ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) - -- (if (ci_1 =/= `%`(0)))*{ci_1} + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) + -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), inn : inn, N : N}: @@ -20559,35 +20559,35 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vbitmask{c : vec_(V128_vnn), inn : inn, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) - -- if ($ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1}) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) + -- if ($ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($size((inn : inn <: numtype)))}) ;; 8-reduction.watsup rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn_1 : inn, N_1 : N, inn_2 : inn, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, cj_1* : iN($size((inn_2 : inn <: numtype)))*, cj_2* : iN($size((inn_2 : inn <: numtype)))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) - -- if (ci_2*{ci_2} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2)) - -- if (cj_1*{cj_1} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1}) - -- if (cj_2*{cj_2} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_2)*{ci_2}) - -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), cj_1*{cj_1} :: cj_2*{cj_2})) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) + -- if (ci_2*{ci_2 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2)) + -- if (cj_1*{cj_1 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1 : iN($size((inn_1 : inn <: numtype)))}) + -- if (cj_2*{cj_2 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_2)*{ci_2 : iN($size((inn_1 : inn <: numtype)))}) + -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), cj_1*{cj_1 : lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), `%`(N_2))))} :: cj_2*{cj_2 : lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), `%`(N_2))))})) ;; 8-reduction.watsup rule vcvtop-normal{c_1 : vec_(V128_vnn), lnn_2 : lnn, N_2 : N, vcvtop : vcvtop, lnn_1 : lnn, N_1 : N, sx : sx, c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- if (c'*{c'} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1)) - -- if (c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c'})) + -- if (c'*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1)) + -- if (c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-half{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, hf : half, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci*{ci} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) - -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx}, ci)*{ci})) + `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) + -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-zero{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci*{ci} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) - -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx}, ci)*{ci} :: `%`(0)^N_1{})) + `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) + -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} :: `%`(0)^N_1{})) ;; 8-reduction.watsup rule vextunop{c_1 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: @@ -20617,13 +20617,13 @@ def $blocktype(state : state, blocktype : blocktype) : functype relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule block{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, n : n, t_1^k : valtype^k, t_2^n : valtype^n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val} :: (instr : instr <: admininstr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) ;; 8-reduction.watsup rule loop{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, t_1^k : valtype^k, t_2^n : valtype^n, n : n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], (val : val <: admininstr)^k{val} :: (instr : instr <: admininstr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) ;; 8-reduction.watsup rule br_on_cast-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: @@ -20653,15 +20653,15 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule call_ref-null{z : state, ht : heaptype, x? : idx?}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule call_ref-func{z : state, val^n : val^n, n : n, a : addr, x? : idx?, m : m, f : frame, instr* : instr*, fi : funcinst, t_1^n : valtype^n, t_2^m : valtype^m, y : idx, t* : valtype*}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr})])]) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) -- if ($funcinst(z)[a] = fi) - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) - -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) + -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t : valtype}, instr*{instr : instr})) + -- if (f = {LOCAL ?(val)^n{val : val} :: $default(t)*{t : valtype}, MODULE fi.MODULE_funcinst}) ;; 8-reduction.watsup rule return_call{z : state, x : idx}: @@ -20669,16 +20669,16 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule return_call_ref-label{z : state, k : nat, instr'* : instr*, val* : val*, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, (val : val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), (val : val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) + `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) ;; 8-reduction.watsup rule return_call_ref-frame-addr{z : state, k : nat, f : frame, val'* : val*, val^n : val^n, n : n, a : addr, x? : idx?, instr* : instr*, t_1^n : valtype^n, t_2^m : valtype^m, m : m}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) ;; 8-reduction.watsup rule return_call_ref-frame-null{z : state, k : nat, f : frame, val* : val*, ht : heaptype, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule ref.func{z : state, x : idx}: @@ -20708,19 +20708,19 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule struct.new_default{z : state, x : idx, val* : val*, mut* : mut*, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val} :: [STRUCT.NEW_admininstr(x)]) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpack(zt)) = ?(val)))*{val zt} + `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 8-reduction.watsup rule struct.get-null{z : state, ht : heaptype, sx? : sx?, x : idx, i : nat}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, `%`(i))]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) ;; 8-reduction.watsup rule struct.get-struct{z : state, a : addr, sx? : sx?, x : idx, i : nat, zt* : storagetype*, si : structinst, mut* : mut*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, `%`(i))]), [($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]) : val <: admininstr)]) + `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) -- if ($structinst(z)[a] = si) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) ;; 8-reduction.watsup rule array.new{z : state, val : val, n : n, x : idx}: @@ -20739,8 +20739,8 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.new_elem-alloc{z : state, i : nat, n : n, x : idx, y : idx, ref^n : ref^n}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- if (ref^n{ref : ref} = $elem(z, y).ELEM_eleminst[i : n]) ;; 8-reduction.watsup rule array.new_data-oob{z : state, i : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: @@ -20750,32 +20750,32 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.new_data-num{z : state, i : nat, n : n, x : idx, y : idx, nt : numtype, c^n : num_(nt)^n, mut : mut, zt : storagetype, o0 : numtype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- if ($nunpack(zt) = ?(o0)) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (nt = o0) - -- if ($concat_(syntax byte, $nbytes(nt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) + -- if ($concat_(syntax byte, $nbytes(nt, c)^n{c : num_(nt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) ;; 8-reduction.watsup rule array.new_data-vec{z : state, i : nat, n : n, x : idx, y : idx, vt : vectype, c^n : vec_(vt)^n, mut : mut, zt : storagetype, o0 : vectype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- if ($vunpack(zt) = ?(o0)) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (vt = o0) - -- if ($concat_(syntax byte, $vbytes(vt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) + -- if ($concat_(syntax byte, $vbytes(vt, c)^n{c : vec_(vt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) ;; 8-reduction.watsup rule array.get-null{z : state, ht : heaptype, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.get-oob{z : state, a : addr, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.get-array{z : state, a : addr, i : nat, sx? : sx?, x : idx, zt : storagetype, fv : fieldval, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [($unpackval(zt, sx?{sx}, fv) : val <: admininstr)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) @@ -20834,18 +20834,18 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.copy-le{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) + -- if (sx?{sx : sx} = $sxfield(zt_2)) -- if (i_1 <= i_2) ;; 8-reduction.watsup rule array.copy-gt{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) + -- if (sx?{sx : sx} = $sxfield(zt_2)) ;; 8-reduction.watsup rule array.init_elem-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: @@ -21028,9 +21028,9 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule vload-shape-val{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop, c : vec_(V128_vnn), j^N : nat^N, k^N : nat^N, inn : inn}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) - -- (if ($ibytes(M, `%`(j)) = $mem(z, x).DATA_meminst[((i + mo.OFFSET_memop.`%`.0) + ((k * M) / 8)) : (M / 8)]))^(k%*`(config, admininstr*) relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule pure{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr'})) - -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr}, (instr' : instr <: admininstr)*{instr'}) + `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule read{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr'})) - -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), (instr' : instr <: admininstr)*{instr'}) + `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule struct.new{z : state, val^n : val^n, n : n, x : idx, si : structinst, mut^n : mut^n, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) - -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) + `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut : mut zt : storagetype})) + -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val zt : storagetype}}) ;; 8-reduction.watsup rule struct.set-null{z : state, ht : heaptype, val : val, x : idx, i : nat}: @@ -21153,14 +21153,14 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule struct.set-struct{z : state, a : addr, val : val, x : idx, i : nat, fv : fieldval, mut* : mut*, zt* : storagetype*}: `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`($with_struct(z, a, i, fv), [])) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- if (fv = $packval(zt*{zt}[i], val)) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- if (fv = $packval(zt*{zt : storagetype}[i], val)) ;; 8-reduction.watsup rule array.new_fixed{z : state, val^n : val^n, n : n, x : idx, ai : arrayinst, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) + -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val}}) ;; 8-reduction.watsup rule array.set-null{z : state, ht : heaptype, i : nat, val : val, x : idx}: @@ -21216,8 +21216,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule store-num-val{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b}), [])) - -- if (b*{b} = $nbytes(nt, c)) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) + -- if (b*{b : byte} = $nbytes(nt, c)) ;; 8-reduction.watsup rule store-pack-oob{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop}: @@ -21226,8 +21226,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule store-pack-val{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b}), [])) - -- if (b*{b} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c))) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) + -- if (b*{b : byte} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c))) ;; 8-reduction.watsup rule vstore-oob{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop}: @@ -21236,8 +21236,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule vstore-val{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b}), [])) - -- if (b*{b} = $vbytes(V128_vectype, c)) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) + -- if (b*{b : byte} = $vbytes(V128_vectype, c)) ;; 8-reduction.watsup rule vstore_lane-oob{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: @@ -21246,10 +21246,10 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule vstore_lane-val{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, b* : byte*, imm : imm, M : M}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b}), [])) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = (128 / N)) - -- if (b*{b} = $ibytes(N, `%`($lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)[j].`%`.0))) + -- if (b*{b : byte} = $ibytes(N, `%`($lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)[j].`%`.0))) ;; 8-reduction.watsup rule memory.grow-succeed{z : state, n : n, x : idx, mi : meminst, o0 : meminst}: @@ -21272,21 +21272,21 @@ rec { relation Steps: `%~>*%`(config, config) ;; 8-reduction.watsup:18.1-19.36 rule refl{z : state, admininstr* : admininstr*}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) + `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z, admininstr*{admininstr : admininstr})) ;; 8-reduction.watsup:21.1-24.53 rule trans{z : state, admininstr* : admininstr*, z'' : state, admininstr''* : admininstr*, z' : state, admininstr' : admininstr}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z'', admininstr''*{admininstr''})) - -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z', admininstr'*{})) - -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr''})) + `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) + -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z', admininstr'*{})) + -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) } ;; 8-reduction.watsup relation Eval_expr: `%;%~>*%;%*`(state, expr, state, val*) ;; 8-reduction.watsup rule _{z : state, instr* : instr*, z' : state, val* : val*}: - `%;%~>*%;%*`(z, instr*{instr}, z', val*{val}) - -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z', (val : val <: admininstr)*{val})) + `%;%~>*%;%*`(z, instr*{instr : instr}, z', val*{val : val}) + -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z', (val : val <: admininstr)*{val : val})) ;; 9-module.watsup rec { @@ -21296,18 +21296,18 @@ def $alloctypes(type*) : deftype* ;; 9-module.watsup:8.1-8.27 def $alloctypes([]) = [] ;; 9-module.watsup:9.1-13.24 - def $alloctypes{type'* : type*, type : type, deftype'* : deftype*, deftype* : deftype*, rectype : rectype, x : idx}(type'*{type'} :: [type]) = deftype'*{deftype'} :: deftype*{deftype} - -- if (deftype'*{deftype'} = $alloctypes(type'*{type'})) + def $alloctypes{type'* : type*, type : type, deftype'* : deftype*, deftype* : deftype*, rectype : rectype, x : idx}(type'*{type' : type} :: [type]) = deftype'*{deftype' : deftype} :: deftype*{deftype : deftype} + -- if (deftype'*{deftype' : deftype} = $alloctypes(type'*{type' : type})) -- if (type = TYPE(rectype)) - -- if (deftype*{deftype} = $subst_all_deftypes($rolldt(x, rectype), (deftype' : deftype <: heaptype)*{deftype'})) - -- if (x = `%`(|deftype'*{deftype'}|)) + -- if (deftype*{deftype : deftype} = $subst_all_deftypes($rolldt(x, rectype), (deftype' : deftype <: heaptype)*{deftype' : deftype})) + -- if (x = `%`(|deftype'*{deftype' : deftype}|)) } ;; 9-module.watsup def $allocfunc(store : store, moduleinst : moduleinst, func : func) : (store, funcaddr) ;; 9-module.watsup def $allocfunc{s : store, mm : moduleinst, func : func, fi : funcinst, x : idx, local* : local*, expr : expr}(s, mm, func) = (s[FUNC_store =.. [fi]], |s.FUNC_store|) - -- if (func = `FUNC%%*%`(x, local*{local}, expr)) + -- if (func = `FUNC%%*%`(x, local*{local : local}, expr)) -- if (fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func}) ;; 9-module.watsup @@ -21318,9 +21318,9 @@ def $allocfuncs(store : store, moduleinst : moduleinst, func*) : (store, funcadd ;; 9-module.watsup:21.1-21.39 def $allocfuncs{s : store, mm : moduleinst}(s, mm, []) = (s, []) ;; 9-module.watsup:22.1-24.51 - def $allocfuncs{s : store, mm : moduleinst, func : func, func'* : func*, s_2 : store, fa : funcaddr, fa'* : funcaddr*, s_1 : store}(s, mm, [func] :: func'*{func'}) = (s_2, [fa] :: fa'*{fa'}) + def $allocfuncs{s : store, mm : moduleinst, func : func, func'* : func*, s_2 : store, fa : funcaddr, fa'* : funcaddr*, s_1 : store}(s, mm, [func] :: func'*{func' : func}) = (s_2, [fa] :: fa'*{fa' : funcaddr}) -- if ((s_1, fa) = $allocfunc(s, mm, func)) - -- if ((s_2, fa'*{fa'}) = $allocfuncs(s_1, mm, func'*{func'})) + -- if ((s_2, fa'*{fa' : funcaddr}) = $allocfuncs(s_1, mm, func'*{func' : func})) } ;; 9-module.watsup @@ -21337,9 +21337,9 @@ def $allocglobals(store : store, globaltype*, val*) : (store, globaladdr*) ;; 9-module.watsup:31.1-31.42 def $allocglobals{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:32.1-34.62 - def $allocglobals{s : store, globaltype : globaltype, globaltype'* : globaltype*, val : val, val'* : val*, s_2 : store, ga : globaladdr, ga'* : globaladdr*, s_1 : store}(s, [globaltype] :: globaltype'*{globaltype'}, [val] :: val'*{val'}) = (s_2, [ga] :: ga'*{ga'}) + def $allocglobals{s : store, globaltype : globaltype, globaltype'* : globaltype*, val : val, val'* : val*, s_2 : store, ga : globaladdr, ga'* : globaladdr*, s_1 : store}(s, [globaltype] :: globaltype'*{globaltype' : globaltype}, [val] :: val'*{val' : val}) = (s_2, [ga] :: ga'*{ga' : globaladdr}) -- if ((s_1, ga) = $allocglobal(s, globaltype, val)) - -- if ((s_2, ga'*{ga'}) = $allocglobals(s_1, globaltype'*{globaltype'}, val'*{val'})) + -- if ((s_2, ga'*{ga' : globaladdr}) = $allocglobals(s_1, globaltype'*{globaltype' : globaltype}, val'*{val' : val})) } ;; 9-module.watsup @@ -21356,9 +21356,9 @@ def $alloctables(store : store, tabletype*, ref*) : (store, tableaddr*) ;; 9-module.watsup:41.1-41.41 def $alloctables{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:42.1-44.60 - def $alloctables{s : store, tabletype : tabletype, tabletype'* : tabletype*, ref : ref, ref'* : ref*, s_2 : store, ta : tableaddr, ta'* : tableaddr*, s_1 : store}(s, [tabletype] :: tabletype'*{tabletype'}, [ref] :: ref'*{ref'}) = (s_2, [ta] :: ta'*{ta'}) + def $alloctables{s : store, tabletype : tabletype, tabletype'* : tabletype*, ref : ref, ref'* : ref*, s_2 : store, ta : tableaddr, ta'* : tableaddr*, s_1 : store}(s, [tabletype] :: tabletype'*{tabletype' : tabletype}, [ref] :: ref'*{ref' : ref}) = (s_2, [ta] :: ta'*{ta' : tableaddr}) -- if ((s_1, ta) = $alloctable(s, tabletype, ref)) - -- if ((s_2, ta'*{ta'}) = $alloctables(s_1, tabletype'*{tabletype'}, ref'*{ref'})) + -- if ((s_2, ta'*{ta' : tableaddr}) = $alloctables(s_1, tabletype'*{tabletype' : tabletype}, ref'*{ref' : ref})) } ;; 9-module.watsup @@ -21375,16 +21375,16 @@ def $allocmems(store : store, memtype*) : (store, memaddr*) ;; 9-module.watsup:51.1-51.34 def $allocmems{s : store}(s, []) = (s, []) ;; 9-module.watsup:52.1-54.49 - def $allocmems{s : store, memtype : memtype, memtype'* : memtype*, s_2 : store, ma : memaddr, ma'* : memaddr*, s_1 : store}(s, [memtype] :: memtype'*{memtype'}) = (s_2, [ma] :: ma'*{ma'}) + def $allocmems{s : store, memtype : memtype, memtype'* : memtype*, s_2 : store, ma : memaddr, ma'* : memaddr*, s_1 : store}(s, [memtype] :: memtype'*{memtype' : memtype}) = (s_2, [ma] :: ma'*{ma' : memaddr}) -- if ((s_1, ma) = $allocmem(s, memtype)) - -- if ((s_2, ma'*{ma'}) = $allocmems(s_1, memtype'*{memtype'})) + -- if ((s_2, ma'*{ma' : memaddr}) = $allocmems(s_1, memtype'*{memtype' : memtype})) } ;; 9-module.watsup def $allocelem(store : store, reftype : reftype, ref*) : (store, elemaddr) ;; 9-module.watsup - def $allocelem{s : store, rt : reftype, ref* : ref*, ei : eleminst}(s, rt, ref*{ref}) = (s[ELEM_store =.. [ei]], |s.ELEM_store|) - -- if (ei = {TYPE rt, ELEM ref*{ref}}) + def $allocelem{s : store, rt : reftype, ref* : ref*, ei : eleminst}(s, rt, ref*{ref : ref}) = (s[ELEM_store =.. [ei]], |s.ELEM_store|) + -- if (ei = {TYPE rt, ELEM ref*{ref : ref}}) ;; 9-module.watsup rec { @@ -21394,16 +21394,16 @@ def $allocelems(store : store, reftype*, ref**) : (store, elemaddr*) ;; 9-module.watsup:61.1-61.40 def $allocelems{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:62.1-64.55 - def $allocelems{s : store, rt : reftype, rt'* : reftype*, ref* : ref*, ref'** : ref**, s_2 : store, ea : elemaddr, ea'* : elemaddr*, s_1 : store}(s, [rt] :: rt'*{rt'}, [ref*{ref}] :: ref'*{ref'}*{ref'}) = (s_2, [ea] :: ea'*{ea'}) - -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref})) - -- if ((s_2, ea'*{ea'}) = $allocelems(s_2, rt'*{rt'}, ref'*{ref'}*{ref'})) + def $allocelems{s : store, rt : reftype, rt'* : reftype*, ref* : ref*, ref'** : ref**, s_2 : store, ea : elemaddr, ea'* : elemaddr*, s_1 : store}(s, [rt] :: rt'*{rt' : reftype}, [ref*{ref : ref}] :: ref'*{ref' : ref}*{ref' : ref}) = (s_2, [ea] :: ea'*{ea' : elemaddr}) + -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref : ref})) + -- if ((s_2, ea'*{ea' : elemaddr}) = $allocelems(s_2, rt'*{rt' : reftype}, ref'*{ref' : ref}*{ref' : ref})) } ;; 9-module.watsup def $allocdata(store : store, byte*) : (store, dataaddr) ;; 9-module.watsup - def $allocdata{s : store, byte* : byte*, di : datainst}(s, byte*{byte}) = (s[DATA_store =.. [di]], |s.DATA_store|) - -- if (di = {DATA byte*{byte}}) + def $allocdata{s : store, byte* : byte*, di : datainst}(s, byte*{byte : byte}) = (s[DATA_store =.. [di]], |s.DATA_store|) + -- if (di = {DATA byte*{byte : byte}}) ;; 9-module.watsup rec { @@ -21413,92 +21413,92 @@ def $allocdatas(store : store, byte**) : (store, dataaddr*) ;; 9-module.watsup:71.1-71.35 def $allocdatas{s : store}(s, []) = (s, []) ;; 9-module.watsup:72.1-74.50 - def $allocdatas{s : store, byte* : byte*, byte'** : byte**, s_2 : store, da : dataaddr, da'* : dataaddr*, s_1 : store}(s, [byte*{byte}] :: byte'*{byte'}*{byte'}) = (s_2, [da] :: da'*{da'}) - -- if ((s_1, da) = $allocdata(s, byte*{byte})) - -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) + def $allocdatas{s : store, byte* : byte*, byte'** : byte**, s_2 : store, da : dataaddr, da'* : dataaddr*, s_1 : store}(s, [byte*{byte : byte}] :: byte'*{byte' : byte}*{byte' : byte}) = (s_2, [da] :: da'*{da' : dataaddr}) + -- if ((s_1, da) = $allocdata(s, byte*{byte : byte})) + -- if ((s_2, da'*{da' : dataaddr}) = $allocdatas(s_1, byte'*{byte' : byte}*{byte' : byte})) } ;; 9-module.watsup def $instexport(funcaddr*, globaladdr*, tableaddr*, memaddr*, export : export) : exportinst ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa : funcaddr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga : globaladdr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta : tableaddr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma : memaddr}[x.`%`.0])} ;; 9-module.watsup def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) : (store, moduleinst) ;; 9-module.watsup - def $allocmodule{s : store, module : module, externval* : externval*, val_g* : val*, ref_t* : ref*, ref_e** : ref**, s_6 : store, mm : moduleinst, type* : type*, import* : import*, func^n_f : func^n_f, n_f : n, globaltype^n_g : globaltype^n_g, expr_g^n_g : expr^n_g, n_g : n, tabletype^n_t : tabletype^n_t, expr_t^n_t : expr^n_t, n_t : n, memtype^n_m : memtype^n_m, n_m : n, reftype^n_e : reftype^n_e, expr_e*^n_e : expr*^n_e, elemmode^n_e : elemmode^n_e, n_e : n, byte*^n_d : byte*^n_d, datamode^n_d : datamode^n_d, n_d : n, start? : start?, export* : export*, fa_ex* : funcaddr*, ga_ex* : globaladdr*, ta_ex* : tableaddr*, ma_ex* : memaddr*, fa* : funcaddr*, i_f^n_f : nat^n_f, ga* : globaladdr*, i_g^n_g : nat^n_g, ta* : tableaddr*, i_t^n_t : nat^n_t, ma* : memaddr*, i_m^n_m : nat^n_m, ea* : elemaddr*, i_e^n_e : nat^n_e, da* : dataaddr*, i_d^n_d : nat^n_d, xi* : exportinst*, dt* : deftype*, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store}(s, module, externval*{externval}, val_g*{val_g}, ref_t*{ref_t}, ref_e*{ref_e}*{ref_e}) = (s_6, mm) - -- if (module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type}, import*{import}, func^n_f{func}, GLOBAL(globaltype, expr_g)^n_g{expr_g globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t tabletype}, MEMORY(memtype)^n_m{memtype}, `ELEM%%*%`(reftype, expr_e*{expr_e}, elemmode)^n_e{elemmode expr_e reftype}, `DATA%*%`(byte*{byte}, datamode)^n_d{byte datamode}, start?{start}, export*{export})) - -- if (fa_ex*{fa_ex} = $funcsxv(externval*{externval})) - -- if (ga_ex*{ga_ex} = $globalsxv(externval*{externval})) - -- if (ta_ex*{ta_ex} = $tablesxv(externval*{externval})) - -- if (ma_ex*{ma_ex} = $memsxv(externval*{externval})) - -- if (fa*{fa} = (|s.FUNC_store| + i_f)^(i_f*%;%*`(z, expr_G, z, [val_G]))*{expr_G val_G} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T ref_T} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E ref_E}*{expr_E ref_E} - -- if ((s', mm) = $allocmodule(s, module, externval*{externval}, val_G*{val_G}, ref_T*{ref_T}, ref_E*{ref_E}*{ref_E})) + -- (Eval_expr: `%;%~>*%;%*`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} + -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} + -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} + -- if ((s', mm) = $allocmodule(s, module, externval*{externval : externval}, val_G*{val_G : val}, ref_T*{ref_T : ref}, ref_E*{ref_E : ref}*{ref_E : ref})) -- if (f = {LOCAL [], MODULE mm}) - -- if (instr_E*{instr_E} = $concat_(syntax instr, $runelem(elem*{elem}[i], `%`(i))^(i%`(t_1^n{t_1}, t_2*{t_2}))) + -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = `FUNC%%*%`(x, local*{local : local}, expr)) + -- Expand: `%~~%`(s.FUNC_store[fa].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; A-binary.watsup rec { @@ -21518,7 +21518,7 @@ def $utf8(name : name) : byte* def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([`%`(ch)]) = [b_1 b_2 b_3 b_4] -- if (((65536 <= ch) /\ (ch < 69632)) /\ (ch = (((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128)))) ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(`%`(ch)*{ch}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch}) + def $utf8{ch* : nat*}(`%`(ch)*{ch : nat}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch : nat}) } ;; A-binary.watsup @@ -21538,14 +21538,14 @@ syntax B = nat ;; C-conventions.watsup syntax sym = - | _FIRST(A_1 : A) + | _FIRST{A_1 : A}(A_1 : A) | _DOTS - | _LAST(A_n : A) + | _LAST{A_n : A}(A_n : A) ;; C-conventions.watsup syntax symsplit = - | _FIRST(A_1 : A) - | _LAST(A_2 : A) + | _FIRST{A_1 : A}(A_1 : A) + | _LAST{A_2 : A}(A_2 : A) ;; C-conventions.watsup syntax recorddots = `...` @@ -21553,21 +21553,21 @@ syntax recorddots = `...` ;; C-conventions.watsup syntax record = { - FIELD_1 A, - FIELD_2 A, - DOTS recorddots + FIELD_1{A_1 : A} A, + FIELD_2{A_2 : A} A, + DOTS{recorddots : recorddots} recorddots } ;; C-conventions.watsup syntax recordstar = { - FIELD_1 A*, - FIELD_2 A*, - DOTS recorddots + FIELD_1{A_1* : A*} A*, + FIELD_2{A_2* : A*} A*, + DOTS{recorddots : recorddots} recorddots } ;; C-conventions.watsup -syntax recordeq = `%++%=%`(recordstar : recordstar, recordstar : recordstar, recordstar : recordstar) +syntax recordeq = `%++%=%`{recordstar : recordstar}(recordstar : recordstar, recordstar, recordstar) ;; C-conventions.watsup syntax pth = @@ -21623,7 +21623,7 @@ def $sum(nat*) : nat ;; 0-aux.watsup:33.1-33.18 def $sum([]) = 0 ;; 0-aux.watsup:34.1-34.35 - def $sum{n : n, n'* : n*}([n] :: n'*{n'}) = (n + $sum(n'*{n'})) + def $sum{n : n, n'* : n*}([n] :: n'*{n' : nat}) = (n + $sum(n'*{n' : nat})) } ;; 0-aux.watsup @@ -21634,7 +21634,7 @@ def $concat_(syntax X, X**) : X* ;; 0-aux.watsup:40.1-40.34 def $concat_{syntax X}(syntax X, []) = [] ;; 0-aux.watsup:41.1-41.61 - def $concat_{syntax X, w* : X*, w'** : X**}(syntax X, [w*{w}] :: w'*{w'}*{w'}) = w*{w} :: $concat_(syntax X, w'*{w'}*{w'}) + def $concat_{syntax X, w* : X*, w'** : X**}(syntax X, [w*{w : X}] :: w'*{w' : X}*{w' : X}) = w*{w : X} :: $concat_(syntax X, w'*{w' : X}*{w' : X}) } ;; 1-syntax.watsup @@ -21723,8 +21723,8 @@ syntax fNmag{N : N}(N) = ;; 1-syntax.watsup syntax fN{N : N}(N) = - | POS(fNmag : fNmag(N)) - | NEG(fNmag : fNmag(N)) + | POS{fNmag : fNmag(N)}(fNmag : fNmag(N)) + | NEG{fNmag : fNmag(N)}(fNmag : fNmag(N)) ;; 1-syntax.watsup syntax f32 = fN(32) @@ -21827,7 +21827,7 @@ syntax valtype = | F32 | F64 | V128 - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | BOT ;; 1-syntax.watsup:154.1-155.16 @@ -21841,15 +21841,15 @@ syntax storagetype = | F32 | F64 | V128 - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | I8 | I16 ;; 1-syntax.watsup:175.1-176.18 -syntax fieldtype = `%%`(mut : mut, storagetype : storagetype) +syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) ;; 1-syntax.watsup:178.1-178.70 -syntax functype = `%->%`(resulttype : resulttype, resulttype : resulttype) +syntax functype = `%->%`{resulttype : resulttype}(resulttype : resulttype, resulttype) ;; 1-syntax.watsup:179.1-179.64 syntax structtype = list(syntax fieldtype) @@ -21859,22 +21859,22 @@ syntax arraytype = fieldtype ;; 1-syntax.watsup:182.1-185.18 syntax comptype = - | STRUCT(structtype : structtype) - | ARRAY(arraytype : arraytype) - | FUNC(functype : functype) + | STRUCT{structtype : structtype}(structtype : structtype) + | ARRAY{arraytype : arraytype}(arraytype : arraytype) + | FUNC{functype : functype}(functype : functype) ;; 1-syntax.watsup:189.1-190.60 syntax subtype = - | SUB(fin : fin, typeidx*, comptype : comptype) - | SUBD(fin : fin, heaptype*, comptype : comptype) + | SUB{fin : fin, typeidx* : typeidx*, comptype : comptype}(fin : fin, typeidx*{typeidx : typeidx} : typeidx*, comptype : comptype) + | SUBD{fin : fin, heaptype* : heaptype*, comptype : comptype}(fin : fin, heaptype*{heaptype : heaptype} : heaptype*, comptype : comptype) ;; 1-syntax.watsup:192.1-193.22 syntax rectype = - | REC(list : list(syntax subtype)) + | REC{list : list(syntax subtype)}(list : list(syntax subtype)) ;; 1-syntax.watsup:198.1-199.26 syntax heaptype = - | _IDX(typeidx : typeidx) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY | EQ | I31 @@ -21886,13 +21886,13 @@ syntax heaptype = | EXTERN | NOEXTERN | BOT - | DEF(rectype : rectype, nat : nat) - | REC(n : n) + | DEF{rectype : rectype}(rectype : rectype, nat) + | REC{n : n}(n : n) } ;; 1-syntax.watsup syntax reftype = - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) ;; 1-syntax.watsup syntax inn = @@ -21945,19 +21945,19 @@ syntax imm = ;; 1-syntax.watsup syntax deftype = - | DEF(rectype : rectype, nat : nat) + | DEF{rectype : rectype}(rectype : rectype, nat) ;; 1-syntax.watsup -syntax limits = `[%..%]`(u32 : u32, u32 : u32) +syntax limits = `[%..%]`{u32 : u32}(u32 : u32, u32) ;; 1-syntax.watsup -syntax globaltype = `%%`(mut : mut, valtype : valtype) +syntax globaltype = `%%`{mut : mut, valtype : valtype}(mut : mut, valtype : valtype) ;; 1-syntax.watsup -syntax tabletype = `%%`(limits : limits, reftype : reftype) +syntax tabletype = `%%`{limits : limits, reftype : reftype}(limits : limits, reftype : reftype) ;; 1-syntax.watsup -syntax memtype = `%I8`(limits : limits) +syntax memtype = `%I8`{limits : limits}(limits : limits) ;; 1-syntax.watsup syntax elemtype = reftype @@ -21967,10 +21967,10 @@ syntax datatype = OK ;; 1-syntax.watsup syntax externtype = - | FUNC(deftype : deftype) - | GLOBAL(globaltype : globaltype) - | TABLE(tabletype : tabletype) - | MEM(memtype : memtype) + | FUNC{deftype : deftype}(deftype : deftype) + | GLOBAL{globaltype : globaltype}(globaltype : globaltype) + | TABLE{tabletype : tabletype}(tabletype : tabletype) + | MEM{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup def $size(numtype : numtype) : nat @@ -22016,7 +22016,7 @@ syntax dim = `%`{i : nat}(i : nat) -- if (((((i = 1) \/ (i = 2)) \/ (i = 4)) \/ (i = 8)) \/ (i = 16)) ;; 1-syntax.watsup -syntax shape = `%X%`(lanetype : lanetype, dim : dim) +syntax shape = `%X%`{lanetype : lanetype, dim : dim}(lanetype : lanetype, dim : dim) ;; 1-syntax.watsup def $lanetype(shape : shape) : lanetype @@ -22084,7 +22084,7 @@ syntax unop_(numtype : numtype) | CLZ | CTZ | POPCNT - | EXTEND(n : n) + | EXTEND{n : n}(n : n) ;; 1-syntax.watsup @@ -22105,13 +22105,13 @@ syntax binop_(numtype : numtype) | ADD | SUB | MUL - | DIV(sx : sx) - | REM(sx : sx) + | DIV{sx : sx}(sx : sx) + | REM{sx : sx}(sx : sx) | AND | OR | XOR | SHL - | SHR(sx : sx) + | SHR{sx : sx}(sx : sx) | ROTL | ROTR @@ -22137,10 +22137,10 @@ syntax relop_(numtype : numtype) syntax relop_{inn : inn}((inn : inn <: numtype)) = | EQ | NE - | LT(sx : sx) - | GT(sx : sx) - | LE(sx : sx) - | GE(sx : sx) + | LT{sx : sx}(sx : sx) + | GT{sx : sx}(sx : sx) + | LE{sx : sx}(sx : sx) + | GE{sx : sx}(sx : sx) ;; 1-syntax.watsup @@ -22160,13 +22160,13 @@ syntax cvtop = | REINTERPRET ;; 1-syntax.watsup -syntax ishape = `%X%`(imm : imm, dim : dim) +syntax ishape = `%X%`{imm : imm, dim : dim}(imm : imm, dim : dim) ;; 1-syntax.watsup -syntax fshape = `%X%`(fnn : fnn, dim : dim) +syntax fshape = `%X%`{fnn : fnn, dim : dim}(fnn : fnn, dim : dim) ;; 1-syntax.watsup -syntax pshape = `%X%`(pnn : pnn, dim : dim) +syntax pshape = `%X%`{pnn : pnn, dim : dim}(pnn : pnn, dim : dim) ;; 1-syntax.watsup def $dim(shape : shape) : dim @@ -22224,9 +22224,9 @@ syntax vbinop_(shape : shape) syntax vbinop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ADD | SUB - | ADD_SAT(sx : sx) + | ADD_SAT{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 16) - | SUB_SAT(sx : sx) + | SUB_SAT{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 16) | MUL -- if ($lsize((imm : imm <: lanetype)) >= 16) @@ -22234,9 +22234,9 @@ syntax vbinop_(shape : shape) -- if ($lsize((imm : imm <: lanetype)) <= 16) | Q15MULR_SAT_S{imm : imm} -- if ($lsize((imm : imm <: lanetype)) = 16) - | MIN(sx : sx) + | MIN{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 32) - | MAX(sx : sx) + | MAX{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 32) @@ -22262,10 +22262,10 @@ syntax vrelop_(shape : shape) syntax vrelop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | EQ | NE - | LT(sx : sx) - | GT(sx : sx) - | LE(sx : sx) - | GE(sx : sx) + | LT{sx : sx}(sx : sx) + | GT{sx : sx}(sx : sx) + | LE{sx : sx}(sx : sx) + | GE{sx : sx}(sx : sx) ;; 1-syntax.watsup @@ -22289,7 +22289,7 @@ syntax vcvtop = ;; 1-syntax.watsup syntax vshiftop_{imm : imm, N : N}(`%X%`(imm, `%`(N))) = | SHL - | SHR(sx : sx) + | SHR{sx : sx}(sx : sx) ;; 1-syntax.watsup syntax vextunop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = @@ -22303,27 +22303,27 @@ syntax half = ;; 1-syntax.watsup syntax vextbinop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = - | EXTMUL(half : half) + | EXTMUL{half : half}(half : half) | DOT{imm_1 : imm} -- if ($lsize((imm_1 : imm <: lanetype)) = 32) ;; 1-syntax.watsup syntax memop = { - ALIGN u32, - OFFSET u32 + ALIGN{u32 : u32} u32, + OFFSET{u32 : u32} u32 } ;; 1-syntax.watsup syntax vloadop = - | SHAPE(nat : nat, nat : nat, sx : sx) - | SPLAT(nat : nat) - | ZERO(nat : nat) + | SHAPE{sx : sx}(nat, nat, sx : sx) + | SPLAT(nat) + | ZERO(nat) ;; 1-syntax.watsup syntax blocktype = - | _RESULT(valtype?) - | _IDX(funcidx : funcidx) + | _RESULT{valtype? : valtype?}(valtype?{valtype : valtype} : valtype?) + | _IDX{funcidx : funcidx}(funcidx : funcidx) ;; 1-syntax.watsup syntax zero = `ZERO%?`(()?) @@ -22336,108 +22336,108 @@ syntax instr = | UNREACHABLE | NOP | DROP - | SELECT(valtype*?) - | BLOCK(blocktype : blocktype, instr*) - | LOOP(blocktype : blocktype, instr*) - | IF(blocktype : blocktype, instr*, instr*) - | BR(labelidx : labelidx) - | BR_IF(labelidx : labelidx) - | BR_TABLE(labelidx*, labelidx : labelidx) - | BR_ON_NULL(labelidx : labelidx) - | BR_ON_NON_NULL(labelidx : labelidx) - | BR_ON_CAST(labelidx : labelidx, reftype : reftype, reftype : reftype) - | BR_ON_CAST_FAIL(labelidx : labelidx, reftype : reftype, reftype : reftype) - | CALL(funcidx : funcidx) - | CALL_REF(typeidx?) - | CALL_INDIRECT(tableidx : tableidx, typeidx : typeidx) + | SELECT{valtype*? : valtype*?}(valtype*{valtype : valtype}?{valtype : valtype} : valtype*?) + | BLOCK{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*) + | LOOP{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*) + | IF{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*, instr*) + | BR{labelidx : labelidx}(labelidx : labelidx) + | BR_IF{labelidx : labelidx}(labelidx : labelidx) + | BR_TABLE{labelidx : labelidx}(labelidx*{} : labelidx*, labelidx) + | BR_ON_NULL{labelidx : labelidx}(labelidx : labelidx) + | BR_ON_NON_NULL{labelidx : labelidx}(labelidx : labelidx) + | BR_ON_CAST{labelidx : labelidx, reftype : reftype}(labelidx : labelidx, reftype : reftype, reftype) + | BR_ON_CAST_FAIL{labelidx : labelidx, reftype : reftype}(labelidx : labelidx, reftype : reftype, reftype) + | CALL{funcidx : funcidx}(funcidx : funcidx) + | CALL_REF{typeidx? : typeidx?}(typeidx?{typeidx : typeidx} : typeidx?) + | CALL_INDIRECT{tableidx : tableidx, typeidx : typeidx}(tableidx : tableidx, typeidx : typeidx) | RETURN - | RETURN_CALL(funcidx : funcidx) - | RETURN_CALL_REF(typeidx?) - | RETURN_CALL_INDIRECT(tableidx : tableidx, typeidx : typeidx) - | CONST(numtype : numtype, num_ : num_(numtype)) - | UNOP(numtype : numtype, unop_ : unop_(numtype)) - | BINOP(numtype : numtype, binop_ : binop_(numtype)) - | TESTOP(numtype : numtype, testop_ : testop_(numtype)) - | RELOP(numtype : numtype, relop_ : relop_(numtype)) - | CVTOP(numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx?) - | EXTEND(numtype : numtype, n : n) - | VCONST(vectype : vectype, vec_ : vec_(vectype)) - | VVUNOP(vectype : vectype, vvunop : vvunop) - | VVBINOP(vectype : vectype, vvbinop : vvbinop) - | VVTERNOP(vectype : vectype, vvternop : vvternop) - | VVTESTOP(vectype : vectype, vvtestop : vvtestop) + | RETURN_CALL{funcidx : funcidx}(funcidx : funcidx) + | RETURN_CALL_REF{typeidx? : typeidx?}(typeidx?{typeidx : typeidx} : typeidx?) + | RETURN_CALL_INDIRECT{tableidx : tableidx, typeidx : typeidx}(tableidx : tableidx, typeidx : typeidx) + | CONST{numtype : numtype, num_ : num_(numtype)}(numtype : numtype, num_ : num_(numtype)) + | UNOP{numtype : numtype, unop_ : unop_(numtype)}(numtype : numtype, unop_ : unop_(numtype)) + | BINOP{numtype : numtype, binop_ : binop_(numtype)}(numtype : numtype, binop_ : binop_(numtype)) + | TESTOP{numtype : numtype, testop_ : testop_(numtype)}(numtype : numtype, testop_ : testop_(numtype)) + | RELOP{numtype : numtype, relop_ : relop_(numtype)}(numtype : numtype, relop_ : relop_(numtype)) + | CVTOP{numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx? : sx?}(numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx?{sx : sx} : sx?) + | EXTEND{numtype : numtype, n : n}(numtype : numtype, n : n) + | VCONST{vectype : vectype, vec_ : vec_(vectype)}(vectype : vectype, vec_ : vec_(vectype)) + | VVUNOP{vectype : vectype, vvunop : vvunop}(vectype : vectype, vvunop : vvunop) + | VVBINOP{vectype : vectype, vvbinop : vvbinop}(vectype : vectype, vvbinop : vvbinop) + | VVTERNOP{vectype : vectype, vvternop : vvternop}(vectype : vectype, vvternop : vvternop) + | VVTESTOP{vectype : vectype, vvtestop : vvtestop}(vectype : vectype, vvtestop : vvtestop) | VSWIZZLE{ishape : ishape}(ishape : ishape) -- if (ishape = `%X%`(I8_imm, `%`(16))) - | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*) - -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) - | VSPLAT(shape : shape) - | VEXTRACT_LANE{shape : shape, numtype : numtype, sx? : sx?}(shape : shape, sx?, laneidx : laneidx) - -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx} = ?())) - | VREPLACE_LANE(shape : shape, laneidx : laneidx) - | VUNOP(shape : shape, vunop_ : vunop_(shape)) - | VBINOP(shape : shape, vbinop_ : vbinop_(shape)) - | VTESTOP(shape : shape, vtestop_ : vtestop_(shape)) - | VRELOP(shape : shape, vrelop_ : vrelop_(shape)) - | VSHIFTOP(ishape : ishape, vshiftop_ : vshiftop_(ishape)) - | VBITMASK(ishape : ishape) - | VCVTOP(shape : shape, vcvtop : vcvtop, half?, shape : shape, sx?, zero : zero) - | VNARROW(ishape : ishape, ishape : ishape, sx : sx) - | VEXTUNOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) + | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*{laneidx : laneidx} : laneidx*) + -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx : laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) + | VSPLAT{shape : shape}(shape : shape) + | VEXTRACT_LANE{shape : shape, sx? : sx?, laneidx : laneidx, numtype : numtype}(shape : shape, sx?{sx : sx} : sx?, laneidx : laneidx) + -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx : sx} = ?())) + | VREPLACE_LANE{shape : shape, laneidx : laneidx}(shape : shape, laneidx : laneidx) + | VUNOP{shape : shape, vunop_ : vunop_(shape)}(shape : shape, vunop_ : vunop_(shape)) + | VBINOP{shape : shape, vbinop_ : vbinop_(shape)}(shape : shape, vbinop_ : vbinop_(shape)) + | VTESTOP{shape : shape, vtestop_ : vtestop_(shape)}(shape : shape, vtestop_ : vtestop_(shape)) + | VRELOP{shape : shape, vrelop_ : vrelop_(shape)}(shape : shape, vrelop_ : vrelop_(shape)) + | VSHIFTOP{ishape : ishape, vshiftop_ : vshiftop_(ishape)}(ishape : ishape, vshiftop_ : vshiftop_(ishape)) + | VBITMASK{ishape : ishape}(ishape : ishape) + | VCVTOP{shape : shape, vcvtop : vcvtop, half? : half?, sx? : sx?, zero : zero}(shape : shape, vcvtop : vcvtop, half?{half : half} : half?, shape, sx?{sx : sx} : sx?, zero : zero) + | VNARROW{ishape : ishape, sx : sx}(ishape : ishape, ishape, sx : sx) + | VEXTUNOP{ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | VEXTBINOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) + | VEXTBINOP{ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | REF.NULL(heaptype : heaptype) + | REF.NULL{heaptype : heaptype}(heaptype : heaptype) | REF.I31 - | REF.FUNC(funcidx : funcidx) + | REF.FUNC{funcidx : funcidx}(funcidx : funcidx) | REF.IS_NULL | REF.AS_NON_NULL | REF.EQ - | REF.TEST(reftype : reftype) - | REF.CAST(reftype : reftype) - | I31.GET(sx : sx) - | STRUCT.NEW(typeidx : typeidx) - | STRUCT.NEW_DEFAULT(typeidx : typeidx) - | STRUCT.GET(sx?, typeidx : typeidx, u32 : u32) - | STRUCT.SET(typeidx : typeidx, u32 : u32) - | ARRAY.NEW(typeidx : typeidx) - | ARRAY.NEW_DEFAULT(typeidx : typeidx) - | ARRAY.NEW_FIXED(typeidx : typeidx, nat : nat) - | ARRAY.NEW_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.NEW_ELEM(typeidx : typeidx, elemidx : elemidx) - | ARRAY.GET(sx?, typeidx : typeidx) - | ARRAY.SET(typeidx : typeidx) + | REF.TEST{reftype : reftype}(reftype : reftype) + | REF.CAST{reftype : reftype}(reftype : reftype) + | I31.GET{sx : sx}(sx : sx) + | STRUCT.NEW{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.GET{sx? : sx?, typeidx : typeidx, u32 : u32}(sx?{sx : sx} : sx?, typeidx : typeidx, u32 : u32) + | STRUCT.SET{typeidx : typeidx, u32 : u32}(typeidx : typeidx, u32 : u32) + | ARRAY.NEW{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_FIXED{typeidx : typeidx}(typeidx : typeidx, nat) + | ARRAY.NEW_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.NEW_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) + | ARRAY.GET{sx? : sx?, typeidx : typeidx}(sx?{sx : sx} : sx?, typeidx : typeidx) + | ARRAY.SET{typeidx : typeidx}(typeidx : typeidx) | ARRAY.LEN - | ARRAY.FILL(typeidx : typeidx) - | ARRAY.COPY(typeidx : typeidx, typeidx : typeidx) - | ARRAY.INIT_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.INIT_ELEM(typeidx : typeidx, elemidx : elemidx) + | ARRAY.FILL{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.COPY{typeidx : typeidx}(typeidx : typeidx, typeidx) + | ARRAY.INIT_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.INIT_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) | EXTERN.CONVERT_ANY | ANY.CONVERT_EXTERN - | LOCAL.GET(localidx : localidx) - | LOCAL.SET(localidx : localidx) - | LOCAL.TEE(localidx : localidx) - | GLOBAL.GET(globalidx : globalidx) - | GLOBAL.SET(globalidx : globalidx) - | TABLE.GET(tableidx : tableidx) - | TABLE.SET(tableidx : tableidx) - | TABLE.SIZE(tableidx : tableidx) - | TABLE.GROW(tableidx : tableidx) - | TABLE.FILL(tableidx : tableidx) - | TABLE.COPY(tableidx : tableidx, tableidx : tableidx) - | TABLE.INIT(tableidx : tableidx, elemidx : elemidx) - | ELEM.DROP(elemidx : elemidx) - | MEMORY.SIZE(memidx : memidx) - | MEMORY.GROW(memidx : memidx) - | MEMORY.FILL(memidx : memidx) - | MEMORY.COPY(memidx : memidx, memidx : memidx) - | MEMORY.INIT(memidx : memidx, dataidx : dataidx) - | DATA.DROP(dataidx : dataidx) - | LOAD(numtype : numtype, (n, sx)?, memidx : memidx, memop : memop) - | STORE(numtype : numtype, n?, memidx : memidx, memop : memop) - | VLOAD(vloadop?, memidx : memidx, memop : memop) - | VLOAD_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | VSTORE(memidx : memidx, memop : memop) - | VSTORE_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | LOCAL.GET{localidx : localidx}(localidx : localidx) + | LOCAL.SET{localidx : localidx}(localidx : localidx) + | LOCAL.TEE{localidx : localidx}(localidx : localidx) + | GLOBAL.GET{globalidx : globalidx}(globalidx : globalidx) + | GLOBAL.SET{globalidx : globalidx}(globalidx : globalidx) + | TABLE.GET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SIZE{tableidx : tableidx}(tableidx : tableidx) + | TABLE.GROW{tableidx : tableidx}(tableidx : tableidx) + | TABLE.FILL{tableidx : tableidx}(tableidx : tableidx) + | TABLE.COPY{tableidx : tableidx}(tableidx : tableidx, tableidx) + | TABLE.INIT{tableidx : tableidx, elemidx : elemidx}(tableidx : tableidx, elemidx : elemidx) + | ELEM.DROP{elemidx : elemidx}(elemidx : elemidx) + | MEMORY.SIZE{memidx : memidx}(memidx : memidx) + | MEMORY.GROW{memidx : memidx}(memidx : memidx) + | MEMORY.FILL{memidx : memidx}(memidx : memidx) + | MEMORY.COPY{memidx : memidx}(memidx : memidx, memidx) + | MEMORY.INIT{memidx : memidx, dataidx : dataidx}(memidx : memidx, dataidx : dataidx) + | DATA.DROP{dataidx : dataidx}(dataidx : dataidx) + | LOAD{numtype : numtype, n? : n?, sx? : sx?, memidx : memidx, memop : memop}(numtype : numtype, (n, sx)?{n : n sx : sx} : (n, sx)?, memidx : memidx, memop : memop) + | STORE{numtype : numtype, n? : n?, memidx : memidx, memop : memop}(numtype : numtype, n?{n : n} : n?, memidx : memidx, memop : memop) + | VLOAD{vloadop? : vloadop?, memidx : memidx, memop : memop}(vloadop?{vloadop : vloadop} : vloadop?, memidx : memidx, memop : memop) + | VLOAD_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | VSTORE{memidx : memidx, memop : memop}(memidx : memidx, memop : memop) + | VSTORE_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) } ;; 1-syntax.watsup @@ -22445,57 +22445,57 @@ syntax expr = instr* ;; 1-syntax.watsup syntax elemmode = - | ACTIVE(tableidx : tableidx, expr : expr) + | ACTIVE{tableidx : tableidx, expr : expr}(tableidx : tableidx, expr : expr) | PASSIVE | DECLARE ;; 1-syntax.watsup syntax datamode = - | ACTIVE(memidx : memidx, expr : expr) + | ACTIVE{memidx : memidx, expr : expr}(memidx : memidx, expr : expr) | PASSIVE ;; 1-syntax.watsup -syntax type = TYPE(rectype : rectype) +syntax type = TYPE{rectype : rectype}(rectype : rectype) ;; 1-syntax.watsup -syntax local = LOCAL(valtype : valtype) +syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`(typeidx : typeidx, local*, expr : expr) +syntax func = `FUNC%%*%`{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) ;; 1-syntax.watsup -syntax global = GLOBAL(globaltype : globaltype, expr : expr) +syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) ;; 1-syntax.watsup -syntax table = TABLE(tabletype : tabletype, expr : expr) +syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, expr : expr) ;; 1-syntax.watsup -syntax mem = MEMORY(memtype : memtype) +syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`(reftype : reftype, expr*, elemmode : elemmode) +syntax elem = `ELEM%%*%`{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) ;; 1-syntax.watsup -syntax data = `DATA%*%`(byte*, datamode : datamode) +syntax data = `DATA%*%`{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup -syntax start = START(funcidx : funcidx) +syntax start = START{funcidx : funcidx}(funcidx : funcidx) ;; 1-syntax.watsup syntax externidx = - | FUNC(funcidx : funcidx) - | GLOBAL(globalidx : globalidx) - | TABLE(tableidx : tableidx) - | MEM(memidx : memidx) + | FUNC{funcidx : funcidx}(funcidx : funcidx) + | GLOBAL{globalidx : globalidx}(globalidx : globalidx) + | TABLE{tableidx : tableidx}(tableidx : tableidx) + | MEM{memidx : memidx}(memidx : memidx) ;; 1-syntax.watsup -syntax export = EXPORT(name : name, externidx : externidx) +syntax export = EXPORT{name : name, externidx : externidx}(name : name, externidx : externidx) ;; 1-syntax.watsup -syntax import = IMPORT(name : name, name : name, externtype : externtype) +syntax import = IMPORT{name : name, externtype : externtype}(name : name, name, externtype : externtype) ;; 1-syntax.watsup -syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*, import*, func*, global*, table*, mem*, elem*, data*, start*, export*) +syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) ;; 2-syntax-aux.watsup rec { @@ -22505,10 +22505,10 @@ def $setminus1(idx : idx, idx*) : idx* ;; 2-syntax-aux.watsup:13.1-13.27 def $setminus1{x : idx}(x, []) = [x] ;; 2-syntax-aux.watsup:14.1-14.61 - def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y}) = [] + def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y : idx}) = [] -- if (x = y_1) ;; 2-syntax-aux.watsup:15.1-15.60 - def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y}) = $setminus1(x, y*{y}) + def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y : idx}) = $setminus1(x, y*{y : idx}) -- otherwise } @@ -22518,9 +22518,9 @@ rec { ;; 2-syntax-aux.watsup:7.1-7.49 def $setminus(idx*, idx*) : idx* ;; 2-syntax-aux.watsup:10.1-10.29 - def $setminus{y* : idx*}([], y*{y}) = [] + def $setminus{y* : idx*}([], y*{y : idx}) = [] ;; 2-syntax-aux.watsup:11.1-11.66 - def $setminus{x_1 : idx, x* : idx*, y* : idx*}([x_1] :: x*{x}, y*{y}) = $setminus1(x_1, y*{y}) :: $setminus(x*{x}, y*{y}) + def $setminus{x_1 : idx, x* : idx*, y* : idx*}([x_1] :: x*{x : idx}, y*{y : idx}) = $setminus1(x_1, y*{y : idx}) :: $setminus(x*{x : idx}, y*{y : idx}) } ;; 2-syntax-aux.watsup @@ -22540,18 +22540,18 @@ def $free_dataidx_instrs(instr*) : dataidx* ;; 2-syntax-aux.watsup:26.1-26.36 def $free_dataidx_instrs([]) = [] ;; 2-syntax-aux.watsup:27.1-27.99 - def $free_dataidx_instrs{instr : instr, instr'* : instr*}([instr] :: instr'*{instr'}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr'}) + def $free_dataidx_instrs{instr : instr, instr'* : instr*}([instr] :: instr'*{instr' : instr}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr' : instr}) } ;; 2-syntax-aux.watsup def $free_dataidx_expr(expr : expr) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_expr{in* : instr*}(in*{in}) = $free_dataidx_instrs(in*{in}) + def $free_dataidx_expr{in* : instr*}(in*{in : instr}) = $free_dataidx_instrs(in*{in : instr}) ;; 2-syntax-aux.watsup def $free_dataidx_func(func : func) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc}, e)) = $free_dataidx_expr(e) + def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) ;; 2-syntax-aux.watsup rec { @@ -22561,7 +22561,7 @@ def $free_dataidx_funcs(func*) : dataidx* ;; 2-syntax-aux.watsup:36.1-36.35 def $free_dataidx_funcs([]) = [] ;; 2-syntax-aux.watsup:37.1-37.92 - def $free_dataidx_funcs{func : func, func'* : func*}([func] :: func'*{func'}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func'}) + def $free_dataidx_funcs{func : func, func'* : func*}([func] :: func'*{func' : func}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func' : func}) } ;; 2-syntax-aux.watsup @@ -22608,8 +22608,8 @@ def $diffrt(reftype : reftype, reftype : reftype) : reftype ;; 2-syntax-aux.watsup syntax typevar = - | _IDX(typeidx : typeidx) - | REC(nat : nat) + | _IDX{typeidx : typeidx}(typeidx : typeidx) + | REC(nat) ;; 2-syntax-aux.watsup def $idx(typeidx : typeidx) : typevar @@ -22624,27 +22624,27 @@ def $subst_typevar(typevar : typevar, typevar*, heaptype*) : heaptype ;; 2-syntax-aux.watsup:150.1-150.38 def $subst_typevar{xx : typevar}(xx, [], []) = (xx : typevar <: heaptype) ;; 2-syntax-aux.watsup:151.1-151.95 - def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 + def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = ht_1 -- if (xx = xx_1) ;; 2-syntax-aux.watsup:152.1-152.92 - def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = $subst_typevar(xx, xx'*{xx'}, ht'*{ht'}) + def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = $subst_typevar(xx, xx'*{xx' : typevar}, ht'*{ht' : heaptype}) -- otherwise } ;; 2-syntax-aux.watsup def $subst_numtype(numtype : numtype, typevar*, heaptype*) : numtype ;; 2-syntax-aux.watsup - def $subst_numtype{nt : numtype, xx* : typevar*, ht* : heaptype*}(nt, xx*{xx}, ht*{ht}) = nt + def $subst_numtype{nt : numtype, xx* : typevar*, ht* : heaptype*}(nt, xx*{xx : typevar}, ht*{ht : heaptype}) = nt ;; 2-syntax-aux.watsup def $subst_vectype(vectype : vectype, typevar*, heaptype*) : vectype ;; 2-syntax-aux.watsup - def $subst_vectype{vt : vectype, xx* : typevar*, ht* : heaptype*}(vt, xx*{xx}, ht*{ht}) = vt + def $subst_vectype{vt : vectype, xx* : typevar*, ht* : heaptype*}(vt, xx*{xx : typevar}, ht*{ht : heaptype}) = vt ;; 2-syntax-aux.watsup def $subst_packtype(packtype : packtype, typevar*, heaptype*) : packtype ;; 2-syntax-aux.watsup - def $subst_packtype{pt : packtype, xx* : typevar*, ht* : heaptype*}(pt, xx*{xx}, ht*{ht}) = pt + def $subst_packtype{pt : packtype, xx* : typevar*, ht* : heaptype*}(pt, xx*{xx : typevar}, ht*{ht : heaptype}) = pt ;; 2-syntax-aux.watsup rec { @@ -22652,108 +22652,108 @@ rec { ;; 2-syntax-aux.watsup:129.1-129.92 def $subst_heaptype(heaptype : heaptype, typevar*, heaptype*) : heaptype ;; 2-syntax-aux.watsup:157.1-157.67 - def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) + def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx : typevar}, ht*{ht : heaptype}) = $subst_typevar(xx', xx*{xx : typevar}, ht*{ht : heaptype}) ;; 2-syntax-aux.watsup:158.1-158.65 - def $subst_heaptype{dt : deftype, xx* : typevar*, ht* : heaptype*}((dt : deftype <: heaptype), xx*{xx}, ht*{ht}) = ($subst_deftype(dt, xx*{xx}, ht*{ht}) : deftype <: heaptype) + def $subst_heaptype{dt : deftype, xx* : typevar*, ht* : heaptype*}((dt : deftype <: heaptype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_deftype(dt, xx*{xx : typevar}, ht*{ht : heaptype}) : deftype <: heaptype) ;; 2-syntax-aux.watsup:159.1-159.55 - def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx}, ht*{ht}) = ht' + def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx : typevar}, ht*{ht : heaptype}) = ht' -- otherwise ;; 2-syntax-aux.watsup:130.1-130.92 def $subst_reftype(reftype : reftype, typevar*, heaptype*) : reftype ;; 2-syntax-aux.watsup:161.1-161.85 - def $subst_reftype{nul : nul, ht' : heaptype, xx* : typevar*, ht* : heaptype*}(REF_reftype(nul, ht'), xx*{xx}, ht*{ht}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx}, ht*{ht})) + def $subst_reftype{nul : nul, ht' : heaptype, xx* : typevar*, ht* : heaptype*}(REF_reftype(nul, ht'), xx*{xx : typevar}, ht*{ht : heaptype}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:131.1-131.92 def $subst_valtype(valtype : valtype, typevar*, heaptype*) : valtype ;; 2-syntax-aux.watsup:163.1-163.64 - def $subst_valtype{nt : numtype, xx* : typevar*, ht* : heaptype*}((nt : numtype <: valtype), xx*{xx}, ht*{ht}) = ($subst_numtype(nt, xx*{xx}, ht*{ht}) : numtype <: valtype) + def $subst_valtype{nt : numtype, xx* : typevar*, ht* : heaptype*}((nt : numtype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_numtype(nt, xx*{xx : typevar}, ht*{ht : heaptype}) : numtype <: valtype) ;; 2-syntax-aux.watsup:164.1-164.64 - def $subst_valtype{vt : vectype, xx* : typevar*, ht* : heaptype*}((vt : vectype <: valtype), xx*{xx}, ht*{ht}) = ($subst_vectype(vt, xx*{xx}, ht*{ht}) : vectype <: valtype) + def $subst_valtype{vt : vectype, xx* : typevar*, ht* : heaptype*}((vt : vectype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_vectype(vt, xx*{xx : typevar}, ht*{ht : heaptype}) : vectype <: valtype) ;; 2-syntax-aux.watsup:165.1-165.64 - def $subst_valtype{rt : reftype, xx* : typevar*, ht* : heaptype*}((rt : reftype <: valtype), xx*{xx}, ht*{ht}) = ($subst_reftype(rt, xx*{xx}, ht*{ht}) : reftype <: valtype) + def $subst_valtype{rt : reftype, xx* : typevar*, ht* : heaptype*}((rt : reftype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_reftype(rt, xx*{xx : typevar}, ht*{ht : heaptype}) : reftype <: valtype) ;; 2-syntax-aux.watsup:166.1-166.40 - def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx : typevar}, ht*{ht : heaptype}) = BOT_valtype ;; 2-syntax-aux.watsup:134.1-134.92 def $subst_storagetype(storagetype : storagetype, typevar*, heaptype*) : storagetype ;; 2-syntax-aux.watsup:170.1-170.66 - def $subst_storagetype{t : valtype, xx* : typevar*, ht* : heaptype*}((t : valtype <: storagetype), xx*{xx}, ht*{ht}) = ($subst_valtype(t, xx*{xx}, ht*{ht}) : valtype <: storagetype) + def $subst_storagetype{t : valtype, xx* : typevar*, ht* : heaptype*}((t : valtype <: storagetype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_valtype(t, xx*{xx : typevar}, ht*{ht : heaptype}) : valtype <: storagetype) ;; 2-syntax-aux.watsup:171.1-171.69 - def $subst_storagetype{pt : packtype, xx* : typevar*, ht* : heaptype*}((pt : packtype <: storagetype), xx*{xx}, ht*{ht}) = ($subst_packtype(pt, xx*{xx}, ht*{ht}) : packtype <: storagetype) + def $subst_storagetype{pt : packtype, xx* : typevar*, ht* : heaptype*}((pt : packtype <: storagetype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_packtype(pt, xx*{xx : typevar}, ht*{ht : heaptype}) : packtype <: storagetype) ;; 2-syntax-aux.watsup:135.1-135.92 def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype ;; 2-syntax-aux.watsup:173.1-173.80 - def $subst_fieldtype{mut : mut, zt : storagetype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, zt), xx*{xx}, ht*{ht}) = `%%`(mut, $subst_storagetype(zt, xx*{xx}, ht*{ht})) + def $subst_fieldtype{mut : mut, zt : storagetype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, zt), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(mut, $subst_storagetype(zt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype ;; 2-syntax-aux.watsup:175.1-175.85 - def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) + def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt : fieldtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype}) ;; 2-syntax-aux.watsup:176.1-176.81 - def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) + def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx : typevar}, ht*{ht : heaptype}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:177.1-177.78 - def $subst_comptype{ft : functype, xx* : typevar*, ht* : heaptype*}(FUNC_comptype(ft), xx*{xx}, ht*{ht}) = FUNC_comptype($subst_functype(ft, xx*{xx}, ht*{ht})) + def $subst_comptype{ft : functype, xx* : typevar*, ht* : heaptype*}(FUNC_comptype(ft), xx*{xx : typevar}, ht*{ht : heaptype}) = FUNC_comptype($subst_functype(ft, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:138.1-138.92 def $subst_subtype(subtype : subtype, typevar*, heaptype*) : subtype ;; 2-syntax-aux.watsup:179.1-180.76 - def $subst_subtype{fin : fin, y* : idx*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + def $subst_subtype{fin : fin, y* : idx*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUB_subtype(fin, y*{y : typeidx}, ct), xx*{xx : typevar}, ht*{ht : heaptype}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx : typevar}, ht*{ht : heaptype})*{y : typeidx}, $subst_comptype(ct, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:181.1-182.73 - def $subst_subtype{fin : fin, ht'* : heaptype*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUBD_subtype(fin, ht'*{ht'}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx}, ht*{ht})*{ht'}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + def $subst_subtype{fin : fin, ht'* : heaptype*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUBD_subtype(fin, ht'*{ht' : heaptype}, ct), xx*{xx : typevar}, ht*{ht : heaptype}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})*{ht' : heaptype}, $subst_comptype(ct, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype ;; 2-syntax-aux.watsup:184.1-184.76 - def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st}), xx*{xx}, ht*{ht}) = REC_rectype($subst_subtype(st, xx*{xx}, ht*{ht})*{st}) + def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st : subtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype}) ;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype ;; 2-syntax-aux.watsup:186.1-186.78 - def $subst_deftype{qt : rectype, i : nat, xx* : typevar*, ht* : heaptype*}(DEF_deftype(qt, i), xx*{xx}, ht*{ht}) = DEF_deftype($subst_rectype(qt, xx*{xx}, ht*{ht}), i) + def $subst_deftype{qt : rectype, i : nat, xx* : typevar*, ht* : heaptype*}(DEF_deftype(qt, i), xx*{xx : typevar}, ht*{ht : heaptype}) = DEF_deftype($subst_rectype(qt, xx*{xx : typevar}, ht*{ht : heaptype}), i) ;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype ;; 2-syntax-aux.watsup:189.1-189.113 - def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1}, t_2*{t_2}), xx*{xx}, ht*{ht}) = `%->%`($subst_valtype(t_1, xx*{xx}, ht*{ht})*{t_1}, $subst_valtype(t_2, xx*{xx}, ht*{ht})*{t_2}) + def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}, $subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype}) } ;; 2-syntax-aux.watsup def $subst_globaltype(globaltype : globaltype, typevar*, heaptype*) : globaltype ;; 2-syntax-aux.watsup - def $subst_globaltype{mut : mut, t : valtype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, t), xx*{xx}, ht*{ht}) = `%%`(mut, $subst_valtype(t, xx*{xx}, ht*{ht})) + def $subst_globaltype{mut : mut, t : valtype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, t), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(mut, $subst_valtype(t, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_tabletype(tabletype : tabletype, typevar*, heaptype*) : tabletype ;; 2-syntax-aux.watsup - def $subst_tabletype{lim : limits, rt : reftype, xx* : typevar*, ht* : heaptype*}(`%%`(lim, rt), xx*{xx}, ht*{ht}) = `%%`(lim, $subst_reftype(rt, xx*{xx}, ht*{ht})) + def $subst_tabletype{lim : limits, rt : reftype, xx* : typevar*, ht* : heaptype*}(`%%`(lim, rt), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(lim, $subst_reftype(rt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_memtype(memtype : memtype, typevar*, heaptype*) : memtype ;; 2-syntax-aux.watsup - def $subst_memtype{lim : limits, xx* : typevar*, ht* : heaptype*}(`%I8`(lim), xx*{xx}, ht*{ht}) = `%I8`(lim) + def $subst_memtype{lim : limits, xx* : typevar*, ht* : heaptype*}(`%I8`(lim), xx*{xx : typevar}, ht*{ht : heaptype}) = `%I8`(lim) ;; 2-syntax-aux.watsup def $subst_externtype(externtype : externtype, typevar*, heaptype*) : externtype ;; 2-syntax-aux.watsup - def $subst_externtype{dt : deftype, xx* : typevar*, ht* : heaptype*}(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) + def $subst_externtype{dt : deftype, xx* : typevar*, ht* : heaptype*}(FUNC_externtype(dt), xx*{xx : typevar}, ht*{ht : heaptype}) = FUNC_externtype($subst_deftype(dt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{gt : globaltype, xx* : typevar*, ht* : heaptype*}(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) + def $subst_externtype{gt : globaltype, xx* : typevar*, ht* : heaptype*}(GLOBAL_externtype(gt), xx*{xx : typevar}, ht*{ht : heaptype}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{tt : tabletype, xx* : typevar*, ht* : heaptype*}(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) + def $subst_externtype{tt : tabletype, xx* : typevar*, ht* : heaptype*}(TABLE_externtype(tt), xx*{xx : typevar}, ht*{ht : heaptype}) = TABLE_externtype($subst_tabletype(tt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{mt : memtype, xx* : typevar*, ht* : heaptype*}(MEM_externtype(mt), xx*{xx}, ht*{ht}) = MEM_externtype($subst_memtype(mt, xx*{xx}, ht*{ht})) + def $subst_externtype{mt : memtype, xx* : typevar*, ht* : heaptype*}(MEM_externtype(mt), xx*{xx : typevar}, ht*{ht : heaptype}) = MEM_externtype($subst_memtype(mt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_all_reftype(reftype : reftype, heaptype*) : reftype ;; 2-syntax-aux.watsup - def $subst_all_reftype{rt : reftype, ht^n : heaptype^n, n : n, i^n : nat^n}(rt, ht^n{ht}) = $subst_reftype(rt, $idx(`%`(i))^(i (sx?{sx} = ?())) - | VREPLACE_LANE(shape : shape, laneidx : laneidx) - | VUNOP(shape : shape, vunop_ : vunop_(shape)) - | VBINOP(shape : shape, vbinop_ : vbinop_(shape)) - | VTESTOP(shape : shape, vtestop_ : vtestop_(shape)) - | VRELOP(shape : shape, vrelop_ : vrelop_(shape)) - | VSHIFTOP(ishape : ishape, vshiftop_ : vshiftop_(ishape)) - | VBITMASK(ishape : ishape) - | VCVTOP(shape : shape, vcvtop : vcvtop, half?, shape : shape, sx?, zero : zero) - | VNARROW(ishape : ishape, ishape : ishape, sx : sx) - | VEXTUNOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) + | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*{laneidx : laneidx} : laneidx*) + -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx : laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) + | VSPLAT{shape : shape}(shape : shape) + | VEXTRACT_LANE{shape : shape, sx? : sx?, laneidx : laneidx, numtype : numtype}(shape : shape, sx?{sx : sx} : sx?, laneidx : laneidx) + -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx : sx} = ?())) + | VREPLACE_LANE{shape : shape, laneidx : laneidx}(shape : shape, laneidx : laneidx) + | VUNOP{shape : shape, vunop_ : vunop_(shape)}(shape : shape, vunop_ : vunop_(shape)) + | VBINOP{shape : shape, vbinop_ : vbinop_(shape)}(shape : shape, vbinop_ : vbinop_(shape)) + | VTESTOP{shape : shape, vtestop_ : vtestop_(shape)}(shape : shape, vtestop_ : vtestop_(shape)) + | VRELOP{shape : shape, vrelop_ : vrelop_(shape)}(shape : shape, vrelop_ : vrelop_(shape)) + | VSHIFTOP{ishape : ishape, vshiftop_ : vshiftop_(ishape)}(ishape : ishape, vshiftop_ : vshiftop_(ishape)) + | VBITMASK{ishape : ishape}(ishape : ishape) + | VCVTOP{shape : shape, vcvtop : vcvtop, half? : half?, sx? : sx?, zero : zero}(shape : shape, vcvtop : vcvtop, half?{half : half} : half?, shape, sx?{sx : sx} : sx?, zero : zero) + | VNARROW{ishape : ishape, sx : sx}(ishape : ishape, ishape, sx : sx) + | VEXTUNOP{ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | VEXTBINOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) + | VEXTBINOP{ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | REF.NULL(heaptype : heaptype) + | REF.NULL{heaptype : heaptype}(heaptype : heaptype) | REF.I31 - | REF.FUNC(funcidx : funcidx) + | REF.FUNC{funcidx : funcidx}(funcidx : funcidx) | REF.IS_NULL | REF.AS_NON_NULL | REF.EQ - | REF.TEST(reftype : reftype) - | REF.CAST(reftype : reftype) - | I31.GET(sx : sx) - | STRUCT.NEW(typeidx : typeidx) - | STRUCT.NEW_DEFAULT(typeidx : typeidx) - | STRUCT.GET(sx?, typeidx : typeidx, u32 : u32) - | STRUCT.SET(typeidx : typeidx, u32 : u32) - | ARRAY.NEW(typeidx : typeidx) - | ARRAY.NEW_DEFAULT(typeidx : typeidx) - | ARRAY.NEW_FIXED(typeidx : typeidx, nat : nat) - | ARRAY.NEW_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.NEW_ELEM(typeidx : typeidx, elemidx : elemidx) - | ARRAY.GET(sx?, typeidx : typeidx) - | ARRAY.SET(typeidx : typeidx) + | REF.TEST{reftype : reftype}(reftype : reftype) + | REF.CAST{reftype : reftype}(reftype : reftype) + | I31.GET{sx : sx}(sx : sx) + | STRUCT.NEW{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.GET{sx? : sx?, typeidx : typeidx, u32 : u32}(sx?{sx : sx} : sx?, typeidx : typeidx, u32 : u32) + | STRUCT.SET{typeidx : typeidx, u32 : u32}(typeidx : typeidx, u32 : u32) + | ARRAY.NEW{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_FIXED{typeidx : typeidx}(typeidx : typeidx, nat) + | ARRAY.NEW_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.NEW_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) + | ARRAY.GET{sx? : sx?, typeidx : typeidx}(sx?{sx : sx} : sx?, typeidx : typeidx) + | ARRAY.SET{typeidx : typeidx}(typeidx : typeidx) | ARRAY.LEN - | ARRAY.FILL(typeidx : typeidx) - | ARRAY.COPY(typeidx : typeidx, typeidx : typeidx) - | ARRAY.INIT_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.INIT_ELEM(typeidx : typeidx, elemidx : elemidx) + | ARRAY.FILL{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.COPY{typeidx : typeidx}(typeidx : typeidx, typeidx) + | ARRAY.INIT_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.INIT_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) | EXTERN.CONVERT_ANY | ANY.CONVERT_EXTERN - | LOCAL.GET(localidx : localidx) - | LOCAL.SET(localidx : localidx) - | LOCAL.TEE(localidx : localidx) - | GLOBAL.GET(globalidx : globalidx) - | GLOBAL.SET(globalidx : globalidx) - | TABLE.GET(tableidx : tableidx) - | TABLE.SET(tableidx : tableidx) - | TABLE.SIZE(tableidx : tableidx) - | TABLE.GROW(tableidx : tableidx) - | TABLE.FILL(tableidx : tableidx) - | TABLE.COPY(tableidx : tableidx, tableidx : tableidx) - | TABLE.INIT(tableidx : tableidx, elemidx : elemidx) - | ELEM.DROP(elemidx : elemidx) - | MEMORY.SIZE(memidx : memidx) - | MEMORY.GROW(memidx : memidx) - | MEMORY.FILL(memidx : memidx) - | MEMORY.COPY(memidx : memidx, memidx : memidx) - | MEMORY.INIT(memidx : memidx, dataidx : dataidx) - | DATA.DROP(dataidx : dataidx) - | LOAD(numtype : numtype, (n, sx)?, memidx : memidx, memop : memop) - | STORE(numtype : numtype, n?, memidx : memidx, memop : memop) - | VLOAD(vloadop?, memidx : memidx, memop : memop) - | VLOAD_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | VSTORE(memidx : memidx, memop : memop) - | VSTORE_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | REF.I31_NUM(u31 : u31) - | REF.STRUCT_ADDR(structaddr : structaddr) - | REF.ARRAY_ADDR(arrayaddr : arrayaddr) - | REF.FUNC_ADDR(funcaddr : funcaddr) - | REF.HOST_ADDR(hostaddr : hostaddr) - | REF.EXTERN(addrref : addrref) - | LABEL_(n : n, instr*, admininstr*) - | FRAME_(n : n, frame : frame, admininstr*) + | LOCAL.GET{localidx : localidx}(localidx : localidx) + | LOCAL.SET{localidx : localidx}(localidx : localidx) + | LOCAL.TEE{localidx : localidx}(localidx : localidx) + | GLOBAL.GET{globalidx : globalidx}(globalidx : globalidx) + | GLOBAL.SET{globalidx : globalidx}(globalidx : globalidx) + | TABLE.GET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SIZE{tableidx : tableidx}(tableidx : tableidx) + | TABLE.GROW{tableidx : tableidx}(tableidx : tableidx) + | TABLE.FILL{tableidx : tableidx}(tableidx : tableidx) + | TABLE.COPY{tableidx : tableidx}(tableidx : tableidx, tableidx) + | TABLE.INIT{tableidx : tableidx, elemidx : elemidx}(tableidx : tableidx, elemidx : elemidx) + | ELEM.DROP{elemidx : elemidx}(elemidx : elemidx) + | MEMORY.SIZE{memidx : memidx}(memidx : memidx) + | MEMORY.GROW{memidx : memidx}(memidx : memidx) + | MEMORY.FILL{memidx : memidx}(memidx : memidx) + | MEMORY.COPY{memidx : memidx}(memidx : memidx, memidx) + | MEMORY.INIT{memidx : memidx, dataidx : dataidx}(memidx : memidx, dataidx : dataidx) + | DATA.DROP{dataidx : dataidx}(dataidx : dataidx) + | LOAD{numtype : numtype, n? : n?, sx? : sx?, memidx : memidx, memop : memop}(numtype : numtype, (n, sx)?{n : n sx : sx} : (n, sx)?, memidx : memidx, memop : memop) + | STORE{numtype : numtype, n? : n?, memidx : memidx, memop : memop}(numtype : numtype, n?{n : n} : n?, memidx : memidx, memop : memop) + | VLOAD{vloadop? : vloadop?, memidx : memidx, memop : memop}(vloadop?{vloadop : vloadop} : vloadop?, memidx : memidx, memop : memop) + | VLOAD_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | VSTORE{memidx : memidx, memop : memop}(memidx : memidx, memop : memop) + | VSTORE_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | REF.I31_NUM{u31 : u31}(u31 : u31) + | REF.STRUCT_ADDR{structaddr : structaddr}(structaddr : structaddr) + | REF.ARRAY_ADDR{arrayaddr : arrayaddr}(arrayaddr : arrayaddr) + | REF.FUNC_ADDR{funcaddr : funcaddr}(funcaddr : funcaddr) + | REF.HOST_ADDR{hostaddr : hostaddr}(hostaddr : hostaddr) + | REF.EXTERN{addrref : addrref}(addrref : addrref) + | LABEL_{n : n, instr* : instr*, admininstr* : admininstr*}(n : n, instr*{instr : instr} : instr*, admininstr*{admininstr : admininstr} : admininstr*) + | FRAME_{n : n, frame : frame, admininstr* : admininstr*}(n : n, frame : frame, admininstr*{admininstr : admininstr} : admininstr*) | TRAP } ;; 4-runtime.watsup -syntax config = `%;%*`(state : state, admininstr*) +syntax config = `%;%*`{state : state, admininstr* : admininstr*}(state : state, admininstr*{admininstr : admininstr} : admininstr*) ;; 4-runtime.watsup rec { @@ -23867,15 +23867,15 @@ rec { ;; 4-runtime.watsup:165.1-168.25 syntax E = | _HOLE - | _SEQ(val*, E : E, instr*) - | LABEL_(n : n, instr*, E : E) + | _SEQ{val* : val*, E : E, instr* : instr*}(val*{val : val} : val*, E : E, instr*{instr : instr} : instr*) + | LABEL_{n : n, instr* : instr*, E : E}(n : n, instr*{instr : instr} : instr*, E : E) } ;; 5-runtime-aux.watsup def $inst_reftype(moduleinst : moduleinst, reftype : reftype) : reftype ;; 5-runtime-aux.watsup - def $inst_reftype{mm : moduleinst, rt : reftype, dt* : deftype*}(mm, rt) = $subst_all_reftype(rt, (dt : deftype <: heaptype)*{dt}) - -- if (dt*{dt} = mm.TYPE_moduleinst) + def $inst_reftype{mm : moduleinst, rt : reftype, dt* : deftype*}(mm, rt) = $subst_all_reftype(rt, (dt : deftype <: heaptype)*{dt : deftype}) + -- if (dt*{dt : deftype} = mm.TYPE_moduleinst) ;; 5-runtime-aux.watsup def $default(valtype : valtype) : val? @@ -23916,9 +23916,9 @@ def $funcsxv(externval*) : funcaddr* ;; 5-runtime-aux.watsup:49.1-49.24 def $funcsxv([]) = [] ;; 5-runtime-aux.watsup:50.1-50.47 - def $funcsxv{fa : funcaddr, xv* : externval*}([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) + def $funcsxv{fa : funcaddr, xv* : externval*}([FUNC_externval(fa)] :: xv*{xv : externval}) = [fa] :: $funcsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:51.1-51.58 - def $funcsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $funcsxv(xv*{xv}) + def $funcsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $funcsxv(xv*{xv : externval}) -- otherwise } @@ -23930,9 +23930,9 @@ def $globalsxv(externval*) : globaladdr* ;; 5-runtime-aux.watsup:53.1-53.26 def $globalsxv([]) = [] ;; 5-runtime-aux.watsup:54.1-54.53 - def $globalsxv{ga : globaladdr, xv* : externval*}([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) + def $globalsxv{ga : globaladdr, xv* : externval*}([GLOBAL_externval(ga)] :: xv*{xv : externval}) = [ga] :: $globalsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:55.1-55.62 - def $globalsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $globalsxv(xv*{xv}) + def $globalsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $globalsxv(xv*{xv : externval}) -- otherwise } @@ -23944,9 +23944,9 @@ def $tablesxv(externval*) : tableaddr* ;; 5-runtime-aux.watsup:57.1-57.25 def $tablesxv([]) = [] ;; 5-runtime-aux.watsup:58.1-58.50 - def $tablesxv{ta : tableaddr, xv* : externval*}([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) + def $tablesxv{ta : tableaddr, xv* : externval*}([TABLE_externval(ta)] :: xv*{xv : externval}) = [ta] :: $tablesxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:59.1-59.60 - def $tablesxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $tablesxv(xv*{xv}) + def $tablesxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $tablesxv(xv*{xv : externval}) -- otherwise } @@ -23958,9 +23958,9 @@ def $memsxv(externval*) : memaddr* ;; 5-runtime-aux.watsup:61.1-61.23 def $memsxv([]) = [] ;; 5-runtime-aux.watsup:62.1-62.44 - def $memsxv{ma : memaddr, xv* : externval*}([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) + def $memsxv{ma : memaddr, xv* : externval*}([MEM_externval(ma)] :: xv*{xv : externval}) = [ma] :: $memsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:63.1-63.56 - def $memsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $memsxv(xv*{xv}) + def $memsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $memsxv(xv*{xv : externval}) -- otherwise } @@ -24087,7 +24087,7 @@ def $with_tableinst(state : state, tableidx : tableidx, tableinst : tableinst) : ;; 5-runtime-aux.watsup def $with_mem(state : state, memidx : memidx, nat : nat, nat : nat, byte*) : state ;; 5-runtime-aux.watsup - def $with_mem{s : store, f : frame, x : idx, i : nat, j : nat, b* : byte*}(`%;%`(s, f), x, i, j, b*{b}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]].DATA_meminst[i : j] = b*{b}], f) + def $with_mem{s : store, f : frame, x : idx, i : nat, j : nat, b* : byte*}(`%;%`(s, f), x, i, j, b*{b : byte}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]].DATA_meminst[i : j] = b*{b : byte}], f) ;; 5-runtime-aux.watsup def $with_meminst(state : state, memidx : memidx, meminst : meminst) : state @@ -24097,12 +24097,12 @@ def $with_meminst(state : state, memidx : memidx, meminst : meminst) : state ;; 5-runtime-aux.watsup def $with_elem(state : state, elemidx : elemidx, ref*) : state ;; 5-runtime-aux.watsup - def $with_elem{s : store, f : frame, x : idx, r* : ref*}(`%;%`(s, f), x, r*{r}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]].ELEM_eleminst = r*{r}], f) + def $with_elem{s : store, f : frame, x : idx, r* : ref*}(`%;%`(s, f), x, r*{r : ref}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]].ELEM_eleminst = r*{r : ref}], f) ;; 5-runtime-aux.watsup def $with_data(state : state, dataidx : dataidx, byte*) : state ;; 5-runtime-aux.watsup - def $with_data{s : store, f : frame, x : idx, b* : byte*}(`%;%`(s, f), x, b*{b}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]].DATA_datainst = b*{b}], f) + def $with_data{s : store, f : frame, x : idx, b* : byte*}(`%;%`(s, f), x, b*{b : byte}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]].DATA_datainst = b*{b : byte}], f) ;; 5-runtime-aux.watsup def $with_struct(state : state, structaddr : structaddr, nat : nat, fieldval : fieldval) : state @@ -24117,20 +24117,20 @@ def $with_array(state : state, arrayaddr : arrayaddr, nat : nat, fieldval : fiel ;; 5-runtime-aux.watsup def $ext_structinst(state : state, structinst*) : state ;; 5-runtime-aux.watsup - def $ext_structinst{s : store, f : frame, si* : structinst*}(`%;%`(s, f), si*{si}) = `%;%`(s[STRUCT_store =.. si*{si}], f) + def $ext_structinst{s : store, f : frame, si* : structinst*}(`%;%`(s, f), si*{si : structinst}) = `%;%`(s[STRUCT_store =.. si*{si : structinst}], f) ;; 5-runtime-aux.watsup def $ext_arrayinst(state : state, arrayinst*) : state ;; 5-runtime-aux.watsup - def $ext_arrayinst{s : store, f : frame, ai* : arrayinst*}(`%;%`(s, f), ai*{ai}) = `%;%`(s[ARRAY_store =.. ai*{ai}], f) + def $ext_arrayinst{s : store, f : frame, ai* : arrayinst*}(`%;%`(s, f), ai*{ai : arrayinst}) = `%;%`(s[ARRAY_store =.. ai*{ai : arrayinst}], f) ;; 5-runtime-aux.watsup def $growtable(tableinst : tableinst, nat : nat, ref : ref) : tableinst? ;; 5-runtime-aux.watsup def $growtable{ti : tableinst, n : n, r : ref, ti' : tableinst, i : nat, j : nat, rt : reftype, r'* : ref*, i' : nat}(ti, n, r) = ?(ti') - -- if (ti = {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM r'*{r'}}) - -- if (i' = (|r'*{r'}| + n)) - -- if (ti' = {TYPE `%%`(`[%..%]`(`%`(i'), `%`(j)), rt), ELEM r'*{r'} :: r^n{}}) + -- if (ti = {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM r'*{r' : ref}}) + -- if (i' = (|r'*{r' : ref}| + n)) + -- if (ti' = {TYPE `%%`(`[%..%]`(`%`(i'), `%`(j)), rt), ELEM r'*{r' : ref} :: r^n{}}) -- if (i' <= j) def $growtable{x0 : tableinst, x1 : nat, x2 : ref}(x0, x1, x2) = ?() @@ -24138,9 +24138,9 @@ def $growtable(tableinst : tableinst, nat : nat, ref : ref) : tableinst? def $growmemory(meminst : meminst, nat : nat) : meminst? ;; 5-runtime-aux.watsup def $growmemory{mi : meminst, n : n, mi' : meminst, i : nat, j : nat, b* : byte*, i' : nat}(mi, n) = ?(mi') - -- if (mi = {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA b*{b}}) - -- if (i' = ((|b*{b}| / (64 * $Ki)) + n)) - -- if (mi' = {TYPE `%I8`(`[%..%]`(`%`(i'), `%`(j))), DATA b*{b} :: `%`(0)^((n * 64) * $Ki){}}) + -- if (mi = {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA b*{b : byte}}) + -- if (i' = ((|b*{b : byte}| / (64 * $Ki)) + n)) + -- if (mi' = {TYPE `%I8`(`[%..%]`(`%`(i'), `%`(j))), DATA b*{b : byte} :: `%`(0)^((n * 64) * $Ki){}}) -- if (i' <= j) def $growmemory{x0 : meminst, x1 : nat}(x0, x1) = ?() @@ -24150,25 +24150,25 @@ syntax init = | UNSET ;; 6-typing.watsup -syntax localtype = `%%`(init : init, valtype : valtype) +syntax localtype = `%%`{init : init, valtype : valtype}(init : init, valtype : valtype) ;; 6-typing.watsup -syntax instrtype = `%->%*%`(resulttype : resulttype, localidx*, resulttype : resulttype) +syntax instrtype = `%->%*%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) ;; 6-typing.watsup syntax context = { - TYPE deftype*, - REC subtype*, - FUNC deftype*, - GLOBAL globaltype*, - TABLE tabletype*, - MEM memtype*, - ELEM elemtype*, - DATA datatype*, - LOCAL localtype*, - LABEL resulttype*, - RETURN resulttype? + TYPE{deftype* : deftype*} deftype*, + REC{subtype* : subtype*} subtype*, + FUNC{deftype* : deftype*} deftype*, + GLOBAL{globaltype* : globaltype*} globaltype*, + TABLE{tabletype* : tabletype*} tabletype*, + MEM{memtype* : memtype*} memtype*, + ELEM{elemtype* : elemtype*} elemtype*, + DATA{datatype* : datatype*} datatype*, + LOCAL{localtype* : localtype*} localtype*, + LABEL{resulttype* : resulttype*} resulttype*, + RETURN{resulttype? : resulttype?} resulttype? } ;; 6-typing.watsup @@ -24179,7 +24179,7 @@ def $with_locals(context : context, localidx*, localtype*) : context ;; 6-typing.watsup:28.1-28.34 def $with_locals{C : context}(C, [], []) = C ;; 6-typing.watsup:29.1-29.85 - def $with_locals{C : context, x_1 : idx, x* : idx*, lt_1 : localtype, lt* : localtype*}(C, [x_1] :: x*{x}, [lt_1] :: lt*{lt}) = $with_locals(C[LOCAL_context[x_1.`%`.0] = lt_1], x*{x}, lt*{lt}) + def $with_locals{C : context, x_1 : idx, x* : idx*, lt_1 : localtype, lt* : localtype*}(C, [x_1] :: x*{x : localidx}, [lt_1] :: lt*{lt : localtype}) = $with_locals(C[LOCAL_context[x_1.`%`.0] = lt_1], x*{x : localidx}, lt*{lt : localtype}) } ;; 6-typing.watsup @@ -24190,15 +24190,15 @@ def $clostypes(deftype*) : deftype* ;; 6-typing.watsup:37.1-37.26 def $clostypes([]) = [] ;; 6-typing.watsup:38.1-38.93 - def $clostypes{dt* : deftype*, dt_N : deftype, dt'* : deftype*}(dt*{dt} :: [dt_N]) = dt'*{dt'} :: [$subst_all_deftype(dt_N, (dt' : deftype <: heaptype)*{dt'})] - -- if (dt'*{dt'} = $clostypes(dt*{dt})) + def $clostypes{dt* : deftype*, dt_N : deftype, dt'* : deftype*}(dt*{dt : deftype} :: [dt_N]) = dt'*{dt' : deftype} :: [$subst_all_deftype(dt_N, (dt' : deftype <: heaptype)*{dt' : deftype})] + -- if (dt'*{dt' : deftype} = $clostypes(dt*{dt : deftype})) } ;; 6-typing.watsup def $clostype(context : context, deftype : deftype) : deftype ;; 6-typing.watsup - def $clostype{C : context, dt : deftype, dt'* : deftype*}(C, dt) = $subst_all_deftype(dt, (dt' : deftype <: heaptype)*{dt'}) - -- if (dt'*{dt'} = $clostypes(C.TYPE_context)) + def $clostype{C : context, dt : deftype, dt'* : deftype*}(C, dt) = $subst_all_deftype(dt, (dt' : deftype <: heaptype)*{dt' : deftype}) + -- if (dt'*{dt' : deftype} = $clostypes(C.TYPE_context)) ;; 6-typing.watsup relation Numtype_ok: `%|-%:_OK`(context, numtype) @@ -24262,27 +24262,27 @@ relation Valtype_ok: `%|-%:_OK`(context, valtype) relation Resulttype_ok: `%|-%:_OK`(context, resulttype) ;; 6-typing.watsup rule _{C : context, t* : valtype*}: - `%|-%:_OK`(C, t*{t}) - -- (Valtype_ok: `%|-%:_OK`(C, t))*{t} + `%|-%:_OK`(C, t*{t : valtype}) + -- (Valtype_ok: `%|-%:_OK`(C, t))*{t : valtype} ;; 6-typing.watsup relation Instrtype_ok: `%|-%:_OK`(context, instrtype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, x* : idx*, t_2* : valtype*, lt* : localtype*}: - `%|-%:_OK`(C, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - -- if (|lt*{lt}| = |x*{x}|) - -- (if (x.`%`.0 < |C.LOCAL_context|))*{lt x} - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2}) - -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt x} + `%|-%:_OK`(C, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + -- if (|lt*{lt : localtype}| = |x*{x : idx}|) + -- (if (x.`%`.0 < |C.LOCAL_context|))*{lt : localtype x : idx} + -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) + -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt : localtype x : idx} ;; 6-typing.watsup syntax oktypeidx = - | OK(typeidx : typeidx) + | OK{typeidx : typeidx}(typeidx : typeidx) ;; 6-typing.watsup syntax oktypeidxnat = - | OK(typeidx : typeidx, nat : nat) + | OK{typeidx : typeidx}(typeidx : typeidx, nat) ;; 6-typing.watsup relation Packtype_ok: `%|-%:_OK`(context, packtype) @@ -24313,16 +24313,16 @@ relation Fieldtype_ok: `%|-%:_OK`(context, fieldtype) relation Functype_ok: `%|-%:_OK`(context, functype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:_OK`(C, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2}) + `%|-%:_OK`(C, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) + -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) ;; 6-typing.watsup relation Comptype_ok: `%|-%:_OK`(context, comptype) ;; 6-typing.watsup rule struct{C : context, yt* : fieldtype*}: - `%|-%:_OK`(C, STRUCT_comptype(yt*{yt})) - -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt} + `%|-%:_OK`(C, STRUCT_comptype(yt*{yt : fieldtype})) + -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt : fieldtype} ;; 6-typing.watsup rule array{C : context, yt : fieldtype}: @@ -24359,7 +24359,7 @@ relation Deftype_sub: `%|-%<:%`(context, deftype, deftype) ;; 6-typing.watsup:438.1-441.40 rule super{C : context, deftype_1 : deftype, deftype_2 : deftype, fin : fin, ht_1* : heaptype*, ht : heaptype, ht_2* : heaptype*, ct : comptype}: `%|-%<:%`(C, deftype_1, deftype_2) - -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1 : heaptype} :: [ht] :: ht_2*{ht_2 : heaptype}, ct)) -- Heaptype_sub: `%|-%<:%`(C, ht, (deftype_2 : deftype <: heaptype)) ;; 6-typing.watsup:271.1-271.79 @@ -24394,7 +24394,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:303.1-305.35 rule struct{C : context, deftype : deftype, yt* : fieldtype*}: `%|-%<:%`(C, (deftype : deftype <: heaptype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) + -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt : fieldtype})) ;; 6-typing.watsup:307.1-309.33 rule array{C : context, deftype : deftype, yt : fieldtype}: @@ -24427,7 +24427,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) rule rec{C : context, i : nat, ht : heaptype, fin : fin, ht_1* : heaptype*, ht_2* : heaptype*, ct : comptype}: `%|-%<:%`(C, REC_heaptype(i), ht) -- if (i < |C.REC_context|) - -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1 : heaptype} :: [ht] :: ht_2*{ht_2 : heaptype}, ct)) ;; 6-typing.watsup:331.1-333.40 rule none{C : context, heaptype : heaptype}: @@ -24523,9 +24523,9 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) ;; 6-typing.watsup rule struct{C : context, yt_1* : fieldtype*, yt'_1 : fieldtype, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) - -- if (|yt_1*{yt_1}| = |yt_2*{yt_2}|) - -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} + `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1 : fieldtype} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2 : fieldtype})) + -- if (|yt_1*{yt_1 : fieldtype}| = |yt_2*{yt_2 : fieldtype}|) + -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 : fieldtype yt_2 : fieldtype} ;; 6-typing.watsup rule array{C : context, yt_1 : fieldtype, yt_2 : fieldtype}: @@ -24541,15 +24541,15 @@ relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) ;; 6-typing.watsup rule _{C : context, fin : fin, y* : idx*, ct : comptype, x : idx, y'** : idx**, ct'* : comptype*}: - `%|-%:%`(C, SUB_subtype(fin, y*{y}, ct), OK_oktypeidx(x)) - -- if (|ct'*{ct'}| = |y*{y}|) - -- if (|ct'*{ct'}| = |y'*{y'}*{y'}|) - -- (if (y.`%`.0 < |C.TYPE_context|))*{ct' y y'} - -- if (|y*{y}| <= 1) - -- (if (y.`%`.0 < x.`%`.0))*{y} - -- (if ($unrolldt(C.TYPE_context[y.`%`.0]) = SUB_subtype(`FINAL%?`(?()), y'*{y'}, ct')))*{ct' y y'} + `%|-%:%`(C, SUB_subtype(fin, y*{y : typeidx}, ct), OK_oktypeidx(x)) + -- if (|ct'*{ct' : comptype}| = |y*{y : idx}|) + -- if (|ct'*{ct' : comptype}| = |y'*{y' : idx}*{y' : idx}|) + -- (if (y.`%`.0 < |C.TYPE_context|))*{ct' : comptype y : idx y' : typeidx} + -- if (|y*{y : idx}| <= 1) + -- (if (y.`%`.0 < x.`%`.0))*{y : idx} + -- (if ($unrolldt(C.TYPE_context[y.`%`.0]) = SUB_subtype(`FINAL%?`(?()), y'*{y' : typeidx}, ct')))*{ct' : comptype y : idx y' : typeidx} -- Comptype_ok: `%|-%:_OK`(C, ct) - -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct'} + -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct' : comptype} ;; 6-typing.watsup def $before(heaptype : heaptype, typeidx : typeidx, nat : nat) : bool @@ -24573,14 +24573,14 @@ def $unrollht(context : context, heaptype : heaptype) : subtype relation Subtype_ok2: `%|-%:%`(context, subtype, oktypeidxnat) ;; 6-typing.watsup rule _{C : context, fin : fin, ht* : heaptype*, ct : comptype, x : idx, i : nat, ht'** : heaptype**, ct'* : comptype*}: - `%|-%:%`(C, SUBD_subtype(fin, ht*{ht}, ct), OK_oktypeidxnat(x, i)) - -- if (|ct'*{ct'}| = |ht*{ht}|) - -- if (|ct'*{ct'}| = |ht'*{ht'}*{ht'}|) - -- if (|ht*{ht}| <= 1) - -- (if $before(ht, x, i))*{ht} - -- (if ($unrollht(C, ht) = SUBD_subtype(`FINAL%?`(?()), ht'*{ht'}, ct')))*{ct' ht ht'} + `%|-%:%`(C, SUBD_subtype(fin, ht*{ht : heaptype}, ct), OK_oktypeidxnat(x, i)) + -- if (|ct'*{ct' : comptype}| = |ht*{ht : heaptype}|) + -- if (|ct'*{ct' : comptype}| = |ht'*{ht' : heaptype}*{ht' : heaptype}|) + -- if (|ht*{ht : heaptype}| <= 1) + -- (if $before(ht, x, i))*{ht : heaptype} + -- (if ($unrollht(C, ht) = SUBD_subtype(`FINAL%?`(?()), ht'*{ht' : heaptype}, ct')))*{ct' : comptype ht : heaptype ht' : heaptype} -- Comptype_ok: `%|-%:_OK`(C, ct) - -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct'} + -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct' : comptype} ;; 6-typing.watsup rec { @@ -24593,9 +24593,9 @@ relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) ;; 6-typing.watsup:199.1-202.50 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidxnat(x, i)) + `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) - -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) } ;; 6-typing.watsup @@ -24609,14 +24609,14 @@ relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) ;; 6-typing.watsup:187.1-190.43 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidx(x)) + `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidx(x)) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) - -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) + -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) ;; 6-typing.watsup:192.1-194.49 rule rec2{C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) + `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(x, 0)) } ;; 6-typing.watsup @@ -24625,7 +24625,7 @@ relation Deftype_ok: `%|-%:_OK`(context, deftype) rule _{C : context, qt : rectype, i : nat, x : idx, st^n : subtype^n, n : n}: `%|-%:_OK`(C, DEF_deftype(qt, i)) -- Rectype_ok: `%|-%:%`(C, qt, OK_oktypeidx(x)) - -- if (qt = REC_rectype(st^n{st})) + -- if (qt = REC_rectype(st^n{st : subtype})) -- if (i < n) ;; 6-typing.watsup @@ -24684,21 +24684,21 @@ relation Externtype_ok: `%|-%:_OK`(context, externtype) relation Resulttype_sub: `%|-%*_<:%*`(context, valtype*, valtype*) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%*_<:%*`(C, t_1*{t_1}, t_2*{t_2}) - -- if (|t_1*{t_1}| = |t_2*{t_2}|) - -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 t_2} + `%|-%*_<:%*`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) + -- if (|t_1*{t_1 : valtype}| = |t_2*{t_2 : valtype}|) + -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 : valtype t_2 : valtype} ;; 6-typing.watsup relation Instrtype_sub: `%|-%<:%`(context, instrtype, instrtype) ;; 6-typing.watsup rule _{C : context, t_11* : valtype*, x_1* : idx*, t_12* : valtype*, t_21* : valtype*, x_2* : idx*, t_22* : valtype*, x* : idx*, t* : valtype*}: - `%|-%<:%`(C, `%->%*%`(t_11*{t_11}, x_1*{x_1}, t_12*{t_12}), `%->%*%`(t_21*{t_21}, x_2*{x_2}, t_22*{t_22})) - -- if (|t*{t}| = |x*{x}|) - -- (if (x.`%`.0 < |C.LOCAL_context|))*{t x} - -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21}, t_11*{t_11}) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12}, t_22*{t_22}) - -- if (x*{x} = $setminus(x_2*{x_2}, x_1*{x_1})) - -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t x} + `%|-%<:%`(C, `%->%*%`(t_11*{t_11 : valtype}, x_1*{x_1 : localidx}, t_12*{t_12 : valtype}), `%->%*%`(t_21*{t_21 : valtype}, x_2*{x_2 : localidx}, t_22*{t_22 : valtype})) + -- if (|t*{t : valtype}| = |x*{x : idx}|) + -- (if (x.`%`.0 < |C.LOCAL_context|))*{t : valtype x : idx} + -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) + -- if (x*{x : idx} = $setminus(x_2*{x_2 : idx}, x_1*{x_1 : idx})) + -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t : valtype x : idx} ;; 6-typing.watsup relation Limits_sub: `%|-%<:%`(context, limits, limits) @@ -24782,7 +24782,7 @@ rec { relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:544.1-545.34 rule unreachable{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:547.1-548.24 rule nop{C : context}: @@ -24804,62 +24804,62 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:578.1-581.61 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:583.1-586.61 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:588.1-592.65 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_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_2*{x_2 : localidx}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:597.1-599.24 rule br{C : context, l : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) -- if (l.`%`.0 < |C.LABEL_context|) - -- if (C.LABEL_context[l.`%`.0] = t*{t}) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) ;; 6-typing.watsup:601.1-603.24 rule br_if{C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) + `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t : valtype} :: [I32_valtype], t*{t : valtype})) -- if (l.`%`.0 < |C.LABEL_context|) - -- if (C.LABEL_context[l.`%`.0] = t*{t}) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) ;; 6-typing.watsup:605.1-608.44 rule br_table{C : context, l* : labelidx*, l' : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- (if (l.`%`.0 < |C.LABEL_context|))*{l} + `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + -- (if (l.`%`.0 < |C.LABEL_context|))*{l : labelidx} -- if (l'.`%`.0 < |C.LABEL_context|) - -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[l.`%`.0]))*{l} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[l'.`%`.0]) + -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0]))*{l : labelidx} + -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0]) ;; 6-typing.watsup:610.1-613.31 rule br_on_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) -- if (l.`%`.0 < |C.LABEL_context|) - -- if (C.LABEL_context[l.`%`.0] = t*{t}) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:615.1-618.31 rule br_on_non_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype})) -- if (l.`%`.0 < |C.LABEL_context|) - -- if (C.LABEL_context[l.`%`.0] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:620.1-626.34 rule br_on_cast{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 : reftype <: valtype)], t*{t} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) -- if (l.`%`.0 < |C.LABEL_context|) - -- if (C.LABEL_context[l.`%`.0] = t*{t} :: [(rt : reftype <: valtype)]) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -24867,9 +24867,9 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:628.1-634.49 rule br_on_cast_fail{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 : reftype <: valtype)], t*{t} :: [(rt_2 : reftype <: valtype)])) + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [(rt_2 : reftype <: valtype)])) -- if (l.`%`.0 < |C.LABEL_context|) - -- if (C.LABEL_context[l.`%`.0] = t*{t} :: [(rt : reftype <: valtype)]) + -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -24877,56 +24877,56 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:639.1-641.24 rule return{C : context, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.RETURN_context = ?(t*{t})) + `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + -- if (C.RETURN_context = ?(t*{t : valtype})) ;; 6-typing.watsup:643.1-645.46 rule call{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) + `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) -- if (x.`%`.0 < |C.FUNC_context|) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; 6-typing.watsup:647.1-649.46 rule call_ref{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2})) + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2 : valtype})) -- if (x.`%`.0 < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; 6-typing.watsup:651.1-655.46 rule call_indirect{C : context, x : idx, y : idx, t_1* : valtype*, t_2* : valtype*, lim : limits, rt : reftype}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) -- if (x.`%`.0 < |C.TABLE_context|) -- if (y.`%`.0 < |C.TYPE_context|) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; 6-typing.watsup:657.1-661.40 rule return_call{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}, t_4*{t_4 : valtype})) -- if (x.`%`.0 < |C.FUNC_context|) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:663.1-667.40 rule return_call_ref{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4})) + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4 : valtype})) -- if (x.`%`.0 < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:669.1-675.40 rule return_call_indirect{C : context, x : idx, y : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, lim : limits, rt : reftype, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype], t_4*{t_4 : valtype})) -- if (x.`%`.0 < |C.TABLE_context|) -- if (y.`%`.0 < |C.TYPE_context|) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:680.1-681.33 rule const{C : context, nt : numtype, c_nt : num_(nt)}: @@ -24956,9 +24956,9 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:701.1-704.50 rule convert-i{C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: - `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) -- if (inn_1 =/= inn_2) - -- if ((sx?{sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) + -- if ((sx?{sx : sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) ;; 6-typing.watsup:706.1-708.24 rule convert-f{C : context, fnn_1 : fnn, fnn_2 : fnn}: @@ -25013,36 +25013,36 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:756.1-758.43 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) -- if (x.`%`.0 < |C.TYPE_context|) - -- if (|mut*{mut}| = |zt*{zt}|) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) ;; 6-typing.watsup:760.1-763.39 rule struct.new_default{C : context, x : idx, zt* : storagetype*, mut* : mut*, val* : val*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) -- if (x.`%`.0 < |C.TYPE_context|) - -- if (|mut*{mut}| = |zt*{zt}|) - -- if (|val*{val}| = |zt*{zt}|) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpack(zt)) = ?(val)))*{val zt} + -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) + -- if (|val*{val : val}| = |zt*{zt : storagetype}|) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 6-typing.watsup:765.1-769.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: - `%|-%:%`(C, STRUCT.GET_instr(sx?{sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) + `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) -- if (x.`%`.0 < |C.TYPE_context|) - -- if (i < |yt*{yt}|) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(mut, zt)) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + -- if (i < |yt*{yt : fieldtype}|) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + -- if (yt*{yt : fieldtype}[i] = `%%`(mut, zt)) + -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:771.1-774.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)], [])) -- if (x.`%`.0 < |C.TYPE_context|) - -- if (i < |yt*{yt}|) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) + -- if (i < |yt*{yt : fieldtype}|) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + -- if (yt*{yt : fieldtype}[i] = `%%`(`MUT%?`(?(())), zt)) ;; 6-typing.watsup:779.1-781.41 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: @@ -25082,10 +25082,10 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:803.1-806.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) -- if (x.`%`.0 < |C.TYPE_context|) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:808.1-810.41 rule array.set{C : context, x : idx, zt : storagetype}: @@ -25169,8 +25169,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:870.1-872.22 rule vshuffle{C : context, imm : imm, N : N, i* : nat*}: - `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) - -- (if (i < (N * 2)))*{i} + `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + -- (if (i < (N * 2)))*{i : nat} ;; 6-typing.watsup:874.1-875.48 rule vsplat{C : context, lnn : lnn, N : N}: @@ -25178,7 +25178,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:878.1-880.14 rule vextract_lane{C : context, lnn : lnn, N : N, sx? : sx?, i : nat}: - `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) + `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) -- if (i < N) ;; 6-typing.watsup:882.1-884.14 @@ -25208,7 +25208,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:902.1-903.55 rule vcvtop{C : context, sh : shape, vcvtop : vcvtop, hf? : half?, sx? : sx?, zero : zero}: - `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf}, sh, sx?{sx}, zero), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`([V128_valtype], [V128_valtype])) ;; 6-typing.watsup:905.1-906.44 rule vnarrow{C : context, sh : ishape, sx : sx}: @@ -25340,22 +25340,22 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1011.1-1016.29 rule load{C : context, nt : numtype, n? : n?, sx? : sx?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) -- if (x.`%`.0 < |C.MEM_context|) - -- if ((n?{n} = ?()) <=> (sx?{sx} = ?())) + -- if ((n?{n : n} = ?()) <=> (sx?{sx : sx} = ?())) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} + -- if ((n?{n : n} = ?()) \/ (nt = (inn : inn <: numtype))) ;; 6-typing.watsup:1018.1-1023.29 rule store{C : context, nt : numtype, n? : n?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) + `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) -- if (x.`%`.0 < |C.MEM_context|) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} + -- if ((n?{n : n} = ?()) \/ (nt = (inn : inn <: numtype))) ;; 6-typing.watsup:1025.1-1028.30 rule vload{C : context, M : M, N : N, sx : sx, x : idx, n_A : n, n_O : n, mt : memtype}: @@ -25405,8 +25405,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) relation Instrf_ok: `%|-%:%`(context, instr, instrtype) ;; 6-typing.watsup:518.1-520.41 rule instr{C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1 : valtype}, [], t_2*{t_2 : valtype})) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:924.1-926.28 rule local.set{C : context, x : idx, t : valtype, init : init}: @@ -25428,33 +25428,33 @@ relation Instrs_ok: `%|-%*_:%`(context, instr*, instrtype) ;; 6-typing.watsup:525.1-530.52 rule seq{C : context, instr_1 : instr, instr_2* : instr*, t_1* : valtype*, x_1* : idx*, x_2* : idx*, t_3* : valtype*, init* : init*, t* : valtype*, C' : context, t_2* : valtype*}: - `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_1*{x_1} :: x_2*{x_2}, t_3*{t_3})) - -- if (|init*{init}| = |t*{t}|) - -- if (|init*{init}| = |x_1*{x_1}|) - -- (if (x_1.`%`.0 < |C.LOCAL_context|))*{init t x_1} - -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init t x_1} - -- if (C' = $with_locals(C, x_1*{x_1}, `%%`(SET_init, t)*{t})) - -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2}, `%->%*%`(t_2*{t_2}, x_2*{x_2}, t_3*{t_3})) + `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + -- if (|init*{init : init}| = |t*{t : valtype}|) + -- if (|init*{init : init}| = |x_1*{x_1 : idx}|) + -- (if (x_1.`%`.0 < |C.LOCAL_context|))*{init : init t : valtype x_1 : idx} + -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init : init t : valtype x_1 : idx} + -- if (C' = $with_locals(C, x_1*{x_1 : localidx}, `%%`(SET_init, t)*{t : valtype})) + -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2 : instr}, `%->%*%`(t_2*{t_2 : valtype}, x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) ;; 6-typing.watsup:532.1-535.35 rule sub{C : context, instr* : instr*, it' : instrtype, it : instrtype}: - `%|-%*_:%`(C, instr*{instr}, it') - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, it) + `%|-%*_:%`(C, instr*{instr : instr}, it') + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, it) -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:537.1-539.47 rule frame{C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, x* : idx*, t_2* : valtype*}: - `%|-%*_:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t*{t : valtype} :: t_1*{t_1 : valtype}, x*{x : localidx}, t*{t : valtype} :: t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) } ;; 6-typing.watsup relation Expr_ok: `%|-%:%`(context, expr, resulttype) ;; 6-typing.watsup rule _{C : context, instr* : instr*, t* : valtype*}: - `%|-%:%`(C, instr*{instr}, t*{t}) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, `%->%*%`([], [], t*{t})) + `%|-%:%`(C, instr*{instr : instr}, t*{t : valtype}) + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`([], [], t*{t : valtype})) ;; 6-typing.watsup rec { @@ -25464,7 +25464,7 @@ def $in_binop(numtype : numtype, binop_ : binop_(numtype), binop_(numtype)*) : b ;; 6-typing.watsup:1087.1-1087.42 def $in_binop{nt : numtype, binop : binop_(nt), epsilon : binop_(nt)*}(nt, binop, epsilon) = false ;; 6-typing.watsup:1088.1-1088.99 - def $in_binop{nt : numtype, binop : binop_(nt), ibinop_1 : binop_(nt), ibinop'* : binop_(nt)*}(nt, binop, [ibinop_1] :: ibinop'*{ibinop'}) = ((binop = ibinop_1) \/ $in_binop(nt, binop, ibinop'*{ibinop'})) + def $in_binop{nt : numtype, binop : binop_(nt), ibinop_1 : binop_(nt), ibinop'* : binop_(nt)*}(nt, binop, [ibinop_1] :: ibinop'*{ibinop' : binop_(nt)}) = ((binop = ibinop_1) \/ $in_binop(nt, binop, ibinop'*{ibinop' : binop_(nt)})) } ;; 6-typing.watsup @@ -25475,7 +25475,7 @@ def $in_numtype(numtype : numtype, numtype*) : bool ;; 6-typing.watsup:1083.1-1083.37 def $in_numtype{nt : numtype, epsilon : numtype*}(nt, epsilon) = false ;; 6-typing.watsup:1084.1-1084.68 - def $in_numtype{nt : numtype, nt_1 : numtype, nt'* : numtype*}(nt, [nt_1] :: nt'*{nt'}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt'})) + def $in_numtype{nt : numtype, nt_1 : numtype, nt'* : numtype*}(nt, [nt_1] :: nt'*{nt' : numtype}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt' : numtype})) } ;; 6-typing.watsup @@ -25512,8 +25512,8 @@ relation Instr_const: `%|-%CONST`(context, instr) relation Expr_const: `%|-%CONST`(context, expr) ;; 6-typing.watsup rule _{C : context, instr* : instr*}: - `%|-%CONST`(C, instr*{instr}) - -- (Instr_const: `%|-%CONST`(C, instr))*{instr} + `%|-%CONST`(C, instr*{instr : instr}) + -- (Instr_const: `%|-%CONST`(C, instr))*{instr : instr} ;; 6-typing.watsup relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) @@ -25527,10 +25527,10 @@ relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) relation Type_ok: `%|-%:%*`(context, type, deftype*) ;; 6-typing.watsup rule _{C : context, rectype : rectype, dt* : deftype*, x : idx}: - `%|-%:%*`(C, TYPE(rectype), dt*{dt}) + `%|-%:%*`(C, TYPE(rectype), dt*{dt : deftype}) -- if (x = `%`(|C.TYPE_context|)) - -- if (dt*{dt} = $rolldt(x, rectype)) - -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt}], rectype, OK_oktypeidx(x)) + -- if (dt*{dt : deftype} = $rolldt(x, rectype)) + -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt : deftype}], rectype, OK_oktypeidx(x)) ;; 6-typing.watsup relation Local_ok: `%|-%:%`(context, local, localtype) @@ -25548,12 +25548,12 @@ relation Local_ok: `%|-%:%`(context, local, localtype) relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup rule _{C : context, x : idx, local* : local*, expr : expr, t_1* : valtype*, t_2* : valtype*, lt* : localtype*}: - `%|-%:%`(C, `FUNC%%*%`(x, local*{local}, expr), C.TYPE_context[x.`%`.0]) + `%|-%:%`(C, `FUNC%%*%`(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) -- if (x.`%`.0 < |C.TYPE_context|) - -- if (|local*{local}| = |lt*{lt}|) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- (Local_ok: `%|-%:%`(C, local, lt))*{local lt} - -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1} :: lt*{lt}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2})}, expr, t_2*{t_2}) + -- if (|local*{local : local}| = |lt*{lt : localtype}|) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- (Local_ok: `%|-%:%`(C, local, lt))*{local : local lt : localtype} + -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2 : valtype})}, expr, t_2*{t_2 : valtype}) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -25601,8 +25601,8 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup rule _{C : context, rt : reftype, expr* : expr*, elemmode : elemmode}: - `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr}, elemmode), rt) - -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr} + `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr : expr}, elemmode), rt) + -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr : expr} -- Elemmode_ok: `%|-%:%`(C, elemmode, rt) ;; 6-typing.watsup @@ -25622,7 +25622,7 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) relation Data_ok: `%|-%:_OK`(context, data) ;; 6-typing.watsup rule _{C : context, b* : byte*, datamode : datamode}: - `%|-%:_OK`(C, `DATA%*%`(b*{b}, datamode)) + `%|-%:_OK`(C, `DATA%*%`(b*{b : byte}, datamode)) -- Datamode_ok: `%|-%:_OK`(C, datamode) ;; 6-typing.watsup @@ -25684,9 +25684,9 @@ relation Globals_ok: `%|-%*_:%*`(context, global*, globaltype*) ;; 6-typing.watsup:1275.1-1278.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: - `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt}) + `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) - -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt}) + -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) } ;; 6-typing.watsup @@ -25700,38 +25700,38 @@ relation Types_ok: `%|-%*_:%*`(context, type*, deftype*) ;; 6-typing.watsup:1267.1-1270.49 rule cons{C : context, type_1 : type, type* : type*, dt_1 : deftype, dt* : deftype*}: - `%|-%*_:%*`(C, [type_1] :: type*{type}, dt_1*{} :: dt*{dt}) + `%|-%*_:%*`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, dt*{dt}) + -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) } ;; 6-typing.watsup relation Module_ok: `|-%:_OK`(module) ;; 6-typing.watsup rule _{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data^n : data^n, n : n, start? : start?, export* : export*, dt'* : deftype*, ixt* : externtype*, C' : context, gt* : globaltype*, tt* : tabletype*, mt* : memtype*, C : context, dt* : deftype*, rt* : reftype*, et* : externtype*, idt* : deftype*, igt* : globaltype*, itt* : tabletype*, imt* : memtype*}: - `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type}, import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data^n{data}, start?{start}, export*{export})) - -- if (|import*{import}| = |ixt*{ixt}|) - -- if (|table*{table}| = |tt*{tt}|) - -- if (|mem*{mem}| = |mt*{mt}|) - -- if (|dt*{dt}| = |func*{func}|) - -- if (|elem*{elem}| = |rt*{rt}|) - -- if (|et*{et}| = |export*{export}|) - -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type}, dt'*{dt'}) - -- (Import_ok: `%|-%:%`({TYPE dt'*{dt'}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import ixt} - -- Globals_ok: `%|-%*_:%*`(C', global*{global}, gt*{gt}) - -- (Table_ok: `%|-%:%`(C', table, tt))*{table tt} - -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem mt} - -- (Func_ok: `%|-%:%`(C, func, dt))*{dt func} - -- (Elem_ok: `%|-%:%`(C, elem, rt))*{elem rt} - -- (Data_ok: `%|-%:_OK`(C, data))^n{data} - -- (Start_ok: `%|-%:_OK`(C, start))?{start} - -- (Export_ok: `%|-%:%`(C, export, et))*{et export} - -- if (C = {TYPE dt'*{dt'}, REC [], FUNC idt*{idt} :: dt*{dt}, GLOBAL igt*{igt} :: gt*{gt}, TABLE itt*{itt} :: tt*{tt}, MEM imt*{imt} :: mt*{mt}, ELEM rt*{rt}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) - -- if (C' = {TYPE dt'*{dt'}, REC [], FUNC idt*{idt} :: dt*{dt}, GLOBAL igt*{igt}, TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}) - -- if (idt*{idt} = $funcsxt(ixt*{ixt})) - -- if (igt*{igt} = $globalsxt(ixt*{ixt})) - -- if (itt*{itt} = $tablesxt(ixt*{ixt})) - -- if (imt*{imt} = $memsxt(ixt*{ixt})) + `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) + -- if (|import*{import : import}| = |ixt*{ixt : externtype}|) + -- if (|table*{table : table}| = |tt*{tt : tabletype}|) + -- if (|mem*{mem : mem}| = |mt*{mt : memtype}|) + -- if (|dt*{dt : deftype}| = |func*{func : func}|) + -- if (|elem*{elem : elem}| = |rt*{rt : reftype}|) + -- if (|et*{et : externtype}| = |export*{export : export}|) + -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) + -- (Import_ok: `%|-%:%`({TYPE dt'*{dt' : deftype}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import : import ixt : externtype} + -- Globals_ok: `%|-%*_:%*`(C', global*{global : global}, gt*{gt : globaltype}) + -- (Table_ok: `%|-%:%`(C', table, tt))*{table : table tt : tabletype} + -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem : mem mt : memtype} + -- (Func_ok: `%|-%:%`(C, func, dt))*{dt : deftype func : func} + -- (Elem_ok: `%|-%:%`(C, elem, rt))*{elem : elem rt : reftype} + -- (Data_ok: `%|-%:_OK`(C, data))^n{data : data} + -- (Start_ok: `%|-%:_OK`(C, start))?{start : start} + -- (Export_ok: `%|-%:%`(C, export, et))*{et : externtype export : export} + -- if (C = {TYPE dt'*{dt' : deftype}, REC [], FUNC idt*{idt : deftype} :: dt*{dt : deftype}, GLOBAL igt*{igt : globaltype} :: gt*{gt : globaltype}, TABLE itt*{itt : tabletype} :: tt*{tt : tabletype}, MEM imt*{imt : memtype} :: mt*{mt : memtype}, ELEM rt*{rt : elemtype}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) + -- if (C' = {TYPE dt'*{dt' : deftype}, REC [], FUNC idt*{idt : deftype} :: dt*{dt : deftype}, GLOBAL igt*{igt : globaltype}, TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}) + -- if (idt*{idt : deftype} = $funcsxt(ixt*{ixt : externtype})) + -- if (igt*{igt : globaltype} = $globalsxt(ixt*{ixt : externtype})) + -- if (itt*{itt : tabletype} = $tablesxt(ixt*{ixt : externtype})) + -- if (imt*{imt : memtype} = $memsxt(ixt*{ixt : externtype})) ;; 7-runtime-typing.watsup relation Ref_ok: `%|-%:%`(store, ref, reftype) @@ -25785,35 +25785,35 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule select-true{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_1 : val <: admininstr)]) + `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule select-false{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_2 : val <: admininstr)]) + `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule if-true{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) + `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule if-false{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) + `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule label-vals{n : n, instr* : instr*, val* : val*}: - `%*_~>%*`([LABEL__admininstr(n, instr*{instr}, (val : val <: admininstr)*{val})], (val : val <: admininstr)*{val}) + `%*_~>%*`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) ;; 8-reduction.watsup rule br-zero{n : n, instr'* : instr*, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)^n{val} :: (instr' : instr <: admininstr)*{instr'}) + `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule br-succ{n : n, instr'* : instr*, val* : val*, l : labelidx, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val : val <: admininstr)*{val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)*{val} :: [BR_admininstr(l)]) + `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) ;; 8-reduction.watsup rule br_if-true{c : num_(I32_numtype), l : labelidx}: @@ -25827,13 +25827,13 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule br_table-lt{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) - -- if (i < |l*{l}|) + `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) + -- if (i < |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_table-ge{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) - -- if (i >= |l*{l}|) + `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) + -- if (i >= |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_on_null-null{val : val, l : labelidx, ht : heaptype}: @@ -25865,15 +25865,15 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule frame-vals{n : n, f : frame, val^n : val^n}: - `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val})], (val : val <: admininstr)^n{val}) + `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-frame{n : n, f : frame, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)^n{val}) + `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-label{k : nat, instr'* : instr*, val* : val*, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(k, instr'*{instr'}, (val : val <: admininstr)*{val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)*{val} :: [RETURN_admininstr]) + `%*_~>%*`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) ;; 8-reduction.watsup rule unop-val{nt : numtype, c_1 : num_(nt), unop : unop_(nt), c : num_(nt)}: @@ -25907,13 +25907,13 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?, c : num_(nt_2)}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx}, c_1) = [c]) + `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) + -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = [c]) ;; 8-reduction.watsup rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx}, c_1) = []) + `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) + -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: @@ -26002,19 +26002,19 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vswizzle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn : inn, N : N, c' : vec_(V128_vnn), c : iN($size((inn : inn <: numtype))), ci* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*, k^N : nat^N}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) - -- (if (ci*{ci}[k].`%`.0 < |c*{}|))^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i})], [VCONST_admininstr(V128_vectype, c)]) - -- (if (i*{i}[k] < |c'*{}|))^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) + -- (if (i*{i : nat}[k] < |c'*{}|))^(k%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vshiftop{c_1 : vec_(V128_vnn), n : n, imm : imm, N : N, vshiftop : vshiftop_(`%X%`(imm, `%`(N))), c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) - -- if (c'*{c'} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1)) - -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c'})) + -- if (c'*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1)) + -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))})) ;; 8-reduction.watsup rule vtestop-true{c : vec_(V128_vnn), inn : inn, N : N, ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) - -- (if (ci_1 =/= `%`(0)))*{ci_1} + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) + -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), inn : inn, N : N}: @@ -26078,35 +26078,35 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vbitmask{c : vec_(V128_vnn), inn : inn, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) - -- if ($ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1}) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) + -- if ($ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($size((inn : inn <: numtype)))}) ;; 8-reduction.watsup rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn_1 : inn, N_1 : N, inn_2 : inn, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, cj_1* : iN($size((inn_2 : inn <: numtype)))*, cj_2* : iN($size((inn_2 : inn <: numtype)))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) - -- if (ci_2*{ci_2} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2)) - -- if (cj_1*{cj_1} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1}) - -- if (cj_2*{cj_2} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_2)*{ci_2}) - -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), cj_1*{cj_1} :: cj_2*{cj_2})) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) + -- if (ci_2*{ci_2 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2)) + -- if (cj_1*{cj_1 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1 : iN($size((inn_1 : inn <: numtype)))}) + -- if (cj_2*{cj_2 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_2)*{ci_2 : iN($size((inn_1 : inn <: numtype)))}) + -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), cj_1*{cj_1 : lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), `%`(N_2))))} :: cj_2*{cj_2 : lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), `%`(N_2))))})) ;; 8-reduction.watsup rule vcvtop-normal{c_1 : vec_(V128_vnn), lnn_2 : lnn, N_2 : N, vcvtop : vcvtop, lnn_1 : lnn, N_1 : N, sx : sx, c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- if (c'*{c'} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1)) - -- if (c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c'})) + -- if (c'*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1)) + -- if (c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-half{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, hf : half, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci*{ci} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) - -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx}, ci)*{ci})) + `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) + -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-zero{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci*{ci} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) - -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx}, ci)*{ci} :: `%`(0)^N_1{})) + `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) + -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} :: `%`(0)^N_1{})) ;; 8-reduction.watsup rule vextunop{c_1 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: @@ -26136,13 +26136,13 @@ def $blocktype(state : state, blocktype : blocktype) : functype relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule block{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, n : n, t_1^k : valtype^k, t_2^n : valtype^n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val} :: (instr : instr <: admininstr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) ;; 8-reduction.watsup rule loop{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, t_1^k : valtype^k, t_2^n : valtype^n, n : n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], (val : val <: admininstr)^k{val} :: (instr : instr <: admininstr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) ;; 8-reduction.watsup rule br_on_cast-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: @@ -26173,16 +26173,16 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule call_ref-null{z : state, ht : heaptype, x? : idx?}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule call_ref-func{z : state, val^n : val^n, n : n, a : addr, x? : idx?, m : m, f : frame, instr* : instr*, fi : funcinst, t_1^n : valtype^n, t_2^m : valtype^m, y : idx, t* : valtype*}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr})])]) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) -- if (a < |$funcinst(z)|) -- if ($funcinst(z)[a] = fi) - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) - -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) + -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t : valtype}, instr*{instr : instr})) + -- if (f = {LOCAL ?(val)^n{val : val} :: $default(t)*{t : valtype}, MODULE fi.MODULE_funcinst}) ;; 8-reduction.watsup rule return_call{z : state, x : idx}: @@ -26191,17 +26191,17 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule return_call_ref-label{z : state, k : nat, instr'* : instr*, val* : val*, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, (val : val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), (val : val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) + `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) ;; 8-reduction.watsup rule return_call_ref-frame-addr{z : state, k : nat, f : frame, val'* : val*, val^n : val^n, n : n, a : addr, x? : idx?, instr* : instr*, t_1^n : valtype^n, t_2^m : valtype^m, m : m}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) -- if (a < |$funcinst(z)|) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) ;; 8-reduction.watsup rule return_call_ref-frame-null{z : state, k : nat, f : frame, val* : val*, ht : heaptype, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule ref.func{z : state, x : idx}: @@ -26232,25 +26232,25 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule struct.new_default{z : state, x : idx, val* : val*, mut* : mut*, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val} :: [STRUCT.NEW_admininstr(x)]) - -- if (|mut*{mut}| = |zt*{zt}|) - -- if (|val*{val}| = |zt*{zt}|) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpack(zt)) = ?(val)))*{val zt} + `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) + -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) + -- if (|val*{val : val}| = |zt*{zt : storagetype}|) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 8-reduction.watsup rule struct.get-null{z : state, ht : heaptype, sx? : sx?, x : idx, i : nat}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, `%`(i))]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) ;; 8-reduction.watsup rule struct.get-struct{z : state, a : addr, sx? : sx?, x : idx, i : nat, zt* : storagetype*, si : structinst, mut* : mut*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, `%`(i))]), [($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]) : val <: admininstr)]) + `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) -- if (a < |$structinst(z)|) - -- if (|mut*{mut}| = |zt*{zt}|) - -- if (i < |zt*{zt}|) + -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) + -- if (i < |zt*{zt : storagetype}|) -- if (i < |si.FIELD_structinst|) -- if ($structinst(z)[a] = si) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) ;; 8-reduction.watsup rule array.new{z : state, val : val, n : n, x : idx}: @@ -26269,8 +26269,8 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.new_elem-alloc{z : state, i : nat, n : n, x : idx, y : idx, ref^n : ref^n}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- if (ref^n{ref : ref} = $elem(z, y).ELEM_eleminst[i : n]) ;; 8-reduction.watsup rule array.new_data-oob{z : state, i : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: @@ -26280,33 +26280,33 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.new_data-num{z : state, i : nat, n : n, x : idx, y : idx, nt : numtype, c^n : num_(nt)^n, mut : mut, zt : storagetype, o0 : numtype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- if ($nunpack(zt) = ?(o0)) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (nt = o0) - -- if ($concat_(syntax byte, $nbytes(nt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) + -- if ($concat_(syntax byte, $nbytes(nt, c)^n{c : num_(nt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) ;; 8-reduction.watsup rule array.new_data-vec{z : state, i : nat, n : n, x : idx, y : idx, vt : vectype, c^n : vec_(vt)^n, mut : mut, zt : storagetype, o0 : vectype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- if ($vunpack(zt) = ?(o0)) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (vt = o0) - -- if ($concat_(syntax byte, $vbytes(vt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) + -- if ($concat_(syntax byte, $vbytes(vt, c)^n{c : vec_(vt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) ;; 8-reduction.watsup rule array.get-null{z : state, ht : heaptype, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.get-oob{z : state, a : addr, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) -- if (a < |$arrayinst(z)|) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.get-array{z : state, a : addr, i : nat, sx? : sx?, x : idx, zt : storagetype, fv : fieldval, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [($unpackval(zt, sx?{sx}, fv) : val <: admininstr)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) -- if (i < |$arrayinst(z)[a].FIELD_arrayinst|) -- if (a < |$arrayinst(z)|) -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) @@ -26371,18 +26371,18 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.copy-le{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) + -- if (sx?{sx : sx} = $sxfield(zt_2)) -- if (i_1 <= i_2) ;; 8-reduction.watsup rule array.copy-gt{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) + -- if (sx?{sx : sx} = $sxfield(zt_2)) ;; 8-reduction.watsup rule array.init_elem-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: @@ -26569,9 +26569,9 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule vload-shape-val{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop, c : vec_(V128_vnn), j^N : nat^N, k^N : nat^N, inn : inn}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) - -- (if ($ibytes(M, `%`(j)) = $mem(z, x).DATA_meminst[((i + mo.OFFSET_memop.`%`.0) + ((k * M) / 8)) : (M / 8)]))^(k%*`(config, admininstr*) relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule pure{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr'})) - -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr}, (instr' : instr <: admininstr)*{instr'}) + `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule read{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr'})) - -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), (instr' : instr <: admininstr)*{instr'}) + `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule struct.new{z : state, val^n : val^n, n : n, x : idx, si : structinst, mut^n : mut^n, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) - -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) + `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut : mut zt : storagetype})) + -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val zt : storagetype}}) ;; 8-reduction.watsup rule struct.set-null{z : state, ht : heaptype, val : val, x : idx, i : nat}: @@ -26696,16 +26696,16 @@ relation Step: `%~>%`(config, config) rule struct.set-struct{z : state, a : addr, val : val, x : idx, i : nat, fv : fieldval, mut* : mut*, zt* : storagetype*}: `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`($with_struct(z, a, i, fv), [])) -- if (a < |$structinst(z)|) - -- if (|mut*{mut}| = |zt*{zt}|) - -- if (i < |zt*{zt}|) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- if (fv = $packval(zt*{zt}[i], val)) + -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) + -- if (i < |zt*{zt : storagetype}|) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- if (fv = $packval(zt*{zt : storagetype}[i], val)) ;; 8-reduction.watsup rule array.new_fixed{z : state, val^n : val^n, n : n, x : idx, ai : arrayinst, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) + -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val}}) ;; 8-reduction.watsup rule array.set-null{z : state, ht : heaptype, i : nat, val : val, x : idx}: @@ -26763,8 +26763,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule store-num-val{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b}), [])) - -- if (b*{b} = $nbytes(nt, c)) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) + -- if (b*{b : byte} = $nbytes(nt, c)) ;; 8-reduction.watsup rule store-pack-oob{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop}: @@ -26773,8 +26773,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule store-pack-val{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b}), [])) - -- if (b*{b} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c))) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) + -- if (b*{b : byte} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c))) ;; 8-reduction.watsup rule vstore-oob{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop}: @@ -26783,8 +26783,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule vstore-val{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b}), [])) - -- if (b*{b} = $vbytes(V128_vectype, c)) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) + -- if (b*{b : byte} = $vbytes(V128_vectype, c)) ;; 8-reduction.watsup rule vstore_lane-oob{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: @@ -26793,11 +26793,11 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule vstore_lane-val{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, b* : byte*, imm : imm, M : M}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b}), [])) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) -- if (j < |$lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)|) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = (128 / N)) - -- if (b*{b} = $ibytes(N, `%`($lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)[j].`%`.0))) + -- if (b*{b : byte} = $ibytes(N, `%`($lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)[j].`%`.0))) ;; 8-reduction.watsup rule memory.grow-succeed{z : state, n : n, x : idx, mi : meminst, o0 : meminst}: @@ -26820,21 +26820,21 @@ rec { relation Steps: `%~>*%`(config, config) ;; 8-reduction.watsup:18.1-19.36 rule refl{z : state, admininstr* : admininstr*}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) + `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z, admininstr*{admininstr : admininstr})) ;; 8-reduction.watsup:21.1-24.53 rule trans{z : state, admininstr* : admininstr*, z'' : state, admininstr''* : admininstr*, z' : state, admininstr' : admininstr}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z'', admininstr''*{admininstr''})) - -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z', admininstr'*{})) - -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr''})) + `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) + -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z', admininstr'*{})) + -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) } ;; 8-reduction.watsup relation Eval_expr: `%;%~>*%;%*`(state, expr, state, val*) ;; 8-reduction.watsup rule _{z : state, instr* : instr*, z' : state, val* : val*}: - `%;%~>*%;%*`(z, instr*{instr}, z', val*{val}) - -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z', (val : val <: admininstr)*{val})) + `%;%~>*%;%*`(z, instr*{instr : instr}, z', val*{val : val}) + -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z', (val : val <: admininstr)*{val : val})) ;; 9-module.watsup rec { @@ -26844,18 +26844,18 @@ def $alloctypes(type*) : deftype* ;; 9-module.watsup:8.1-8.27 def $alloctypes([]) = [] ;; 9-module.watsup:9.1-13.24 - def $alloctypes{type'* : type*, type : type, deftype'* : deftype*, deftype* : deftype*, rectype : rectype, x : idx}(type'*{type'} :: [type]) = deftype'*{deftype'} :: deftype*{deftype} - -- if (deftype'*{deftype'} = $alloctypes(type'*{type'})) + def $alloctypes{type'* : type*, type : type, deftype'* : deftype*, deftype* : deftype*, rectype : rectype, x : idx}(type'*{type' : type} :: [type]) = deftype'*{deftype' : deftype} :: deftype*{deftype : deftype} + -- if (deftype'*{deftype' : deftype} = $alloctypes(type'*{type' : type})) -- if (type = TYPE(rectype)) - -- if (deftype*{deftype} = $subst_all_deftypes($rolldt(x, rectype), (deftype' : deftype <: heaptype)*{deftype'})) - -- if (x = `%`(|deftype'*{deftype'}|)) + -- if (deftype*{deftype : deftype} = $subst_all_deftypes($rolldt(x, rectype), (deftype' : deftype <: heaptype)*{deftype' : deftype})) + -- if (x = `%`(|deftype'*{deftype' : deftype}|)) } ;; 9-module.watsup def $allocfunc(store : store, moduleinst : moduleinst, func : func) : (store, funcaddr) ;; 9-module.watsup def $allocfunc{s : store, mm : moduleinst, func : func, fi : funcinst, x : idx, local* : local*, expr : expr}(s, mm, func) = (s[FUNC_store =.. [fi]], |s.FUNC_store|) - -- if (func = `FUNC%%*%`(x, local*{local}, expr)) + -- if (func = `FUNC%%*%`(x, local*{local : local}, expr)) -- if (fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func}) ;; 9-module.watsup @@ -26866,9 +26866,9 @@ def $allocfuncs(store : store, moduleinst : moduleinst, func*) : (store, funcadd ;; 9-module.watsup:21.1-21.39 def $allocfuncs{s : store, mm : moduleinst}(s, mm, []) = (s, []) ;; 9-module.watsup:22.1-24.51 - def $allocfuncs{s : store, mm : moduleinst, func : func, func'* : func*, s_2 : store, fa : funcaddr, fa'* : funcaddr*, s_1 : store}(s, mm, [func] :: func'*{func'}) = (s_2, [fa] :: fa'*{fa'}) + def $allocfuncs{s : store, mm : moduleinst, func : func, func'* : func*, s_2 : store, fa : funcaddr, fa'* : funcaddr*, s_1 : store}(s, mm, [func] :: func'*{func' : func}) = (s_2, [fa] :: fa'*{fa' : funcaddr}) -- if ((s_1, fa) = $allocfunc(s, mm, func)) - -- if ((s_2, fa'*{fa'}) = $allocfuncs(s_1, mm, func'*{func'})) + -- if ((s_2, fa'*{fa' : funcaddr}) = $allocfuncs(s_1, mm, func'*{func' : func})) } ;; 9-module.watsup @@ -26885,9 +26885,9 @@ def $allocglobals(store : store, globaltype*, val*) : (store, globaladdr*) ;; 9-module.watsup:31.1-31.42 def $allocglobals{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:32.1-34.62 - def $allocglobals{s : store, globaltype : globaltype, globaltype'* : globaltype*, val : val, val'* : val*, s_2 : store, ga : globaladdr, ga'* : globaladdr*, s_1 : store}(s, [globaltype] :: globaltype'*{globaltype'}, [val] :: val'*{val'}) = (s_2, [ga] :: ga'*{ga'}) + def $allocglobals{s : store, globaltype : globaltype, globaltype'* : globaltype*, val : val, val'* : val*, s_2 : store, ga : globaladdr, ga'* : globaladdr*, s_1 : store}(s, [globaltype] :: globaltype'*{globaltype' : globaltype}, [val] :: val'*{val' : val}) = (s_2, [ga] :: ga'*{ga' : globaladdr}) -- if ((s_1, ga) = $allocglobal(s, globaltype, val)) - -- if ((s_2, ga'*{ga'}) = $allocglobals(s_1, globaltype'*{globaltype'}, val'*{val'})) + -- if ((s_2, ga'*{ga' : globaladdr}) = $allocglobals(s_1, globaltype'*{globaltype' : globaltype}, val'*{val' : val})) } ;; 9-module.watsup @@ -26904,9 +26904,9 @@ def $alloctables(store : store, tabletype*, ref*) : (store, tableaddr*) ;; 9-module.watsup:41.1-41.41 def $alloctables{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:42.1-44.60 - def $alloctables{s : store, tabletype : tabletype, tabletype'* : tabletype*, ref : ref, ref'* : ref*, s_2 : store, ta : tableaddr, ta'* : tableaddr*, s_1 : store}(s, [tabletype] :: tabletype'*{tabletype'}, [ref] :: ref'*{ref'}) = (s_2, [ta] :: ta'*{ta'}) + def $alloctables{s : store, tabletype : tabletype, tabletype'* : tabletype*, ref : ref, ref'* : ref*, s_2 : store, ta : tableaddr, ta'* : tableaddr*, s_1 : store}(s, [tabletype] :: tabletype'*{tabletype' : tabletype}, [ref] :: ref'*{ref' : ref}) = (s_2, [ta] :: ta'*{ta' : tableaddr}) -- if ((s_1, ta) = $alloctable(s, tabletype, ref)) - -- if ((s_2, ta'*{ta'}) = $alloctables(s_1, tabletype'*{tabletype'}, ref'*{ref'})) + -- if ((s_2, ta'*{ta' : tableaddr}) = $alloctables(s_1, tabletype'*{tabletype' : tabletype}, ref'*{ref' : ref})) } ;; 9-module.watsup @@ -26923,16 +26923,16 @@ def $allocmems(store : store, memtype*) : (store, memaddr*) ;; 9-module.watsup:51.1-51.34 def $allocmems{s : store}(s, []) = (s, []) ;; 9-module.watsup:52.1-54.49 - def $allocmems{s : store, memtype : memtype, memtype'* : memtype*, s_2 : store, ma : memaddr, ma'* : memaddr*, s_1 : store}(s, [memtype] :: memtype'*{memtype'}) = (s_2, [ma] :: ma'*{ma'}) + def $allocmems{s : store, memtype : memtype, memtype'* : memtype*, s_2 : store, ma : memaddr, ma'* : memaddr*, s_1 : store}(s, [memtype] :: memtype'*{memtype' : memtype}) = (s_2, [ma] :: ma'*{ma' : memaddr}) -- if ((s_1, ma) = $allocmem(s, memtype)) - -- if ((s_2, ma'*{ma'}) = $allocmems(s_1, memtype'*{memtype'})) + -- if ((s_2, ma'*{ma' : memaddr}) = $allocmems(s_1, memtype'*{memtype' : memtype})) } ;; 9-module.watsup def $allocelem(store : store, reftype : reftype, ref*) : (store, elemaddr) ;; 9-module.watsup - def $allocelem{s : store, rt : reftype, ref* : ref*, ei : eleminst}(s, rt, ref*{ref}) = (s[ELEM_store =.. [ei]], |s.ELEM_store|) - -- if (ei = {TYPE rt, ELEM ref*{ref}}) + def $allocelem{s : store, rt : reftype, ref* : ref*, ei : eleminst}(s, rt, ref*{ref : ref}) = (s[ELEM_store =.. [ei]], |s.ELEM_store|) + -- if (ei = {TYPE rt, ELEM ref*{ref : ref}}) ;; 9-module.watsup rec { @@ -26942,16 +26942,16 @@ def $allocelems(store : store, reftype*, ref**) : (store, elemaddr*) ;; 9-module.watsup:61.1-61.40 def $allocelems{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:62.1-64.55 - def $allocelems{s : store, rt : reftype, rt'* : reftype*, ref* : ref*, ref'** : ref**, s_2 : store, ea : elemaddr, ea'* : elemaddr*, s_1 : store}(s, [rt] :: rt'*{rt'}, [ref*{ref}] :: ref'*{ref'}*{ref'}) = (s_2, [ea] :: ea'*{ea'}) - -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref})) - -- if ((s_2, ea'*{ea'}) = $allocelems(s_2, rt'*{rt'}, ref'*{ref'}*{ref'})) + def $allocelems{s : store, rt : reftype, rt'* : reftype*, ref* : ref*, ref'** : ref**, s_2 : store, ea : elemaddr, ea'* : elemaddr*, s_1 : store}(s, [rt] :: rt'*{rt' : reftype}, [ref*{ref : ref}] :: ref'*{ref' : ref}*{ref' : ref}) = (s_2, [ea] :: ea'*{ea' : elemaddr}) + -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref : ref})) + -- if ((s_2, ea'*{ea' : elemaddr}) = $allocelems(s_2, rt'*{rt' : reftype}, ref'*{ref' : ref}*{ref' : ref})) } ;; 9-module.watsup def $allocdata(store : store, byte*) : (store, dataaddr) ;; 9-module.watsup - def $allocdata{s : store, byte* : byte*, di : datainst}(s, byte*{byte}) = (s[DATA_store =.. [di]], |s.DATA_store|) - -- if (di = {DATA byte*{byte}}) + def $allocdata{s : store, byte* : byte*, di : datainst}(s, byte*{byte : byte}) = (s[DATA_store =.. [di]], |s.DATA_store|) + -- if (di = {DATA byte*{byte : byte}}) ;; 9-module.watsup rec { @@ -26961,92 +26961,92 @@ def $allocdatas(store : store, byte**) : (store, dataaddr*) ;; 9-module.watsup:71.1-71.35 def $allocdatas{s : store}(s, []) = (s, []) ;; 9-module.watsup:72.1-74.50 - def $allocdatas{s : store, byte* : byte*, byte'** : byte**, s_2 : store, da : dataaddr, da'* : dataaddr*, s_1 : store}(s, [byte*{byte}] :: byte'*{byte'}*{byte'}) = (s_2, [da] :: da'*{da'}) - -- if ((s_1, da) = $allocdata(s, byte*{byte})) - -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) + def $allocdatas{s : store, byte* : byte*, byte'** : byte**, s_2 : store, da : dataaddr, da'* : dataaddr*, s_1 : store}(s, [byte*{byte : byte}] :: byte'*{byte' : byte}*{byte' : byte}) = (s_2, [da] :: da'*{da' : dataaddr}) + -- if ((s_1, da) = $allocdata(s, byte*{byte : byte})) + -- if ((s_2, da'*{da' : dataaddr}) = $allocdatas(s_1, byte'*{byte' : byte}*{byte' : byte})) } ;; 9-module.watsup def $instexport(funcaddr*, globaladdr*, tableaddr*, memaddr*, export : export) : exportinst ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa : funcaddr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga : globaladdr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta : tableaddr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma : memaddr}[x.`%`.0])} ;; 9-module.watsup def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) : (store, moduleinst) ;; 9-module.watsup - def $allocmodule{s : store, module : module, externval* : externval*, val_g* : val*, ref_t* : ref*, ref_e** : ref**, s_6 : store, mm : moduleinst, type* : type*, import* : import*, func^n_f : func^n_f, n_f : n, globaltype^n_g : globaltype^n_g, expr_g^n_g : expr^n_g, n_g : n, tabletype^n_t : tabletype^n_t, expr_t^n_t : expr^n_t, n_t : n, memtype^n_m : memtype^n_m, n_m : n, reftype^n_e : reftype^n_e, expr_e*^n_e : expr*^n_e, elemmode^n_e : elemmode^n_e, n_e : n, byte*^n_d : byte*^n_d, datamode^n_d : datamode^n_d, n_d : n, start? : start?, export* : export*, fa_ex* : funcaddr*, ga_ex* : globaladdr*, ta_ex* : tableaddr*, ma_ex* : memaddr*, fa* : funcaddr*, i_f^n_f : nat^n_f, ga* : globaladdr*, i_g^n_g : nat^n_g, ta* : tableaddr*, i_t^n_t : nat^n_t, ma* : memaddr*, i_m^n_m : nat^n_m, ea* : elemaddr*, i_e^n_e : nat^n_e, da* : dataaddr*, i_d^n_d : nat^n_d, xi* : exportinst*, dt* : deftype*, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store}(s, module, externval*{externval}, val_g*{val_g}, ref_t*{ref_t}, ref_e*{ref_e}*{ref_e}) = (s_6, mm) - -- if (module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type}, import*{import}, func^n_f{func}, GLOBAL(globaltype, expr_g)^n_g{expr_g globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t tabletype}, MEMORY(memtype)^n_m{memtype}, `ELEM%%*%`(reftype, expr_e*{expr_e}, elemmode)^n_e{elemmode expr_e reftype}, `DATA%*%`(byte*{byte}, datamode)^n_d{byte datamode}, start?{start}, export*{export})) - -- if (fa_ex*{fa_ex} = $funcsxv(externval*{externval})) - -- if (ga_ex*{ga_ex} = $globalsxv(externval*{externval})) - -- if (ta_ex*{ta_ex} = $tablesxv(externval*{externval})) - -- if (ma_ex*{ma_ex} = $memsxv(externval*{externval})) - -- if (fa*{fa} = (|s.FUNC_store| + i_f)^(i_f*%;%*`(z, expr_G, z, [val_G]))*{expr_G val_G} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T ref_T} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E ref_E}*{expr_E ref_E} - -- if ((s', mm) = $allocmodule(s, module, externval*{externval}, val_G*{val_G}, ref_T*{ref_T}, ref_E*{ref_E}*{ref_E})) + -- (Eval_expr: `%;%~>*%;%*`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} + -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} + -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} + -- if ((s', mm) = $allocmodule(s, module, externval*{externval : externval}, val_G*{val_G : val}, ref_T*{ref_T : ref}, ref_E*{ref_E : ref}*{ref_E : ref})) -- if (f = {LOCAL [], MODULE mm}) - -- if (instr_E*{instr_E} = $concat_(syntax instr, $runelem(elem*{elem}[i], `%`(i))^(i%`(t_1^n{t_1}, t_2*{t_2}))) + -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = `FUNC%%*%`(x, local*{local : local}, expr)) + -- Expand: `%~~%`(s.FUNC_store[fa].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2*{t_2 : valtype}))) ;; A-binary.watsup rec { @@ -27066,7 +27066,7 @@ def $utf8(name : name) : byte* def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([`%`(ch)]) = [b_1 b_2 b_3 b_4] -- if (((65536 <= ch) /\ (ch < 69632)) /\ (ch = (((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128)))) ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(`%`(ch)*{ch}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch}) + def $utf8{ch* : nat*}(`%`(ch)*{ch : nat}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch : nat}) } ;; A-binary.watsup @@ -27086,14 +27086,14 @@ syntax B = nat ;; C-conventions.watsup syntax sym = - | _FIRST(A_1 : A) + | _FIRST{A_1 : A}(A_1 : A) | _DOTS - | _LAST(A_n : A) + | _LAST{A_n : A}(A_n : A) ;; C-conventions.watsup syntax symsplit = - | _FIRST(A_1 : A) - | _LAST(A_2 : A) + | _FIRST{A_1 : A}(A_1 : A) + | _LAST{A_2 : A}(A_2 : A) ;; C-conventions.watsup syntax recorddots = `...` @@ -27101,21 +27101,21 @@ syntax recorddots = `...` ;; C-conventions.watsup syntax record = { - FIELD_1 A, - FIELD_2 A, - DOTS recorddots + FIELD_1{A_1 : A} A, + FIELD_2{A_2 : A} A, + DOTS{recorddots : recorddots} recorddots } ;; C-conventions.watsup syntax recordstar = { - FIELD_1 A*, - FIELD_2 A*, - DOTS recorddots + FIELD_1{A_1* : A*} A*, + FIELD_2{A_2* : A*} A*, + DOTS{recorddots : recorddots} recorddots } ;; C-conventions.watsup -syntax recordeq = `%++%=%`(recordstar : recordstar, recordstar : recordstar, recordstar : recordstar) +syntax recordeq = `%++%=%`{recordstar : recordstar}(recordstar : recordstar, recordstar, recordstar) ;; C-conventions.watsup syntax pth = @@ -27171,7 +27171,7 @@ def $sum(nat*) : nat ;; 0-aux.watsup:33.1-33.18 def $sum([]) = 0 ;; 0-aux.watsup:34.1-34.35 - def $sum{n : n, n'* : n*}([n] :: n'*{n'}) = (n + $sum(n'*{n'})) + def $sum{n : n, n'* : n*}([n] :: n'*{n' : nat}) = (n + $sum(n'*{n' : nat})) } ;; 0-aux.watsup @@ -27182,7 +27182,7 @@ def $concat_(syntax X, X**) : X* ;; 0-aux.watsup:40.1-40.34 def $concat_{syntax X}(syntax X, []) = [] ;; 0-aux.watsup:41.1-41.61 - def $concat_{syntax X, w* : X*, w'** : X**}(syntax X, [w*{w}] :: w'*{w'}*{w'}) = w*{w} :: $concat_(syntax X, w'*{w'}*{w'}) + def $concat_{syntax X, w* : X*, w'** : X**}(syntax X, [w*{w : X}] :: w'*{w' : X}*{w' : X}) = w*{w : X} :: $concat_(syntax X, w'*{w' : X}*{w' : X}) } ;; 1-syntax.watsup @@ -27271,8 +27271,8 @@ syntax fNmag{N : N}(N) = ;; 1-syntax.watsup syntax fN{N : N}(N) = - | POS(fNmag : fNmag(N)) - | NEG(fNmag : fNmag(N)) + | POS{fNmag : fNmag(N)}(fNmag : fNmag(N)) + | NEG{fNmag : fNmag(N)}(fNmag : fNmag(N)) ;; 1-syntax.watsup syntax f32 = fN(32) @@ -27375,7 +27375,7 @@ syntax valtype = | F32 | F64 | V128 - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | BOT ;; 1-syntax.watsup:154.1-155.16 @@ -27389,15 +27389,15 @@ syntax storagetype = | F32 | F64 | V128 - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | I8 | I16 ;; 1-syntax.watsup:175.1-176.18 -syntax fieldtype = `%%`(mut : mut, storagetype : storagetype) +syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) ;; 1-syntax.watsup:178.1-178.70 -syntax functype = `%->%`(resulttype : resulttype, resulttype : resulttype) +syntax functype = `%->%`{resulttype : resulttype}(resulttype : resulttype, resulttype) ;; 1-syntax.watsup:179.1-179.64 syntax structtype = list(syntax fieldtype) @@ -27407,22 +27407,22 @@ syntax arraytype = fieldtype ;; 1-syntax.watsup:182.1-185.18 syntax comptype = - | STRUCT(structtype : structtype) - | ARRAY(arraytype : arraytype) - | FUNC(functype : functype) + | STRUCT{structtype : structtype}(structtype : structtype) + | ARRAY{arraytype : arraytype}(arraytype : arraytype) + | FUNC{functype : functype}(functype : functype) ;; 1-syntax.watsup:189.1-190.60 syntax subtype = - | SUB(fin : fin, typeidx*, comptype : comptype) - | SUBD(fin : fin, heaptype*, comptype : comptype) + | SUB{fin : fin, typeidx* : typeidx*, comptype : comptype}(fin : fin, typeidx*{typeidx : typeidx} : typeidx*, comptype : comptype) + | SUBD{fin : fin, heaptype* : heaptype*, comptype : comptype}(fin : fin, heaptype*{heaptype : heaptype} : heaptype*, comptype : comptype) ;; 1-syntax.watsup:192.1-193.22 syntax rectype = - | REC(list : list(syntax subtype)) + | REC{list : list(syntax subtype)}(list : list(syntax subtype)) ;; 1-syntax.watsup:198.1-199.26 syntax heaptype = - | _IDX(typeidx : typeidx) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY | EQ | I31 @@ -27434,13 +27434,13 @@ syntax heaptype = | EXTERN | NOEXTERN | BOT - | DEF(rectype : rectype, nat : nat) - | REC(n : n) + | DEF{rectype : rectype}(rectype : rectype, nat) + | REC{n : n}(n : n) } ;; 1-syntax.watsup syntax reftype = - | REF(nul : nul, heaptype : heaptype) + | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) ;; 1-syntax.watsup syntax inn = @@ -27493,19 +27493,19 @@ syntax imm = ;; 1-syntax.watsup syntax deftype = - | DEF(rectype : rectype, nat : nat) + | DEF{rectype : rectype}(rectype : rectype, nat) ;; 1-syntax.watsup -syntax limits = `[%..%]`(u32 : u32, u32 : u32) +syntax limits = `[%..%]`{u32 : u32}(u32 : u32, u32) ;; 1-syntax.watsup -syntax globaltype = `%%`(mut : mut, valtype : valtype) +syntax globaltype = `%%`{mut : mut, valtype : valtype}(mut : mut, valtype : valtype) ;; 1-syntax.watsup -syntax tabletype = `%%`(limits : limits, reftype : reftype) +syntax tabletype = `%%`{limits : limits, reftype : reftype}(limits : limits, reftype : reftype) ;; 1-syntax.watsup -syntax memtype = `%I8`(limits : limits) +syntax memtype = `%I8`{limits : limits}(limits : limits) ;; 1-syntax.watsup syntax elemtype = reftype @@ -27515,10 +27515,10 @@ syntax datatype = OK ;; 1-syntax.watsup syntax externtype = - | FUNC(deftype : deftype) - | GLOBAL(globaltype : globaltype) - | TABLE(tabletype : tabletype) - | MEM(memtype : memtype) + | FUNC{deftype : deftype}(deftype : deftype) + | GLOBAL{globaltype : globaltype}(globaltype : globaltype) + | TABLE{tabletype : tabletype}(tabletype : tabletype) + | MEM{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup def $size(numtype : numtype) : nat @@ -27564,7 +27564,7 @@ syntax dim = `%`{i : nat}(i : nat) -- if (((((i = 1) \/ (i = 2)) \/ (i = 4)) \/ (i = 8)) \/ (i = 16)) ;; 1-syntax.watsup -syntax shape = `%X%`(lanetype : lanetype, dim : dim) +syntax shape = `%X%`{lanetype : lanetype, dim : dim}(lanetype : lanetype, dim : dim) ;; 1-syntax.watsup def $lanetype(shape : shape) : lanetype @@ -27632,7 +27632,7 @@ syntax unop_(numtype : numtype) | CLZ | CTZ | POPCNT - | EXTEND(n : n) + | EXTEND{n : n}(n : n) ;; 1-syntax.watsup @@ -27653,13 +27653,13 @@ syntax binop_(numtype : numtype) | ADD | SUB | MUL - | DIV(sx : sx) - | REM(sx : sx) + | DIV{sx : sx}(sx : sx) + | REM{sx : sx}(sx : sx) | AND | OR | XOR | SHL - | SHR(sx : sx) + | SHR{sx : sx}(sx : sx) | ROTL | ROTR @@ -27685,10 +27685,10 @@ syntax relop_(numtype : numtype) syntax relop_{inn : inn}((inn : inn <: numtype)) = | EQ | NE - | LT(sx : sx) - | GT(sx : sx) - | LE(sx : sx) - | GE(sx : sx) + | LT{sx : sx}(sx : sx) + | GT{sx : sx}(sx : sx) + | LE{sx : sx}(sx : sx) + | GE{sx : sx}(sx : sx) ;; 1-syntax.watsup @@ -27708,13 +27708,13 @@ syntax cvtop = | REINTERPRET ;; 1-syntax.watsup -syntax ishape = `%X%`(imm : imm, dim : dim) +syntax ishape = `%X%`{imm : imm, dim : dim}(imm : imm, dim : dim) ;; 1-syntax.watsup -syntax fshape = `%X%`(fnn : fnn, dim : dim) +syntax fshape = `%X%`{fnn : fnn, dim : dim}(fnn : fnn, dim : dim) ;; 1-syntax.watsup -syntax pshape = `%X%`(pnn : pnn, dim : dim) +syntax pshape = `%X%`{pnn : pnn, dim : dim}(pnn : pnn, dim : dim) ;; 1-syntax.watsup def $dim(shape : shape) : dim @@ -27772,9 +27772,9 @@ syntax vbinop_(shape : shape) syntax vbinop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ADD | SUB - | ADD_SAT(sx : sx) + | ADD_SAT{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 16) - | SUB_SAT(sx : sx) + | SUB_SAT{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 16) | MUL -- if ($lsize((imm : imm <: lanetype)) >= 16) @@ -27782,9 +27782,9 @@ syntax vbinop_(shape : shape) -- if ($lsize((imm : imm <: lanetype)) <= 16) | Q15MULR_SAT_S{imm : imm} -- if ($lsize((imm : imm <: lanetype)) = 16) - | MIN(sx : sx) + | MIN{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 32) - | MAX(sx : sx) + | MAX{sx : sx}(sx : sx) -- if ($lsize((imm : imm <: lanetype)) <= 32) @@ -27810,10 +27810,10 @@ syntax vrelop_(shape : shape) syntax vrelop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | EQ | NE - | LT(sx : sx) - | GT(sx : sx) - | LE(sx : sx) - | GE(sx : sx) + | LT{sx : sx}(sx : sx) + | GT{sx : sx}(sx : sx) + | LE{sx : sx}(sx : sx) + | GE{sx : sx}(sx : sx) ;; 1-syntax.watsup @@ -27837,7 +27837,7 @@ syntax vcvtop = ;; 1-syntax.watsup syntax vshiftop_{imm : imm, N : N}(`%X%`(imm, `%`(N))) = | SHL - | SHR(sx : sx) + | SHR{sx : sx}(sx : sx) ;; 1-syntax.watsup syntax vextunop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = @@ -27851,27 +27851,27 @@ syntax half = ;; 1-syntax.watsup syntax vextbinop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = - | EXTMUL(half : half) + | EXTMUL{half : half}(half : half) | DOT{imm_1 : imm} -- if ($lsize((imm_1 : imm <: lanetype)) = 32) ;; 1-syntax.watsup syntax memop = { - ALIGN u32, - OFFSET u32 + ALIGN{u32 : u32} u32, + OFFSET{u32 : u32} u32 } ;; 1-syntax.watsup syntax vloadop = - | SHAPE(nat : nat, nat : nat, sx : sx) - | SPLAT(nat : nat) - | ZERO(nat : nat) + | SHAPE{sx : sx}(nat, nat, sx : sx) + | SPLAT(nat) + | ZERO(nat) ;; 1-syntax.watsup syntax blocktype = - | _RESULT(valtype?) - | _IDX(funcidx : funcidx) + | _RESULT{valtype? : valtype?}(valtype?{valtype : valtype} : valtype?) + | _IDX{funcidx : funcidx}(funcidx : funcidx) ;; 1-syntax.watsup syntax zero = `ZERO%?`(()?) @@ -27884,108 +27884,108 @@ syntax instr = | UNREACHABLE | NOP | DROP - | SELECT(valtype*?) - | BLOCK(blocktype : blocktype, instr*) - | LOOP(blocktype : blocktype, instr*) - | IF(blocktype : blocktype, instr*, instr*) - | BR(labelidx : labelidx) - | BR_IF(labelidx : labelidx) - | BR_TABLE(labelidx*, labelidx : labelidx) - | BR_ON_NULL(labelidx : labelidx) - | BR_ON_NON_NULL(labelidx : labelidx) - | BR_ON_CAST(labelidx : labelidx, reftype : reftype, reftype : reftype) - | BR_ON_CAST_FAIL(labelidx : labelidx, reftype : reftype, reftype : reftype) - | CALL(funcidx : funcidx) - | CALL_REF(typeidx?) - | CALL_INDIRECT(tableidx : tableidx, typeidx : typeidx) + | SELECT{valtype*? : valtype*?}(valtype*{valtype : valtype}?{valtype : valtype} : valtype*?) + | BLOCK{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*) + | LOOP{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*) + | IF{blocktype : blocktype, instr* : instr*}(blocktype : blocktype, instr*{instr : instr} : instr*, instr*) + | BR{labelidx : labelidx}(labelidx : labelidx) + | BR_IF{labelidx : labelidx}(labelidx : labelidx) + | BR_TABLE{labelidx : labelidx}(labelidx*{} : labelidx*, labelidx) + | BR_ON_NULL{labelidx : labelidx}(labelidx : labelidx) + | BR_ON_NON_NULL{labelidx : labelidx}(labelidx : labelidx) + | BR_ON_CAST{labelidx : labelidx, reftype : reftype}(labelidx : labelidx, reftype : reftype, reftype) + | BR_ON_CAST_FAIL{labelidx : labelidx, reftype : reftype}(labelidx : labelidx, reftype : reftype, reftype) + | CALL{funcidx : funcidx}(funcidx : funcidx) + | CALL_REF{typeidx? : typeidx?}(typeidx?{typeidx : typeidx} : typeidx?) + | CALL_INDIRECT{tableidx : tableidx, typeidx : typeidx}(tableidx : tableidx, typeidx : typeidx) | RETURN - | RETURN_CALL(funcidx : funcidx) - | RETURN_CALL_REF(typeidx?) - | RETURN_CALL_INDIRECT(tableidx : tableidx, typeidx : typeidx) - | CONST(numtype : numtype, num_ : num_(numtype)) - | UNOP(numtype : numtype, unop_ : unop_(numtype)) - | BINOP(numtype : numtype, binop_ : binop_(numtype)) - | TESTOP(numtype : numtype, testop_ : testop_(numtype)) - | RELOP(numtype : numtype, relop_ : relop_(numtype)) - | CVTOP(numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx?) - | EXTEND(numtype : numtype, n : n) - | VCONST(vectype : vectype, vec_ : vec_(vectype)) - | VVUNOP(vectype : vectype, vvunop : vvunop) - | VVBINOP(vectype : vectype, vvbinop : vvbinop) - | VVTERNOP(vectype : vectype, vvternop : vvternop) - | VVTESTOP(vectype : vectype, vvtestop : vvtestop) + | RETURN_CALL{funcidx : funcidx}(funcidx : funcidx) + | RETURN_CALL_REF{typeidx? : typeidx?}(typeidx?{typeidx : typeidx} : typeidx?) + | RETURN_CALL_INDIRECT{tableidx : tableidx, typeidx : typeidx}(tableidx : tableidx, typeidx : typeidx) + | CONST{numtype : numtype, num_ : num_(numtype)}(numtype : numtype, num_ : num_(numtype)) + | UNOP{numtype : numtype, unop_ : unop_(numtype)}(numtype : numtype, unop_ : unop_(numtype)) + | BINOP{numtype : numtype, binop_ : binop_(numtype)}(numtype : numtype, binop_ : binop_(numtype)) + | TESTOP{numtype : numtype, testop_ : testop_(numtype)}(numtype : numtype, testop_ : testop_(numtype)) + | RELOP{numtype : numtype, relop_ : relop_(numtype)}(numtype : numtype, relop_ : relop_(numtype)) + | CVTOP{numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx? : sx?}(numtype_1 : numtype, cvtop : cvtop, numtype_2 : numtype, sx?{sx : sx} : sx?) + | EXTEND{numtype : numtype, n : n}(numtype : numtype, n : n) + | VCONST{vectype : vectype, vec_ : vec_(vectype)}(vectype : vectype, vec_ : vec_(vectype)) + | VVUNOP{vectype : vectype, vvunop : vvunop}(vectype : vectype, vvunop : vvunop) + | VVBINOP{vectype : vectype, vvbinop : vvbinop}(vectype : vectype, vvbinop : vvbinop) + | VVTERNOP{vectype : vectype, vvternop : vvternop}(vectype : vectype, vvternop : vvternop) + | VVTESTOP{vectype : vectype, vvtestop : vvtestop}(vectype : vectype, vvtestop : vvtestop) | VSWIZZLE{ishape : ishape}(ishape : ishape) -- if (ishape = `%X%`(I8_imm, `%`(16))) - | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*) - -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) - | VSPLAT(shape : shape) - | VEXTRACT_LANE{shape : shape, numtype : numtype, sx? : sx?}(shape : shape, sx?, laneidx : laneidx) - -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx} = ?())) - | VREPLACE_LANE(shape : shape, laneidx : laneidx) - | VUNOP(shape : shape, vunop_ : vunop_(shape)) - | VBINOP(shape : shape, vbinop_ : vbinop_(shape)) - | VTESTOP(shape : shape, vtestop_ : vtestop_(shape)) - | VRELOP(shape : shape, vrelop_ : vrelop_(shape)) - | VSHIFTOP(ishape : ishape, vshiftop_ : vshiftop_(ishape)) - | VBITMASK(ishape : ishape) - | VCVTOP(shape : shape, vcvtop : vcvtop, half?, shape : shape, sx?, zero : zero) - | VNARROW(ishape : ishape, ishape : ishape, sx : sx) - | VEXTUNOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) + | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*{laneidx : laneidx} : laneidx*) + -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx : laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) + | VSPLAT{shape : shape}(shape : shape) + | VEXTRACT_LANE{shape : shape, sx? : sx?, laneidx : laneidx, numtype : numtype}(shape : shape, sx?{sx : sx} : sx?, laneidx : laneidx) + -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx : sx} = ?())) + | VREPLACE_LANE{shape : shape, laneidx : laneidx}(shape : shape, laneidx : laneidx) + | VUNOP{shape : shape, vunop_ : vunop_(shape)}(shape : shape, vunop_ : vunop_(shape)) + | VBINOP{shape : shape, vbinop_ : vbinop_(shape)}(shape : shape, vbinop_ : vbinop_(shape)) + | VTESTOP{shape : shape, vtestop_ : vtestop_(shape)}(shape : shape, vtestop_ : vtestop_(shape)) + | VRELOP{shape : shape, vrelop_ : vrelop_(shape)}(shape : shape, vrelop_ : vrelop_(shape)) + | VSHIFTOP{ishape : ishape, vshiftop_ : vshiftop_(ishape)}(ishape : ishape, vshiftop_ : vshiftop_(ishape)) + | VBITMASK{ishape : ishape}(ishape : ishape) + | VCVTOP{shape : shape, vcvtop : vcvtop, half? : half?, sx? : sx?, zero : zero}(shape : shape, vcvtop : vcvtop, half?{half : half} : half?, shape, sx?{sx : sx} : sx?, zero : zero) + | VNARROW{ishape : ishape, sx : sx}(ishape : ishape, ishape, sx : sx) + | VEXTUNOP{ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | VEXTBINOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) + | VEXTBINOP{ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | REF.NULL(heaptype : heaptype) + | REF.NULL{heaptype : heaptype}(heaptype : heaptype) | REF.I31 - | REF.FUNC(funcidx : funcidx) + | REF.FUNC{funcidx : funcidx}(funcidx : funcidx) | REF.IS_NULL | REF.AS_NON_NULL | REF.EQ - | REF.TEST(reftype : reftype) - | REF.CAST(reftype : reftype) - | I31.GET(sx : sx) - | STRUCT.NEW(typeidx : typeidx) - | STRUCT.NEW_DEFAULT(typeidx : typeidx) - | STRUCT.GET(sx?, typeidx : typeidx, u32 : u32) - | STRUCT.SET(typeidx : typeidx, u32 : u32) - | ARRAY.NEW(typeidx : typeidx) - | ARRAY.NEW_DEFAULT(typeidx : typeidx) - | ARRAY.NEW_FIXED(typeidx : typeidx, nat : nat) - | ARRAY.NEW_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.NEW_ELEM(typeidx : typeidx, elemidx : elemidx) - | ARRAY.GET(sx?, typeidx : typeidx) - | ARRAY.SET(typeidx : typeidx) + | REF.TEST{reftype : reftype}(reftype : reftype) + | REF.CAST{reftype : reftype}(reftype : reftype) + | I31.GET{sx : sx}(sx : sx) + | STRUCT.NEW{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.GET{sx? : sx?, typeidx : typeidx, u32 : u32}(sx?{sx : sx} : sx?, typeidx : typeidx, u32 : u32) + | STRUCT.SET{typeidx : typeidx, u32 : u32}(typeidx : typeidx, u32 : u32) + | ARRAY.NEW{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_FIXED{typeidx : typeidx}(typeidx : typeidx, nat) + | ARRAY.NEW_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.NEW_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) + | ARRAY.GET{sx? : sx?, typeidx : typeidx}(sx?{sx : sx} : sx?, typeidx : typeidx) + | ARRAY.SET{typeidx : typeidx}(typeidx : typeidx) | ARRAY.LEN - | ARRAY.FILL(typeidx : typeidx) - | ARRAY.COPY(typeidx : typeidx, typeidx : typeidx) - | ARRAY.INIT_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.INIT_ELEM(typeidx : typeidx, elemidx : elemidx) + | ARRAY.FILL{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.COPY{typeidx : typeidx}(typeidx : typeidx, typeidx) + | ARRAY.INIT_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.INIT_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) | EXTERN.CONVERT_ANY | ANY.CONVERT_EXTERN - | LOCAL.GET(localidx : localidx) - | LOCAL.SET(localidx : localidx) - | LOCAL.TEE(localidx : localidx) - | GLOBAL.GET(globalidx : globalidx) - | GLOBAL.SET(globalidx : globalidx) - | TABLE.GET(tableidx : tableidx) - | TABLE.SET(tableidx : tableidx) - | TABLE.SIZE(tableidx : tableidx) - | TABLE.GROW(tableidx : tableidx) - | TABLE.FILL(tableidx : tableidx) - | TABLE.COPY(tableidx : tableidx, tableidx : tableidx) - | TABLE.INIT(tableidx : tableidx, elemidx : elemidx) - | ELEM.DROP(elemidx : elemidx) - | MEMORY.SIZE(memidx : memidx) - | MEMORY.GROW(memidx : memidx) - | MEMORY.FILL(memidx : memidx) - | MEMORY.COPY(memidx : memidx, memidx : memidx) - | MEMORY.INIT(memidx : memidx, dataidx : dataidx) - | DATA.DROP(dataidx : dataidx) - | LOAD(numtype : numtype, (n, sx)?, memidx : memidx, memop : memop) - | STORE(numtype : numtype, n?, memidx : memidx, memop : memop) - | VLOAD(vloadop?, memidx : memidx, memop : memop) - | VLOAD_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | VSTORE(memidx : memidx, memop : memop) - | VSTORE_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | LOCAL.GET{localidx : localidx}(localidx : localidx) + | LOCAL.SET{localidx : localidx}(localidx : localidx) + | LOCAL.TEE{localidx : localidx}(localidx : localidx) + | GLOBAL.GET{globalidx : globalidx}(globalidx : globalidx) + | GLOBAL.SET{globalidx : globalidx}(globalidx : globalidx) + | TABLE.GET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SIZE{tableidx : tableidx}(tableidx : tableidx) + | TABLE.GROW{tableidx : tableidx}(tableidx : tableidx) + | TABLE.FILL{tableidx : tableidx}(tableidx : tableidx) + | TABLE.COPY{tableidx : tableidx}(tableidx : tableidx, tableidx) + | TABLE.INIT{tableidx : tableidx, elemidx : elemidx}(tableidx : tableidx, elemidx : elemidx) + | ELEM.DROP{elemidx : elemidx}(elemidx : elemidx) + | MEMORY.SIZE{memidx : memidx}(memidx : memidx) + | MEMORY.GROW{memidx : memidx}(memidx : memidx) + | MEMORY.FILL{memidx : memidx}(memidx : memidx) + | MEMORY.COPY{memidx : memidx}(memidx : memidx, memidx) + | MEMORY.INIT{memidx : memidx, dataidx : dataidx}(memidx : memidx, dataidx : dataidx) + | DATA.DROP{dataidx : dataidx}(dataidx : dataidx) + | LOAD{numtype : numtype, n? : n?, sx? : sx?, memidx : memidx, memop : memop}(numtype : numtype, (n, sx)?{n : n sx : sx} : (n, sx)?, memidx : memidx, memop : memop) + | STORE{numtype : numtype, n? : n?, memidx : memidx, memop : memop}(numtype : numtype, n?{n : n} : n?, memidx : memidx, memop : memop) + | VLOAD{vloadop? : vloadop?, memidx : memidx, memop : memop}(vloadop?{vloadop : vloadop} : vloadop?, memidx : memidx, memop : memop) + | VLOAD_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | VSTORE{memidx : memidx, memop : memop}(memidx : memidx, memop : memop) + | VSTORE_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) } ;; 1-syntax.watsup @@ -27993,57 +27993,57 @@ syntax expr = instr* ;; 1-syntax.watsup syntax elemmode = - | ACTIVE(tableidx : tableidx, expr : expr) + | ACTIVE{tableidx : tableidx, expr : expr}(tableidx : tableidx, expr : expr) | PASSIVE | DECLARE ;; 1-syntax.watsup syntax datamode = - | ACTIVE(memidx : memidx, expr : expr) + | ACTIVE{memidx : memidx, expr : expr}(memidx : memidx, expr : expr) | PASSIVE ;; 1-syntax.watsup -syntax type = TYPE(rectype : rectype) +syntax type = TYPE{rectype : rectype}(rectype : rectype) ;; 1-syntax.watsup -syntax local = LOCAL(valtype : valtype) +syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`(typeidx : typeidx, local*, expr : expr) +syntax func = `FUNC%%*%`{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) ;; 1-syntax.watsup -syntax global = GLOBAL(globaltype : globaltype, expr : expr) +syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) ;; 1-syntax.watsup -syntax table = TABLE(tabletype : tabletype, expr : expr) +syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, expr : expr) ;; 1-syntax.watsup -syntax mem = MEMORY(memtype : memtype) +syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`(reftype : reftype, expr*, elemmode : elemmode) +syntax elem = `ELEM%%*%`{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) ;; 1-syntax.watsup -syntax data = `DATA%*%`(byte*, datamode : datamode) +syntax data = `DATA%*%`{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup -syntax start = START(funcidx : funcidx) +syntax start = START{funcidx : funcidx}(funcidx : funcidx) ;; 1-syntax.watsup syntax externidx = - | FUNC(funcidx : funcidx) - | GLOBAL(globalidx : globalidx) - | TABLE(tableidx : tableidx) - | MEM(memidx : memidx) + | FUNC{funcidx : funcidx}(funcidx : funcidx) + | GLOBAL{globalidx : globalidx}(globalidx : globalidx) + | TABLE{tableidx : tableidx}(tableidx : tableidx) + | MEM{memidx : memidx}(memidx : memidx) ;; 1-syntax.watsup -syntax export = EXPORT(name : name, externidx : externidx) +syntax export = EXPORT{name : name, externidx : externidx}(name : name, externidx : externidx) ;; 1-syntax.watsup -syntax import = IMPORT(name : name, name : name, externtype : externtype) +syntax import = IMPORT{name : name, externtype : externtype}(name : name, name, externtype : externtype) ;; 1-syntax.watsup -syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*, import*, func*, global*, table*, mem*, elem*, data*, start*, export*) +syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) ;; 2-syntax-aux.watsup rec { @@ -28053,10 +28053,10 @@ def $setminus1(idx : idx, idx*) : idx* ;; 2-syntax-aux.watsup:13.1-13.27 def $setminus1{x : idx}(x, []) = [x] ;; 2-syntax-aux.watsup:14.1-14.61 - def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y}) = [] + def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y : idx}) = [] -- if (x = y_1) ;; 2-syntax-aux.watsup:15.1-15.60 - def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y}) = $setminus1(x, y*{y}) + def $setminus1{x : idx, y_1 : idx, y* : idx*}(x, [y_1] :: y*{y : idx}) = $setminus1(x, y*{y : idx}) -- otherwise } @@ -28066,9 +28066,9 @@ rec { ;; 2-syntax-aux.watsup:7.1-7.49 def $setminus(idx*, idx*) : idx* ;; 2-syntax-aux.watsup:10.1-10.29 - def $setminus{y* : idx*}([], y*{y}) = [] + def $setminus{y* : idx*}([], y*{y : idx}) = [] ;; 2-syntax-aux.watsup:11.1-11.66 - def $setminus{x_1 : idx, x* : idx*, y* : idx*}([x_1] :: x*{x}, y*{y}) = $setminus1(x_1, y*{y}) :: $setminus(x*{x}, y*{y}) + def $setminus{x_1 : idx, x* : idx*, y* : idx*}([x_1] :: x*{x : idx}, y*{y : idx}) = $setminus1(x_1, y*{y : idx}) :: $setminus(x*{x : idx}, y*{y : idx}) } ;; 2-syntax-aux.watsup @@ -28088,18 +28088,18 @@ def $free_dataidx_instrs(instr*) : dataidx* ;; 2-syntax-aux.watsup:26.1-26.36 def $free_dataidx_instrs([]) = [] ;; 2-syntax-aux.watsup:27.1-27.99 - def $free_dataidx_instrs{instr : instr, instr'* : instr*}([instr] :: instr'*{instr'}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr'}) + def $free_dataidx_instrs{instr : instr, instr'* : instr*}([instr] :: instr'*{instr' : instr}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr' : instr}) } ;; 2-syntax-aux.watsup def $free_dataidx_expr(expr : expr) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_expr{in* : instr*}(in*{in}) = $free_dataidx_instrs(in*{in}) + def $free_dataidx_expr{in* : instr*}(in*{in : instr}) = $free_dataidx_instrs(in*{in : instr}) ;; 2-syntax-aux.watsup def $free_dataidx_func(func : func) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc}, e)) = $free_dataidx_expr(e) + def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) ;; 2-syntax-aux.watsup rec { @@ -28109,7 +28109,7 @@ def $free_dataidx_funcs(func*) : dataidx* ;; 2-syntax-aux.watsup:36.1-36.35 def $free_dataidx_funcs([]) = [] ;; 2-syntax-aux.watsup:37.1-37.92 - def $free_dataidx_funcs{func : func, func'* : func*}([func] :: func'*{func'}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func'}) + def $free_dataidx_funcs{func : func, func'* : func*}([func] :: func'*{func' : func}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func' : func}) } ;; 2-syntax-aux.watsup @@ -28156,8 +28156,8 @@ def $diffrt(reftype : reftype, reftype : reftype) : reftype ;; 2-syntax-aux.watsup syntax typevar = - | _IDX(typeidx : typeidx) - | REC(nat : nat) + | _IDX{typeidx : typeidx}(typeidx : typeidx) + | REC(nat) ;; 2-syntax-aux.watsup def $idx(typeidx : typeidx) : typevar @@ -28172,27 +28172,27 @@ def $subst_typevar(typevar : typevar, typevar*, heaptype*) : heaptype ;; 2-syntax-aux.watsup:150.1-150.38 def $subst_typevar{xx : typevar}(xx, [], []) = (xx : typevar <: heaptype) ;; 2-syntax-aux.watsup:151.1-151.95 - def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 + def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = ht_1 -- if (xx = xx_1) ;; 2-syntax-aux.watsup:152.1-152.92 - def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = $subst_typevar(xx, xx'*{xx'}, ht'*{ht'}) + def $subst_typevar{xx : typevar, xx_1 : typevar, xx'* : typevar*, ht_1 : heaptype, ht'* : heaptype*}(xx, [xx_1] :: xx'*{xx' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = $subst_typevar(xx, xx'*{xx' : typevar}, ht'*{ht' : heaptype}) -- otherwise } ;; 2-syntax-aux.watsup def $subst_numtype(numtype : numtype, typevar*, heaptype*) : numtype ;; 2-syntax-aux.watsup - def $subst_numtype{nt : numtype, xx* : typevar*, ht* : heaptype*}(nt, xx*{xx}, ht*{ht}) = nt + def $subst_numtype{nt : numtype, xx* : typevar*, ht* : heaptype*}(nt, xx*{xx : typevar}, ht*{ht : heaptype}) = nt ;; 2-syntax-aux.watsup def $subst_vectype(vectype : vectype, typevar*, heaptype*) : vectype ;; 2-syntax-aux.watsup - def $subst_vectype{vt : vectype, xx* : typevar*, ht* : heaptype*}(vt, xx*{xx}, ht*{ht}) = vt + def $subst_vectype{vt : vectype, xx* : typevar*, ht* : heaptype*}(vt, xx*{xx : typevar}, ht*{ht : heaptype}) = vt ;; 2-syntax-aux.watsup def $subst_packtype(packtype : packtype, typevar*, heaptype*) : packtype ;; 2-syntax-aux.watsup - def $subst_packtype{pt : packtype, xx* : typevar*, ht* : heaptype*}(pt, xx*{xx}, ht*{ht}) = pt + def $subst_packtype{pt : packtype, xx* : typevar*, ht* : heaptype*}(pt, xx*{xx : typevar}, ht*{ht : heaptype}) = pt ;; 2-syntax-aux.watsup rec { @@ -28200,108 +28200,108 @@ rec { ;; 2-syntax-aux.watsup:129.1-129.92 def $subst_heaptype(heaptype : heaptype, typevar*, heaptype*) : heaptype ;; 2-syntax-aux.watsup:157.1-157.67 - def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) + def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx : typevar}, ht*{ht : heaptype}) = $subst_typevar(xx', xx*{xx : typevar}, ht*{ht : heaptype}) ;; 2-syntax-aux.watsup:158.1-158.65 - def $subst_heaptype{dt : deftype, xx* : typevar*, ht* : heaptype*}((dt : deftype <: heaptype), xx*{xx}, ht*{ht}) = ($subst_deftype(dt, xx*{xx}, ht*{ht}) : deftype <: heaptype) + def $subst_heaptype{dt : deftype, xx* : typevar*, ht* : heaptype*}((dt : deftype <: heaptype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_deftype(dt, xx*{xx : typevar}, ht*{ht : heaptype}) : deftype <: heaptype) ;; 2-syntax-aux.watsup:159.1-159.55 - def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx}, ht*{ht}) = ht' + def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx : typevar}, ht*{ht : heaptype}) = ht' -- otherwise ;; 2-syntax-aux.watsup:130.1-130.92 def $subst_reftype(reftype : reftype, typevar*, heaptype*) : reftype ;; 2-syntax-aux.watsup:161.1-161.85 - def $subst_reftype{nul : nul, ht' : heaptype, xx* : typevar*, ht* : heaptype*}(REF_reftype(nul, ht'), xx*{xx}, ht*{ht}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx}, ht*{ht})) + def $subst_reftype{nul : nul, ht' : heaptype, xx* : typevar*, ht* : heaptype*}(REF_reftype(nul, ht'), xx*{xx : typevar}, ht*{ht : heaptype}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:131.1-131.92 def $subst_valtype(valtype : valtype, typevar*, heaptype*) : valtype ;; 2-syntax-aux.watsup:163.1-163.64 - def $subst_valtype{nt : numtype, xx* : typevar*, ht* : heaptype*}((nt : numtype <: valtype), xx*{xx}, ht*{ht}) = ($subst_numtype(nt, xx*{xx}, ht*{ht}) : numtype <: valtype) + def $subst_valtype{nt : numtype, xx* : typevar*, ht* : heaptype*}((nt : numtype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_numtype(nt, xx*{xx : typevar}, ht*{ht : heaptype}) : numtype <: valtype) ;; 2-syntax-aux.watsup:164.1-164.64 - def $subst_valtype{vt : vectype, xx* : typevar*, ht* : heaptype*}((vt : vectype <: valtype), xx*{xx}, ht*{ht}) = ($subst_vectype(vt, xx*{xx}, ht*{ht}) : vectype <: valtype) + def $subst_valtype{vt : vectype, xx* : typevar*, ht* : heaptype*}((vt : vectype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_vectype(vt, xx*{xx : typevar}, ht*{ht : heaptype}) : vectype <: valtype) ;; 2-syntax-aux.watsup:165.1-165.64 - def $subst_valtype{rt : reftype, xx* : typevar*, ht* : heaptype*}((rt : reftype <: valtype), xx*{xx}, ht*{ht}) = ($subst_reftype(rt, xx*{xx}, ht*{ht}) : reftype <: valtype) + def $subst_valtype{rt : reftype, xx* : typevar*, ht* : heaptype*}((rt : reftype <: valtype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_reftype(rt, xx*{xx : typevar}, ht*{ht : heaptype}) : reftype <: valtype) ;; 2-syntax-aux.watsup:166.1-166.40 - def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx : typevar}, ht*{ht : heaptype}) = BOT_valtype ;; 2-syntax-aux.watsup:134.1-134.92 def $subst_storagetype(storagetype : storagetype, typevar*, heaptype*) : storagetype ;; 2-syntax-aux.watsup:170.1-170.66 - def $subst_storagetype{t : valtype, xx* : typevar*, ht* : heaptype*}((t : valtype <: storagetype), xx*{xx}, ht*{ht}) = ($subst_valtype(t, xx*{xx}, ht*{ht}) : valtype <: storagetype) + def $subst_storagetype{t : valtype, xx* : typevar*, ht* : heaptype*}((t : valtype <: storagetype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_valtype(t, xx*{xx : typevar}, ht*{ht : heaptype}) : valtype <: storagetype) ;; 2-syntax-aux.watsup:171.1-171.69 - def $subst_storagetype{pt : packtype, xx* : typevar*, ht* : heaptype*}((pt : packtype <: storagetype), xx*{xx}, ht*{ht}) = ($subst_packtype(pt, xx*{xx}, ht*{ht}) : packtype <: storagetype) + def $subst_storagetype{pt : packtype, xx* : typevar*, ht* : heaptype*}((pt : packtype <: storagetype), xx*{xx : typevar}, ht*{ht : heaptype}) = ($subst_packtype(pt, xx*{xx : typevar}, ht*{ht : heaptype}) : packtype <: storagetype) ;; 2-syntax-aux.watsup:135.1-135.92 def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype ;; 2-syntax-aux.watsup:173.1-173.80 - def $subst_fieldtype{mut : mut, zt : storagetype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, zt), xx*{xx}, ht*{ht}) = `%%`(mut, $subst_storagetype(zt, xx*{xx}, ht*{ht})) + def $subst_fieldtype{mut : mut, zt : storagetype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, zt), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(mut, $subst_storagetype(zt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype ;; 2-syntax-aux.watsup:175.1-175.85 - def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) + def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt : fieldtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype}) ;; 2-syntax-aux.watsup:176.1-176.81 - def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) + def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx : typevar}, ht*{ht : heaptype}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:177.1-177.78 - def $subst_comptype{ft : functype, xx* : typevar*, ht* : heaptype*}(FUNC_comptype(ft), xx*{xx}, ht*{ht}) = FUNC_comptype($subst_functype(ft, xx*{xx}, ht*{ht})) + def $subst_comptype{ft : functype, xx* : typevar*, ht* : heaptype*}(FUNC_comptype(ft), xx*{xx : typevar}, ht*{ht : heaptype}) = FUNC_comptype($subst_functype(ft, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:138.1-138.92 def $subst_subtype(subtype : subtype, typevar*, heaptype*) : subtype ;; 2-syntax-aux.watsup:179.1-180.76 - def $subst_subtype{fin : fin, y* : idx*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + def $subst_subtype{fin : fin, y* : idx*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUB_subtype(fin, y*{y : typeidx}, ct), xx*{xx : typevar}, ht*{ht : heaptype}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx : typevar}, ht*{ht : heaptype})*{y : typeidx}, $subst_comptype(ct, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:181.1-182.73 - def $subst_subtype{fin : fin, ht'* : heaptype*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUBD_subtype(fin, ht'*{ht'}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx}, ht*{ht})*{ht'}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + def $subst_subtype{fin : fin, ht'* : heaptype*, ct : comptype, xx* : typevar*, ht* : heaptype*}(SUBD_subtype(fin, ht'*{ht' : heaptype}, ct), xx*{xx : typevar}, ht*{ht : heaptype}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})*{ht' : heaptype}, $subst_comptype(ct, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype ;; 2-syntax-aux.watsup:184.1-184.76 - def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st}), xx*{xx}, ht*{ht}) = REC_rectype($subst_subtype(st, xx*{xx}, ht*{ht})*{st}) + def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st : subtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype}) ;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype ;; 2-syntax-aux.watsup:186.1-186.78 - def $subst_deftype{qt : rectype, i : nat, xx* : typevar*, ht* : heaptype*}(DEF_deftype(qt, i), xx*{xx}, ht*{ht}) = DEF_deftype($subst_rectype(qt, xx*{xx}, ht*{ht}), i) + def $subst_deftype{qt : rectype, i : nat, xx* : typevar*, ht* : heaptype*}(DEF_deftype(qt, i), xx*{xx : typevar}, ht*{ht : heaptype}) = DEF_deftype($subst_rectype(qt, xx*{xx : typevar}, ht*{ht : heaptype}), i) ;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype ;; 2-syntax-aux.watsup:189.1-189.113 - def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1}, t_2*{t_2}), xx*{xx}, ht*{ht}) = `%->%`($subst_valtype(t_1, xx*{xx}, ht*{ht})*{t_1}, $subst_valtype(t_2, xx*{xx}, ht*{ht})*{t_2}) + def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}, $subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype}) } ;; 2-syntax-aux.watsup def $subst_globaltype(globaltype : globaltype, typevar*, heaptype*) : globaltype ;; 2-syntax-aux.watsup - def $subst_globaltype{mut : mut, t : valtype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, t), xx*{xx}, ht*{ht}) = `%%`(mut, $subst_valtype(t, xx*{xx}, ht*{ht})) + def $subst_globaltype{mut : mut, t : valtype, xx* : typevar*, ht* : heaptype*}(`%%`(mut, t), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(mut, $subst_valtype(t, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_tabletype(tabletype : tabletype, typevar*, heaptype*) : tabletype ;; 2-syntax-aux.watsup - def $subst_tabletype{lim : limits, rt : reftype, xx* : typevar*, ht* : heaptype*}(`%%`(lim, rt), xx*{xx}, ht*{ht}) = `%%`(lim, $subst_reftype(rt, xx*{xx}, ht*{ht})) + def $subst_tabletype{lim : limits, rt : reftype, xx* : typevar*, ht* : heaptype*}(`%%`(lim, rt), xx*{xx : typevar}, ht*{ht : heaptype}) = `%%`(lim, $subst_reftype(rt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_memtype(memtype : memtype, typevar*, heaptype*) : memtype ;; 2-syntax-aux.watsup - def $subst_memtype{lim : limits, xx* : typevar*, ht* : heaptype*}(`%I8`(lim), xx*{xx}, ht*{ht}) = `%I8`(lim) + def $subst_memtype{lim : limits, xx* : typevar*, ht* : heaptype*}(`%I8`(lim), xx*{xx : typevar}, ht*{ht : heaptype}) = `%I8`(lim) ;; 2-syntax-aux.watsup def $subst_externtype(externtype : externtype, typevar*, heaptype*) : externtype ;; 2-syntax-aux.watsup - def $subst_externtype{dt : deftype, xx* : typevar*, ht* : heaptype*}(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) + def $subst_externtype{dt : deftype, xx* : typevar*, ht* : heaptype*}(FUNC_externtype(dt), xx*{xx : typevar}, ht*{ht : heaptype}) = FUNC_externtype($subst_deftype(dt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{gt : globaltype, xx* : typevar*, ht* : heaptype*}(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) + def $subst_externtype{gt : globaltype, xx* : typevar*, ht* : heaptype*}(GLOBAL_externtype(gt), xx*{xx : typevar}, ht*{ht : heaptype}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{tt : tabletype, xx* : typevar*, ht* : heaptype*}(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) + def $subst_externtype{tt : tabletype, xx* : typevar*, ht* : heaptype*}(TABLE_externtype(tt), xx*{xx : typevar}, ht*{ht : heaptype}) = TABLE_externtype($subst_tabletype(tt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup - def $subst_externtype{mt : memtype, xx* : typevar*, ht* : heaptype*}(MEM_externtype(mt), xx*{xx}, ht*{ht}) = MEM_externtype($subst_memtype(mt, xx*{xx}, ht*{ht})) + def $subst_externtype{mt : memtype, xx* : typevar*, ht* : heaptype*}(MEM_externtype(mt), xx*{xx : typevar}, ht*{ht : heaptype}) = MEM_externtype($subst_memtype(mt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup def $subst_all_reftype(reftype : reftype, heaptype*) : reftype ;; 2-syntax-aux.watsup - def $subst_all_reftype{rt : reftype, ht^n : heaptype^n, n : n, i^n : nat^n}(rt, ht^n{ht}) = $subst_reftype(rt, $idx(`%`(i))^(i (sx?{sx} = ?())) - | VREPLACE_LANE(shape : shape, laneidx : laneidx) - | VUNOP(shape : shape, vunop_ : vunop_(shape)) - | VBINOP(shape : shape, vbinop_ : vbinop_(shape)) - | VTESTOP(shape : shape, vtestop_ : vtestop_(shape)) - | VRELOP(shape : shape, vrelop_ : vrelop_(shape)) - | VSHIFTOP(ishape : ishape, vshiftop_ : vshiftop_(ishape)) - | VBITMASK(ishape : ishape) - | VCVTOP(shape : shape, vcvtop : vcvtop, half?, shape : shape, sx?, zero : zero) - | VNARROW(ishape : ishape, ishape : ishape, sx : sx) - | VEXTUNOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) + | VSHUFFLE{ishape : ishape, laneidx* : laneidx*}(ishape : ishape, laneidx*{laneidx : laneidx} : laneidx*) + -- if ((ishape = `%X%`(I8_imm, `%`(16))) /\ (|laneidx*{laneidx : laneidx}| = $dim((ishape : ishape <: shape)).`%`.0)) + | VSPLAT{shape : shape}(shape : shape) + | VEXTRACT_LANE{shape : shape, sx? : sx?, laneidx : laneidx, numtype : numtype}(shape : shape, sx?{sx : sx} : sx?, laneidx : laneidx) + -- if (($lanetype(shape) = (numtype : numtype <: lanetype)) <=> (sx?{sx : sx} = ?())) + | VREPLACE_LANE{shape : shape, laneidx : laneidx}(shape : shape, laneidx : laneidx) + | VUNOP{shape : shape, vunop_ : vunop_(shape)}(shape : shape, vunop_ : vunop_(shape)) + | VBINOP{shape : shape, vbinop_ : vbinop_(shape)}(shape : shape, vbinop_ : vbinop_(shape)) + | VTESTOP{shape : shape, vtestop_ : vtestop_(shape)}(shape : shape, vtestop_ : vtestop_(shape)) + | VRELOP{shape : shape, vrelop_ : vrelop_(shape)}(shape : shape, vrelop_ : vrelop_(shape)) + | VSHIFTOP{ishape : ishape, vshiftop_ : vshiftop_(ishape)}(ishape : ishape, vshiftop_ : vshiftop_(ishape)) + | VBITMASK{ishape : ishape}(ishape : ishape) + | VCVTOP{shape : shape, vcvtop : vcvtop, half? : half?, sx? : sx?, zero : zero}(shape : shape, vcvtop : vcvtop, half?{half : half} : half?, shape, sx?{sx : sx} : sx?, zero : zero) + | VNARROW{ishape : ishape, sx : sx}(ishape : ishape, ishape, sx : sx) + | VEXTUNOP{ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextunop_ : vextunop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | VEXTBINOP{imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) + | VEXTBINOP{ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx, imm_1 : imm, imm_2 : imm}(ishape_1 : ishape, ishape_2 : ishape, vextbinop_ : vextbinop_(ishape_1, ishape_2), sx : sx) -- if ($lsize((imm_1 : imm <: lanetype)) = (2 * $lsize((imm_2 : imm <: lanetype)))) - | REF.NULL(heaptype : heaptype) + | REF.NULL{heaptype : heaptype}(heaptype : heaptype) | REF.I31 - | REF.FUNC(funcidx : funcidx) + | REF.FUNC{funcidx : funcidx}(funcidx : funcidx) | REF.IS_NULL | REF.AS_NON_NULL | REF.EQ - | REF.TEST(reftype : reftype) - | REF.CAST(reftype : reftype) - | I31.GET(sx : sx) - | STRUCT.NEW(typeidx : typeidx) - | STRUCT.NEW_DEFAULT(typeidx : typeidx) - | STRUCT.GET(sx?, typeidx : typeidx, u32 : u32) - | STRUCT.SET(typeidx : typeidx, u32 : u32) - | ARRAY.NEW(typeidx : typeidx) - | ARRAY.NEW_DEFAULT(typeidx : typeidx) - | ARRAY.NEW_FIXED(typeidx : typeidx, nat : nat) - | ARRAY.NEW_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.NEW_ELEM(typeidx : typeidx, elemidx : elemidx) - | ARRAY.GET(sx?, typeidx : typeidx) - | ARRAY.SET(typeidx : typeidx) + | REF.TEST{reftype : reftype}(reftype : reftype) + | REF.CAST{reftype : reftype}(reftype : reftype) + | I31.GET{sx : sx}(sx : sx) + | STRUCT.NEW{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | STRUCT.GET{sx? : sx?, typeidx : typeidx, u32 : u32}(sx?{sx : sx} : sx?, typeidx : typeidx, u32 : u32) + | STRUCT.SET{typeidx : typeidx, u32 : u32}(typeidx : typeidx, u32 : u32) + | ARRAY.NEW{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_DEFAULT{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.NEW_FIXED{typeidx : typeidx}(typeidx : typeidx, nat) + | ARRAY.NEW_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.NEW_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) + | ARRAY.GET{sx? : sx?, typeidx : typeidx}(sx?{sx : sx} : sx?, typeidx : typeidx) + | ARRAY.SET{typeidx : typeidx}(typeidx : typeidx) | ARRAY.LEN - | ARRAY.FILL(typeidx : typeidx) - | ARRAY.COPY(typeidx : typeidx, typeidx : typeidx) - | ARRAY.INIT_DATA(typeidx : typeidx, dataidx : dataidx) - | ARRAY.INIT_ELEM(typeidx : typeidx, elemidx : elemidx) + | ARRAY.FILL{typeidx : typeidx}(typeidx : typeidx) + | ARRAY.COPY{typeidx : typeidx}(typeidx : typeidx, typeidx) + | ARRAY.INIT_DATA{typeidx : typeidx, dataidx : dataidx}(typeidx : typeidx, dataidx : dataidx) + | ARRAY.INIT_ELEM{typeidx : typeidx, elemidx : elemidx}(typeidx : typeidx, elemidx : elemidx) | EXTERN.CONVERT_ANY | ANY.CONVERT_EXTERN - | LOCAL.GET(localidx : localidx) - | LOCAL.SET(localidx : localidx) - | LOCAL.TEE(localidx : localidx) - | GLOBAL.GET(globalidx : globalidx) - | GLOBAL.SET(globalidx : globalidx) - | TABLE.GET(tableidx : tableidx) - | TABLE.SET(tableidx : tableidx) - | TABLE.SIZE(tableidx : tableidx) - | TABLE.GROW(tableidx : tableidx) - | TABLE.FILL(tableidx : tableidx) - | TABLE.COPY(tableidx : tableidx, tableidx : tableidx) - | TABLE.INIT(tableidx : tableidx, elemidx : elemidx) - | ELEM.DROP(elemidx : elemidx) - | MEMORY.SIZE(memidx : memidx) - | MEMORY.GROW(memidx : memidx) - | MEMORY.FILL(memidx : memidx) - | MEMORY.COPY(memidx : memidx, memidx : memidx) - | MEMORY.INIT(memidx : memidx, dataidx : dataidx) - | DATA.DROP(dataidx : dataidx) - | LOAD(numtype : numtype, (n, sx)?, memidx : memidx, memop : memop) - | STORE(numtype : numtype, n?, memidx : memidx, memop : memop) - | VLOAD(vloadop?, memidx : memidx, memop : memop) - | VLOAD_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | VSTORE(memidx : memidx, memop : memop) - | VSTORE_LANE(n : n, memidx : memidx, memop : memop, laneidx : laneidx) - | REF.I31_NUM(u31 : u31) - | REF.STRUCT_ADDR(structaddr : structaddr) - | REF.ARRAY_ADDR(arrayaddr : arrayaddr) - | REF.FUNC_ADDR(funcaddr : funcaddr) - | REF.HOST_ADDR(hostaddr : hostaddr) - | REF.EXTERN(addrref : addrref) - | LABEL_(n : n, instr*, admininstr*) - | FRAME_(n : n, frame : frame, admininstr*) + | LOCAL.GET{localidx : localidx}(localidx : localidx) + | LOCAL.SET{localidx : localidx}(localidx : localidx) + | LOCAL.TEE{localidx : localidx}(localidx : localidx) + | GLOBAL.GET{globalidx : globalidx}(globalidx : globalidx) + | GLOBAL.SET{globalidx : globalidx}(globalidx : globalidx) + | TABLE.GET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SET{tableidx : tableidx}(tableidx : tableidx) + | TABLE.SIZE{tableidx : tableidx}(tableidx : tableidx) + | TABLE.GROW{tableidx : tableidx}(tableidx : tableidx) + | TABLE.FILL{tableidx : tableidx}(tableidx : tableidx) + | TABLE.COPY{tableidx : tableidx}(tableidx : tableidx, tableidx) + | TABLE.INIT{tableidx : tableidx, elemidx : elemidx}(tableidx : tableidx, elemidx : elemidx) + | ELEM.DROP{elemidx : elemidx}(elemidx : elemidx) + | MEMORY.SIZE{memidx : memidx}(memidx : memidx) + | MEMORY.GROW{memidx : memidx}(memidx : memidx) + | MEMORY.FILL{memidx : memidx}(memidx : memidx) + | MEMORY.COPY{memidx : memidx}(memidx : memidx, memidx) + | MEMORY.INIT{memidx : memidx, dataidx : dataidx}(memidx : memidx, dataidx : dataidx) + | DATA.DROP{dataidx : dataidx}(dataidx : dataidx) + | LOAD{numtype : numtype, n? : n?, sx? : sx?, memidx : memidx, memop : memop}(numtype : numtype, (n, sx)?{n : n sx : sx} : (n, sx)?, memidx : memidx, memop : memop) + | STORE{numtype : numtype, n? : n?, memidx : memidx, memop : memop}(numtype : numtype, n?{n : n} : n?, memidx : memidx, memop : memop) + | VLOAD{vloadop? : vloadop?, memidx : memidx, memop : memop}(vloadop?{vloadop : vloadop} : vloadop?, memidx : memidx, memop : memop) + | VLOAD_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | VSTORE{memidx : memidx, memop : memop}(memidx : memidx, memop : memop) + | VSTORE_LANE{n : n, memidx : memidx, memop : memop, laneidx : laneidx}(n : n, memidx : memidx, memop : memop, laneidx : laneidx) + | REF.I31_NUM{u31 : u31}(u31 : u31) + | REF.STRUCT_ADDR{structaddr : structaddr}(structaddr : structaddr) + | REF.ARRAY_ADDR{arrayaddr : arrayaddr}(arrayaddr : arrayaddr) + | REF.FUNC_ADDR{funcaddr : funcaddr}(funcaddr : funcaddr) + | REF.HOST_ADDR{hostaddr : hostaddr}(hostaddr : hostaddr) + | REF.EXTERN{addrref : addrref}(addrref : addrref) + | LABEL_{n : n, instr* : instr*, admininstr* : admininstr*}(n : n, instr*{instr : instr} : instr*, admininstr*{admininstr : admininstr} : admininstr*) + | FRAME_{n : n, frame : frame, admininstr* : admininstr*}(n : n, frame : frame, admininstr*{admininstr : admininstr} : admininstr*) | TRAP } ;; 4-runtime.watsup -syntax config = `%;%*`(state : state, admininstr*) +syntax config = `%;%*`{state : state, admininstr* : admininstr*}(state : state, admininstr*{admininstr : admininstr} : admininstr*) ;; 4-runtime.watsup rec { @@ -29416,15 +29416,15 @@ rec { ;; 4-runtime.watsup:165.1-168.25 syntax E = | _HOLE - | _SEQ(val*, E : E, instr*) - | LABEL_(n : n, instr*, E : E) + | _SEQ{val* : val*, E : E, instr* : instr*}(val*{val : val} : val*, E : E, instr*{instr : instr} : instr*) + | LABEL_{n : n, instr* : instr*, E : E}(n : n, instr*{instr : instr} : instr*, E : E) } ;; 5-runtime-aux.watsup def $inst_reftype(moduleinst : moduleinst, reftype : reftype) : reftype ;; 5-runtime-aux.watsup - def $inst_reftype{mm : moduleinst, rt : reftype, dt* : deftype*}(mm, rt) = $subst_all_reftype(rt, (dt : deftype <: heaptype)*{dt}) - -- where dt*{dt} = mm.TYPE_moduleinst + def $inst_reftype{mm : moduleinst, rt : reftype, dt* : deftype*}(mm, rt) = $subst_all_reftype(rt, (dt : deftype <: heaptype)*{dt : deftype}) + -- where dt*{dt : deftype} = mm.TYPE_moduleinst ;; 5-runtime-aux.watsup def $default(valtype : valtype) : val? @@ -29465,9 +29465,9 @@ def $funcsxv(externval*) : funcaddr* ;; 5-runtime-aux.watsup:49.1-49.24 def $funcsxv([]) = [] ;; 5-runtime-aux.watsup:50.1-50.47 - def $funcsxv{fa : funcaddr, xv* : externval*}([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) + def $funcsxv{fa : funcaddr, xv* : externval*}([FUNC_externval(fa)] :: xv*{xv : externval}) = [fa] :: $funcsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:51.1-51.58 - def $funcsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $funcsxv(xv*{xv}) + def $funcsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $funcsxv(xv*{xv : externval}) -- otherwise } @@ -29479,9 +29479,9 @@ def $globalsxv(externval*) : globaladdr* ;; 5-runtime-aux.watsup:53.1-53.26 def $globalsxv([]) = [] ;; 5-runtime-aux.watsup:54.1-54.53 - def $globalsxv{ga : globaladdr, xv* : externval*}([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) + def $globalsxv{ga : globaladdr, xv* : externval*}([GLOBAL_externval(ga)] :: xv*{xv : externval}) = [ga] :: $globalsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:55.1-55.62 - def $globalsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $globalsxv(xv*{xv}) + def $globalsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $globalsxv(xv*{xv : externval}) -- otherwise } @@ -29493,9 +29493,9 @@ def $tablesxv(externval*) : tableaddr* ;; 5-runtime-aux.watsup:57.1-57.25 def $tablesxv([]) = [] ;; 5-runtime-aux.watsup:58.1-58.50 - def $tablesxv{ta : tableaddr, xv* : externval*}([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) + def $tablesxv{ta : tableaddr, xv* : externval*}([TABLE_externval(ta)] :: xv*{xv : externval}) = [ta] :: $tablesxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:59.1-59.60 - def $tablesxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $tablesxv(xv*{xv}) + def $tablesxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $tablesxv(xv*{xv : externval}) -- otherwise } @@ -29507,9 +29507,9 @@ def $memsxv(externval*) : memaddr* ;; 5-runtime-aux.watsup:61.1-61.23 def $memsxv([]) = [] ;; 5-runtime-aux.watsup:62.1-62.44 - def $memsxv{ma : memaddr, xv* : externval*}([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) + def $memsxv{ma : memaddr, xv* : externval*}([MEM_externval(ma)] :: xv*{xv : externval}) = [ma] :: $memsxv(xv*{xv : externval}) ;; 5-runtime-aux.watsup:63.1-63.56 - def $memsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv}) = $memsxv(xv*{xv}) + def $memsxv{externval : externval, xv* : externval*}([externval] :: xv*{xv : externval}) = $memsxv(xv*{xv : externval}) -- otherwise } @@ -29636,7 +29636,7 @@ def $with_tableinst(state : state, tableidx : tableidx, tableinst : tableinst) : ;; 5-runtime-aux.watsup def $with_mem(state : state, memidx : memidx, nat : nat, nat : nat, byte*) : state ;; 5-runtime-aux.watsup - def $with_mem{s : store, f : frame, x : idx, i : nat, j : nat, b* : byte*}(`%;%`(s, f), x, i, j, b*{b}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]].DATA_meminst[i : j] = b*{b}], f) + def $with_mem{s : store, f : frame, x : idx, i : nat, j : nat, b* : byte*}(`%;%`(s, f), x, i, j, b*{b : byte}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]].DATA_meminst[i : j] = b*{b : byte}], f) ;; 5-runtime-aux.watsup def $with_meminst(state : state, memidx : memidx, meminst : meminst) : state @@ -29646,12 +29646,12 @@ def $with_meminst(state : state, memidx : memidx, meminst : meminst) : state ;; 5-runtime-aux.watsup def $with_elem(state : state, elemidx : elemidx, ref*) : state ;; 5-runtime-aux.watsup - def $with_elem{s : store, f : frame, x : idx, r* : ref*}(`%;%`(s, f), x, r*{r}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]].ELEM_eleminst = r*{r}], f) + def $with_elem{s : store, f : frame, x : idx, r* : ref*}(`%;%`(s, f), x, r*{r : ref}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]].ELEM_eleminst = r*{r : ref}], f) ;; 5-runtime-aux.watsup def $with_data(state : state, dataidx : dataidx, byte*) : state ;; 5-runtime-aux.watsup - def $with_data{s : store, f : frame, x : idx, b* : byte*}(`%;%`(s, f), x, b*{b}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]].DATA_datainst = b*{b}], f) + def $with_data{s : store, f : frame, x : idx, b* : byte*}(`%;%`(s, f), x, b*{b : byte}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]].DATA_datainst = b*{b : byte}], f) ;; 5-runtime-aux.watsup def $with_struct(state : state, structaddr : structaddr, nat : nat, fieldval : fieldval) : state @@ -29666,31 +29666,31 @@ def $with_array(state : state, arrayaddr : arrayaddr, nat : nat, fieldval : fiel ;; 5-runtime-aux.watsup def $ext_structinst(state : state, structinst*) : state ;; 5-runtime-aux.watsup - def $ext_structinst{s : store, f : frame, si* : structinst*}(`%;%`(s, f), si*{si}) = `%;%`(s[STRUCT_store =.. si*{si}], f) + def $ext_structinst{s : store, f : frame, si* : structinst*}(`%;%`(s, f), si*{si : structinst}) = `%;%`(s[STRUCT_store =.. si*{si : structinst}], f) ;; 5-runtime-aux.watsup def $ext_arrayinst(state : state, arrayinst*) : state ;; 5-runtime-aux.watsup - def $ext_arrayinst{s : store, f : frame, ai* : arrayinst*}(`%;%`(s, f), ai*{ai}) = `%;%`(s[ARRAY_store =.. ai*{ai}], f) + def $ext_arrayinst{s : store, f : frame, ai* : arrayinst*}(`%;%`(s, f), ai*{ai : arrayinst}) = `%;%`(s[ARRAY_store =.. ai*{ai : arrayinst}], f) ;; 5-runtime-aux.watsup def $growtable(tableinst : tableinst, nat : nat, ref : ref) : tableinst? ;; 5-runtime-aux.watsup def $growtable{ti : tableinst, n : n, r : ref, ti' : tableinst, i : nat, j : nat, rt : reftype, r'* : ref*, i' : nat}(ti, n, r) = ?(ti') - -- where {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM r'*{r'}} = ti - -- where i' = (|r'*{r'}| + n) + -- where {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM r'*{r' : ref}} = ti + -- where i' = (|r'*{r' : ref}| + n) -- if (i' <= j) - -- where ti' = {TYPE `%%`(`[%..%]`(`%`(i'), `%`(j)), rt), ELEM r'*{r'} :: r^n{}} + -- where ti' = {TYPE `%%`(`[%..%]`(`%`(i'), `%`(j)), rt), ELEM r'*{r' : ref} :: r^n{}} def $growtable{x0 : tableinst, x1 : nat, x2 : ref}(x0, x1, x2) = ?() ;; 5-runtime-aux.watsup def $growmemory(meminst : meminst, nat : nat) : meminst? ;; 5-runtime-aux.watsup def $growmemory{mi : meminst, n : n, mi' : meminst, i : nat, j : nat, b* : byte*, i' : nat}(mi, n) = ?(mi') - -- where {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA b*{b}} = mi - -- where i' = ((|b*{b}| / (64 * $Ki)) + n) + -- where {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA b*{b : byte}} = mi + -- where i' = ((|b*{b : byte}| / (64 * $Ki)) + n) -- if (i' <= j) - -- where mi' = {TYPE `%I8`(`[%..%]`(`%`(i'), `%`(j))), DATA b*{b} :: `%`(0)^((n * 64) * $Ki){}} + -- where mi' = {TYPE `%I8`(`[%..%]`(`%`(i'), `%`(j))), DATA b*{b : byte} :: `%`(0)^((n * 64) * $Ki){}} def $growmemory{x0 : meminst, x1 : nat}(x0, x1) = ?() ;; 6-typing.watsup @@ -29699,25 +29699,25 @@ syntax init = | UNSET ;; 6-typing.watsup -syntax localtype = `%%`(init : init, valtype : valtype) +syntax localtype = `%%`{init : init, valtype : valtype}(init : init, valtype : valtype) ;; 6-typing.watsup -syntax instrtype = `%->%*%`(resulttype : resulttype, localidx*, resulttype : resulttype) +syntax instrtype = `%->%*%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) ;; 6-typing.watsup syntax context = { - TYPE deftype*, - REC subtype*, - FUNC deftype*, - GLOBAL globaltype*, - TABLE tabletype*, - MEM memtype*, - ELEM elemtype*, - DATA datatype*, - LOCAL localtype*, - LABEL resulttype*, - RETURN resulttype? + TYPE{deftype* : deftype*} deftype*, + REC{subtype* : subtype*} subtype*, + FUNC{deftype* : deftype*} deftype*, + GLOBAL{globaltype* : globaltype*} globaltype*, + TABLE{tabletype* : tabletype*} tabletype*, + MEM{memtype* : memtype*} memtype*, + ELEM{elemtype* : elemtype*} elemtype*, + DATA{datatype* : datatype*} datatype*, + LOCAL{localtype* : localtype*} localtype*, + LABEL{resulttype* : resulttype*} resulttype*, + RETURN{resulttype? : resulttype?} resulttype? } ;; 6-typing.watsup @@ -29728,7 +29728,7 @@ def $with_locals(context : context, localidx*, localtype*) : context ;; 6-typing.watsup:28.1-28.34 def $with_locals{C : context}(C, [], []) = C ;; 6-typing.watsup:29.1-29.85 - def $with_locals{C : context, x_1 : idx, x* : idx*, lt_1 : localtype, lt* : localtype*}(C, [x_1] :: x*{x}, [lt_1] :: lt*{lt}) = $with_locals(C[LOCAL_context[x_1.`%`.0] = lt_1], x*{x}, lt*{lt}) + def $with_locals{C : context, x_1 : idx, x* : idx*, lt_1 : localtype, lt* : localtype*}(C, [x_1] :: x*{x : localidx}, [lt_1] :: lt*{lt : localtype}) = $with_locals(C[LOCAL_context[x_1.`%`.0] = lt_1], x*{x : localidx}, lt*{lt : localtype}) } ;; 6-typing.watsup @@ -29739,15 +29739,15 @@ def $clostypes(deftype*) : deftype* ;; 6-typing.watsup:37.1-37.26 def $clostypes([]) = [] ;; 6-typing.watsup:38.1-38.93 - def $clostypes{dt* : deftype*, dt_N : deftype, dt'* : deftype*}(dt*{dt} :: [dt_N]) = dt'*{dt'} :: [$subst_all_deftype(dt_N, (dt' : deftype <: heaptype)*{dt'})] - -- where dt'*{dt'} = $clostypes(dt*{dt}) + def $clostypes{dt* : deftype*, dt_N : deftype, dt'* : deftype*}(dt*{dt : deftype} :: [dt_N]) = dt'*{dt' : deftype} :: [$subst_all_deftype(dt_N, (dt' : deftype <: heaptype)*{dt' : deftype})] + -- where dt'*{dt' : deftype} = $clostypes(dt*{dt : deftype}) } ;; 6-typing.watsup def $clostype(context : context, deftype : deftype) : deftype ;; 6-typing.watsup - def $clostype{C : context, dt : deftype, dt'* : deftype*}(C, dt) = $subst_all_deftype(dt, (dt' : deftype <: heaptype)*{dt'}) - -- where dt'*{dt'} = $clostypes(C.TYPE_context) + def $clostype{C : context, dt : deftype, dt'* : deftype*}(C, dt) = $subst_all_deftype(dt, (dt' : deftype <: heaptype)*{dt' : deftype}) + -- where dt'*{dt' : deftype} = $clostypes(C.TYPE_context) ;; 6-typing.watsup relation Numtype_ok: `%|-%:_OK`(context, numtype) @@ -29811,27 +29811,27 @@ relation Valtype_ok: `%|-%:_OK`(context, valtype) relation Resulttype_ok: `%|-%:_OK`(context, resulttype) ;; 6-typing.watsup rule _{C : context, t* : valtype*}: - `%|-%:_OK`(C, t*{t}) - -- (Valtype_ok: `%|-%:_OK`(C, t))*{t} + `%|-%:_OK`(C, t*{t : valtype}) + -- (Valtype_ok: `%|-%:_OK`(C, t))*{t : valtype} ;; 6-typing.watsup relation Instrtype_ok: `%|-%:_OK`(context, instrtype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, x* : idx*, t_2* : valtype*, lt* : localtype*}: - `%|-%:_OK`(C, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - -- if (|lt*{lt}| = |x*{x}|) - -- (if (x.`%`.0 < |C.LOCAL_context|))*{lt x} - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2}) - -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt x} + `%|-%:_OK`(C, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + -- if (|lt*{lt : localtype}| = |x*{x : idx}|) + -- (if (x.`%`.0 < |C.LOCAL_context|))*{lt : localtype x : idx} + -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) + -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt : localtype x : idx} ;; 6-typing.watsup syntax oktypeidx = - | OK(typeidx : typeidx) + | OK{typeidx : typeidx}(typeidx : typeidx) ;; 6-typing.watsup syntax oktypeidxnat = - | OK(typeidx : typeidx, nat : nat) + | OK{typeidx : typeidx}(typeidx : typeidx, nat) ;; 6-typing.watsup relation Packtype_ok: `%|-%:_OK`(context, packtype) @@ -29862,16 +29862,16 @@ relation Fieldtype_ok: `%|-%:_OK`(context, fieldtype) relation Functype_ok: `%|-%:_OK`(context, functype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:_OK`(C, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2}) + `%|-%:_OK`(C, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) + -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) ;; 6-typing.watsup relation Comptype_ok: `%|-%:_OK`(context, comptype) ;; 6-typing.watsup rule struct{C : context, yt* : fieldtype*}: - `%|-%:_OK`(C, STRUCT_comptype(yt*{yt})) - -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt} + `%|-%:_OK`(C, STRUCT_comptype(yt*{yt : fieldtype})) + -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt : fieldtype} ;; 6-typing.watsup rule array{C : context, yt : fieldtype}: @@ -29908,7 +29908,7 @@ relation Deftype_sub: `%|-%<:%`(context, deftype, deftype) ;; 6-typing.watsup:438.1-441.40 rule super{C : context, deftype_1 : deftype, deftype_2 : deftype, fin : fin, ht_1* : heaptype*, ht : heaptype, ht_2* : heaptype*, ct : comptype}: `%|-%<:%`(C, deftype_1, deftype_2) - -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1 : heaptype} :: [ht] :: ht_2*{ht_2 : heaptype}, ct)) -- Heaptype_sub: `%|-%<:%`(C, ht, (deftype_2 : deftype <: heaptype)) ;; 6-typing.watsup:271.1-271.79 @@ -29943,7 +29943,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:303.1-305.35 rule struct{C : context, deftype : deftype, yt* : fieldtype*}: `%|-%<:%`(C, (deftype : deftype <: heaptype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) + -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt : fieldtype})) ;; 6-typing.watsup:307.1-309.33 rule array{C : context, deftype : deftype, yt : fieldtype}: @@ -29976,7 +29976,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) rule rec{C : context, i : nat, ht : heaptype, fin : fin, ht_1* : heaptype*, ht_2* : heaptype*, ct : comptype}: `%|-%<:%`(C, REC_heaptype(i), ht) -- if (i < |C.REC_context|) - -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1 : heaptype} :: [ht] :: ht_2*{ht_2 : heaptype}, ct)) ;; 6-typing.watsup:331.1-333.40 rule none{C : context, heaptype : heaptype}: @@ -30072,9 +30072,9 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) ;; 6-typing.watsup rule struct{C : context, yt_1* : fieldtype*, yt'_1 : fieldtype, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) - -- if (|yt_1*{yt_1}| = |yt_2*{yt_2}|) - -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} + `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1 : fieldtype} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2 : fieldtype})) + -- if (|yt_1*{yt_1 : fieldtype}| = |yt_2*{yt_2 : fieldtype}|) + -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 : fieldtype yt_2 : fieldtype} ;; 6-typing.watsup rule array{C : context, yt_1 : fieldtype, yt_2 : fieldtype}: @@ -30090,15 +30090,15 @@ relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) ;; 6-typing.watsup rule _{C : context, fin : fin, y* : idx*, ct : comptype, x : idx, y'** : idx**, ct'* : comptype*}: - `%|-%:%`(C, SUB_subtype(fin, y*{y}, ct), OK_oktypeidx(x)) - -- (if (y.`%`.0 < |C.TYPE_context|))*{ct' y y'} - -- if (|y*{y}| <= 1) + `%|-%:%`(C, SUB_subtype(fin, y*{y : typeidx}, ct), OK_oktypeidx(x)) + -- (if (y.`%`.0 < |C.TYPE_context|))*{ct' : comptype y : idx y' : typeidx} + -- if (|y*{y : idx}| <= 1) -- Comptype_ok: `%|-%:_OK`(C, ct) - -- if (|ct'*{ct'}| = |y*{y}|) - -- if (|ct'*{ct'}| = |y'*{y'}*{y'}|) - -- (if (y.`%`.0 < x.`%`.0))*{y} - -- (if ($unrolldt(C.TYPE_context[y.`%`.0]) = SUB_subtype(`FINAL%?`(?()), y'*{y'}, ct')))*{ct' y y'} - -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct'} + -- if (|ct'*{ct' : comptype}| = |y*{y : idx}|) + -- if (|ct'*{ct' : comptype}| = |y'*{y' : idx}*{y' : idx}|) + -- (if (y.`%`.0 < x.`%`.0))*{y : idx} + -- (if ($unrolldt(C.TYPE_context[y.`%`.0]) = SUB_subtype(`FINAL%?`(?()), y'*{y' : typeidx}, ct')))*{ct' : comptype y : idx y' : typeidx} + -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct' : comptype} ;; 6-typing.watsup def $before(heaptype : heaptype, typeidx : typeidx, nat : nat) : bool @@ -30122,14 +30122,14 @@ def $unrollht(context : context, heaptype : heaptype) : subtype relation Subtype_ok2: `%|-%:%`(context, subtype, oktypeidxnat) ;; 6-typing.watsup rule _{C : context, fin : fin, ht* : heaptype*, ct : comptype, x : idx, i : nat, ht'** : heaptype**, ct'* : comptype*}: - `%|-%:%`(C, SUBD_subtype(fin, ht*{ht}, ct), OK_oktypeidxnat(x, i)) - -- if (|ht*{ht}| <= 1) + `%|-%:%`(C, SUBD_subtype(fin, ht*{ht : heaptype}, ct), OK_oktypeidxnat(x, i)) + -- if (|ht*{ht : heaptype}| <= 1) -- Comptype_ok: `%|-%:_OK`(C, ct) - -- if (|ct'*{ct'}| = |ht*{ht}|) - -- if (|ct'*{ct'}| = |ht'*{ht'}*{ht'}|) - -- (if $before(ht, x, i))*{ht} - -- (if ($unrollht(C, ht) = SUBD_subtype(`FINAL%?`(?()), ht'*{ht'}, ct')))*{ct' ht ht'} - -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct'} + -- if (|ct'*{ct' : comptype}| = |ht*{ht : heaptype}|) + -- if (|ct'*{ct' : comptype}| = |ht'*{ht' : heaptype}*{ht' : heaptype}|) + -- (if $before(ht, x, i))*{ht : heaptype} + -- (if ($unrollht(C, ht) = SUBD_subtype(`FINAL%?`(?()), ht'*{ht' : heaptype}, ct')))*{ct' : comptype ht : heaptype ht' : heaptype} + -- (Comptype_sub: `%|-%<:%`(C, ct, ct'))*{ct' : comptype} ;; 6-typing.watsup rec { @@ -30142,8 +30142,8 @@ relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) ;; 6-typing.watsup:199.1-202.50 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidxnat(x, i)) - -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) + `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidxnat(x, i)) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) } @@ -30158,14 +30158,14 @@ relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) ;; 6-typing.watsup:187.1-190.43 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidx(x)) - -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) + `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidx(x)) + -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) ;; 6-typing.watsup:192.1-194.49 rule rec2{C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) + `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(x, 0)) } ;; 6-typing.watsup @@ -30174,7 +30174,7 @@ relation Deftype_ok: `%|-%:_OK`(context, deftype) rule _{C : context, qt : rectype, i : nat, x : idx, st^n : subtype^n, n : n}: `%|-%:_OK`(C, DEF_deftype(qt, i)) -- Rectype_ok: `%|-%:%`(C, qt, OK_oktypeidx(x)) - -- if (qt = REC_rectype(st^n{st})) + -- if (qt = REC_rectype(st^n{st : subtype})) -- if (i < n) ;; 6-typing.watsup @@ -30234,21 +30234,21 @@ relation Externtype_ok: `%|-%:_OK`(context, externtype) relation Resulttype_sub: `%|-%*_<:%*`(context, valtype*, valtype*) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%*_<:%*`(C, t_1*{t_1}, t_2*{t_2}) - -- if (|t_1*{t_1}| = |t_2*{t_2}|) - -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 t_2} + `%|-%*_<:%*`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) + -- if (|t_1*{t_1 : valtype}| = |t_2*{t_2 : valtype}|) + -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 : valtype t_2 : valtype} ;; 6-typing.watsup relation Instrtype_sub: `%|-%<:%`(context, instrtype, instrtype) ;; 6-typing.watsup rule _{C : context, t_11* : valtype*, x_1* : idx*, t_12* : valtype*, t_21* : valtype*, x_2* : idx*, t_22* : valtype*, x* : idx*, t* : valtype*}: - `%|-%<:%`(C, `%->%*%`(t_11*{t_11}, x_1*{x_1}, t_12*{t_12}), `%->%*%`(t_21*{t_21}, x_2*{x_2}, t_22*{t_22})) - -- if (|t*{t}| = |x*{x}|) - -- (if (x.`%`.0 < |C.LOCAL_context|))*{t x} - -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21}, t_11*{t_11}) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12}, t_22*{t_22}) - -- if (x*{x} = $setminus(x_2*{x_2}, x_1*{x_1})) - -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t x} + `%|-%<:%`(C, `%->%*%`(t_11*{t_11 : valtype}, x_1*{x_1 : localidx}, t_12*{t_12 : valtype}), `%->%*%`(t_21*{t_21 : valtype}, x_2*{x_2 : localidx}, t_22*{t_22 : valtype})) + -- if (|t*{t : valtype}| = |x*{x : idx}|) + -- (if (x.`%`.0 < |C.LOCAL_context|))*{t : valtype x : idx} + -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) + -- if (x*{x : idx} = $setminus(x_2*{x_2 : idx}, x_1*{x_1 : idx})) + -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t : valtype x : idx} ;; 6-typing.watsup relation Limits_sub: `%|-%<:%`(context, limits, limits) @@ -30332,7 +30332,7 @@ rec { relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:544.1-545.34 rule unreachable{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:547.1-548.24 rule nop{C : context}: @@ -30360,129 +30360,129 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:578.1-581.61 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:583.1-586.61 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:588.1-592.65 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_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_2*{x_2 : localidx}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:597.1-599.24 rule br{C : context, l : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) -- if (l.`%`.0 < |C.LABEL_context|) - -- where t*{t} = C.LABEL_context[l.`%`.0] + -- where t*{t : valtype} = C.LABEL_context[l.`%`.0] ;; 6-typing.watsup:601.1-603.24 rule br_if{C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) + `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t : valtype} :: [I32_valtype], t*{t : valtype})) -- if (l.`%`.0 < |C.LABEL_context|) - -- where t*{t} = C.LABEL_context[l.`%`.0] + -- where t*{t : valtype} = C.LABEL_context[l.`%`.0] ;; 6-typing.watsup:605.1-608.44 rule br_table{C : context, l* : labelidx*, l' : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- (if (l.`%`.0 < |C.LABEL_context|))*{l} + `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + -- (if (l.`%`.0 < |C.LABEL_context|))*{l : labelidx} -- if (l'.`%`.0 < |C.LABEL_context|) - -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[l.`%`.0]))*{l} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[l'.`%`.0]) + -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0]))*{l : labelidx} + -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0]) ;; 6-typing.watsup:610.1-613.31 rule br_on_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) -- if (l.`%`.0 < |C.LABEL_context|) -- Heaptype_ok: `%|-%:_OK`(C, ht) - -- where t*{t} = C.LABEL_context[l.`%`.0] + -- where t*{t : valtype} = C.LABEL_context[l.`%`.0] ;; 6-typing.watsup:615.1-618.31 rule br_on_non_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype})) -- if (l.`%`.0 < |C.LABEL_context|) - -- where t*{t} :: [REF_valtype(`NULL%?`(?()), ht)] = C.LABEL_context[l.`%`.0] + -- where t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)] = C.LABEL_context[l.`%`.0] -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:620.1-626.34 rule br_on_cast{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 : reftype <: valtype)], t*{t} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) -- if (l.`%`.0 < |C.LABEL_context|) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- where t*{t} :: [(rt : reftype <: valtype)] = C.LABEL_context[l.`%`.0] + -- where t*{t : valtype} :: [(rt : reftype <: valtype)] = C.LABEL_context[l.`%`.0] -- Reftype_sub: `%|-%<:%`(C, rt_2, rt) ;; 6-typing.watsup:628.1-634.49 rule br_on_cast_fail{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 : reftype <: valtype)], t*{t} :: [(rt_2 : reftype <: valtype)])) + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [(rt_2 : reftype <: valtype)])) -- if (l.`%`.0 < |C.LABEL_context|) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- where t*{t} :: [(rt : reftype <: valtype)] = C.LABEL_context[l.`%`.0] + -- where t*{t : valtype} :: [(rt : reftype <: valtype)] = C.LABEL_context[l.`%`.0] -- Reftype_sub: `%|-%<:%`(C, $diffrt(rt_1, rt_2), rt) ;; 6-typing.watsup:639.1-641.24 rule return{C : context, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- where ?(t*{t}) = C.RETURN_context + `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + -- where ?(t*{t : valtype}) = C.RETURN_context ;; 6-typing.watsup:643.1-645.46 rule call{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) + `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) -- if (x.`%`.0 < |C.FUNC_context|) - -- where FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2})) = $expanddt(C.FUNC_context[x.`%`.0]) + -- where FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) = $expanddt(C.FUNC_context[x.`%`.0]) ;; 6-typing.watsup:647.1-649.46 rule call_ref{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2})) + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2 : valtype})) -- if (x.`%`.0 < |C.TYPE_context|) - -- where FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2})) = $expanddt(C.TYPE_context[x.`%`.0]) + -- where FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) = $expanddt(C.TYPE_context[x.`%`.0]) ;; 6-typing.watsup:651.1-655.46 rule call_indirect{C : context, x : idx, y : idx, t_1* : valtype*, t_2* : valtype*, lim : limits, rt : reftype}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) -- if (x.`%`.0 < |C.TABLE_context|) -- if (y.`%`.0 < |C.TYPE_context|) -- where `%%`(lim, rt) = C.TABLE_context[x.`%`.0] - -- where FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2})) = $expanddt(C.TYPE_context[y.`%`.0]) + -- where FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) = $expanddt(C.TYPE_context[y.`%`.0]) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) ;; 6-typing.watsup:657.1-661.40 rule return_call{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}, t_4*{t_4 : valtype})) -- if (x.`%`.0 < |C.FUNC_context|) - -- where FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2})) = $expanddt(C.FUNC_context[x.`%`.0]) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- where FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) = $expanddt(C.FUNC_context[x.`%`.0]) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) ;; 6-typing.watsup:663.1-667.40 rule return_call_ref{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4})) + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4 : valtype})) -- if (x.`%`.0 < |C.TYPE_context|) - -- where FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2})) = $expanddt(C.TYPE_context[x.`%`.0]) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- where FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) = $expanddt(C.TYPE_context[x.`%`.0]) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) ;; 6-typing.watsup:669.1-675.40 rule return_call_indirect{C : context, x : idx, y : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, lim : limits, rt : reftype, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype], t_4*{t_4 : valtype})) -- if (x.`%`.0 < |C.TABLE_context|) -- if (y.`%`.0 < |C.TYPE_context|) -- where `%%`(lim, rt) = C.TABLE_context[x.`%`.0] - -- where FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2})) = $expanddt(C.TYPE_context[y.`%`.0]) + -- where FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) = $expanddt(C.TYPE_context[y.`%`.0]) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) ;; 6-typing.watsup:680.1-681.33 rule const{C : context, nt : numtype, c_nt : num_(nt)}: @@ -30512,9 +30512,9 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:701.1-704.50 rule convert-i{C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: - `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) -- if (inn_1 =/= inn_2) - -- if ((sx?{sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) + -- if ((sx?{sx : sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) ;; 6-typing.watsup:706.1-708.24 rule convert-f{C : context, fnn_1 : fnn, fnn_2 : fnn}: @@ -30569,36 +30569,36 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:756.1-758.43 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) -- if (x.`%`.0 < |C.TYPE_context|) - -- where STRUCT_comptype(`%%`(mut, zt)*{mut zt}) = $expanddt(C.TYPE_context[x.`%`.0]) - -- if (|mut*{mut}| = |zt*{zt}|) + -- where STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype}) = $expanddt(C.TYPE_context[x.`%`.0]) + -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) ;; 6-typing.watsup:760.1-763.39 rule struct.new_default{C : context, x : idx, zt* : storagetype*, mut* : mut*, val* : val*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) -- if (x.`%`.0 < |C.TYPE_context|) - -- where STRUCT_comptype(`%%`(mut, zt)*{mut zt}) = $expanddt(C.TYPE_context[x.`%`.0]) - -- if (|mut*{mut}| = |zt*{zt}|) - -- (where ?(val) = $default($unpack(zt)))*{val zt} - -- if (|val*{val}| = |zt*{zt}|) + -- where STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype}) = $expanddt(C.TYPE_context[x.`%`.0]) + -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) + -- (where ?(val) = $default($unpack(zt)))*{val : val zt : storagetype} + -- if (|val*{val : val}| = |zt*{zt : storagetype}|) ;; 6-typing.watsup:765.1-769.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: - `%|-%:%`(C, STRUCT.GET_instr(sx?{sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) + `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) -- if (x.`%`.0 < |C.TYPE_context|) - -- where STRUCT_comptype(yt*{yt}) = $expanddt(C.TYPE_context[x.`%`.0]) - -- if (i < |yt*{yt}|) - -- where `%%`(mut, zt) = yt*{yt}[i] - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + -- where STRUCT_comptype(yt*{yt : fieldtype}) = $expanddt(C.TYPE_context[x.`%`.0]) + -- if (i < |yt*{yt : fieldtype}|) + -- where `%%`(mut, zt) = yt*{yt : fieldtype}[i] + -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:771.1-774.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)], [])) -- if (x.`%`.0 < |C.TYPE_context|) - -- where STRUCT_comptype(yt*{yt}) = $expanddt(C.TYPE_context[x.`%`.0]) - -- if (i < |yt*{yt}|) - -- where `%%`(`MUT%?`(?(())), zt) = yt*{yt}[i] + -- where STRUCT_comptype(yt*{yt : fieldtype}) = $expanddt(C.TYPE_context[x.`%`.0]) + -- if (i < |yt*{yt : fieldtype}|) + -- where `%%`(`MUT%?`(?(())), zt) = yt*{yt : fieldtype}[i] ;; 6-typing.watsup:779.1-781.41 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: @@ -30647,10 +30647,10 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:803.1-806.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) -- if (x.`%`.0 < |C.TYPE_context|) -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt(C.TYPE_context[x.`%`.0]) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:808.1-810.41 rule array.set{C : context, x : idx, zt : storagetype}: @@ -30743,8 +30743,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:870.1-872.22 rule vshuffle{C : context, imm : imm, N : N, i* : nat*}: - `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) - -- (if (i < (N * 2)))*{i} + `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + -- (if (i < (N * 2)))*{i : nat} ;; 6-typing.watsup:874.1-875.48 rule vsplat{C : context, lnn : lnn, N : N}: @@ -30752,7 +30752,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:878.1-880.14 rule vextract_lane{C : context, lnn : lnn, N : N, sx? : sx?, i : nat}: - `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) + `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) -- if (i < N) ;; 6-typing.watsup:882.1-884.14 @@ -30782,7 +30782,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:902.1-903.55 rule vcvtop{C : context, sh : shape, vcvtop : vcvtop, hf? : half?, sx? : sx?, zero : zero}: - `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf}, sh, sx?{sx}, zero), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`([V128_valtype], [V128_valtype])) ;; 6-typing.watsup:905.1-906.44 rule vnarrow{C : context, sh : ishape, sx : sx}: @@ -30914,39 +30914,39 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1011.1-1016.29 rule load-0{C : context, nt : numtype, n? : n?, sx? : sx?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) -- if (x.`%`.0 < |C.MEM_context|) - -- if ((n?{n} = ?()) <=> (sx?{sx} = ?())) + -- if ((n?{n : n} = ?()) <=> (sx?{sx : sx} = ?())) -- if ((2 ^ n_A) <= ($size(nt) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n} - -- if (n?{n} = ?()) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} + -- if (n?{n : n} = ?()) -- where mt = C.MEM_context[x.`%`.0] ;; 6-typing.watsup:1011.1-1016.29 rule load-1{C : context, nt : numtype, n? : n?, sx? : sx?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) -- if (x.`%`.0 < |C.MEM_context|) - -- if ((n?{n} = ?()) <=> (sx?{sx} = ?())) + -- if ((n?{n : n} = ?()) <=> (sx?{sx : sx} = ?())) -- if ((2 ^ n_A) <= ($size(nt) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n} + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} -- where (inn : inn <: numtype) = nt -- where mt = C.MEM_context[x.`%`.0] ;; 6-typing.watsup:1018.1-1023.29 rule store-0{C : context, nt : numtype, n? : n?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) + `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) -- if (x.`%`.0 < |C.MEM_context|) -- if ((2 ^ n_A) <= ($size(nt) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n} - -- if (n?{n} = ?()) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} + -- if (n?{n : n} = ?()) -- where mt = C.MEM_context[x.`%`.0] ;; 6-typing.watsup:1018.1-1023.29 rule store-1{C : context, nt : numtype, n? : n?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) + `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) -- if (x.`%`.0 < |C.MEM_context|) -- if ((2 ^ n_A) <= ($size(nt) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n} + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} -- where (inn : inn <: numtype) = nt -- where mt = C.MEM_context[x.`%`.0] @@ -30998,8 +30998,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) relation Instrf_ok: `%|-%:%`(context, instr, instrtype) ;; 6-typing.watsup:518.1-520.41 rule instr{C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1 : valtype}, [], t_2*{t_2 : valtype})) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) ;; 6-typing.watsup:924.1-926.28 rule local.set{C : context, x : idx, t : valtype, init : init}: @@ -31021,33 +31021,33 @@ relation Instrs_ok: `%|-%*_:%`(context, instr*, instrtype) ;; 6-typing.watsup:525.1-530.52 rule seq{C : context, instr_1 : instr, instr_2* : instr*, t_1* : valtype*, x_1* : idx*, x_2* : idx*, t_3* : valtype*, init* : init*, t* : valtype*, C' : context, t_2* : valtype*}: - `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_1*{x_1} :: x_2*{x_2}, t_3*{t_3})) - -- if (|init*{init}| = |t*{t}|) - -- if (|init*{init}| = |x_1*{x_1}|) - -- (if (x_1.`%`.0 < |C.LOCAL_context|))*{init t x_1} - -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init t x_1} - -- if (C' = $with_locals(C, x_1*{x_1}, `%%`(SET_init, t)*{t})) - -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2}, `%->%*%`(t_2*{t_2}, x_2*{x_2}, t_3*{t_3})) + `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + -- if (|init*{init : init}| = |t*{t : valtype}|) + -- if (|init*{init : init}| = |x_1*{x_1 : idx}|) + -- (if (x_1.`%`.0 < |C.LOCAL_context|))*{init : init t : valtype x_1 : idx} + -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init : init t : valtype x_1 : idx} + -- if (C' = $with_locals(C, x_1*{x_1 : localidx}, `%%`(SET_init, t)*{t : valtype})) + -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2 : instr}, `%->%*%`(t_2*{t_2 : valtype}, x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) ;; 6-typing.watsup:532.1-535.35 rule sub{C : context, instr* : instr*, it' : instrtype, it : instrtype}: - `%|-%*_:%`(C, instr*{instr}, it') - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, it) + `%|-%*_:%`(C, instr*{instr : instr}, it') + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, it) -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:537.1-539.47 rule frame{C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, x* : idx*, t_2* : valtype*}: - `%|-%*_:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t*{t : valtype} :: t_1*{t_1 : valtype}, x*{x : localidx}, t*{t : valtype} :: t_2*{t_2 : valtype})) + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) } ;; 6-typing.watsup relation Expr_ok: `%|-%:%`(context, expr, resulttype) ;; 6-typing.watsup rule _{C : context, instr* : instr*, t* : valtype*}: - `%|-%:%`(C, instr*{instr}, t*{t}) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr}, `%->%*%`([], [], t*{t})) + `%|-%:%`(C, instr*{instr : instr}, t*{t : valtype}) + -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`([], [], t*{t : valtype})) ;; 6-typing.watsup rec { @@ -31057,7 +31057,7 @@ def $in_binop(numtype : numtype, binop_ : binop_(numtype), binop_(numtype)*) : b ;; 6-typing.watsup:1087.1-1087.42 def $in_binop{nt : numtype, binop : binop_(nt), epsilon : binop_(nt)*}(nt, binop, epsilon) = false ;; 6-typing.watsup:1088.1-1088.99 - def $in_binop{nt : numtype, binop : binop_(nt), ibinop_1 : binop_(nt), ibinop'* : binop_(nt)*}(nt, binop, [ibinop_1] :: ibinop'*{ibinop'}) = ((binop = ibinop_1) \/ $in_binop(nt, binop, ibinop'*{ibinop'})) + def $in_binop{nt : numtype, binop : binop_(nt), ibinop_1 : binop_(nt), ibinop'* : binop_(nt)*}(nt, binop, [ibinop_1] :: ibinop'*{ibinop' : binop_(nt)}) = ((binop = ibinop_1) \/ $in_binop(nt, binop, ibinop'*{ibinop' : binop_(nt)})) } ;; 6-typing.watsup @@ -31068,7 +31068,7 @@ def $in_numtype(numtype : numtype, numtype*) : bool ;; 6-typing.watsup:1083.1-1083.37 def $in_numtype{nt : numtype, epsilon : numtype*}(nt, epsilon) = false ;; 6-typing.watsup:1084.1-1084.68 - def $in_numtype{nt : numtype, nt_1 : numtype, nt'* : numtype*}(nt, [nt_1] :: nt'*{nt'}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt'})) + def $in_numtype{nt : numtype, nt_1 : numtype, nt'* : numtype*}(nt, [nt_1] :: nt'*{nt' : numtype}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt' : numtype})) } ;; 6-typing.watsup @@ -31105,8 +31105,8 @@ relation Instr_const: `%|-%CONST`(context, instr) relation Expr_const: `%|-%CONST`(context, expr) ;; 6-typing.watsup rule _{C : context, instr* : instr*}: - `%|-%CONST`(C, instr*{instr}) - -- (Instr_const: `%|-%CONST`(C, instr))*{instr} + `%|-%CONST`(C, instr*{instr : instr}) + -- (Instr_const: `%|-%CONST`(C, instr))*{instr : instr} ;; 6-typing.watsup relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) @@ -31120,10 +31120,10 @@ relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) relation Type_ok: `%|-%:%*`(context, type, deftype*) ;; 6-typing.watsup rule _{C : context, rectype : rectype, dt* : deftype*, x : idx}: - `%|-%:%*`(C, TYPE(rectype), dt*{dt}) + `%|-%:%*`(C, TYPE(rectype), dt*{dt : deftype}) -- if (x = `%`(|C.TYPE_context|)) - -- if (dt*{dt} = $rolldt(x, rectype)) - -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt}], rectype, OK_oktypeidx(x)) + -- if (dt*{dt : deftype} = $rolldt(x, rectype)) + -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt : deftype}], rectype, OK_oktypeidx(x)) ;; 6-typing.watsup relation Local_ok: `%|-%:%`(context, local, localtype) @@ -31141,12 +31141,12 @@ relation Local_ok: `%|-%:%`(context, local, localtype) relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup rule _{C : context, x : idx, local* : local*, expr : expr, t_1* : valtype*, t_2* : valtype*, lt* : localtype*}: - `%|-%:%`(C, `FUNC%%*%`(x, local*{local}, expr), C.TYPE_context[x.`%`.0]) + `%|-%:%`(C, `FUNC%%*%`(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) -- if (x.`%`.0 < |C.TYPE_context|) - -- (Local_ok: `%|-%:%`(C, local, lt))*{local lt} - -- where FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2})) = $expanddt(C.TYPE_context[x.`%`.0]) - -- if (|local*{local}| = |lt*{lt}|) - -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1} :: lt*{lt}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2})}, expr, t_2*{t_2}) + -- (Local_ok: `%|-%:%`(C, local, lt))*{local : local lt : localtype} + -- where FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) = $expanddt(C.TYPE_context[x.`%`.0]) + -- if (|local*{local : local}| = |lt*{lt : localtype}|) + -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2 : valtype})}, expr, t_2*{t_2 : valtype}) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -31194,8 +31194,8 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup rule _{C : context, rt : reftype, expr* : expr*, elemmode : elemmode}: - `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr}, elemmode), rt) - -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr} + `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr : expr}, elemmode), rt) + -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr : expr} -- Elemmode_ok: `%|-%:%`(C, elemmode, rt) ;; 6-typing.watsup @@ -31215,7 +31215,7 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) relation Data_ok: `%|-%:_OK`(context, data) ;; 6-typing.watsup rule _{C : context, b* : byte*, datamode : datamode}: - `%|-%:_OK`(C, `DATA%*%`(b*{b}, datamode)) + `%|-%:_OK`(C, `DATA%*%`(b*{b : byte}, datamode)) -- Datamode_ok: `%|-%:_OK`(C, datamode) ;; 6-typing.watsup @@ -31277,9 +31277,9 @@ relation Globals_ok: `%|-%*_:%*`(context, global*, globaltype*) ;; 6-typing.watsup:1275.1-1278.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: - `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt}) + `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) - -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt}) + -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) } ;; 6-typing.watsup @@ -31293,38 +31293,38 @@ relation Types_ok: `%|-%*_:%*`(context, type*, deftype*) ;; 6-typing.watsup:1267.1-1270.49 rule cons{C : context, type_1 : type, type* : type*, dt_1 : deftype, dt* : deftype*}: - `%|-%*_:%*`(C, [type_1] :: type*{type}, dt_1*{} :: dt*{dt}) + `%|-%*_:%*`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, dt*{dt}) + -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) } ;; 6-typing.watsup relation Module_ok: `|-%:_OK`(module) ;; 6-typing.watsup rule _{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data^n : data^n, n : n, start? : start?, export* : export*, dt'* : deftype*, ixt* : externtype*, C' : context, gt* : globaltype*, tt* : tabletype*, mt* : memtype*, C : context, dt* : deftype*, rt* : reftype*, et* : externtype*, idt* : deftype*, igt* : globaltype*, itt* : tabletype*, imt* : memtype*}: - `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type}, import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data^n{data}, start?{start}, export*{export})) - -- if (|import*{import}| = |ixt*{ixt}|) - -- if (|table*{table}| = |tt*{tt}|) - -- if (|mem*{mem}| = |mt*{mt}|) - -- if (|dt*{dt}| = |func*{func}|) - -- if (|elem*{elem}| = |rt*{rt}|) - -- if (|et*{et}| = |export*{export}|) - -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type}, dt'*{dt'}) - -- (Import_ok: `%|-%:%`({TYPE dt'*{dt'}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import ixt} - -- Globals_ok: `%|-%*_:%*`(C', global*{global}, gt*{gt}) - -- (Table_ok: `%|-%:%`(C', table, tt))*{table tt} - -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem mt} - -- (Func_ok: `%|-%:%`(C, func, dt))*{dt func} - -- (Elem_ok: `%|-%:%`(C, elem, rt))*{elem rt} - -- (Data_ok: `%|-%:_OK`(C, data))^n{data} - -- (Start_ok: `%|-%:_OK`(C, start))?{start} - -- (Export_ok: `%|-%:%`(C, export, et))*{et export} - -- if (C = {TYPE dt'*{dt'}, REC [], FUNC idt*{idt} :: dt*{dt}, GLOBAL igt*{igt} :: gt*{gt}, TABLE itt*{itt} :: tt*{tt}, MEM imt*{imt} :: mt*{mt}, ELEM rt*{rt}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) - -- if (C' = {TYPE dt'*{dt'}, REC [], FUNC idt*{idt} :: dt*{dt}, GLOBAL igt*{igt}, TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}) - -- if (idt*{idt} = $funcsxt(ixt*{ixt})) - -- if (igt*{igt} = $globalsxt(ixt*{ixt})) - -- if (itt*{itt} = $tablesxt(ixt*{ixt})) - -- if (imt*{imt} = $memsxt(ixt*{ixt})) + `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) + -- if (|import*{import : import}| = |ixt*{ixt : externtype}|) + -- if (|table*{table : table}| = |tt*{tt : tabletype}|) + -- if (|mem*{mem : mem}| = |mt*{mt : memtype}|) + -- if (|dt*{dt : deftype}| = |func*{func : func}|) + -- if (|elem*{elem : elem}| = |rt*{rt : reftype}|) + -- if (|et*{et : externtype}| = |export*{export : export}|) + -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) + -- (Import_ok: `%|-%:%`({TYPE dt'*{dt' : deftype}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import : import ixt : externtype} + -- Globals_ok: `%|-%*_:%*`(C', global*{global : global}, gt*{gt : globaltype}) + -- (Table_ok: `%|-%:%`(C', table, tt))*{table : table tt : tabletype} + -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem : mem mt : memtype} + -- (Func_ok: `%|-%:%`(C, func, dt))*{dt : deftype func : func} + -- (Elem_ok: `%|-%:%`(C, elem, rt))*{elem : elem rt : reftype} + -- (Data_ok: `%|-%:_OK`(C, data))^n{data : data} + -- (Start_ok: `%|-%:_OK`(C, start))?{start : start} + -- (Export_ok: `%|-%:%`(C, export, et))*{et : externtype export : export} + -- if (C = {TYPE dt'*{dt' : deftype}, REC [], FUNC idt*{idt : deftype} :: dt*{dt : deftype}, GLOBAL igt*{igt : globaltype} :: gt*{gt : globaltype}, TABLE itt*{itt : tabletype} :: tt*{tt : tabletype}, MEM imt*{imt : memtype} :: mt*{mt : memtype}, ELEM rt*{rt : elemtype}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) + -- if (C' = {TYPE dt'*{dt' : deftype}, REC [], FUNC idt*{idt : deftype} :: dt*{dt : deftype}, GLOBAL igt*{igt : globaltype}, TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}) + -- if (idt*{idt : deftype} = $funcsxt(ixt*{ixt : externtype})) + -- if (igt*{igt : globaltype} = $globalsxt(ixt*{ixt : externtype})) + -- if (itt*{itt : tabletype} = $tablesxt(ixt*{ixt : externtype})) + -- if (imt*{imt : memtype} = $memsxt(ixt*{ixt : externtype})) ;; 7-runtime-typing.watsup relation Ref_ok: `%|-%:%`(store, ref, reftype) @@ -31378,35 +31378,35 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule select-true{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_1 : val <: admininstr)]) + `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule select-false{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_2 : val <: admininstr)]) + `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule if-true{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) + `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule if-false{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) + `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule label-vals{n : n, instr* : instr*, val* : val*}: - `%*_~>%*`([LABEL__admininstr(n, instr*{instr}, (val : val <: admininstr)*{val})], (val : val <: admininstr)*{val}) + `%*_~>%*`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) ;; 8-reduction.watsup rule br-zero{n : n, instr'* : instr*, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)^n{val} :: (instr' : instr <: admininstr)*{instr'}) + `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule br-succ{n : n, instr'* : instr*, val* : val*, l : labelidx, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val : val <: admininstr)*{val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)*{val} :: [BR_admininstr(l)]) + `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) ;; 8-reduction.watsup rule br_if-true{c : num_(I32_numtype), l : labelidx}: @@ -31420,13 +31420,13 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule br_table-lt{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) - -- if (i < |l*{l}|) + `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) + -- if (i < |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_table-ge{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) - -- if (i >= |l*{l}|) + `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) + -- if (i >= |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_on_null-null{val : val, l : labelidx, ht : heaptype}: @@ -31458,15 +31458,15 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule frame-vals{n : n, f : frame, val^n : val^n}: - `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val})], (val : val <: admininstr)^n{val}) + `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-frame{n : n, f : frame, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)^n{val}) + `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-label{k : nat, instr'* : instr*, val* : val*, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(k, instr'*{instr'}, (val : val <: admininstr)*{val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr})], (val : val <: admininstr)*{val} :: [RETURN_admininstr]) + `%*_~>%*`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) ;; 8-reduction.watsup rule unop-val{nt : numtype, c_1 : num_(nt), unop : unop_(nt), c : num_(nt)}: @@ -31500,13 +31500,13 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?, c : num_(nt_2)}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) - -- where [c] = $cvtop(nt_1, nt_2, cvtop, sx?{sx}, c_1) + `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) + -- where [c] = $cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) ;; 8-reduction.watsup rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) - -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx}, c_1) = []) + `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) + -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: @@ -31597,18 +31597,18 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) rule vswizzle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn : inn, N : N, c' : vec_(V128_vnn), c : iN($size((inn : inn <: numtype))), ci* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*, k^N : nat^N}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) -- where c*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: `%`(0)^(256 - N){} - -- where ci*{ci} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2) - -- (if (ci*{ci}[k].`%`.0 < |c*{}|))^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i})], [VCONST_admininstr(V128_vectype, c)]) - -- (if (k < |i*{i}|))^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) + -- (if (k < |i*{i : nat}|))^(k%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vshiftop{c_1 : vec_(V128_vnn), n : n, imm : imm, N : N, vshiftop : vshiftop_(`%X%`(imm, `%`(N))), c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) - -- where c'*{c'} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1) - -- where c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c'}) + -- where c'*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1) + -- where c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))}) ;; 8-reduction.watsup rule vtestop-true{c : vec_(V128_vnn), inn : inn, N : N, ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) - -- where ci_1*{ci_1} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c) - -- (if (ci_1 =/= `%`(0)))*{ci_1} + -- where ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c) + -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), inn : inn, N : N}: @@ -31672,35 +31672,35 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vbitmask{c : vec_(V128_vnn), inn : inn, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) - -- where ci_1*{ci_1} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c) - -- where $ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1} + -- where ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c) + -- where $ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($size((inn : inn <: numtype)))} ;; 8-reduction.watsup rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn_1 : inn, N_1 : N, inn_2 : inn, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, cj_1* : iN($size((inn_2 : inn <: numtype)))*, cj_2* : iN($size((inn_2 : inn <: numtype)))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) - -- where ci_1*{ci_1} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1) - -- where ci_2*{ci_2} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2) - -- where cj_1*{cj_1} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1} - -- where cj_2*{cj_2} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_2)*{ci_2} - -- where c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), cj_1*{cj_1} :: cj_2*{cj_2}) + -- where ci_1*{ci_1 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1) + -- where ci_2*{ci_2 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2) + -- where cj_1*{cj_1 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1 : iN($size((inn_1 : inn <: numtype)))} + -- where cj_2*{cj_2 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_2)*{ci_2 : iN($size((inn_1 : inn <: numtype)))} + -- where c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), cj_1*{cj_1 : lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), `%`(N_2))))} :: cj_2*{cj_2 : lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), `%`(N_2))))}) ;; 8-reduction.watsup rule vcvtop-normal{c_1 : vec_(V128_vnn), lnn_2 : lnn, N_2 : N, vcvtop : vcvtop, lnn_1 : lnn, N_1 : N, sx : sx, c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))*}: `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- where c'*{c'} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1) - -- where c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c'}) + -- where c'*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1) + -- where c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))}) ;; 8-reduction.watsup rule vcvtop-half{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, hf : half, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- where ci*{ci} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2] - -- where c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx}, ci)*{ci}) + `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + -- where ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2] + -- where c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))}) ;; 8-reduction.watsup rule vcvtop-zero{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) - -- where ci*{ci} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1) - -- where c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx}, ci)*{ci} :: `%`(0)^N_1{}) + `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) + -- where ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1) + -- where c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} :: `%`(0)^N_1{}) ;; 8-reduction.watsup rule vextunop{c_1 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: @@ -31730,13 +31730,13 @@ def $blocktype(state : state, blocktype : blocktype) : functype relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule block{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, n : n, t_1^k : valtype^k, t_2^n : valtype^n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val} :: (instr : instr <: admininstr)*{instr})]) - -- where `%->%`(t_1^k{t_1}, t_2^n{t_2}) = $blocktype(z, bt) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- where `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype}) = $blocktype(z, bt) ;; 8-reduction.watsup rule loop{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, t_1^k : valtype^k, t_2^n : valtype^n, n : n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], (val : val <: admininstr)^k{val} :: (instr : instr <: admininstr)*{instr})]) - -- where `%->%`(t_1^k{t_1}, t_2^n{t_2}) = $blocktype(z, bt) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- where `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype}) = $blocktype(z, bt) ;; 8-reduction.watsup rule br_on_cast-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: @@ -31767,16 +31767,16 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule call_ref-null{z : state, ht : heaptype, x? : idx?}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule call_ref-func{z : state, val^n : val^n, n : n, a : addr, x? : idx?, m : m, f : frame, instr* : instr*, fi : funcinst, t_1^n : valtype^n, t_2^m : valtype^m, y : idx, t* : valtype*}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr})])]) + `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) -- if (a < |$funcinst(z)|) -- where fi = $funcinst(z)[a] - -- where `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr}) = fi.CODE_funcinst - -- where FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2})) = $expanddt(fi.TYPE_funcinst) - -- where f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst} + -- where `FUNC%%*%`(y, LOCAL(t)*{t : valtype}, instr*{instr : instr}) = fi.CODE_funcinst + -- where FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype})) = $expanddt(fi.TYPE_funcinst) + -- where f = {LOCAL ?(val)^n{val : val} :: $default(t)*{t : valtype}, MODULE fi.MODULE_funcinst} ;; 8-reduction.watsup rule return_call{z : state, x : idx}: @@ -31785,17 +31785,17 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule return_call_ref-label{z : state, k : nat, instr'* : instr*, val* : val*, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, (val : val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), (val : val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) + `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) ;; 8-reduction.watsup rule return_call_ref-frame-addr{z : state, k : nat, f : frame, val'* : val*, val^n : val^n, n : n, a : addr, x? : idx?, instr* : instr*, t_1^n : valtype^n, t_2^m : valtype^m, m : m}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val'} :: (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) -- if (a < |$funcinst(z)|) - -- where FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2})) = $expanddt($funcinst(z)[a].TYPE_funcinst) + -- where FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype})) = $expanddt($funcinst(z)[a].TYPE_funcinst) ;; 8-reduction.watsup rule return_call_ref-frame-null{z : state, k : nat, f : frame, val* : val*, ht : heaptype, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr : instr <: admininstr)*{instr})]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule ref.func{z : state, x : idx}: @@ -31826,25 +31826,25 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule struct.new_default{z : state, x : idx, val* : val*, mut* : mut*, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val} :: [STRUCT.NEW_admininstr(x)]) - -- where STRUCT_comptype(`%%`(mut, zt)*{mut zt}) = $expanddt($type(z, x)) - -- if (|mut*{mut}| = |zt*{zt}|) - -- (where ?(val) = $default($unpack(zt)))*{val zt} - -- if (|val*{val}| = |zt*{zt}|) + `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) + -- where STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype}) = $expanddt($type(z, x)) + -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) + -- (where ?(val) = $default($unpack(zt)))*{val : val zt : storagetype} + -- if (|val*{val : val}| = |zt*{zt : storagetype}|) ;; 8-reduction.watsup rule struct.get-null{z : state, ht : heaptype, sx? : sx?, x : idx, i : nat}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, `%`(i))]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) ;; 8-reduction.watsup rule struct.get-struct{z : state, a : addr, sx? : sx?, x : idx, i : nat, zt* : storagetype*, si : structinst, mut* : mut*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, `%`(i))]), [($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]) : val <: admininstr)]) + `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) -- if (a < |$structinst(z)|) -- where si = $structinst(z)[a] -- if (i < |si.FIELD_structinst|) - -- where STRUCT_comptype(`%%`(mut, zt)*{mut zt}) = $expanddt(si.TYPE_structinst) - -- if (|mut*{mut}| = |zt*{zt}|) - -- if (i < |zt*{zt}|) + -- where STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype}) = $expanddt(si.TYPE_structinst) + -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) + -- if (i < |zt*{zt : storagetype}|) ;; 8-reduction.watsup rule array.new{z : state, val : val, n : n, x : idx}: @@ -31863,8 +31863,8 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.new_elem-alloc{z : state, i : nat, n : n, x : idx, y : idx, ref^n : ref^n}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- where ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n] + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- where ref^n{ref : ref} = $elem(z, y).ELEM_eleminst[i : n] ;; 8-reduction.watsup rule array.new_data-oob{z : state, i : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: @@ -31874,33 +31874,33 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.new_data-num{z : state, i : nat, n : n, x : idx, y : idx, nt : numtype, c^n : num_(nt)^n, mut : mut, zt : storagetype, o0 : numtype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt($type(z, x)) -- where ?(o0) = $nunpack(zt) -- where nt = o0 - -- where $concat_(syntax byte, $nbytes(nt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)] + -- where $concat_(syntax byte, $nbytes(nt, c)^n{c : num_(nt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)] ;; 8-reduction.watsup rule array.new_data-vec{z : state, i : nat, n : n, x : idx, y : idx, vt : vectype, c^n : vec_(vt)^n, mut : mut, zt : storagetype, o0 : vectype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt($type(z, x)) -- where ?(o0) = $vunpack(zt) -- where vt = o0 - -- where $concat_(syntax byte, $vbytes(vt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)] + -- where $concat_(syntax byte, $vbytes(vt, c)^n{c : vec_(vt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)] ;; 8-reduction.watsup rule array.get-null{z : state, ht : heaptype, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.get-oob{z : state, a : addr, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) -- if (a < |$arrayinst(z)|) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.get-array{z : state, a : addr, i : nat, sx? : sx?, x : idx, zt : storagetype, fv : fieldval, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx}, x)]), [($unpackval(zt, sx?{sx}, fv) : val <: admininstr)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) -- if (i < |$arrayinst(z)[a].FIELD_arrayinst|) -- if (a < |$arrayinst(z)|) -- where fv = $arrayinst(z)[a].FIELD_arrayinst[i] @@ -31965,18 +31965,18 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.copy-le{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- if (i_1 <= i_2) -- where ARRAY_comptype(`%%`(mut, zt_2)) = $expanddt($type(z, x_2)) - -- where sx?{sx} = $sxfield(zt_2) + -- where sx?{sx : sx} = $sxfield(zt_2) ;; 8-reduction.watsup rule array.copy-gt{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- where ARRAY_comptype(`%%`(mut, zt_2)) = $expanddt($type(z, x_2)) - -- where sx?{sx} = $sxfield(zt_2) + -- where sx?{sx : sx} = $sxfield(zt_2) ;; 8-reduction.watsup rule array.init_elem-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: @@ -32174,8 +32174,8 @@ relation Step_read: `%~>%*`(config, admininstr*) rule vload-shape-val{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop, c : vec_(V128_vnn), j^N : nat^N, k^N : nat^N, inn : inn}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- where $size((inn : inn <: numtype)) = (M * 2) - -- (where $ibytes(M, `%`(j)) = $mem(z, x).DATA_meminst[((i + mo.OFFSET_memop.`%`.0) + ((k * M) / 8)) : (M / 8)])^(k%*`(config, admininstr*) relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule pure{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr'})) - -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr}, (instr' : instr <: admininstr)*{instr'}) + `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule read{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr'})) - -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), (instr' : instr <: admininstr)*{instr'}) + `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule struct.new{z : state, val^n : val^n, n : n, x : idx, si : structinst, mut^n : mut^n, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- where STRUCT_comptype(`%%`(mut, zt)^n{mut zt}) = $expanddt($type(z, x)) - -- where si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}} + `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- where STRUCT_comptype(`%%`(mut, zt)^n{mut : mut zt : storagetype}) = $expanddt($type(z, x)) + -- where si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val zt : storagetype}} ;; 8-reduction.watsup rule struct.set-null{z : state, ht : heaptype, val : val, x : idx, i : nat}: @@ -32310,16 +32310,16 @@ relation Step: `%~>%`(config, config) rule struct.set-struct{z : state, a : addr, val : val, x : idx, i : nat, fv : fieldval, mut* : mut*, zt* : storagetype*}: `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`($with_struct(z, a, i, fv), [])) -- if (a < |$structinst(z)|) - -- where STRUCT_comptype(`%%`(mut, zt)*{mut zt}) = $expanddt($structinst(z)[a].TYPE_structinst) - -- if (|mut*{mut}| = |zt*{zt}|) - -- if (i < |zt*{zt}|) - -- where fv = $packval(zt*{zt}[i], val) + -- where STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype}) = $expanddt($structinst(z)[a].TYPE_structinst) + -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) + -- if (i < |zt*{zt : storagetype}|) + -- where fv = $packval(zt*{zt : storagetype}[i], val) ;; 8-reduction.watsup rule array.new_fixed{z : state, val^n : val^n, n : n, x : idx, ai : arrayinst, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt($type(z, x)) - -- where ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}} + -- where ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val}} ;; 8-reduction.watsup rule array.set-null{z : state, ht : heaptype, i : nat, val : val, x : idx}: @@ -32377,8 +32377,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule store-num-val{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b}), [])) - -- where b*{b} = $nbytes(nt, c) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) + -- where b*{b : byte} = $nbytes(nt, c) ;; 8-reduction.watsup rule store-pack-oob{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop}: @@ -32387,8 +32387,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule store-pack-val{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b}), [])) - -- where b*{b} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c)) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) + -- where b*{b : byte} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c)) ;; 8-reduction.watsup rule vstore-oob{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop}: @@ -32397,8 +32397,8 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule vstore-val{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b}), [])) - -- where b*{b} = $vbytes(V128_vectype, c) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) + -- where b*{b : byte} = $vbytes(V128_vectype, c) ;; 8-reduction.watsup rule vstore_lane-oob{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: @@ -32407,11 +32407,11 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule vstore_lane-val{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, b* : byte*, imm : imm, M : M}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b}), [])) + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) -- where M = (128 / N) -- where $lsize((imm : imm <: lanetype)) = N -- if (j < |$lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)|) - -- where b*{b} = $ibytes(N, `%`($lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)[j].`%`.0)) + -- where b*{b : byte} = $ibytes(N, `%`($lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)[j].`%`.0)) ;; 8-reduction.watsup rule memory.grow-succeed{z : state, n : n, x : idx, mi : meminst, o0 : meminst}: @@ -32434,21 +32434,21 @@ rec { relation Steps: `%~>*%`(config, config) ;; 8-reduction.watsup:18.1-19.36 rule refl{z : state, admininstr* : admininstr*}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) + `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z, admininstr*{admininstr : admininstr})) ;; 8-reduction.watsup:21.1-24.53 rule trans{z : state, admininstr* : admininstr*, z'' : state, admininstr''* : admininstr*, z' : state, admininstr' : admininstr}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z'', admininstr''*{admininstr''})) - -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z', admininstr'*{})) - -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr''})) + `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) + -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z', admininstr'*{})) + -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) } ;; 8-reduction.watsup relation Eval_expr: `%;%~>*%;%*`(state, expr, state, val*) ;; 8-reduction.watsup rule _{z : state, instr* : instr*, z' : state, val* : val*}: - `%;%~>*%;%*`(z, instr*{instr}, z', val*{val}) - -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr}), `%;%*`(z', (val : val <: admininstr)*{val})) + `%;%~>*%;%*`(z, instr*{instr : instr}, z', val*{val : val}) + -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z', (val : val <: admininstr)*{val : val})) ;; 9-module.watsup rec { @@ -32458,18 +32458,18 @@ def $alloctypes(type*) : deftype* ;; 9-module.watsup:8.1-8.27 def $alloctypes([]) = [] ;; 9-module.watsup:9.1-13.24 - def $alloctypes{type'* : type*, type : type, deftype'* : deftype*, deftype* : deftype*, rectype : rectype, x : idx}(type'*{type'} :: [type]) = deftype'*{deftype'} :: deftype*{deftype} + def $alloctypes{type'* : type*, type : type, deftype'* : deftype*, deftype* : deftype*, rectype : rectype, x : idx}(type'*{type' : type} :: [type]) = deftype'*{deftype' : deftype} :: deftype*{deftype : deftype} -- where TYPE(rectype) = type - -- where deftype'*{deftype'} = $alloctypes(type'*{type'}) - -- where x = `%`(|deftype'*{deftype'}|) - -- where deftype*{deftype} = $subst_all_deftypes($rolldt(x, rectype), (deftype' : deftype <: heaptype)*{deftype'}) + -- where deftype'*{deftype' : deftype} = $alloctypes(type'*{type' : type}) + -- where x = `%`(|deftype'*{deftype' : deftype}|) + -- where deftype*{deftype : deftype} = $subst_all_deftypes($rolldt(x, rectype), (deftype' : deftype <: heaptype)*{deftype' : deftype}) } ;; 9-module.watsup def $allocfunc(store : store, moduleinst : moduleinst, func : func) : (store, funcaddr) ;; 9-module.watsup def $allocfunc{s : store, mm : moduleinst, func : func, fi : funcinst, x : idx, local* : local*, expr : expr}(s, mm, func) = (s[FUNC_store =.. [fi]], |s.FUNC_store|) - -- where `FUNC%%*%`(x, local*{local}, expr) = func + -- where `FUNC%%*%`(x, local*{local : local}, expr) = func -- where fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func} ;; 9-module.watsup @@ -32480,9 +32480,9 @@ def $allocfuncs(store : store, moduleinst : moduleinst, func*) : (store, funcadd ;; 9-module.watsup:21.1-21.39 def $allocfuncs{s : store, mm : moduleinst}(s, mm, []) = (s, []) ;; 9-module.watsup:22.1-24.51 - def $allocfuncs{s : store, mm : moduleinst, func : func, func'* : func*, s_2 : store, fa : funcaddr, fa'* : funcaddr*, s_1 : store}(s, mm, [func] :: func'*{func'}) = (s_2, [fa] :: fa'*{fa'}) + def $allocfuncs{s : store, mm : moduleinst, func : func, func'* : func*, s_2 : store, fa : funcaddr, fa'* : funcaddr*, s_1 : store}(s, mm, [func] :: func'*{func' : func}) = (s_2, [fa] :: fa'*{fa' : funcaddr}) -- where (s_1, fa) = $allocfunc(s, mm, func) - -- where (s_2, fa'*{fa'}) = $allocfuncs(s_1, mm, func'*{func'}) + -- where (s_2, fa'*{fa' : funcaddr}) = $allocfuncs(s_1, mm, func'*{func' : func}) } ;; 9-module.watsup @@ -32499,9 +32499,9 @@ def $allocglobals(store : store, globaltype*, val*) : (store, globaladdr*) ;; 9-module.watsup:31.1-31.42 def $allocglobals{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:32.1-34.62 - def $allocglobals{s : store, globaltype : globaltype, globaltype'* : globaltype*, val : val, val'* : val*, s_2 : store, ga : globaladdr, ga'* : globaladdr*, s_1 : store}(s, [globaltype] :: globaltype'*{globaltype'}, [val] :: val'*{val'}) = (s_2, [ga] :: ga'*{ga'}) + def $allocglobals{s : store, globaltype : globaltype, globaltype'* : globaltype*, val : val, val'* : val*, s_2 : store, ga : globaladdr, ga'* : globaladdr*, s_1 : store}(s, [globaltype] :: globaltype'*{globaltype' : globaltype}, [val] :: val'*{val' : val}) = (s_2, [ga] :: ga'*{ga' : globaladdr}) -- where (s_1, ga) = $allocglobal(s, globaltype, val) - -- where (s_2, ga'*{ga'}) = $allocglobals(s_1, globaltype'*{globaltype'}, val'*{val'}) + -- where (s_2, ga'*{ga' : globaladdr}) = $allocglobals(s_1, globaltype'*{globaltype' : globaltype}, val'*{val' : val}) } ;; 9-module.watsup @@ -32518,9 +32518,9 @@ def $alloctables(store : store, tabletype*, ref*) : (store, tableaddr*) ;; 9-module.watsup:41.1-41.41 def $alloctables{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:42.1-44.60 - def $alloctables{s : store, tabletype : tabletype, tabletype'* : tabletype*, ref : ref, ref'* : ref*, s_2 : store, ta : tableaddr, ta'* : tableaddr*, s_1 : store}(s, [tabletype] :: tabletype'*{tabletype'}, [ref] :: ref'*{ref'}) = (s_2, [ta] :: ta'*{ta'}) + def $alloctables{s : store, tabletype : tabletype, tabletype'* : tabletype*, ref : ref, ref'* : ref*, s_2 : store, ta : tableaddr, ta'* : tableaddr*, s_1 : store}(s, [tabletype] :: tabletype'*{tabletype' : tabletype}, [ref] :: ref'*{ref' : ref}) = (s_2, [ta] :: ta'*{ta' : tableaddr}) -- where (s_1, ta) = $alloctable(s, tabletype, ref) - -- where (s_2, ta'*{ta'}) = $alloctables(s_1, tabletype'*{tabletype'}, ref'*{ref'}) + -- where (s_2, ta'*{ta' : tableaddr}) = $alloctables(s_1, tabletype'*{tabletype' : tabletype}, ref'*{ref' : ref}) } ;; 9-module.watsup @@ -32537,16 +32537,16 @@ def $allocmems(store : store, memtype*) : (store, memaddr*) ;; 9-module.watsup:51.1-51.34 def $allocmems{s : store}(s, []) = (s, []) ;; 9-module.watsup:52.1-54.49 - def $allocmems{s : store, memtype : memtype, memtype'* : memtype*, s_2 : store, ma : memaddr, ma'* : memaddr*, s_1 : store}(s, [memtype] :: memtype'*{memtype'}) = (s_2, [ma] :: ma'*{ma'}) + def $allocmems{s : store, memtype : memtype, memtype'* : memtype*, s_2 : store, ma : memaddr, ma'* : memaddr*, s_1 : store}(s, [memtype] :: memtype'*{memtype' : memtype}) = (s_2, [ma] :: ma'*{ma' : memaddr}) -- where (s_1, ma) = $allocmem(s, memtype) - -- where (s_2, ma'*{ma'}) = $allocmems(s_1, memtype'*{memtype'}) + -- where (s_2, ma'*{ma' : memaddr}) = $allocmems(s_1, memtype'*{memtype' : memtype}) } ;; 9-module.watsup def $allocelem(store : store, reftype : reftype, ref*) : (store, elemaddr) ;; 9-module.watsup - def $allocelem{s : store, rt : reftype, ref* : ref*, ei : eleminst}(s, rt, ref*{ref}) = (s[ELEM_store =.. [ei]], |s.ELEM_store|) - -- where ei = {TYPE rt, ELEM ref*{ref}} + def $allocelem{s : store, rt : reftype, ref* : ref*, ei : eleminst}(s, rt, ref*{ref : ref}) = (s[ELEM_store =.. [ei]], |s.ELEM_store|) + -- where ei = {TYPE rt, ELEM ref*{ref : ref}} ;; 9-module.watsup rec { @@ -32556,16 +32556,16 @@ def $allocelems(store : store, reftype*, ref**) : (store, elemaddr*) ;; 9-module.watsup:61.1-61.40 def $allocelems{s : store}(s, [], []) = (s, []) ;; 9-module.watsup:62.1-64.55 - def $allocelems{s : store, rt : reftype, rt'* : reftype*, ref* : ref*, ref'** : ref**, s_2 : store, ea : elemaddr, ea'* : elemaddr*, s_1 : store}(s, [rt] :: rt'*{rt'}, [ref*{ref}] :: ref'*{ref'}*{ref'}) = (s_2, [ea] :: ea'*{ea'}) - -- where (s_1, ea) = $allocelem(s, rt, ref*{ref}) - -- where (s_2, ea'*{ea'}) = $allocelems(s_2, rt'*{rt'}, ref'*{ref'}*{ref'}) + def $allocelems{s : store, rt : reftype, rt'* : reftype*, ref* : ref*, ref'** : ref**, s_2 : store, ea : elemaddr, ea'* : elemaddr*, s_1 : store}(s, [rt] :: rt'*{rt' : reftype}, [ref*{ref : ref}] :: ref'*{ref' : ref}*{ref' : ref}) = (s_2, [ea] :: ea'*{ea' : elemaddr}) + -- where (s_1, ea) = $allocelem(s, rt, ref*{ref : ref}) + -- where (s_2, ea'*{ea' : elemaddr}) = $allocelems(s_2, rt'*{rt' : reftype}, ref'*{ref' : ref}*{ref' : ref}) } ;; 9-module.watsup def $allocdata(store : store, byte*) : (store, dataaddr) ;; 9-module.watsup - def $allocdata{s : store, byte* : byte*, di : datainst}(s, byte*{byte}) = (s[DATA_store =.. [di]], |s.DATA_store|) - -- where di = {DATA byte*{byte}} + def $allocdata{s : store, byte* : byte*, di : datainst}(s, byte*{byte : byte}) = (s[DATA_store =.. [di]], |s.DATA_store|) + -- where di = {DATA byte*{byte : byte}} ;; 9-module.watsup rec { @@ -32575,92 +32575,92 @@ def $allocdatas(store : store, byte**) : (store, dataaddr*) ;; 9-module.watsup:71.1-71.35 def $allocdatas{s : store}(s, []) = (s, []) ;; 9-module.watsup:72.1-74.50 - def $allocdatas{s : store, byte* : byte*, byte'** : byte**, s_2 : store, da : dataaddr, da'* : dataaddr*, s_1 : store}(s, [byte*{byte}] :: byte'*{byte'}*{byte'}) = (s_2, [da] :: da'*{da'}) - -- where (s_1, da) = $allocdata(s, byte*{byte}) - -- where (s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'}) + def $allocdatas{s : store, byte* : byte*, byte'** : byte**, s_2 : store, da : dataaddr, da'* : dataaddr*, s_1 : store}(s, [byte*{byte : byte}] :: byte'*{byte' : byte}*{byte' : byte}) = (s_2, [da] :: da'*{da' : dataaddr}) + -- where (s_1, da) = $allocdata(s, byte*{byte : byte}) + -- where (s_2, da'*{da' : dataaddr}) = $allocdatas(s_1, byte'*{byte' : byte}*{byte' : byte}) } ;; 9-module.watsup def $instexport(funcaddr*, globaladdr*, tableaddr*, memaddr*, export : export) : exportinst ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa : funcaddr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga : globaladdr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta : tableaddr}[x.`%`.0])} ;; 9-module.watsup - def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x.`%`.0])} + def $instexport{fa* : funcaddr*, ga* : globaladdr*, ta* : tableaddr*, ma* : memaddr*, name : name, x : idx}(fa*{fa : funcaddr}, ga*{ga : globaladdr}, ta*{ta : tableaddr}, ma*{ma : memaddr}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma : memaddr}[x.`%`.0])} ;; 9-module.watsup def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) : (store, moduleinst) ;; 9-module.watsup - def $allocmodule{s : store, module : module, externval* : externval*, val_g* : val*, ref_t* : ref*, ref_e** : ref**, s_6 : store, mm : moduleinst, type* : type*, import* : import*, func^n_f : func^n_f, n_f : n, globaltype^n_g : globaltype^n_g, expr_g^n_g : expr^n_g, n_g : n, tabletype^n_t : tabletype^n_t, expr_t^n_t : expr^n_t, n_t : n, memtype^n_m : memtype^n_m, n_m : n, reftype^n_e : reftype^n_e, expr_e*^n_e : expr*^n_e, elemmode^n_e : elemmode^n_e, n_e : n, byte*^n_d : byte*^n_d, datamode^n_d : datamode^n_d, n_d : n, start? : start?, export* : export*, fa_ex* : funcaddr*, ga_ex* : globaladdr*, ta_ex* : tableaddr*, ma_ex* : memaddr*, fa* : funcaddr*, i_f^n_f : nat^n_f, ga* : globaladdr*, i_g^n_g : nat^n_g, ta* : tableaddr*, i_t^n_t : nat^n_t, ma* : memaddr*, i_m^n_m : nat^n_m, ea* : elemaddr*, i_e^n_e : nat^n_e, da* : dataaddr*, i_d^n_d : nat^n_d, xi* : exportinst*, dt* : deftype*, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store}(s, module, externval*{externval}, val_g*{val_g}, ref_t*{ref_t}, ref_e*{ref_e}*{ref_e}) = (s_6, mm) - -- where fa_ex*{fa_ex} = $funcsxv(externval*{externval}) - -- where ga_ex*{ga_ex} = $globalsxv(externval*{externval}) - -- where ma_ex*{ma_ex} = $memsxv(externval*{externval}) - -- where ta_ex*{ta_ex} = $tablesxv(externval*{externval}) - -- where `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type}, import*{import}, func^n_f{func}, GLOBAL(globaltype, expr_g)^n_g{expr_g globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t tabletype}, MEMORY(memtype)^n_m{memtype}, `ELEM%%*%`(reftype, expr_e*{expr_e}, elemmode)^n_e{elemmode expr_e reftype}, `DATA%*%`(byte*{byte}, datamode)^n_d{byte datamode}, start?{start}, export*{export}) = module - -- where dt*{dt} = $alloctypes(type*{type}) - -- where fa*{fa} = (|s.FUNC_store| + i_f)^(i_f*%;%*`(z, expr_G, z, [val_G]))*{expr_G val_G} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T ref_T} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E ref_E}*{expr_E ref_E} - -- where (s', mm) = $allocmodule(s, module, externval*{externval}, val_G*{val_G}, ref_T*{ref_T}, ref_E*{ref_E}*{ref_E}) + -- (Eval_expr: `%;%~>*%;%*`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} + -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} + -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} + -- where (s', mm) = $allocmodule(s, module, externval*{externval : externval}, val_G*{val_G : val}, ref_T*{ref_T : ref}, ref_E*{ref_E : ref}*{ref_E : ref}) -- where f = {LOCAL [], MODULE mm} ;; 9-module.watsup def $invoke(store : store, funcaddr : funcaddr, val*) : config ;; 9-module.watsup - def $invoke{s : store, fa : funcaddr, val^n : val^n, n : n, f : frame, x : idx, local* : local*, expr : expr, t_1^n : valtype^n, t_2* : valtype*}(s, fa, val^n{val}) = `%;%*`(`%;%`(s, f), (val : val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(fa) CALL_REF_admininstr(?(`%`(0)))]) + def $invoke{s : store, fa : funcaddr, val^n : val^n, n : n, f : frame, x : idx, local* : local*, expr : expr, t_1^n : valtype^n, t_2* : valtype*}(s, fa, val^n{val : val}) = `%;%*`(`%;%`(s, f), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(fa) CALL_REF_admininstr(?(`%`(0)))]) -- where f = {LOCAL [], MODULE {TYPE [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], EXPORT []}} - -- where FUNC_comptype(`%->%`(t_1^n{t_1}, t_2*{t_2})) = $expanddt(s.FUNC_store[fa].TYPE_funcinst) - -- where `FUNC%%*%`(x, local*{local}, expr) = $funcinst(`%;%`(s, f))[fa].CODE_funcinst + -- where FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2*{t_2 : valtype})) = $expanddt(s.FUNC_store[fa].TYPE_funcinst) + -- where `FUNC%%*%`(x, local*{local : local}, expr) = $funcinst(`%;%`(s, f))[fa].CODE_funcinst ;; A-binary.watsup rec { @@ -32686,7 +32686,7 @@ def $utf8(name : name) : byte* -- if (ch < 69632) -- where (((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128)) = ch ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(`%`(ch)*{ch}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch}) + def $utf8{ch* : nat*}(`%`(ch)*{ch : nat}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch : nat}) } ;; A-binary.watsup @@ -32706,14 +32706,14 @@ syntax B = nat ;; C-conventions.watsup syntax sym = - | _FIRST(A_1 : A) + | _FIRST{A_1 : A}(A_1 : A) | _DOTS - | _LAST(A_n : A) + | _LAST{A_n : A}(A_n : A) ;; C-conventions.watsup syntax symsplit = - | _FIRST(A_1 : A) - | _LAST(A_2 : A) + | _FIRST{A_1 : A}(A_1 : A) + | _LAST{A_2 : A}(A_2 : A) ;; C-conventions.watsup syntax recorddots = `...` @@ -32721,21 +32721,21 @@ syntax recorddots = `...` ;; C-conventions.watsup syntax record = { - FIELD_1 A, - FIELD_2 A, - DOTS recorddots + FIELD_1{A_1 : A} A, + FIELD_2{A_2 : A} A, + DOTS{recorddots : recorddots} recorddots } ;; C-conventions.watsup syntax recordstar = { - FIELD_1 A*, - FIELD_2 A*, - DOTS recorddots + FIELD_1{A_1* : A*} A*, + FIELD_2{A_2* : A*} A*, + DOTS{recorddots : recorddots} recorddots } ;; C-conventions.watsup -syntax recordeq = `%++%=%`(recordstar : recordstar, recordstar : recordstar, recordstar : recordstar) +syntax recordeq = `%++%=%`{recordstar : recordstar}(recordstar : recordstar, recordstar, recordstar) ;; C-conventions.watsup syntax pth = @@ -32767,8 +32767,8 @@ relation HasSize: `%|-%`(nat, nat) relation TestNestedIter: `*_*%*_|-_*%*`(nat***, nat**) ;; test.watsup rule _{n**+ : nat**+, m*+ : nat*+}: - `*_*%*_|-_*%*`(n*{n}*{n}+{n}, m*{m}+{m}) - -- (if (|n*{n}| = m))*{m n}+{m n} + `*_*%*_|-_*%*`(n*{n : nat}*{n : nat}+{n : nat}, m*{m : nat}+{m : nat}) + -- (if (|n*{n : nat}| = m))*{m : nat n : nat}+{m : nat n : nat} == IL Validation... == Running pass totalize... @@ -32780,8 +32780,8 @@ relation HasSize: `%|-%`(nat, nat) relation TestNestedIter: `*_*%*_|-_*%*`(nat***, nat**) ;; test.watsup rule _{n**+ : nat**+, m*+ : nat*+}: - `*_*%*_|-_*%*`(n*{n}*{n}+{n}, m*{m}+{m}) - -- (if (|n*{n}| = m))*{m n}+{m n} + `*_*%*_|-_*%*`(n*{n : nat}*{n : nat}+{n : nat}, m*{m : nat}+{m : nat}) + -- (if (|n*{n : nat}| = m))*{m : nat n : nat}+{m : nat n : nat} == IL Validation after pass totalize... == Running pass the-elimination... @@ -32793,8 +32793,8 @@ relation HasSize: `%|-%`(nat, nat) relation TestNestedIter: `*_*%*_|-_*%*`(nat***, nat**) ;; test.watsup rule _{n**+ : nat**+, m*+ : nat*+}: - `*_*%*_|-_*%*`(n*{n}*{n}+{n}, m*{m}+{m}) - -- (if (|n*{n}| = m))*{m n}+{m n} + `*_*%*_|-_*%*`(n*{n : nat}*{n : nat}+{n : nat}, m*{m : nat}+{m : nat}) + -- (if (|n*{n : nat}| = m))*{m : nat n : nat}+{m : nat n : nat} == IL Validation after pass the-elimination... == Running pass wildcards... @@ -32806,8 +32806,8 @@ relation HasSize: `%|-%`(nat, nat) relation TestNestedIter: `*_*%*_|-_*%*`(nat***, nat**) ;; test.watsup rule _{n**+ : nat**+, m*+ : nat*+}: - `*_*%*_|-_*%*`(n*{n}*{n}+{n}, m*{m}+{m}) - -- (if (|n*{n}| = m))*{m n}+{m n} + `*_*%*_|-_*%*`(n*{n : nat}*{n : nat}+{n : nat}, m*{m : nat}+{m : nat}) + -- (if (|n*{n : nat}| = m))*{m : nat n : nat}+{m : nat n : nat} == IL Validation after pass wildcards... == Running pass sideconditions... @@ -32819,10 +32819,10 @@ relation HasSize: `%|-%`(nat, nat) relation TestNestedIter: `*_*%*_|-_*%*`(nat***, nat**) ;; test.watsup rule _{n**+ : nat**+, m*+ : nat*+}: - `*_*%*_|-_*%*`(n*{n}*{n}+{n}, m*{m}+{m}) - -- if (|m*{m}+{m}| = |n*{n}*{n}+{n}|) - -- (if (|m*{m}| = |n*{n}*{n}|))+{m n} - -- (if (|n*{n}| = m))*{m n}+{m n} + `*_*%*_|-_*%*`(n*{n : nat}*{n : nat}+{n : nat}, m*{m : nat}+{m : nat}) + -- if (|m*{m : nat}+{m : nat}| = |n*{n : nat}*{n : nat}+{n : nat}|) + -- (if (|m*{m : nat}| = |n*{n : nat}*{n : nat}|))+{m : nat n : nat} + -- (if (|n*{n : nat}| = m))*{m : nat n : nat}+{m : nat n : nat} == IL Validation after pass sideconditions... == Running pass animate... @@ -32834,10 +32834,10 @@ relation HasSize: `%|-%`(nat, nat) relation TestNestedIter: `*_*%*_|-_*%*`(nat***, nat**) ;; test.watsup rule _{n**+ : nat**+, m*+ : nat*+}: - `*_*%*_|-_*%*`(n*{n}*{n}+{n}, m*{m}+{m}) - -- if (|m*{m}+{m}| = |n*{n}*{n}+{n}|) - -- (if (|m*{m}| = |n*{n}*{n}|))+{m n} - -- (if (|n*{n}| = m))*{m n}+{m n} + `*_*%*_|-_*%*`(n*{n : nat}*{n : nat}+{n : nat}, m*{m : nat}+{m : nat}) + -- if (|m*{m : nat}+{m : nat}| = |n*{n : nat}*{n : nat}+{n : nat}|) + -- (if (|m*{m : nat}| = |n*{n : nat}*{n : nat}|))+{m : nat n : nat} + -- (if (|n*{n : nat}| = m))*{m : nat n : nat}+{m : nat n : nat} == IL Validation after pass animate... == Complete. From cbcbe4e1a650f666307069b00152497e1f360694 Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Tue, 27 Feb 2024 16:51:56 +0100 Subject: [PATCH 4/5] Enable type refinements --- spectec/spec/wasm-1.0/1-syntax.watsup | 27 +- spectec/spec/wasm-1.0/A-binary.watsup | 4 +- spectec/spec/wasm-2.0/1-syntax.watsup | 27 +- spectec/spec/wasm-2.0/A-binary.watsup | 4 +- spectec/spec/wasm-3.0/1-syntax.watsup | 27 +- spectec/spec/wasm-3.0/6-typing.watsup | 6 +- spectec/spec/wasm-3.0/A-binary.watsup | 4 +- spectec/src/exe-watsup/main.ml | 3 +- spectec/src/frontend/elab.ml | 165 +- spectec/src/il/eval.ml | 13 +- spectec/src/il2al/translate.ml | 13 +- spectec/test-frontend/TEST.md | 970 ++-- spectec/test-middlend/TEST.md | 5884 +++++++++++++------------ spectec/test-prose/TEST.md | 108 +- 14 files changed, 3654 insertions(+), 3601 deletions(-) diff --git a/spectec/spec/wasm-1.0/1-syntax.watsup b/spectec/spec/wasm-1.0/1-syntax.watsup index 270dfd0d1e..eeba7943c1 100644 --- a/spectec/spec/wasm-1.0/1-syntax.watsup +++ b/spectec/spec/wasm-1.0/1-syntax.watsup @@ -3,19 +3,7 @@ ;; ;; TODO: enable writing X^n -syntax list(syntax X) = X* ;;-- if |X*| < $(2^32) - - -;; -;; Names -;; - -syntax char hint(desc "character") = U+0000 | ... | U+D7FF | U+E000 | ... | U+10FFFF - -;; TODO: enable side condition -syntax name hint(desc "name") = char* ;; -- if |$utf8(char*)| < $(2^32) - -var nm : name +syntax list(syntax X) = X* -- if |X*| < $(2^32) ;; @@ -79,6 +67,19 @@ def $canon_(N) : nat def $canon_(N) = $(2^($signif(N)-1)) +;; +;; Names +;; + +syntax char hint(desc "character") = U+0000 | ... | U+D7FF | U+E000 | ... | U+10FFFF + +def $utf8(char*) : byte* + +syntax name hint(desc "name") = char* -- if |$utf8(char*)| < $(2^32) + +var nm : name + + ;; ;; Indices ;; diff --git a/spectec/spec/wasm-1.0/A-binary.watsup b/spectec/spec/wasm-1.0/A-binary.watsup index 1be1afa7dd..ac0a89bef6 100644 --- a/spectec/spec/wasm-1.0/A-binary.watsup +++ b/spectec/spec/wasm-1.0/A-binary.watsup @@ -43,9 +43,9 @@ grammar Bf64 : f64 = | p:BfN(64) => p ;; Names -var ch : nat +var ch : char -def $utf8(name) : byte* +;; def $utf8(char*) : byte* def $utf8(ch) = b -- if ch < U+0080 /\ ch = b def $utf8(ch) = b_1 b_2 -- if U+0080 <= ch < U+0800 /\ ch = $(2^6*(b_1 - 0xC0) + (b_2 - 0x80)) def $utf8(ch) = b_1 b_2 b_3 -- if (U+0800 <= ch < U+D800 \/ U+E000 <= ch < U+10000) /\ ch = $(2^12*(b_1 - 0xE0) + 2^6*(b_2 - 0x80) + (b_3 - 0x80)) diff --git a/spectec/spec/wasm-2.0/1-syntax.watsup b/spectec/spec/wasm-2.0/1-syntax.watsup index e5a908c4ea..a0b5af8669 100644 --- a/spectec/spec/wasm-2.0/1-syntax.watsup +++ b/spectec/spec/wasm-2.0/1-syntax.watsup @@ -3,19 +3,7 @@ ;; ;; TODO: enable writing X^n -syntax list(syntax X) = X* ;;-- if |X*| < $(2^32) - - -;; -;; Names -;; - -syntax char hint(desc "character") = U+0000 | ... | U+D7FF | U+E000 | ... | U+10FFFF - -;; TODO: enable side condition -syntax name hint(desc "name") = char* ;; -- if |$utf8(char*)| < $(2^32) - -var nm : name +syntax list(syntax X) = X* -- if |X*| < $(2^32) ;; @@ -90,6 +78,19 @@ syntax vN(N) hint(desc "vector") hint(show v#%) = iN(N) +;; +;; Names +;; + +syntax char hint(desc "character") = U+0000 | ... | U+D7FF | U+E000 | ... | U+10FFFF + +def $utf8(char*) : byte* + +syntax name hint(desc "name") = char* -- if |$utf8(char*)| < $(2^32) + +var nm : name + + ;; ;; Indices ;; diff --git a/spectec/spec/wasm-2.0/A-binary.watsup b/spectec/spec/wasm-2.0/A-binary.watsup index 6837abb92c..8731f91514 100644 --- a/spectec/spec/wasm-2.0/A-binary.watsup +++ b/spectec/spec/wasm-2.0/A-binary.watsup @@ -44,9 +44,9 @@ grammar Bf64 : f64 = | p:BfN(64) => p ;; Names -var ch : nat +var ch : char -def $utf8(name) : byte* +;; def $utf8(char*) : byte* def $utf8(ch) = b -- if ch < U+0080 /\ ch = b def $utf8(ch) = b_1 b_2 -- if U+0080 <= ch < U+0800 /\ ch = $(2^6*(b_1 - 0xC0) + (b_2 - 0x80)) def $utf8(ch) = b_1 b_2 b_3 -- if (U+0800 <= ch < U+D800 \/ U+E000 <= ch < U+10000) /\ ch = $(2^12*(b_1 - 0xE0) + 2^6*(b_2 - 0x80) + (b_3 - 0x80)) diff --git a/spectec/spec/wasm-3.0/1-syntax.watsup b/spectec/spec/wasm-3.0/1-syntax.watsup index 339c7ee01d..20913e7cdd 100644 --- a/spectec/spec/wasm-3.0/1-syntax.watsup +++ b/spectec/spec/wasm-3.0/1-syntax.watsup @@ -3,19 +3,7 @@ ;; ;; TODO: enable writing X^n -syntax list(syntax X) = X* ;;-- if |X*| < $(2^32) - - -;; -;; Names -;; - -syntax char hint(desc "character") = U+0000 | ... | U+D7FF | U+E000 | ... | U+10FFFF - -;; TODO: enable side condition -syntax name hint(desc "name") = char* ;; -- if |$utf8(char*)| < $(2^32) - -var nm : name +syntax list(syntax X) = X* -- if |X*| < $(2^32) ;; @@ -90,6 +78,19 @@ syntax vN(N) hint(desc "vector") hint(show v#%) = iN(N) +;; +;; Names +;; + +syntax char hint(desc "character") = U+0000 | ... | U+D7FF | U+E000 | ... | U+10FFFF + +def $utf8(char*) : byte* + +syntax name hint(desc "name") = char* -- if |$utf8(char*)| < $(2^32) + +var nm : name + + ;; ;; Indices ;; diff --git a/spectec/spec/wasm-3.0/6-typing.watsup b/spectec/spec/wasm-3.0/6-typing.watsup index 2e142ef842..7af5b2a52c 100644 --- a/spectec/spec/wasm-3.0/6-typing.watsup +++ b/spectec/spec/wasm-3.0/6-typing.watsup @@ -185,7 +185,7 @@ rule Rectype_ok/empty: C |- REC eps : OK(x) rule Rectype_ok/cons: - C |- REC st_1 st* : OK(x) + C |- REC (st_1 st*) : OK(x) -- Subtype_ok: C |- st_1 : OK(x) -- Rectype_ok: C |- REC st* : OK($(x+1)) @@ -197,7 +197,7 @@ rule Rectype_ok2/empty: C |- REC eps : OK x i rule Rectype_ok2/cons: - C |- REC st_1 st* : OK x i + C |- REC (st_1 st*) : OK x i -- Subtype_ok2: C |- st_1 : OK x i -- Rectype_ok2: C |- REC st* : OK $(x+1) $(i+1) @@ -419,7 +419,7 @@ rule Fieldtype_sub/var: rule Comptype_sub/struct: - C |- STRUCT yt_1* yt'_1 <: STRUCT yt_2* + C |- STRUCT (yt_1* yt'_1) <: STRUCT yt_2* -- (Fieldtype_sub: C |- yt_1 <: yt_2)* rule Comptype_sub/array: diff --git a/spectec/spec/wasm-3.0/A-binary.watsup b/spectec/spec/wasm-3.0/A-binary.watsup index a5db9eeb9d..376e23f4d7 100644 --- a/spectec/spec/wasm-3.0/A-binary.watsup +++ b/spectec/spec/wasm-3.0/A-binary.watsup @@ -44,9 +44,9 @@ grammar Bf64 : f64 = | p:BfN(64) => p ;; Names -var ch : nat +var ch : char -def $utf8(name) : byte* +;; def $utf8(char*) : byte* def $utf8(ch) = b -- if ch < U+0080 /\ ch = b def $utf8(ch) = b_1 b_2 -- if U+0080 <= ch < U+0800 /\ ch = $(2^6*(b_1 - 0xC0) + (b_2 - 0x80)) def $utf8(ch) = b_1 b_2 b_3 -- if (U+0800 <= ch < U+D800 \/ U+E000 <= ch < U+10000) /\ ch = $(2^12*(b_1 - 0xE0) + 2^6*(b_2 - 0x80) + (b_3 - 0x80)) diff --git a/spectec/src/exe-watsup/main.ml b/spectec/src/exe-watsup/main.ml index 065dc24963..ea1400d971 100644 --- a/spectec/src/exe-watsup/main.ml +++ b/spectec/src/exe-watsup/main.ml @@ -196,7 +196,8 @@ let () = if !print_final_il && not !print_all_il then print_il il; let al = - if !target = Check || not (PS.mem Animate !selected_passes) then [] else ( + if !target = Check || !target = Latex || not (PS.mem Animate !selected_passes) + then [] else ( log "Translating to AL..."; (Il2al.Translate.translate il @ Backend_interpreter.Manual.manual_algos) ) diff --git a/spectec/src/frontend/elab.ml b/spectec/src/frontend/elab.ml index 98b4ff991e..9ea58e61c1 100644 --- a/spectec/src/frontend/elab.ml +++ b/spectec/src/frontend/elab.ml @@ -678,7 +678,7 @@ and typ_rep env t : typ = and elab_typfield env tid at ((atom, (t, prems), hints) as tf) : Il.typfield = assert (tid.it <> ""); let env' = local_env env in - let _, _, ts', ts = elab_typ_notation env' tid t in + let _mixop, ts', ts = elab_typ_notation env' tid t in let es = Convert.pats_of_typs ts in let dims = Dim.check_typdef t prems in let dims' = Dim.Env.map (List.map (elab_iter env')) dims in @@ -702,7 +702,7 @@ and elab_typfield env tid at ((atom, (t, prems), hints) as tf) : Il.typfield = and elab_typcase env tid at ((atom, (t, prems), hints) as tc) : Il.typcase = assert (tid.it <> ""); let env' = local_env env in - let _, _, ts', ts = elab_typ_notation env' tid t in + let _mixop, ts', ts = elab_typ_notation env' tid t in let es = Convert.pats_of_typs ts in let dims = Dim.check_typdef t prems in let dims' = Dim.Env.map (List.map (elab_iter env')) dims in @@ -726,7 +726,7 @@ and elab_typcase env tid at ((atom, (t, prems), hints) as tc) : Il.typcase = and elab_typcon env tid at (((t, prems), hints) as tc) : Il.typcon = assert (tid.it <> ""); let env' = local_env env in - let is_notation, mixop, ts', ts = elab_typ_notation env' tid t in + let mixop, ts', ts = elab_typ_notation env' tid t in let es = Convert.pats_of_typs ts in let dims = Dim.check_typdef t prems in let dims' = Dim.Env.map (List.map (elab_iter env')) dims in @@ -742,7 +742,6 @@ and elab_typcon env tid at (((t, prems), hints) as tc) : Il.typcon = let module Acc = Iter.Make(Arg) in List.iter Acc.exp es; Acc.prems prems; - assert (is_notation || prems <> []); ( mixop, (!acc_bs', tup_typ_bind' es' ts' at, prems'), elab_hints tid hints @@ -772,10 +771,10 @@ and elab_typenum env tid (e1, e2o) : typ * (Il.exp -> numtyp -> Il.exp) = CmpE (LeOp nt', eid', e2') $$ e2'.at % (BoolT $ e2.at) ) $$ at % (BoolT $ at)) -and elab_typ_notation env tid t : bool * Il.mixop * Il.typ list * typ list = +and elab_typ_notation env tid t : Il.mixop * Il.typ list * typ list = Debug.(log_at "el.elab_typ_notation" t.at (fun _ -> fmt "%s = %s" tid.it (el_typ t)) - (fun (_, mixop, ts', _) -> fmt "%s(%s)" (il_mixop mixop) (list il_typ ts')) + (fun (mixop, ts', _) -> fmt "%s(%s)" (il_mixop mixop) (list il_typ ts')) ) @@ fun _ -> assert (tid.it <> ""); match t.it with @@ -785,45 +784,46 @@ and elab_typ_notation env tid t : bool * Il.mixop * Il.typ list * typ list = | _, Transp -> error_id id "invalid forward reference to syntax type" | ps, _ -> let as', _s = elab_args `Rhs env as_ ps t.at in - false, [[]; []], [Il.VarT (id', as') $ t.at], [t] + [[]; []], [Il.VarT (id', as') $ t.at], [t] ) | AtomT atom -> - true, [[elab_atom atom tid]], [], [] + [[elab_atom atom tid]], [], [] | SeqT [] -> - true, [[]], [], [] + [[]], [], [] | SeqT (t1::ts2) -> - let _b1, mixop1, ts1', ts1 = elab_typ_notation env tid t1 in - let _b2, mixop2, ts2', ts2 = elab_typ_notation env tid (SeqT ts2 $ t.at) in - true, merge_mixop mixop1 mixop2, ts1' @ ts2', ts1 @ ts2 + let mixop1, ts1', ts1 = elab_typ_notation env tid t1 in + let mixop2, ts2', ts2 = elab_typ_notation env tid (SeqT ts2 $ t.at) in + merge_mixop mixop1 mixop2, ts1' @ ts2', ts1 @ ts2 | InfixT (t1, atom, t2) -> - let _b1, mixop1, ts1', ts1 = elab_typ_notation env tid t1 in - let _b2, mixop2, ts2', ts2 = elab_typ_notation env tid t2 in - true, merge_mixop (merge_mixop mixop1 [[elab_atom atom tid]]) mixop2, + let mixop1, ts1', ts1 = elab_typ_notation env tid t1 in + let mixop2, ts2', ts2 = elab_typ_notation env tid t2 in + merge_mixop (merge_mixop mixop1 [[elab_atom atom tid]]) mixop2, ts1' @ ts2', ts1 @ ts2 | BrackT (l, t1, r) -> - let _b1, mixop1, ts1', ts1 = elab_typ_notation env tid t1 in - true, merge_mixop (merge_mixop [[elab_atom l tid]] mixop1) [[elab_atom r tid]], + let mixop1, ts1', ts1 = elab_typ_notation env tid t1 in + merge_mixop (merge_mixop [[elab_atom l tid]] mixop1) [[elab_atom r tid]], ts1', ts1 | ParenT t1 -> - let b1, mixop1, ts1', ts1 = elab_typ_notation env tid t1 in - b1, merge_mixop (merge_mixop [[Il.LParen]] mixop1) [[Il.RParen]], ts1', ts1 + let mixop1, ts1', ts1 = elab_typ_notation env tid t1 in + merge_mixop (merge_mixop [[Il.LParen]] mixop1) [[Il.RParen]], ts1', ts1 | IterT (t1, iter) -> (match iter with | List1 | ListN _ -> error t.at "illegal iterator in notation type" | _ -> - let b1, mixop1, ts1', ts1 = elab_typ_notation env tid t1 in + let mixop1, ts1', ts1 = elab_typ_notation env tid t1 in let iter' = elab_iter env iter in let tit = IterT (tup_typ ts1 t1.at, iter) $ t.at in let t' = Il.IterT (tup_typ' ts1' t1.at, iter') $ t.at in let op = match iter with Opt -> Il.Quest | _ -> Il.Star in - b1, [List.flatten mixop1] @ [[op]], [t'], [tit] + (if mixop1 = [[]; []] then mixop1 else [List.flatten mixop1] @ [[op]]), + [t'], [tit] ) | _ -> - false, [[]; []], [elab_typ env t], [t] + [[]; []], [elab_typ env t], [t] and (!!!) env tid t = - let _, _, ts', _ = elab_typ_notation env tid t in tup_typ' ts' t.at + let _, ts', _ = elab_typ_notation env tid t in tup_typ' ts' t.at (* Expressions *) @@ -995,7 +995,10 @@ and elab_exp env e t : Il.exp = try let e' = elab_exp' env e t in e' $$ e.at % elab_typ env t - with Source.Error _ when is_notation_typ env t -> + with Error _ when is_notation_typ env t -> + Debug.(log_in_at "el.elab_exp" e.at + (fun _ -> fmt "%s : %s # backtrack" (el_exp e) (el_typ t)) + ); elab_exp_notation env (expand_id env t) e (as_notation_typ "" env Check t e.at) t and elab_exp' env e t : Il.exp' = @@ -1193,10 +1196,8 @@ and elab_exp_notation env tid e nt t : Il.exp = (* Convert notation into applications of mixin operators *) assert (tid.it <> ""); let es', _s = elab_exp_notation' env tid e nt in - match elab_typ_notation env tid nt with - | false, _, _, _ -> tup_exp' es' e.at - | true, mixop, _, _ -> - Il.MixE (mixop, tup_exp_bind' es' e.at) $$ e.at % elab_typ env t + let mixop, _, _ = elab_typ_notation env tid nt in + Il.MixE (mixop, tup_exp_bind' es' e.at) $$ e.at % elab_typ env t and elab_exp_notation' env tid e t : Il.exp list * Subst.t = Debug.(log_at "el.elab_exp_notation" e.at @@ -1229,18 +1230,13 @@ and elab_exp_notation' env tid e t : Il.exp list * Subst.t = (* Optional iterations may always be inlined, use backtracking *) | SeqE (e1::es2), SeqT (t1::ts2) when is_opt_notation_typ env t1 -> (try - (* - Printf.eprintf "[try %s] %s : %s\n%!" - (string_of_region e.at) (string_of_exp e) (string_of_typ t); - *) let es1' = [cast_empty "omitted sequence tail" env t1 e.at (!!!env tid t1)] in let es2', s2 = elab_exp_notation' env tid e (SeqT ts2 $ t.at) in es1' @ es2', s2 - with Source.Error _ -> - (* - Printf.eprintf "[backtrack %s] %s : %s\n%!" - (string_of_region e.at) (string_of_exp e) (string_of_typ t); - *) + with Error _ -> + Debug.(log_in_at "el.elab_exp_notation" e.at + (fun _ -> fmt "%s : %s # backtrack" (el_exp e) (el_typ t)) + ); let es1', s1 = elab_exp_notation' env tid e1 t1 in let es2', s2 = elab_exp_notation' env tid (SeqE es2 $ e.at) (Subst.subst_typ s1 (SeqT ts2 $ t.at)) in @@ -1299,7 +1295,7 @@ and elab_exp_notation' env tid e t : Il.exp list * Subst.t = and elab_exp_notation_iter env tid es (t1, iter) t at : Il.exp = assert (tid.it <> ""); let e' = elab_exp_notation_iter' env tid es (t1, iter) t at in - let _, _, ts', _ = elab_typ_notation env tid t in + let _, ts', _ = elab_typ_notation env tid t in e' $$ at % tup_typ' ts' t.at and elab_exp_notation_iter' env tid es (t1, iter) t at : Il.exp' = @@ -1381,6 +1377,10 @@ and elab_path' env p t : Il.path' * typ = and cast_empty phrase env t at t' : Il.exp = + Debug.(log_at "el.cast_empty" at + (fun _ -> fmt "%s >> (%s)" (el_typ t) (el_typ (expand env t $ t.at))) + (fun r -> fmt "%s" (il_exp r)) + ) @@ fun _ -> match expand env t with | IterT (_, Opt) -> Il.OptE None $$ at % t' | IterT (_, List) -> Il.ListE [] $$ at % t' @@ -1388,7 +1388,7 @@ and cast_empty phrase env t at t' : Il.exp = assert (is_notation_typ env t); (match expand_iter_notation env t with | IterT (_, iter) as t1 -> - let _, mixop, ts', _ts = elab_typ_notation env (expand_id env t) (t1 $ t.at) in + let mixop, ts', _ts = elab_typ_notation env (expand_id env t) (t1 $ t.at) in assert (List.length ts' = 1); let e1' = if iter = Opt then Il.OptE None else Il.ListE [] in Il.MixE (mixop, tup_exp_bind' [e1' $$ at % List.hd ts'] at) $$ at % t' @@ -1402,7 +1402,7 @@ and cast_exp phrase env e' t1 t2 : Il.exp = and cast_exp' phrase env e' t1 t2 : Il.exp' = Debug.(log_at "el.cast_exp" e'.at - (fun _ -> fmt "%s <: %s >> (%s) <: (%s) = %s" (el_typ t1) (el_typ t2) + (fun _ -> fmt "%s <: %s >> (%s) <: (%s) = (%s)" (el_typ t1) (el_typ t2) (el_typ (expand_def env t1 $ t1.at)) (el_typ (expand_def env t2 $ t2.at)) (el_typ (expand_nondef env t2)) ) @@ -1414,13 +1414,9 @@ and cast_exp' phrase env e' t1 t2 : Il.exp' = let t1' = elab_typ env (expand_nondef env t1) in let t2' = elab_typ env (expand_nondef env t2) in Il.SubE (e', t1', t2') - | _, IterT (t21, Opt) -> - Il.OptE (Some (cast_exp phrase env e' t1 t21)) - | _, IterT (t21, (List | List1)) -> - Il.ListE [cast_exp phrase env e' t1 t21] | ConT ((t11, _), _), ConT ((t21, _), _) -> - let _, mixop1, ts1', ts1 = elab_typ_notation env (expand_id env t1) t11 in - let _, mixop2, _ts2', ts2 = elab_typ_notation env (expand_id env t2) t21 in + let mixop1, ts1', ts1 = elab_typ_notation env (expand_id env t1) t11 in + let mixop2, _ts2', ts2 = elab_typ_notation env (expand_id env t2) t21 in if mixop1 <> mixop2 then error_typ2 env e'.at phrase t1 t2 ""; let e'' = Il.UnmixE (e', mixop1) $$ e'.at % tup_typ' ts1' e'.at in @@ -1428,28 +1424,62 @@ and cast_exp' phrase env e' t1 t2 : Il.exp' = let es'' = List.map2 (fun eI' (t1I, t2I) -> cast_exp phrase env eI' t1I t2I) es' (List.combine ts1 ts2) in Il.MixE (mixop2, tup_exp_bind' es'' e'.at) - | ConT ((t11, _), _), _ -> - let _, mixop, ts', ts = elab_typ_notation env (expand_id env t1) t11 in - let t111, t111' = match ts, ts' with [t111], [t111'] -> t111, t111' | _ -> - error_typ2 env e'.at phrase t1 t2 "" in - let e'' = Il.UnmixE (e', mixop) $$ e'.at % tup_typ' ts' e'.at in - cast_exp' phrase env (Il.ProjE (e'', 0) $$ e'.at % t111') t111 t2 + | ConT ((t11, _), _), t2' -> + (try + match t2' with + | IterT (t21, Opt) -> + Il.OptE (Some (cast_exp phrase env e' t1 t21)) + | IterT (t21, (List | List1)) -> + Il.ListE [cast_exp phrase env e' t1 t21] + | _ -> raise (Error (e'.at, "")) + with Error _ -> (* backtrack *) + Debug.(log_in_at "el.cast_exp" e'.at + (fun _ -> fmt "%s <: %s >> (%s) <: (%s) = (%s) # backtrack 1" (el_typ t1) (el_typ t2) + (el_typ (expand_def env t1 $ t1.at)) (el_typ (expand_def env t2 $ t2.at)) + (el_typ (expand_nondef env t2)) + ) + ); + let mixop, ts', ts = elab_typ_notation env (expand_id env t1) t11 in + let t111, t111' = match ts, ts' with [t111], [t111'] -> t111, t111' | _ -> + error_typ2 env e'.at phrase t1 t2 "" in + let e'' = Il.UnmixE (e', mixop) $$ e'.at % tup_typ' ts' e'.at in + cast_exp' phrase env (Il.ProjE (e'', 0) $$ e'.at % t111') t111 t2 + ) | _, ConT ((t21, _), _) -> - let _, mixop, _ts', ts = elab_typ_notation env (expand_id env t2) t21 in + let mixop, _ts', ts = elab_typ_notation env (expand_id env t2) t21 in let t211 = match ts with [t211] -> t211 | _ -> error_typ2 env e'.at phrase t1 t2 "" in Il.MixE (mixop, tup_exp_bind' [cast_exp phrase env e' t1 t211] e'.at) - | RangeT _, _ -> - let t11 = typ_rep env t1 in - let t11' = elab_typ env t11 in - let e'' = Il.UnmixE (e', [[]; []]) $$ e'.at % tup_typ' [t11'] e'.at in - let e''' = Il.ProjE (e'', 0) $$ e'.at % t11' in - cast_exp' phrase env e''' t11 t2 + | RangeT _, t2' -> + (try + match t2' with + | IterT (t21, Opt) -> + Il.OptE (Some (cast_exp phrase env e' t1 t21)) + | IterT (t21, (List | List1)) -> + Il.ListE [cast_exp phrase env e' t1 t21] + | _ -> raise (Error (e'.at, "")) + with Error _ -> (* backtrack *) + Debug.(log_in_at "el.cast_exp" e'.at + (fun _ -> fmt "%s <: %s >> (%s) <: (%s) = (%s) # backtrack 2" (el_typ t1) (el_typ t2) + (el_typ (expand_def env t1 $ t1.at)) (el_typ (expand_def env t2 $ t2.at)) + (el_typ (expand_nondef env t2)) + ) + ); + let t11 = typ_rep env t1 in + let t11' = elab_typ env t11 in + let e'' = Il.UnmixE (e', [[]; []]) $$ e'.at % tup_typ' [t11'] e'.at in + let e''' = Il.ProjE (e'', 0) $$ e'.at % t11' in + cast_exp' phrase env e''' t11 t2 + ) | _, RangeT _ -> let t21 = typ_rep env t2 in let e'' = cast_exp phrase env e' t1 t21 in Il.MixE ([[]; []], tup_exp_bind' [e''] e'.at) - | _, _ when is_variant_typ env t1 && is_variant_typ env t2 -> + | _, IterT (t21, Opt) -> + Il.OptE (Some (cast_exp phrase env e' t1 t21)) + | _, IterT (t21, (List | List1)) -> + Il.ListE [cast_exp phrase env e' t1 t21] + | _, _ when is_variant_typ env t1 && is_variant_typ env t2 && not (is_iter_typ env t1) -> let cases1, dots1 = as_variant_typ "" env Check t1 e'.at in let cases2, _dots2 = as_variant_typ "" env Check t2 e'.at in if dots1 = Dots then @@ -1464,9 +1494,12 @@ and cast_exp' phrase env e' t1 t2 : Il.exp' = ) cases1 with Error (_, msg) -> error_typ2 env e'.at phrase t1 t2 (", " ^ msg) ); - let t1' = elab_typ env (expand_nondef env t1) in - let t2' = elab_typ env (expand_nondef env t2) in - Il.SubE (e', t1', t2') + let t11 = expand_singular env t1 $ t1.at in + let t21 = expand_singular env t2 $ t2.at in + let t11' = elab_typ env (expand_nondef env t1) in + let t21' = elab_typ env (expand_nondef env t2) in + let e'' = Il.SubE (cast_exp phrase env e' t1 t11, t11', t21') in + cast_exp' phrase env (e'' $$ e'.at % t21') t21 t2 | _, _ -> error_typ2 env e'.at phrase t1 t2 "" @@ -1484,7 +1517,7 @@ and elab_prem env prem : Il.prem list = [] | RulePr (id, e) -> let t, _ = find "relation" env.rels id in - let _, mixop, _, _ = elab_typ_notation env id t in + let mixop, _, _ = elab_typ_notation env id t in let es', _s = elab_exp_notation' env id e t in [Il.RulePr (id, mixop, tup_exp' es' e.at) $ prem.at] | IfPr e -> @@ -1856,7 +1889,7 @@ let elab_def env d : Il.def list = ) @ elab_hintdef env (TypH (id1, id2, hints) $ d.at) | GramD _ -> [] | RelD (id, t, hints) -> - let _, mixop, ts', _ts = elab_typ_notation env id t in + let mixop, ts', _ts = elab_typ_notation env id t in infer_no_binds env d; env.rels <- bind "relation" env.rels id (t, []); [Il.RelD (id, mixop, tup_typ' ts' t.at, []) $ d.at] @@ -1866,7 +1899,7 @@ let elab_def env d : Il.def list = let dims = Dim.check_def d in let dims' = Dim.Env.map (List.map (elab_iter env')) dims in let t, rules' = find "relation" env.rels id1 in - let _, mixop, _, _ = elab_typ_notation env id1 t in + let mixop, _, _ = elab_typ_notation env id1 t in let es' = List.map (Dim.annot_exp dims') (fst (elab_exp_notation' env' id1 e t)) in let prems' = List.map (Dim.annot_prem dims') (concat_map_filter_nl_list (elab_prem env') prems) in diff --git a/spectec/src/il/eval.ml b/spectec/src/il/eval.ml index 11e338ff75..5426758ccb 100644 --- a/spectec/src/il/eval.ml +++ b/spectec/src/il/eval.ml @@ -58,7 +58,7 @@ let rec reduce_typ env t : typ = match t.it with | VarT (id, args) -> let args' = List.map (reduce_arg env) args in - (match reduce_typ_app' env id args' t.at (Map.find id.it env.typs) with + (match reduce_typ_app' env id args' t.at (Map.find_opt id.it env.typs) with | Some {it = AliasT t'; _} -> reduce_typ env t' | _ -> VarT (id, args') $ t.at ) @@ -79,14 +79,15 @@ and reduce_typ_app env id args at : deftyp option = (fun _ -> fmt "%s(%s)" id.it (il_args args)) (fun r -> fmt "%s" (opt il_deftyp r)) ) @@ fun _ -> - reduce_typ_app' env id (List.map (reduce_arg env) args) at (Map.find id.it env.typs) + reduce_typ_app' env id (List.map (reduce_arg env) args) at (Map.find_opt id.it env.typs) and reduce_typ_app' env id args at = function - | [] -> + | None -> None (* id is a type parameter *) + | Some [] -> if !assume_coherent_matches then None else Source.error at "validation" ("undefined instance of partial type `" ^ id.it ^ "`") - | {it = InstD (_binds, args', dt); _}::insts' -> + | Some ({it = InstD (_binds, args', dt); _}::insts') -> Debug.(log "il.reduce_typ_app'" (fun _ -> fmt "%s(%s) =: %s(%s)" id.it (il_args args) id.it (il_args args')) (fun r -> fmt "%s" (opt (Fun.const "!") r)) @@ -94,8 +95,8 @@ and reduce_typ_app' env id args at = function match match_list match_arg env Subst.empty args args' with | exception Irred -> if not !assume_coherent_matches then None else - reduce_typ_app' env id args at insts' - | None -> reduce_typ_app' env id args at insts' + reduce_typ_app' env id args at (Some insts') + | None -> reduce_typ_app' env id args at (Some insts') | Some s -> Some (Subst.subst_deftyp s dt) diff --git a/spectec/src/il2al/translate.ml b/spectec/src/il2al/translate.ml index 4435c6c977..2bf8b0f744 100644 --- a/spectec/src/il2al/translate.ml +++ b/spectec/src/il2al/translate.ml @@ -41,11 +41,11 @@ let split_state e = let state_instr = [ letI (varE "f", getCurFrameE ()) ] in match e.it with (* z; e *) - | Il.MixE ([ []; [ Il.Semicolon ]; [ Il.Star ] ], { it = Il.TupE [ state; e' ]; _ }) + | Il.MixE ([ []; [ Il.Semicolon ]; [] ], { it = Il.TupE [ state; e' ]; _ }) when is_state state -> state_instr, e' (* s; f; e *) | Il.MixE - ( [ []; [ Il.Semicolon ]; [ Il.Star ] ], + ( [ []; [ Il.Semicolon ]; [] ], { it = Il.TupE [ { it = Il.MixE ( [[]; [ Il.Semicolon ]; []], { it = Il.TupE [ store; frame ]; _ } @@ -208,11 +208,12 @@ and translate_exp exp = | [ []; [ Il.Star; atom ]; [ Il.Star ] ], [ e1; e2 ] | [ []; [ atom ]; [] ], [ e1; e2 ] -> infixE (translate_exp e1, Il.Print.string_of_atom atom, translate_exp e2) ~at:at + | [ []; [ Il.Arrow ]; []; [] ], [ e1; e2; e3 ] | [ []; [ Il.Arrow ]; [ Il.Star ]; [] ], [ e1; e2; e3 ] -> (* HARDCODE *) infixE (translate_exp e1, "->", catE (translate_exp e2, translate_exp e3)) ~at:at (* Constructor *) (* TODO: Need a better way to convert these CaseE into ConstructE *) - | [ [ Il.Atom "FUNC" ]; []; [ Il.Star ]; [] ], _ -> + | [ [ Il.Atom "FUNC" ]; []; []; [] ], _ -> caseE (("FUNC", "func"), List.map translate_exp exps) ~at:at | [ [ Il.Atom "OK" ] ], [] -> caseE (("OK", "datatype"), []) ~at:at @@ -234,9 +235,9 @@ and translate_exp exp = caseE (("MEMORY", "mem"), List.map translate_exp el) ~at:at | [ []; [ Il.Atom "I8" ] ], el -> caseE (("I8", "memtype"), List.map translate_exp el) ~at:at - | [ [ Il.Atom "ELEM" ]; []; [ Il.Star ]; [] ], el -> + | [ [ Il.Atom "ELEM" ]; []; []; [] ], el -> caseE (("ELEM", "elem"), List.map translate_exp el) ~at:at - | [ [ Il.Atom "DATA" ]; [ Il.Star ]; [] ], el -> + | [ [ Il.Atom "DATA" ]; []; [] ], el -> caseE (("DATA", "data"), List.map translate_exp el) ~at:at | [ [ Il.Atom "START" ]; [] ], el -> caseE (("START", "start"), List.map translate_exp el) ~at:at @@ -390,7 +391,7 @@ let rec translate_rhs exp = | Il.CaseE (Atom atomid, argexp) -> [ executeI (caseE (kwd atomid exp.note, translate_argexp argexp)) ~at:at ] | Il.MixE - ( [ []; [ Il.Semicolon ]; [ Il.Star ] ], + ( [ []; [ Il.Semicolon ]; [] ], (* z' ; instr'* *) { it = TupE [ se; rhs ]; _ } ) -> ( let push_instrs = translate_rhs rhs in diff --git a/spectec/test-frontend/TEST.md b/spectec/test-frontend/TEST.md index 9f74dabf45..a020377125 100644 --- a/spectec/test-frontend/TEST.md +++ b/spectec/test-frontend/TEST.md @@ -68,14 +68,8 @@ def $concat_(syntax X, X**) : X* } ;; 1-syntax.watsup -syntax list{syntax X}(syntax X) = X* - -;; 1-syntax.watsup -syntax char = `%`{i : nat}(i : nat) - -- if (((i >= 0) /\ (i <= 55295)) \/ ((i >= 57344) /\ (i <= 1114111))) - -;; 1-syntax.watsup -syntax name = char* +syntax list{syntax X}(syntax X) = `%`{X* : X*}(X*{X : X} : X*) + -- if (|X*{X : X}| < (2 ^ 32)) ;; 1-syntax.watsup syntax bit = `%`{i : nat}(i : nat) @@ -180,6 +174,35 @@ def $canon_(N : N) : nat ;; 1-syntax.watsup syntax vN{N : N}(N) = iN(N) +;; 1-syntax.watsup +syntax char = `%`{i : nat}(i : nat) + -- if (((i >= 0) /\ (i <= 55295)) \/ ((i >= 57344) /\ (i <= 1114111))) + +;; 1-syntax.watsup +rec { + +;; 1-syntax.watsup:87.1-87.25 +def $utf8(char*) : byte* + ;; A-binary.watsup:50.1-50.47 + def $utf8{ch : char, b : byte}([ch]) = [b] + -- if ((ch.`%`.0 < 128) /\ (ch = `%`(b.`%`.0))) + ;; A-binary.watsup:51.1-51.96 + def $utf8{ch : char, b_1 : byte, b_2 : byte}([ch]) = [b_1 b_2] + -- if (((128 <= ch.`%`.0) /\ (ch.`%`.0 < 2048)) /\ (ch = `%`((((2 ^ 6) * (b_1.`%`.0 - 192)) + (b_2.`%`.0 - 128))))) + ;; A-binary.watsup:52.1-52.148 + def $utf8{ch : char, b_1 : byte, b_2 : byte, b_3 : byte}([ch]) = [b_1 b_2 b_3] + -- if ((((2048 <= ch.`%`.0) /\ (ch.`%`.0 < 55296)) \/ ((57344 <= ch.`%`.0) /\ (ch.`%`.0 < 65536))) /\ (ch = `%`(((((2 ^ 12) * (b_1.`%`.0 - 224)) + ((2 ^ 6) * (b_2.`%`.0 - 128))) + (b_3.`%`.0 - 128))))) + ;; A-binary.watsup:53.1-53.148 + def $utf8{ch : char, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([ch]) = [b_1 b_2 b_3 b_4] + -- if (((65536 <= ch.`%`.0) /\ (ch.`%`.0 < 69632)) /\ (ch = `%`((((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128))))) + ;; A-binary.watsup:54.1-54.44 + def $utf8{ch* : char*}(ch*{ch : char}) = $concat_(syntax byte, $utf8([ch])*{ch : char}) +} + +;; 1-syntax.watsup +syntax name = `%`{char* : char*}(char*{char : char} : char*) + -- if (|$utf8(char*{char : char})| < (2 ^ 32)) + ;; 1-syntax.watsup syntax idx = u32 @@ -250,7 +273,7 @@ syntax fin = `FINAL%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:146.1-147.14 +;; 1-syntax.watsup:147.1-148.14 syntax valtype = | I32 | I64 @@ -260,10 +283,10 @@ syntax valtype = | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | BOT -;; 1-syntax.watsup:154.1-155.16 +;; 1-syntax.watsup:155.1-156.16 syntax resulttype = list(syntax valtype) -;; 1-syntax.watsup:162.1-162.68 +;; 1-syntax.watsup:163.1-163.68 syntax storagetype = | BOT | I32 @@ -275,34 +298,34 @@ syntax storagetype = | I8 | I16 -;; 1-syntax.watsup:175.1-176.18 +;; 1-syntax.watsup:176.1-177.18 syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) -;; 1-syntax.watsup:178.1-178.70 +;; 1-syntax.watsup:179.1-179.70 syntax functype = `%->%`{resulttype : resulttype}(resulttype : resulttype, resulttype) -;; 1-syntax.watsup:179.1-179.64 +;; 1-syntax.watsup:180.1-180.64 syntax structtype = list(syntax fieldtype) -;; 1-syntax.watsup:180.1-180.53 +;; 1-syntax.watsup:181.1-181.53 syntax arraytype = fieldtype -;; 1-syntax.watsup:182.1-185.18 +;; 1-syntax.watsup:183.1-186.18 syntax comptype = | STRUCT{structtype : structtype}(structtype : structtype) | ARRAY{arraytype : arraytype}(arraytype : arraytype) | FUNC{functype : functype}(functype : functype) -;; 1-syntax.watsup:189.1-190.60 +;; 1-syntax.watsup:190.1-191.60 syntax subtype = | SUB{fin : fin, typeidx* : typeidx*, comptype : comptype}(fin : fin, typeidx*{typeidx : typeidx} : typeidx*, comptype : comptype) | SUBD{fin : fin, heaptype* : heaptype*, comptype : comptype}(fin : fin, heaptype*{heaptype : heaptype} : heaptype*, comptype : comptype) -;; 1-syntax.watsup:192.1-193.22 +;; 1-syntax.watsup:193.1-194.22 syntax rectype = | REC{list : list(syntax subtype)}(list : list(syntax subtype)) -;; 1-syntax.watsup:198.1-199.26 +;; 1-syntax.watsup:199.1-200.26 syntax heaptype = | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY @@ -761,7 +784,7 @@ syntax zero = `ZERO%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:522.1-534.78 +;; 1-syntax.watsup:523.1-535.78 syntax instr = | UNREACHABLE | NOP @@ -891,7 +914,7 @@ syntax type = TYPE{rectype : rectype}(rectype : rectype) syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) +syntax func = FUNC{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) ;; 1-syntax.watsup syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) @@ -903,10 +926,10 @@ syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) +syntax elem = ELEM{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) ;; 1-syntax.watsup -syntax data = `DATA%*%`{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) +syntax data = DATA{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup syntax start = START{funcidx : funcidx}(funcidx : funcidx) @@ -925,7 +948,7 @@ syntax export = EXPORT{name : name, externidx : externidx}(name : name, externid syntax import = IMPORT{name : name, externtype : externtype}(name : name, name, externtype : externtype) ;; 1-syntax.watsup -syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) +syntax module = MODULE{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) ;; 2-syntax-aux.watsup rec { @@ -981,7 +1004,7 @@ def $free_dataidx_expr(expr : expr) : dataidx* ;; 2-syntax-aux.watsup def $free_dataidx_func(func : func) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) + def $free_dataidx_func{x : idx, loc* : local*, e : expr}(FUNC(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) ;; 2-syntax-aux.watsup rec { @@ -1118,7 +1141,7 @@ def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype ;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype ;; 2-syntax-aux.watsup:175.1-175.85 - def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt : fieldtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype}) + def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(`%`(yt*{yt : fieldtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype(`%`($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype})) ;; 2-syntax-aux.watsup:176.1-176.81 def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx : typevar}, ht*{ht : heaptype}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:177.1-177.78 @@ -1134,7 +1157,7 @@ def $subst_subtype(subtype : subtype, typevar*, heaptype*) : subtype ;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype ;; 2-syntax-aux.watsup:184.1-184.76 - def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st : subtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype}) + def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(`%`(st*{st : subtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype(`%`($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype})) ;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype @@ -1144,7 +1167,7 @@ def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype ;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype ;; 2-syntax-aux.watsup:189.1-189.113 - def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}, $subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype}) + def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`(`%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}), `%`($subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype})) } ;; 2-syntax-aux.watsup @@ -1197,25 +1220,25 @@ def $subst_all_deftypes(deftype*, heaptype*) : deftype* ;; 2-syntax-aux.watsup def $rollrt(typeidx : typeidx, rectype : rectype) : rectype ;; 2-syntax-aux.watsup - def $rollrt{x : idx, st^n : subtype^n, n : n, i^n : nat^n}(x, REC_rectype(st^n{st : subtype})) = REC_rectype($subst_subtype(st, $idx(`%`((x.`%`.0 + i)))^(i%*%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) +syntax instrtype = `%->%%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) ;; 6-typing.watsup syntax context = @@ -2686,16 +2709,16 @@ relation Valtype_ok: `%|-%:_OK`(context, valtype) relation Resulttype_ok: `%|-%:_OK`(context, resulttype) ;; 6-typing.watsup rule _{C : context, t* : valtype*}: - `%|-%:_OK`(C, t*{t : valtype}) + `%|-%:_OK`(C, `%`(t*{t : valtype})) -- (Valtype_ok: `%|-%:_OK`(C, t))*{t : valtype} ;; 6-typing.watsup relation Instrtype_ok: `%|-%:_OK`(context, instrtype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, x* : idx*, t_2* : valtype*, lt* : localtype*}: - `%|-%:_OK`(C, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + `%|-%:_OK`(C, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_1*{t_1 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_2*{t_2 : valtype})) -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt : localtype x : idx} ;; 6-typing.watsup @@ -2735,15 +2758,15 @@ relation Fieldtype_ok: `%|-%:_OK`(context, fieldtype) relation Functype_ok: `%|-%:_OK`(context, functype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:_OK`(C, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + `%|-%:_OK`(C, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_1*{t_1 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Comptype_ok: `%|-%:_OK`(context, comptype) ;; 6-typing.watsup rule struct{C : context, yt* : fieldtype*}: - `%|-%:_OK`(C, STRUCT_comptype(yt*{yt : fieldtype})) + `%|-%:_OK`(C, STRUCT_comptype(`%`(yt*{yt : fieldtype}))) -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt : fieldtype} ;; 6-typing.watsup @@ -2816,7 +2839,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:303.1-305.35 rule struct{C : context, deftype : deftype, yt* : fieldtype*}: `%|-%<:%`(C, (deftype : deftype <: heaptype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt : fieldtype})) + -- Expand: `%~~%`(deftype, STRUCT_comptype(`%`(yt*{yt : fieldtype}))) ;; 6-typing.watsup:307.1-309.33 rule array{C : context, deftype : deftype, yt : fieldtype}: @@ -2942,7 +2965,7 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) ;; 6-typing.watsup rule struct{C : context, yt_1* : fieldtype*, yt'_1 : fieldtype, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1 : fieldtype} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2 : fieldtype})) + `%|-%<:%`(C, STRUCT_comptype(`%`(yt_1*{yt_1 : fieldtype} :: [yt'_1])), STRUCT_comptype(`%`(yt_2*{yt_2 : fieldtype}))) -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 : fieldtype yt_2 : fieldtype} ;; 6-typing.watsup @@ -3002,13 +3025,13 @@ rec { relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) ;; 6-typing.watsup:196.1-197.24 rule empty{C : context, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) + `%|-%:%`(C, REC_rectype(`%`([])), OK_oktypeidxnat(x, i)) ;; 6-typing.watsup:199.1-202.50 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidxnat(x, i)) + `%|-%:%`(C, REC_rectype(`%`([st_1] :: st*{st : subtype})), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) - -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) } ;; 6-typing.watsup @@ -3018,18 +3041,18 @@ rec { relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) ;; 6-typing.watsup:184.1-185.23 rule empty{C : context, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) + `%|-%:%`(C, REC_rectype(`%`([])), OK_oktypeidx(x)) ;; 6-typing.watsup:187.1-190.43 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidx(x)) + `%|-%:%`(C, REC_rectype(`%`([st_1] :: st*{st : subtype})), OK_oktypeidx(x)) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) - -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) + -- Rectype_ok: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidx(`%`((x.`%`.0 + 1)))) ;; 6-typing.watsup:192.1-194.49 rule rec2{C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(x, 0)) + `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(x, 0)) } ;; 6-typing.watsup @@ -3038,7 +3061,7 @@ relation Deftype_ok: `%|-%:_OK`(context, deftype) rule _{C : context, qt : rectype, i : nat, x : idx, st^n : subtype^n, n : n}: `%|-%:_OK`(C, DEF_deftype(qt, i)) -- Rectype_ok: `%|-%:%`(C, qt, OK_oktypeidx(x)) - -- if (qt = REC_rectype(st^n{st : subtype})) + -- if (qt = REC_rectype(`%`(st^n{st : subtype}))) -- if (i < n) ;; 6-typing.watsup @@ -3094,19 +3117,19 @@ relation Externtype_ok: `%|-%:_OK`(context, externtype) -- Memtype_ok: `%|-%:_OK`(C, mt) ;; 6-typing.watsup -relation Resulttype_sub: `%|-%*_<:%*`(context, valtype*, valtype*) +relation Resulttype_sub: `%|-%<:%`(context, valtype*, valtype*) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%*_<:%*`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) + `%|-%<:%`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 : valtype t_2 : valtype} ;; 6-typing.watsup relation Instrtype_sub: `%|-%<:%`(context, instrtype, instrtype) ;; 6-typing.watsup rule _{C : context, t_11* : valtype*, x_1* : idx*, t_12* : valtype*, t_21* : valtype*, x_2* : idx*, t_22* : valtype*, x* : idx*, t* : valtype*}: - `%|-%<:%`(C, `%->%*%`(t_11*{t_11 : valtype}, x_1*{x_1 : localidx}, t_12*{t_12 : valtype}), `%->%*%`(t_21*{t_21 : valtype}, x_2*{x_2 : localidx}, t_22*{t_22 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) + `%|-%<:%`(C, `%->%%`(`%`(t_11*{t_11 : valtype}), x_1*{x_1 : localidx}, `%`(t_12*{t_12 : valtype})), `%->%%`(`%`(t_21*{t_21 : valtype}), x_2*{x_2 : localidx}, `%`(t_22*{t_22 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) + -- Resulttype_sub: `%|-%<:%`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) -- if (x*{x : idx} = $setminus(x_2*{x_2 : idx}, x_1*{x_1 : idx})) -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t : valtype x : idx} @@ -3173,11 +3196,11 @@ relation Externtype_sub: `%|-%<:%`(context, externtype, externtype) relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) ;; 6-typing.watsup rule void{C : context}: - `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) + `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`(`%`([]), `%`([]))) ;; 6-typing.watsup rule result{C : context, t : valtype}: - `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`([], [t])) + `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`(`%`([]), `%`([t]))) ;; 6-typing.watsup rule typeidx{C : context, x : idx, ft : functype}: @@ -3191,77 +3214,77 @@ rec { relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:544.1-545.34 rule unreachable{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:547.1-548.24 rule nop{C : context}: - `%|-%:%`(C, NOP_instr, `%->%`([], [])) + `%|-%:%`(C, NOP_instr, `%->%`(`%`([]), `%`([]))) ;; 6-typing.watsup:550.1-551.23 rule drop{C : context, t : valtype}: - `%|-%:%`(C, DROP_instr, `%->%`([t], [])) + `%|-%:%`(C, DROP_instr, `%->%`(`%`([t]), `%`([]))) ;; 6-typing.watsup:554.1-555.31 rule select-expl{C : context, t : valtype}: - `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) + `%|-%:%`(C, SELECT_instr(?([t])), `%->%`(`%`([t t I32_valtype]), `%`([t]))) ;; 6-typing.watsup:557.1-560.37 rule select-impl{C : context, t : valtype, t' : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) + `%|-%:%`(C, SELECT_instr(?()), `%->%`(`%`([t t I32_valtype]), `%`([t]))) -- Valtype_sub: `%|-%<:%`(C, t, t') -- if ((t' = (numtype : numtype <: valtype)) \/ (t' = (vectype : vectype <: valtype))) ;; 6-typing.watsup:578.1-581.61 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:583.1-586.61 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_1*{t_1 : valtype})], RETURN ?()}, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:588.1-592.65 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_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_2*{x_2 : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(`%`(t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_2*{x_2 : localidx}, `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:597.1-599.24 rule br{C : context, l : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) + `%|-%:%`(C, BR_instr(l), `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype})) ;; 6-typing.watsup:601.1-603.24 rule br_if{C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t : valtype} :: [I32_valtype], t*{t : valtype})) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) + `%|-%:%`(C, BR_IF_instr(l), `%->%`(`%`(t*{t : valtype} :: [I32_valtype]), `%`(t*{t : valtype}))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype})) ;; 6-typing.watsup:605.1-608.44 rule br_table{C : context, l* : labelidx*, l' : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) - -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0]))*{l : labelidx} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0]) + `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) + -- (Resulttype_sub: `%|-%<:%`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0].`%`.0))*{l : labelidx} + -- Resulttype_sub: `%|-%<:%`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0].`%`.0) ;; 6-typing.watsup:610.1-613.31 rule br_on_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(`%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)]), `%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype})) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:615.1-618.31 rule br_on_non_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype})) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]) + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(`%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)]), `%`(t*{t : valtype}))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:620.1-626.34 rule br_on_cast{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(`%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)]), `%`(t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)]))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype} :: [(rt : reftype <: valtype)])) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -3269,8 +3292,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:628.1-634.49 rule br_on_cast_fail{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [(rt_2 : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(`%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)]), `%`(t*{t : valtype} :: [(rt_2 : reftype <: valtype)]))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype} :: [(rt : reftype <: valtype)])) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -3278,414 +3301,414 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:639.1-641.24 rule return{C : context, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) - -- if (C.RETURN_context = ?(t*{t : valtype})) + `%|-%:%`(C, RETURN_instr, `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(`%`(t*{t : valtype}))) ;; 6-typing.watsup:643.1-645.46 rule call{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + `%|-%:%`(C, CALL_instr(x), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; 6-typing.watsup:647.1-649.46 rule call_ref{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2 : valtype})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(`%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`(t_2*{t_2 : valtype}))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; 6-typing.watsup:651.1-655.46 rule call_indirect{C : context, x : idx, y : idx, t_1* : valtype*, t_2* : valtype*, lim : limits, rt : reftype}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(`%`(t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_2*{t_2 : valtype}))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; 6-typing.watsup:657.1-661.40 rule return_call{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}, t_4*{t_4 : valtype})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}), `%`(t_4*{t_4 : valtype}))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:663.1-667.40 rule return_call_ref{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4 : valtype})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`(t_4*{t_4 : valtype}))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:669.1-675.40 rule return_call_indirect{C : context, x : idx, y : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, lim : limits, rt : reftype, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype], t_4*{t_4 : valtype})) + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_4*{t_4 : valtype}))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:680.1-681.33 rule const{C : context, nt : numtype, c_nt : num_(nt)}: - `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [(nt : numtype <: valtype)])) + `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`(`%`([]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:683.1-684.34 rule unop{C : context, nt : numtype, unop_nt : unop_(nt)}: - `%|-%:%`(C, UNOP_instr(nt, unop_nt), `%->%`([(nt : numtype <: valtype)], [(nt : numtype <: valtype)])) + `%|-%:%`(C, UNOP_instr(nt, unop_nt), `%->%`(`%`([(nt : numtype <: valtype)]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:686.1-687.39 rule binop{C : context, nt : numtype, binop_nt : binop_(nt)}: - `%|-%:%`(C, BINOP_instr(nt, binop_nt), `%->%`([(nt : numtype <: valtype) (nt : numtype <: valtype)], [(nt : numtype <: valtype)])) + `%|-%:%`(C, BINOP_instr(nt, binop_nt), `%->%`(`%`([(nt : numtype <: valtype) (nt : numtype <: valtype)]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:689.1-690.39 rule testop{C : context, nt : numtype, testop_nt : testop_(nt)}: - `%|-%:%`(C, TESTOP_instr(nt, testop_nt), `%->%`([(nt : numtype <: valtype)], [I32_valtype])) + `%|-%:%`(C, TESTOP_instr(nt, testop_nt), `%->%`(`%`([(nt : numtype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:692.1-693.40 rule relop{C : context, nt : numtype, relop_nt : relop_(nt)}: - `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->%`([(nt : numtype <: valtype) (nt : numtype <: valtype)], [I32_valtype])) + `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->%`(`%`([(nt : numtype <: valtype) (nt : numtype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:696.1-699.34 rule reinterpret{C : context, nt_1 : numtype, nt_2 : numtype}: - `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([(nt_2 : numtype <: valtype)], [(nt_1 : numtype <: valtype)])) + `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`(`%`([(nt_2 : numtype <: valtype)]), `%`([(nt_1 : numtype <: valtype)]))) -- if (nt_1 =/= nt_2) -- if ($size(nt_1) = $size(nt_2)) ;; 6-typing.watsup:701.1-704.50 rule convert-i{C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: - `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`(`%`([(inn_2 : inn <: valtype)]), `%`([(inn_1 : inn <: valtype)]))) -- if (inn_1 =/= inn_2) -- if ((sx?{sx : sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) ;; 6-typing.watsup:706.1-708.24 rule convert-f{C : context, fnn_1 : fnn, fnn_2 : fnn}: - `%|-%:%`(C, CVTOP_instr((fnn_1 : fnn <: numtype), CONVERT_cvtop, (fnn_2 : fnn <: numtype), ?()), `%->%`([(fnn_2 : fnn <: valtype)], [(fnn_1 : fnn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((fnn_1 : fnn <: numtype), CONVERT_cvtop, (fnn_2 : fnn <: numtype), ?()), `%->%`(`%`([(fnn_2 : fnn <: valtype)]), `%`([(fnn_1 : fnn <: valtype)]))) -- if (fnn_1 =/= fnn_2) ;; 6-typing.watsup:713.1-715.31 rule ref.null{C : context, ht : heaptype}: - `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) + `%|-%:%`(C, REF.NULL_instr(ht), `%->%`(`%`([]), `%`([REF_valtype(`NULL%?`(?(())), ht)]))) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:718.1-720.23 rule ref.func{C : context, x : idx, epsilon : resulttype, dt : deftype}: - `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), (dt : deftype <: heaptype))])) + `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, `%`([REF_valtype(`NULL%?`(?()), (dt : deftype <: heaptype))]))) -- if (C.FUNC_context[x.`%`.0] = dt) ;; 6-typing.watsup:722.1-723.34 rule ref.i31{C : context}: - `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) + `%|-%:%`(C, REF.I31_instr, `%->%`(`%`([I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), I31_heaptype)]))) ;; 6-typing.watsup:725.1-726.31 rule ref.is_null{C : context, rt : reftype}: - `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([(rt : reftype <: valtype)], [I32_valtype])) + `%|-%:%`(C, REF.IS_NULL_instr, `%->%`(`%`([(rt : reftype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:728.1-730.31 rule ref.as_non_null{C : context, ht : heaptype}: - `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) + `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ht)]), `%`([REF_valtype(`NULL%?`(?()), ht)]))) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:732.1-733.51 rule ref.eq{C : context}: - `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) + `%|-%:%`(C, REF.EQ_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:735.1-739.33 rule ref.test{C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([(rt' : reftype <: valtype)], [I32_valtype])) + `%|-%:%`(C, REF.TEST_instr(rt), `%->%`(`%`([(rt' : reftype <: valtype)]), `%`([I32_valtype]))) -- Reftype_ok: `%|-%:_OK`(C, rt) -- Reftype_ok: `%|-%:_OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') ;; 6-typing.watsup:741.1-745.33 rule ref.cast{C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.CAST_instr(rt), `%->%`([(rt' : reftype <: valtype)], [(rt : reftype <: valtype)])) + `%|-%:%`(C, REF.CAST_instr(rt), `%->%`(`%`([(rt' : reftype <: valtype)]), `%`([(rt : reftype <: valtype)]))) -- Reftype_ok: `%|-%:_OK`(C, rt) -- Reftype_ok: `%|-%:_OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') ;; 6-typing.watsup:750.1-751.42 rule i31.get{C : context, sx : sx}: - `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) + `%|-%:%`(C, I31.GET_instr(sx), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:756.1-758.43 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`(`%`($unpack(zt)*{zt : storagetype}), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) ;; 6-typing.watsup:760.1-763.39 rule struct.new_default{C : context, x : idx, zt* : storagetype*, mut* : mut*, val* : val*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`(`%`($unpack(zt)*{zt : storagetype}), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 6-typing.watsup:765.1-769.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: - `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`([$unpack(zt)]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`(mut, zt)) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:771.1-774.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: - `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)]), `%`([]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`(`MUT%?`(?(())), zt)) ;; 6-typing.watsup:779.1-781.41 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpack(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`(`%`([$unpack(zt) I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) ;; 6-typing.watsup:783.1-786.36 rule array.new_default{C : context, x : idx, mut : mut, zt : storagetype, val : val}: - `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`(`%`([I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) -- if ($default($unpack(zt)) = ?(val)) ;; 6-typing.watsup:788.1-790.41 rule array.new_fixed{C : context, x : idx, n : n, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpack(zt)], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`(`%`([$unpack(zt)]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) ;; 6-typing.watsup:792.1-795.39 rule array.new_elem{C : context, x : idx, y : idx, mut : mut, rt : reftype}: - `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, (rt : reftype <: storagetype)))) -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y.`%`.0], rt) ;; 6-typing.watsup:797.1-801.23 rule array.new_data{C : context, x : idx, y : idx, mut : mut, t : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, (t : valtype <: storagetype)))) -- if ((t = (numtype : numtype <: valtype)) \/ (t = (vectype : vectype <: valtype))) -- if (C.DATA_context[y.`%`.0] = OK) ;; 6-typing.watsup:803.1-806.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype]), `%`([$unpack(zt)]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:808.1-810.41 rule array.set{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)], [])) + `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 6-typing.watsup:812.1-814.41 rule array.len{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) + `%|-%:%`(C, ARRAY.LEN_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)]), `%`([I32_valtype]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 6-typing.watsup:816.1-818.41 rule array.fill{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype], [])) + `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 6-typing.watsup:820.1-824.40 rule array.copy{C : context, x_1 : idx, x_2 : idx, zt_1 : storagetype, mut : mut, zt_2 : storagetype}: - `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x_1.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) -- Expand: `%~~%`(C.TYPE_context[x_2.`%`.0], ARRAY_comptype(`%%`(mut, zt_2))) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) ;; 6-typing.watsup:826.1-829.43 rule array.init_elem{C : context, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) -- Storagetype_sub: `%|-%<:%`(C, (C.ELEM_context[y.`%`.0] : reftype <: storagetype), zt) ;; 6-typing.watsup:831.1-835.23 rule array.init_data{C : context, x : idx, y : idx, zt : storagetype, t : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) -- if ((t = (numtype : numtype <: valtype)) \/ (t = (vectype : vectype <: valtype))) -- if (C.DATA_context[y.`%`.0] = OK) ;; 6-typing.watsup:840.1-841.62 rule extern.convert_any{C : context, nul : nul}: - `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) + `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`(`%`([REF_valtype(nul, ANY_heaptype)]), `%`([REF_valtype(nul, EXTERN_heaptype)]))) ;; 6-typing.watsup:843.1-844.62 rule any.convert_extern{C : context, nul : nul}: - `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) + `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`(`%`([REF_valtype(nul, EXTERN_heaptype)]), `%`([REF_valtype(nul, ANY_heaptype)]))) ;; 6-typing.watsup:849.1-850.35 rule vconst{C : context, c : vec_(V128_vnn)}: - `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->%`([], [V128_valtype])) + `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->%`(`%`([]), `%`([V128_valtype]))) ;; 6-typing.watsup:852.1-853.41 rule vvunop{C : context, vvunop : vvunop}: - `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:855.1-856.48 rule vvbinop{C : context, vvbinop : vvbinop}: - `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:858.1-859.55 rule vvternop{C : context, vvternop : vvternop}: - `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->%`([V128_valtype V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->%`(`%`([V128_valtype V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:861.1-862.44 rule vvtestop{C : context, vvtestop : vvtestop}: - `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:864.1-865.33 rule vbitmask{C : context, sh : ishape}: - `%|-%:%`(C, VBITMASK_instr(sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VBITMASK_instr(sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:867.1-868.39 rule vswizzle{C : context, sh : ishape}: - `%|-%:%`(C, VSWIZZLE_instr(sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VSWIZZLE_instr(sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:870.1-872.22 rule vshuffle{C : context, imm : imm, N : N, i* : nat*}: - `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) -- (if (i < (N * 2)))*{i : nat} ;; 6-typing.watsup:874.1-875.48 rule vsplat{C : context, lnn : lnn, N : N}: - `%|-%:%`(C, VSPLAT_instr(`%X%`(lnn, `%`(N))), `%->%`([($lunpack(lnn) : numtype <: valtype)], [V128_valtype])) + `%|-%:%`(C, VSPLAT_instr(`%X%`(lnn, `%`(N))), `%->%`(`%`([($lunpack(lnn) : numtype <: valtype)]), `%`([V128_valtype]))) ;; 6-typing.watsup:878.1-880.14 rule vextract_lane{C : context, lnn : lnn, N : N, sx? : sx?, i : nat}: - `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) + `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`(`%`([V128_valtype]), `%`([($lunpack(lnn) : numtype <: valtype)]))) -- if (i < N) ;; 6-typing.watsup:882.1-884.14 rule vreplace_lane{C : context, lnn : lnn, N : N, i : nat}: - `%|-%:%`(C, VREPLACE_LANE_instr(`%X%`(lnn, `%`(N)), `%`(i)), `%->%`([V128_valtype ($lunpack(lnn) : numtype <: valtype)], [V128_valtype])) + `%|-%:%`(C, VREPLACE_LANE_instr(`%X%`(lnn, `%`(N)), `%`(i)), `%->%`(`%`([V128_valtype ($lunpack(lnn) : numtype <: valtype)]), `%`([V128_valtype]))) -- if (i < N) ;; 6-typing.watsup:886.1-887.40 rule vunop{C : context, sh : shape, vunop_sh : vunop_(sh)}: - `%|-%:%`(C, VUNOP_instr(sh, vunop_sh), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VUNOP_instr(sh, vunop_sh), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:889.1-890.47 rule vbinop{C : context, sh : shape, vbinop_sh : vbinop_(sh)}: - `%|-%:%`(C, VBINOP_instr(sh, vbinop_sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VBINOP_instr(sh, vbinop_sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:892.1-893.43 rule vtestop{C : context, sh : shape, vtestop_sh : vtestop_(sh)}: - `%|-%:%`(C, VTESTOP_instr(sh, vtestop_sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VTESTOP_instr(sh, vtestop_sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:895.1-896.47 rule vrelop{C : context, sh : shape, vrelop_sh : vrelop_(sh)}: - `%|-%:%`(C, VRELOP_instr(sh, vrelop_sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VRELOP_instr(sh, vrelop_sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:898.1-899.50 rule vshiftop{C : context, sh : ishape, vshiftop_sh : vshiftop_(sh)}: - `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop_sh), `%->%`([V128_valtype I32_valtype], [V128_valtype])) + `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop_sh), `%->%`(`%`([V128_valtype I32_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:902.1-903.55 rule vcvtop{C : context, sh : shape, vcvtop : vcvtop, hf? : half?, sx? : sx?, zero : zero}: - `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:905.1-906.44 rule vnarrow{C : context, sh : ishape, sx : sx}: - `%|-%:%`(C, VNARROW_instr(sh, sh, sx), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VNARROW_instr(sh, sh, sx), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:908.1-909.49 rule vextunop{C : context, sh : ishape, vextunop : vextunop_(sh, sh), sx : sx}: - `%|-%:%`(C, VEXTUNOP_instr(sh, sh, vextunop, sx), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VEXTUNOP_instr(sh, sh, vextunop, sx), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:911.1-912.56 rule vextbinop{C : context, sh : ishape, vextbinop : vextbinop_(sh, sh), sx : sx}: - `%|-%:%`(C, VEXTBINOP_instr(sh, sh, vextbinop, sx), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VEXTBINOP_instr(sh, sh, vextbinop, sx), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:914.1-915.33 rule vbitmask{C : context, sh : ishape}: - `%|-%:%`(C, VBITMASK_instr(sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VBITMASK_instr(sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:920.1-922.28 rule local.get{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) + `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`(`%`([]), `%`([t]))) -- if (C.LOCAL_context[x.`%`.0] = `%%`(init, t)) ;; 6-typing.watsup:935.1-937.28 rule global.get{C : context, x : idx, t : valtype, mut : mut}: - `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) + `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`(`%`([]), `%`([t]))) -- if (C.GLOBAL_context[x.`%`.0] = `%%`(mut, t)) ;; 6-typing.watsup:939.1-941.28 rule global.set{C : context, x : idx, t : valtype}: - `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) + `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`(`%`([t]), `%`([]))) -- if (C.GLOBAL_context[x.`%`.0] = `%%`(`MUT%?`(?(())), t)) ;; 6-typing.watsup:946.1-948.28 rule table.get{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [(rt : reftype <: valtype)])) + `%|-%:%`(C, TABLE.GET_instr(x), `%->%`(`%`([I32_valtype]), `%`([(rt : reftype <: valtype)]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:950.1-952.28 rule table.set{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype (rt : reftype <: valtype)], [])) + `%|-%:%`(C, TABLE.SET_instr(x), `%->%`(`%`([I32_valtype (rt : reftype <: valtype)]), `%`([]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:954.1-956.24 rule table.size{C : context, x : idx, tt : tabletype}: - `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) + `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`(`%`([]), `%`([I32_valtype]))) -- if (C.TABLE_context[x.`%`.0] = tt) ;; 6-typing.watsup:958.1-960.28 rule table.grow{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([(rt : reftype <: valtype) I32_valtype], [I32_valtype])) + `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`(`%`([(rt : reftype <: valtype) I32_valtype]), `%`([I32_valtype]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:962.1-964.28 rule table.fill{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype (rt : reftype <: valtype) I32_valtype], [])) + `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`(`%`([I32_valtype (rt : reftype <: valtype) I32_valtype]), `%`([]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:966.1-970.36 rule table.copy{C : context, x_1 : idx, x_2 : idx, lim_1 : limits, rt_1 : reftype, lim_2 : limits, rt_2 : reftype}: - `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.TABLE_context[x_1.`%`.0] = `%%`(lim_1, rt_1)) -- if (C.TABLE_context[x_2.`%`.0] = `%%`(lim_2, rt_2)) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) ;; 6-typing.watsup:972.1-976.36 rule table.init{C : context, x : idx, y : idx, lim : limits, rt_1 : reftype, rt_2 : reftype}: - `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt_1)) -- if (C.ELEM_context[y.`%`.0] = rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) ;; 6-typing.watsup:978.1-980.23 rule elem.drop{C : context, x : idx, rt : reftype}: - `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) + `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`(`%`([]), `%`([]))) -- if (C.ELEM_context[x.`%`.0] = rt) ;; 6-typing.watsup:985.1-987.22 rule memory.size{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) + `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`(`%`([]), `%`([I32_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup:989.1-991.22 rule memory.grow{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) + `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`(`%`([I32_valtype]), `%`([I32_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup:993.1-995.22 rule memory.fill{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup:997.1-1000.26 rule memory.copy{C : context, x_1 : idx, x_2 : idx, mt_1 : memtype, mt_2 : memtype}: - `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.MEM_context[x_1.`%`.0] = mt_1) -- if (C.MEM_context[x_2.`%`.0] = mt_2) ;; 6-typing.watsup:1002.1-1005.23 rule memory.init{C : context, x : idx, y : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if (C.DATA_context[y.`%`.0] = OK) ;; 6-typing.watsup:1007.1-1009.23 rule data.drop{C : context, x : idx}: - `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) + `%|-%:%`(C, DATA.DROP_instr(x), `%->%`(`%`([]), `%`([]))) -- if (C.DATA_context[x.`%`.0] = OK) ;; 6-typing.watsup:1011.1-1016.29 rule load{C : context, nt : numtype, n? : n?, sx? : sx?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([(nt : numtype <: valtype)]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} @@ -3693,7 +3716,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1018.1-1023.29 rule store{C : context, nt : numtype, n? : n?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) + `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype (nt : numtype <: valtype)]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} @@ -3701,38 +3724,38 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1025.1-1028.30 rule vload{C : context, M : M, N : N, sx : sx, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ((M / 8) * N)) ;; 6-typing.watsup:1030.1-1033.26 rule vload-splat{C : context, n : n, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(SPLAT_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(SPLAT_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= (n / 8)) ;; 6-typing.watsup:1035.1-1038.25 rule vload-zero{C : context, n : n, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(ZERO_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(ZERO_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) < (n / 8)) ;; 6-typing.watsup:1040.1-1044.29 rule vload_lane{C : context, n : n, x : idx, n_A : n, n_O : n, laneidx : laneidx, mt : memtype}: - `%|-%:%`(C, VLOAD_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`([I32_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`(`%`([I32_valtype V128_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) < (n / 8)) -- if (laneidx.`%`.0 < (128 / n)) ;; 6-typing.watsup:1046.1-1049.37 rule vstore{C : context, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VSTORE_instr(x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype V128_valtype], [])) + `%|-%:%`(C, VSTORE_instr(x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype V128_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($vsize(V128_vectype) / 8)) ;; 6-typing.watsup:1051.1-1055.29 rule vstore_lane{C : context, n : n, x : idx, n_A : n, n_O : n, laneidx : laneidx, mt : memtype}: - `%|-%:%`(C, VSTORE_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`([I32_valtype V128_valtype], [])) + `%|-%:%`(C, VSTORE_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`(`%`([I32_valtype V128_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) < (n / 8)) -- if (laneidx.`%`.0 < (128 / n)) @@ -3741,51 +3764,51 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) relation Instrf_ok: `%|-%:%`(context, instr, instrtype) ;; 6-typing.watsup:518.1-520.41 rule instr{C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1 : valtype}, [], t_2*{t_2 : valtype})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, instr, `%->%%`(`%`(t_1*{t_1 : valtype}), [], `%`(t_2*{t_2 : valtype}))) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:924.1-926.28 rule local.set{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) + `%|-%:%`(C, LOCAL.SET_instr(x), `%->%%`(`%`([t]), [x], `%`([]))) -- if (C.LOCAL_context[x.`%`.0] = `%%`(init, t)) ;; 6-typing.watsup:928.1-930.28 rule local.tee{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) + `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%%`(`%`([t]), [x], `%`([t]))) -- if (C.LOCAL_context[x.`%`.0] = `%%`(init, t)) ;; 6-typing.watsup:505.1-505.74 -relation Instrs_ok: `%|-%*_:%`(context, instr*, instrtype) +relation Instrs_ok: `%|-%:%`(context, instr*, instrtype) ;; 6-typing.watsup:522.1-523.29 rule empty{C : context}: - `%|-%*_:%`(C, [], `%->%*%`([], [], [])) + `%|-%:%`(C, [], `%->%%`(`%`([]), [], `%`([]))) ;; 6-typing.watsup:525.1-530.52 rule seq{C : context, instr_1 : instr, instr_2* : instr*, t_1* : valtype*, x_1* : idx*, x_2* : idx*, t_3* : valtype*, init* : init*, t* : valtype*, C' : context, t_2* : valtype*}: - `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + `%|-%:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, `%`(t_3*{t_3 : valtype}))) -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init : init t : valtype x_1 : idx} -- if (C' = $with_locals(C, x_1*{x_1 : localidx}, `%%`(SET_init, t)*{t : valtype})) - -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2 : instr}, `%->%*%`(t_2*{t_2 : valtype}, x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C', instr_2*{instr_2 : instr}, `%->%%`(`%`(t_2*{t_2 : valtype}), x_2*{x_2 : localidx}, `%`(t_3*{t_3 : valtype}))) ;; 6-typing.watsup:532.1-535.35 rule sub{C : context, instr* : instr*, it' : instrtype, it : instrtype}: - `%|-%*_:%`(C, instr*{instr : instr}, it') - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, it) + `%|-%:%`(C, instr*{instr : instr}, it') + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, it) -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:537.1-539.47 rule frame{C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, x* : idx*, t_2* : valtype*}: - `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t*{t : valtype} :: t_1*{t_1 : valtype}, x*{x : localidx}, t*{t : valtype} :: t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`(t*{t : valtype} :: t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t*{t : valtype} :: t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) } ;; 6-typing.watsup relation Expr_ok: `%|-%:%`(context, expr, resulttype) ;; 6-typing.watsup rule _{C : context, instr* : instr*, t* : valtype*}: - `%|-%:%`(C, instr*{instr : instr}, t*{t : valtype}) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`([], [], t*{t : valtype})) + `%|-%:%`(C, instr*{instr : instr}, `%`(t*{t : valtype})) + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`([]), [], `%`(t*{t : valtype}))) ;; 6-typing.watsup rec { @@ -3850,14 +3873,14 @@ relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) ;; 6-typing.watsup rule _{C : context, expr : expr, t : valtype}: `%|-%:%CONST`(C, expr, t) - -- Expr_ok: `%|-%:%`(C, expr, [t]) + -- Expr_ok: `%|-%:%`(C, expr, `%`([t])) -- Expr_const: `%|-%CONST`(C, expr) ;; 6-typing.watsup -relation Type_ok: `%|-%:%*`(context, type, deftype*) +relation Type_ok: `%|-%:%`(context, type, deftype*) ;; 6-typing.watsup rule _{C : context, rectype : rectype, dt* : deftype*, x : idx}: - `%|-%:%*`(C, TYPE(rectype), dt*{dt : deftype}) + `%|-%:%`(C, TYPE(rectype), dt*{dt : deftype}) -- if (x = `%`(|C.TYPE_context|)) -- if (dt*{dt : deftype} = $rolldt(x, rectype)) -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt : deftype}], rectype, OK_oktypeidx(x)) @@ -3878,10 +3901,10 @@ relation Local_ok: `%|-%:%`(context, local, localtype) relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup rule _{C : context, x : idx, local* : local*, expr : expr, t_1* : valtype*, t_2* : valtype*, lt* : localtype*}: - `%|-%:%`(C, `FUNC%%*%`(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + `%|-%:%`(C, FUNC(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) -- (Local_ok: `%|-%:%`(C, local, lt))*{local : local lt : localtype} - -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2 : valtype})}, expr, t_2*{t_2 : valtype}) + -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(`%`(t_2*{t_2 : valtype}))}, expr, `%`(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -3928,7 +3951,7 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup rule _{C : context, rt : reftype, expr* : expr*, elemmode : elemmode}: - `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr : expr}, elemmode), rt) + `%|-%:%`(C, ELEM(rt, expr*{expr : expr}, elemmode), rt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr : expr} -- Elemmode_ok: `%|-%:%`(C, elemmode, rt) @@ -3948,7 +3971,7 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) relation Data_ok: `%|-%:_OK`(context, data) ;; 6-typing.watsup rule _{C : context, b* : byte*, datamode : datamode}: - `%|-%:_OK`(C, `DATA%*%`(b*{b : byte}, datamode)) + `%|-%:_OK`(C, DATA(b*{b : byte}, datamode)) -- Datamode_ok: `%|-%:_OK`(C, datamode) ;; 6-typing.watsup @@ -3956,7 +3979,7 @@ relation Start_ok: `%|-%:_OK`(context, start) ;; 6-typing.watsup rule _{C : context, x : idx}: `%|-%:_OK`(C, START(x)) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`([], []))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`([]), `%`([])))) ;; 6-typing.watsup relation Import_ok: `%|-%:%`(context, import, externtype) @@ -3998,42 +4021,42 @@ relation Export_ok: `%|-%:%`(context, export, externtype) rec { ;; 6-typing.watsup:1229.1-1229.77 -relation Globals_ok: `%|-%*_:%*`(context, global*, globaltype*) +relation Globals_ok: `%|-%:%`(context, global*, globaltype*) ;; 6-typing.watsup:1272.1-1273.17 rule empty{C : context}: - `%|-%*_:%*`(C, [], []) + `%|-%:%`(C, [], []) ;; 6-typing.watsup:1275.1-1278.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: - `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) + `%|-%:%`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) - -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) + -- Globals_ok: `%|-%:%`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) } ;; 6-typing.watsup rec { ;; 6-typing.watsup:1228.1-1228.75 -relation Types_ok: `%|-%*_:%*`(context, type*, deftype*) +relation Types_ok: `%|-%:%`(context, type*, deftype*) ;; 6-typing.watsup:1264.1-1265.17 rule empty{C : context}: - `%|-%*_:%*`(C, [], []) + `%|-%:%`(C, [], []) ;; 6-typing.watsup:1267.1-1270.49 rule cons{C : context, type_1 : type, type* : type*, dt_1 : deftype, dt* : deftype*}: - `%|-%*_:%*`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) - -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) + `%|-%:%`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) + -- Type_ok: `%|-%:%`(C, type_1, [dt_1]) + -- Types_ok: `%|-%:%`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) } ;; 6-typing.watsup relation Module_ok: `|-%:_OK`(module) ;; 6-typing.watsup rule _{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data^n : data^n, n : n, start? : start?, export* : export*, dt'* : deftype*, ixt* : externtype*, C' : context, gt* : globaltype*, tt* : tabletype*, mt* : memtype*, C : context, dt* : deftype*, rt* : reftype*, et* : externtype*, idt* : deftype*, igt* : globaltype*, itt* : tabletype*, imt* : memtype*}: - `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) - -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) + `|-%:_OK`(MODULE(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) + -- Types_ok: `%|-%:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) -- (Import_ok: `%|-%:%`({TYPE dt'*{dt' : deftype}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import : import ixt : externtype} - -- Globals_ok: `%|-%*_:%*`(C', global*{global : global}, gt*{gt : globaltype}) + -- Globals_ok: `%|-%:%`(C', global*{global : global}, gt*{gt : globaltype}) -- (Table_ok: `%|-%:%`(C', table, tt))*{table : table tt : tabletype} -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem : mem mt : memtype} -- (Func_ok: `%|-%:%`(C, func, dt))*{dt : deftype func : func} @@ -4082,314 +4105,314 @@ relation Ref_ok: `%|-%:%`(store, ref, reftype) `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) ;; 8-reduction.watsup -relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) +relation Step_pure: `%~>%`(admininstr*, admininstr*) ;; 8-reduction.watsup rule unreachable: - `%*_~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) + `%~>%`([UNREACHABLE_admininstr], [TRAP_admininstr]) ;; 8-reduction.watsup rule nop: - `%*_~>%*`([NOP_admininstr], []) + `%~>%`([NOP_admininstr], []) ;; 8-reduction.watsup rule drop{val : val}: - `%*_~>%*`([(val : val <: admininstr) DROP_admininstr], []) + `%~>%`([(val : val <: admininstr) DROP_admininstr], []) ;; 8-reduction.watsup rule select-true{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) + `%~>%`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule select-false{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) + `%~>%`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule if-true{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) + `%~>%`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule if-false{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) + `%~>%`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule label-vals{n : n, instr* : instr*, val* : val*}: - `%*_~>%*`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) + `%~>%`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) ;; 8-reduction.watsup rule br-zero{n : n, instr'* : instr*, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule br-succ{n : n, instr'* : instr*, val* : val*, l : labelidx, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) + `%~>%`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) ;; 8-reduction.watsup rule br_if-true{c : num_(I32_numtype), l : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) + `%~>%`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule br_if-false{c : num_(I32_numtype), l : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) + `%~>%`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) -- if (c = `%`(0)) ;; 8-reduction.watsup rule br_table-lt{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) -- if (i < |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_table-ge{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) -- if (i >= |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_on_null-null{val : val, l : labelidx, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) + `%~>%`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) -- if (val = REF.NULL_val(ht)) ;; 8-reduction.watsup rule br_on_null-addr{val : val, l : labelidx}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [(val : val <: admininstr)]) + `%~>%`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [(val : val <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule br_on_non_null-null{val : val, l : labelidx, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], []) + `%~>%`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], []) -- if (val = REF.NULL_val(ht)) ;; 8-reduction.watsup rule br_on_non_null-addr{val : val, l : labelidx}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], [(val : val <: admininstr) BR_admininstr(l)]) + `%~>%`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], [(val : val <: admininstr) BR_admininstr(l)]) -- otherwise ;; 8-reduction.watsup rule call_indirect-call{x : idx, y : idx}: - `%*_~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) CALL_REF_admininstr(?(y))]) + `%~>%`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) CALL_REF_admininstr(?(y))]) ;; 8-reduction.watsup rule return_call_indirect{x : idx, y : idx}: - `%*_~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) RETURN_CALL_REF_admininstr(?(y))]) + `%~>%`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) RETURN_CALL_REF_admininstr(?(y))]) ;; 8-reduction.watsup rule frame-vals{n : n, f : frame, val^n : val^n}: - `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) + `%~>%`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-frame{n : n, f : frame, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) + `%~>%`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-label{k : nat, instr'* : instr*, val* : val*, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) + `%~>%`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) ;; 8-reduction.watsup rule unop-val{nt : numtype, c_1 : num_(nt), unop : unop_(nt), c : num_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) + `%~>%`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) -- if ($unop(nt, unop, c_1) = [c]) ;; 8-reduction.watsup rule unop-trap{nt : numtype, c_1 : num_(nt), unop : unop_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) -- if ($unop(nt, unop, c_1) = []) ;; 8-reduction.watsup rule binop-val{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), binop : binop_(nt), c : num_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- if ($binop(nt, binop, c_1, c_2) = [c]) ;; 8-reduction.watsup rule binop-trap{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), binop : binop_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) -- if ($binop(nt, binop, c_1, c_2) = []) ;; 8-reduction.watsup rule testop{nt : numtype, c_1 : num_(nt), testop : testop_(nt), c : num_(I32_numtype)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $testop(nt, testop, c_1)) ;; 8-reduction.watsup rule relop{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), relop : relop_(nt), c : num_(I32_numtype)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $relop(nt, relop, c_1, c_2)) ;; 8-reduction.watsup rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?, c : num_(nt_2)}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) + `%~>%`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = [c]) ;; 8-reduction.watsup rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, `%`(i)))]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, `%`(i)))]) ;; 8-reduction.watsup rule ref.is_null-true{val : val, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- if (val = REF.NULL_val(ht)) ;; 8-reduction.watsup rule ref.is_null-false{val : val}: - `%*_~>%*`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule ref.as_non_null-null{ref : ref, ht : heaptype}: - `%*_~>%*`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) + `%~>%`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) -- if (ref = REF.NULL_ref(ht)) ;; 8-reduction.watsup rule ref.as_non_null-addr{ref : ref}: - `%*_~>%*`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [(ref : ref <: admininstr)]) + `%~>%`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [(ref : ref <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule ref.eq-null{ref_1 : ref, ref_2 : ref, ht_1 : heaptype, ht_2 : heaptype}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) ;; 8-reduction.watsup rule ref.eq-true{ref_1 : ref, ref_2 : ref}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- otherwise -- if (ref_1 = ref_2) ;; 8-reduction.watsup rule ref.eq-false{ref_1 : ref, ref_2 : ref}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule i31.get-null{ht : heaptype, sx : sx}: - `%*_~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) + `%~>%`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) ;; 8-reduction.watsup rule i31.get-num{i : nat, sx : sx}: - `%*_~>%*`([REF.I31_NUM_admininstr(`%`(i)) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, `%`(i)))]) + `%~>%`([REF.I31_NUM_admininstr(`%`(i)) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, `%`(i)))]) ;; 8-reduction.watsup rule extern.convert_any-null{ht : heaptype}: - `%*_~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) + `%~>%`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) ;; 8-reduction.watsup rule extern.convert_any-addr{addrref : addrref}: - `%*_~>%*`([(addrref : addrref <: admininstr) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) + `%~>%`([(addrref : addrref <: admininstr) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) ;; 8-reduction.watsup rule any.convert_extern-null{ht : heaptype}: - `%*_~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) + `%~>%`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) ;; 8-reduction.watsup rule any.convert_extern-addr{addrref : addrref}: - `%*_~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [(addrref : addrref <: admininstr)]) + `%~>%`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [(addrref : addrref <: admininstr)]) ;; 8-reduction.watsup rule vvunop{c_1 : vec_(V128_vnn), vvunop : vvunop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VVUNOP_admininstr(V128_vectype, vvunop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VVUNOP_admininstr(V128_vectype, vvunop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vvunop(V128_vectype, vvunop, c_1) = c) ;; 8-reduction.watsup rule vvbinop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), vvbinop : vvbinop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VVBINOP_admininstr(V128_vectype, vvbinop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VVBINOP_admininstr(V128_vectype, vvbinop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vvbinop(V128_vectype, vvbinop, c_1, c_2) = c) ;; 8-reduction.watsup rule vvternop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), c_3 : vec_(V128_vnn), vvternop : vvternop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VCONST_admininstr(V128_vectype, c_3) VVTERNOP_admininstr(V128_vectype, vvternop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VCONST_admininstr(V128_vectype, c_3) VVTERNOP_admininstr(V128_vectype, vvternop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vvternop(V128_vectype, vvternop, c_1, c_2, c_3) = c) ;; 8-reduction.watsup rule vvtestop{c_1 : vec_(V128_vnn), c : num_(I32_numtype)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VVTESTOP_admininstr(V128_vectype, ANY_TRUE_vvtestop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VVTESTOP_admininstr(V128_vectype, ANY_TRUE_vvtestop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $ine($vsize(V128_vectype), c_1, `%`(0))) ;; 8-reduction.watsup rule vswizzle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn : inn, N : N, c' : vec_(V128_vnn), c : iN($size((inn : inn <: numtype))), ci* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*, k^N : nat^N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) -- if (ci*{ci : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) -- if (c*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: `%`(0)^(256 - N){}) -- if (c' = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c*{}[ci*{ci : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))}[k].`%`.0]^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) -- if (c = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c'*{}[i*{i : nat}[k]]^(k%*`([CONST_admininstr($lunpack(lnn), c_1) VSPLAT_admininstr(`%X%`(lnn, `%`(N)))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([CONST_admininstr($lunpack(lnn), c_1) VSPLAT_admininstr(`%X%`(lnn, `%`(N)))], [VCONST_admininstr(V128_vectype, c)]) -- if (c = $invlanes_(`%X%`(lnn, `%`(N)), $packnum(lnn, c_1)^N{})) ;; 8-reduction.watsup rule vextract_lane-num{c_1 : vec_(V128_vnn), nt : numtype, N : N, i : nat, c_2 : num_(nt)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((nt : numtype <: lanetype), `%`(N)), ?(), `%`(i))], [CONST_admininstr(nt, c_2)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((nt : numtype <: lanetype), `%`(N)), ?(), `%`(i))], [CONST_admininstr(nt, c_2)]) -- if (c_2 = $lanes_(`%X%`((nt : numtype <: lanetype), `%`(N)), c_1)[i]) ;; 8-reduction.watsup rule vextract_lane-pack{c_1 : vec_(V128_vnn), pt : packtype, N : N, sx : sx, i : nat, c_2 : num_(I32_numtype)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((pt : packtype <: lanetype), `%`(N)), ?(sx), `%`(i))], [CONST_admininstr(I32_numtype, c_2)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((pt : packtype <: lanetype), `%`(N)), ?(sx), `%`(i))], [CONST_admininstr(I32_numtype, c_2)]) -- if (c_2 = $ext($psize(pt), 32, sx, $lanes_(`%X%`((pt : packtype <: lanetype), `%`(N)), c_1)[i])) ;; 8-reduction.watsup rule vreplace_lane{c_1 : vec_(V128_vnn), lnn : lnn, c_2 : num_($lunpack(lnn)), N : N, i : nat, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr($lunpack(lnn), c_2) VREPLACE_LANE_admininstr(`%X%`(lnn, `%`(N)), `%`(i))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr($lunpack(lnn), c_2) VREPLACE_LANE_admininstr(`%X%`(lnn, `%`(N)), `%`(i))], [VCONST_admininstr(V128_vectype, c)]) -- if (c = $invlanes_(`%X%`(lnn, `%`(N)), $lanes_(`%X%`(lnn, `%`(N)), c_1)[[i] = $packnum(lnn, c_2)])) ;; 8-reduction.watsup rule vunop{c_1 : vec_(V128_vnn), sh : shape, vunop : vunop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VUNOP_admininstr(sh, vunop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VUNOP_admininstr(sh, vunop)], [VCONST_admininstr(V128_vectype, c)]) -- if (c = $vunop(sh, vunop, c_1)) ;; 8-reduction.watsup rule vbinop-val{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vbinop : vbinop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vbinop(sh, vbinop, c_1, c_2) = [c]) ;; 8-reduction.watsup rule vbinop-trap{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vbinop : vbinop_(sh)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [TRAP_admininstr]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [TRAP_admininstr]) -- if ($vbinop(sh, vbinop, c_1, c_2) = []) ;; 8-reduction.watsup rule vrelop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vrelop : vrelop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VRELOP_admininstr(sh, vrelop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VRELOP_admininstr(sh, vrelop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vrelop(sh, vrelop, c_1, c_2) = c) ;; 8-reduction.watsup rule vshiftop{c_1 : vec_(V128_vnn), n : n, imm : imm, N : N, vshiftop : vshiftop_(`%X%`(imm, `%`(N))), c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1)) -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))})) ;; 8-reduction.watsup rule vtestop-true{c : vec_(V128_vnn), inn : inn, N : N, ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), inn : inn, N : N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule vbitmask{c : vec_(V128_vnn), inn : inn, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) -- if ($ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($size((inn : inn <: numtype)))}) ;; 8-reduction.watsup rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn_1 : inn, N_1 : N, inn_2 : inn, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, cj_1* : iN($size((inn_2 : inn <: numtype)))*, cj_2* : iN($size((inn_2 : inn <: numtype)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) -- if (ci_2*{ci_2 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2)) -- if (cj_1*{cj_1 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1 : iN($size((inn_1 : inn <: numtype)))}) @@ -4398,266 +4421,266 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vcvtop-normal{c_1 : vec_(V128_vnn), lnn_2 : lnn, N_2 : N, vcvtop : vcvtop, lnn_1 : lnn, N_1 : N, sx : sx, c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1)) -- if (c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-half{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, hf : half, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-zero{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} :: `%`(0)^N_1{})) ;; 8-reduction.watsup rule vextunop{c_1 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTUNOP_admininstr(sh_1, sh_2, vextunop, sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTUNOP_admininstr(sh_1, sh_2, vextunop, sx)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vextunop(sh_1, sh_2, vextunop, sx, c_1) = c) ;; 8-reduction.watsup rule vextbinop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextbinop : vextbinop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VEXTBINOP_admininstr(sh_1, sh_2, vextbinop, sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VEXTBINOP_admininstr(sh_1, sh_2, vextbinop, sx)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vextbinop(sh_1, sh_2, vextbinop, sx, c_1, c_2) = c) ;; 8-reduction.watsup rule local.tee{val : val, x : idx}: - `%*_~>%*`([(val : val <: admininstr) LOCAL.TEE_admininstr(x)], [(val : val <: admininstr) (val : val <: admininstr) LOCAL.SET_admininstr(x)]) + `%~>%`([(val : val <: admininstr) LOCAL.TEE_admininstr(x)], [(val : val <: admininstr) (val : val <: admininstr) LOCAL.SET_admininstr(x)]) ;; 8-reduction.watsup def $blocktype(state : state, blocktype : blocktype) : functype ;; 8-reduction.watsup - def $blocktype{z : state}(z, _RESULT_blocktype(?())) = `%->%`([], []) + def $blocktype{z : state}(z, _RESULT_blocktype(?())) = `%->%`(`%`([]), `%`([])) ;; 8-reduction.watsup - def $blocktype{z : state, t : valtype}(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) + def $blocktype{z : state, t : valtype}(z, _RESULT_blocktype(?(t))) = `%->%`(`%`([]), `%`([t])) ;; 8-reduction.watsup def $blocktype{z : state, x : idx, ft : functype}(z, _IDX_blocktype(x)) = ft -- Expand: `%~~%`($type(z, x), FUNC_comptype(ft)) ;; 8-reduction.watsup -relation Step_read: `%~>%*`(config, admininstr*) +relation Step_read: `%~>%`(config, admininstr*) ;; 8-reduction.watsup rule block{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, n : n, t_1^k : valtype^k, t_2^n : valtype^n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) + `%~>%`(`%;%`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(`%`(t_1^k{t_1 : valtype}), `%`(t_2^n{t_2 : valtype}))) ;; 8-reduction.watsup rule loop{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, t_1^k : valtype^k, t_2^n : valtype^n, n : n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) + `%~>%`(`%;%`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(`%`(t_1^k{t_1 : valtype}), `%`(t_2^n{t_2 : valtype}))) ;; 8-reduction.watsup rule br_on_cast-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt) -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) ;; 8-reduction.watsup rule br_on_cast-fail{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule br_on_cast_fail-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt) -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) ;; 8-reduction.watsup rule br_on_cast_fail-fail{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) -- otherwise ;; 8-reduction.watsup rule call{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) CALL_REF_admininstr(?())]) + `%~>%`(`%;%`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) CALL_REF_admininstr(?())]) ;; 8-reduction.watsup rule call_ref-null{z : state, ht : heaptype, x? : idx?}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule call_ref-func{z : state, val^n : val^n, n : n, a : addr, x? : idx?, m : m, f : frame, instr* : instr*, fi : funcinst, t_1^n : valtype^n, t_2^m : valtype^m, y : idx, t* : valtype*}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) -- if ($funcinst(z)[a] = fi) - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) - -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t : valtype}, instr*{instr : instr})) + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2^m{t_2 : valtype})))) + -- if (fi.CODE_funcinst = FUNC(y, LOCAL(t)*{t : valtype}, instr*{instr : instr})) -- if (f = {LOCAL ?(val)^n{val : val} :: $default(t)*{t : valtype}, MODULE fi.MODULE_funcinst}) ;; 8-reduction.watsup rule return_call{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) RETURN_CALL_REF_admininstr(?())]) + `%~>%`(`%;%`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) RETURN_CALL_REF_admininstr(?())]) ;; 8-reduction.watsup rule return_call_ref-label{z : state, k : nat, instr'* : instr*, val* : val*, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) + `%~>%`(`%;%`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) ;; 8-reduction.watsup rule return_call_ref-frame-addr{z : state, k : nat, f : frame, val'* : val*, val^n : val^n, n : n, a : addr, x? : idx?, instr* : instr*, t_1^n : valtype^n, t_2^m : valtype^m, m : m}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) + `%~>%`(`%;%`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2^m{t_2 : valtype})))) ;; 8-reduction.watsup rule return_call_ref-frame-null{z : state, k : nat, f : frame, val* : val*, ht : heaptype, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule ref.func{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0])]) + `%~>%`(`%;%`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0])]) ;; 8-reduction.watsup rule ref.test-true{z : state, ref : ref, rt : reftype, rt' : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(1))]) -- Ref_ok: `%|-%:%`($store(z), ref, rt') -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) ;; 8-reduction.watsup rule ref.test-false{z : state, ref : ref, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule ref.cast-succeed{z : state, ref : ref, rt : reftype, rt' : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [(ref : ref <: admininstr)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt') -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) ;; 8-reduction.watsup rule ref.cast-fail{z : state, ref : ref, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) -- otherwise ;; 8-reduction.watsup rule struct.new_default{z : state, x : idx, val* : val*, mut* : mut*, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%~>%`(`%;%`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 8-reduction.watsup rule struct.get-null{z : state, ht : heaptype, sx? : sx?, x : idx, i : nat}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) ;; 8-reduction.watsup rule struct.get-struct{z : state, a : addr, sx? : sx?, x : idx, i : nat, zt* : storagetype*, si : structinst, mut* : mut*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) + `%~>%`(`%;%`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) -- if ($structinst(z)[a] = si) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) ;; 8-reduction.watsup rule array.new{z : state, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [(val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [(val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) ;; 8-reduction.watsup rule array.new_default{z : state, n : n, x : idx, val : val, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if ($default($unpack(zt)) = ?(val)) ;; 8-reduction.watsup rule array.new_elem-oob{z : state, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) ;; 8-reduction.watsup rule array.new_elem-alloc{z : state, i : nat, n : n, x : idx, y : idx, ref^n : ref^n}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- if (ref^n{ref : ref} = $elem(z, y).ELEM_eleminst[i : n]) ;; 8-reduction.watsup rule array.new_data-oob{z : state, i : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if ((i + ((n * $zsize(zt)) / 8)) > |$data(z, y).DATA_datainst|) ;; 8-reduction.watsup rule array.new_data-num{z : state, i : nat, n : n, x : idx, y : idx, nt : numtype, c^n : num_(nt)^n, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (nt = $nunpack(zt)) -- if ($concat_(syntax byte, $nbytes(nt, c)^n{c : num_(nt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) ;; 8-reduction.watsup rule array.new_data-vec{z : state, i : nat, n : n, x : idx, y : idx, vt : vectype, c^n : vec_(vt)^n, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (vt = $vunpack(zt)) -- if ($concat_(syntax byte, $vbytes(vt, c)^n{c : vec_(vt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) ;; 8-reduction.watsup rule array.get-null{z : state, ht : heaptype, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.get-oob{z : state, a : addr, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.get-array{z : state, a : addr, i : nat, sx? : sx?, x : idx, zt : storagetype, fv : fieldval, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) ;; 8-reduction.watsup rule array.len-null{z : state, ht : heaptype}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.len-array{z : state, a : addr, n : n}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, `%`(n))]) -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.fill-null{z : state, ht : heaptype, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.fill-oob{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.fill-zero{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.fill-succ{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule array.copy-null1{z : state, ht_1 : heaptype, i_1 : nat, ref : ref, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, `%`(i_1)) (ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, `%`(i_1)) (ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.copy-null2{z : state, ref : ref, i_1 : nat, ht_2 : heaptype, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_1)) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_1)) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.copy-oob1{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.copy-oob2{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.copy-zero{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.copy-le{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) -- if (sx?{sx : sx} = $sxfield(zt_2)) @@ -4665,61 +4688,61 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.copy-gt{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) -- if (sx?{sx : sx} = $sxfield(zt_2)) ;; 8-reduction.watsup rule array.init_elem-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.init_elem-oob1{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.init_elem-oob2{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) ;; 8-reduction.watsup rule array.init_elem-zero{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.init_elem-succ{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, ref : ref}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_ELEM_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_ELEM_admininstr(x, y)]) -- otherwise -- if (ref = $elem(z, y).ELEM_eleminst[j]) ;; 8-reduction.watsup rule array.init_data-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.init_data-oob1{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.init_data-oob2{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if ((j + ((n * $zsize(zt)) / 8)) > |$data(z, y).DATA_datainst|) ;; 8-reduction.watsup rule array.init_data-zero{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.init_data-num{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, nt : numtype, c : num_(nt), zt : storagetype, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) -- otherwise -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (nt = $nunpack(zt)) @@ -4727,7 +4750,7 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.init_data-num{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, vt : vectype, c : vec_(vt), zt : storagetype, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) -- otherwise -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (vt = $vunpack((vt : vectype <: storagetype))) @@ -4735,132 +4758,132 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule local.get{z : state, x : idx, val : val}: - `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [(val : val <: admininstr)]) + `%~>%`(`%;%`(z, [LOCAL.GET_admininstr(x)]), [(val : val <: admininstr)]) -- if ($local(z, x) = ?(val)) ;; 8-reduction.watsup rule global.get{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst : val <: admininstr)]) + `%~>%`(`%;%`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst : val <: admininstr)]) ;; 8-reduction.watsup rule table.get-oob{z : state, i : nat, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) -- if (i >= |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.get-val{z : state, i : nat, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] : ref <: admininstr)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] : ref <: admininstr)]) -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.size{z : state, x : idx, n : n}: - `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) -- if (|$table(z, x).ELEM_tableinst| = n) ;; 8-reduction.watsup rule table.fill-oob{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.fill-zero{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.fill-succ{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule table.copy-oob{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) ;; 8-reduction.watsup rule table.copy-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.copy-le{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) -- otherwise -- if (j <= i) ;; 8-reduction.watsup rule table.copy-gt{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(((j + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i + n) - 1))) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(((j + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i + n) - 1))) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) -- otherwise ;; 8-reduction.watsup rule table.init-oob{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) ;; 8-reduction.watsup rule table.init-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.init-succ{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) ($elem(z, y).ELEM_eleminst[i] : ref <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.INIT_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) ($elem(z, y).ELEM_eleminst[i] : ref <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.INIT_admininstr(x, y)]) -- otherwise ;; 8-reduction.watsup rule load-num-oob{z : state, i : nat, nt : numtype, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ($size(nt) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule load-num-val{z : state, i : nat, nt : numtype, x : idx, mo : memop, c : num_(nt)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) -- if ($nbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : ($size(nt) / 8)]) ;; 8-reduction.watsup rule load-pack-oob{z : state, i : nat, inn : inn, n : n, sx : sx, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (n / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule load-pack-val{z : state, i : nat, inn : inn, n : n, sx : sx, x : idx, mo : memop, c : iN(n)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [CONST_admininstr((inn : inn <: numtype), $ext(n, $size((inn : inn <: numtype)), sx, c))]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [CONST_admininstr((inn : inn <: numtype), $ext(n, $size((inn : inn <: numtype)), sx, c))]) -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (n / 8)]) ;; 8-reduction.watsup rule vload-oob{z : state, i : nat, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ($vsize(V128_vectype) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-val{z : state, i : nat, x : idx, mo : memop, c : vec_(V128_vnn)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- if ($vbytes(V128_vectype, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : ($vsize(V128_vectype) / 8)]) ;; 8-reduction.watsup rule vload-shape-oob{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ((M * N) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-shape-val{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop, c : vec_(V128_vnn), j^N : nat^N, k^N : nat^N, inn : inn}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- (if ($ibytes(M, `%`(j)) = $mem(z, x).DATA_meminst[((i + mo.OFFSET_memop.`%`.0) + ((k * M) / 8)) : (M / 8)]))^(k%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-splat-val{z : state, i : nat, N : N, x : idx, mo : memop, c : vec_(V128_vnn), j : nat, imm : imm, M : M}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- if ($ibytes(N, `%`(j)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)]) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = (128 / N)) @@ -4868,23 +4891,23 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule vload-zero-oob{z : state, i : nat, N : N, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-zero-val{z : state, i : nat, N : N, x : idx, mo : memop, c : vec_(V128_vnn), j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- if ($ibytes(N, `%`(j)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)]) -- if (c = $ext(N, 128, U_sx, `%`(j))) ;; 8-reduction.watsup rule vload_lane-oob{z : state, i : nat, vt : vectype, c_1 : vec_(vt), N : N, x : idx, mo : memop, j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload_lane-val{z : state, i : nat, vt : vectype, c_1 : vec_(vt), N : N, x : idx, mo : memop, j : nat, c : vec_(vt), k : nat, imm : imm, M : M}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(vt, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(vt, c)]) -- if ($ibytes(N, `%`(k)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)]) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = ($vsize(vt) / N)) @@ -4892,197 +4915,197 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule memory.size{z : state, x : idx, n : n}: - `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule memory.fill-oob{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule memory.fill-zero{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.fill-succ{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule memory.copy-oob{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) ;; 8-reduction.watsup rule memory.copy-zero{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.copy-le{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise -- if (i_1 <= i_2) ;; 8-reduction.watsup rule memory.copy-gt{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise ;; 8-reduction.watsup rule memory.init-oob{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) ;; 8-reduction.watsup rule memory.init-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.init-succ{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`($data(z, y).DATA_datainst[i].`%`.0)) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.INIT_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`($data(z, y).DATA_datainst[i].`%`.0)) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.INIT_admininstr(x, y)]) -- otherwise ;; 8-reduction.watsup relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule pure{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) - -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_pure: `%~>%`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule read{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) - -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_read: `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule struct.new{z : state, val^n : val^n, n : n, x : idx, si : structinst, mut^n : mut^n, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut : mut zt : storagetype})) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%`(`%%`(mut, zt)^n{mut : mut zt : storagetype}))) -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val zt : storagetype}}) ;; 8-reduction.watsup rule struct.set-null{z : state, ht : heaptype, val : val, x : idx, i : nat}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%`(z, [TRAP_admininstr])) ;; 8-reduction.watsup rule struct.set-struct{z : state, a : addr, val : val, x : idx, i : nat, fv : fieldval, mut* : mut*, zt* : storagetype*}: - `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`($with_struct(z, a, i, fv), [])) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%~>%`(`%;%`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%`($with_struct(z, a, i, fv), [])) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) -- if (fv = $packval(zt*{zt : storagetype}[i], val)) ;; 8-reduction.watsup rule array.new_fixed{z : state, val^n : val^n, n : n, x : idx, ai : arrayinst, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val}}) ;; 8-reduction.watsup rule array.set-null{z : state, ht : heaptype, i : nat, val : val, x : idx}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) ;; 8-reduction.watsup rule array.set-oob{z : state, a : addr, i : nat, val : val, x : idx}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.set-array{z : state, a : addr, i : nat, val : val, x : idx, fv : fieldval, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`($with_array(z, a, i, fv), [])) -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) -- if (fv = $packval(zt, val)) ;; 8-reduction.watsup rule local.set{z : state, val : val, x : idx}: - `%~>%`(`%;%*`(z, [(val : val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) + `%~>%`(`%;%`(z, [(val : val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%`($with_local(z, x, val), [])) ;; 8-reduction.watsup rule global.set{z : state, val : val, x : idx}: - `%~>%`(`%;%*`(z, [(val : val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) + `%~>%`(`%;%`(z, [(val : val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%`($with_global(z, x, val), [])) ;; 8-reduction.watsup rule table.set-oob{z : state, i : nat, ref : ref, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.set-val{z : state, i : nat, ref : ref, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%`($with_table(z, x, i, ref), [])) -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.grow-succeed{z : state, ref : ref, n : n, x : idx, ti : tableinst}: - `%~>%`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, `%`(|$table(z, x).ELEM_tableinst|))])) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, `%`(|$table(z, x).ELEM_tableinst|))])) -- if (ti = $growtable($table(z, x), n, ref)) ;; 8-reduction.watsup rule table.grow-fail{z : state, ref : ref, n : n, x : idx}: - `%~>%`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) ;; 8-reduction.watsup rule elem.drop{z : state, x : idx}: - `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) + `%~>%`(`%;%`(z, [ELEM.DROP_admininstr(x)]), `%;%`($with_elem(z, x, []), [])) ;; 8-reduction.watsup rule store-num-oob{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + ($size(nt) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule store-num-val{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) -- if (b*{b : byte} = $nbytes(nt, c)) ;; 8-reduction.watsup rule store-pack-oob{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + (n / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule store-pack-val{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) -- if (b*{b : byte} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c))) ;; 8-reduction.watsup rule vstore-oob{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + ($vsize(V128_vectype) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vstore-val{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) -- if (b*{b : byte} = $vbytes(V128_vectype, c)) ;; 8-reduction.watsup rule vstore_lane-oob{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + N) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vstore_lane-val{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, b* : byte*, imm : imm, M : M}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = (128 / N)) -- if (b*{b : byte} = $ibytes(N, `%`($lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)[j].`%`.0))) ;; 8-reduction.watsup rule memory.grow-succeed{z : state, n : n, x : idx, mi : meminst}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, `%`((|$mem(z, x).DATA_meminst| / (64 * $Ki))))])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, `%`((|$mem(z, x).DATA_meminst| / (64 * $Ki))))])) -- if (mi = $growmemory($mem(z, x), n)) ;; 8-reduction.watsup rule memory.grow-fail{z : state, n : n, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) ;; 8-reduction.watsup rule data.drop{z : state, x : idx}: - `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) + `%~>%`(`%;%`(z, [DATA.DROP_admininstr(x)]), `%;%`($with_data(z, x, []), [])) ;; 8-reduction.watsup rec { @@ -5091,21 +5114,21 @@ rec { relation Steps: `%~>*%`(config, config) ;; 8-reduction.watsup:18.1-19.36 rule refl{z : state, admininstr* : admininstr*}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z, admininstr*{admininstr : admininstr})) + `%~>*%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z, admininstr*{admininstr : admininstr})) ;; 8-reduction.watsup:21.1-24.53 rule trans{z : state, admininstr* : admininstr*, z'' : state, admininstr''* : admininstr*, z' : state, admininstr' : admininstr}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) - -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z', admininstr'*{})) - -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) + `%~>*%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z'', admininstr''*{admininstr'' : admininstr})) + -- Step: `%~>%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z', admininstr'*{})) + -- Steps: `%~>*%`(`%;%`(z', [admininstr']), `%;%`(z'', admininstr''*{admininstr'' : admininstr})) } ;; 8-reduction.watsup -relation Eval_expr: `%;%~>*%;%*`(state, expr, state, val*) +relation Eval_expr: `%;%~>*%;%`(state, expr, state, val*) ;; 8-reduction.watsup rule _{z : state, instr* : instr*, z' : state, val* : val*}: - `%;%~>*%;%*`(z, instr*{instr : instr}, z', val*{val : val}) - -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z', (val : val <: admininstr)*{val : val})) + `%;%~>*%;%`(z, instr*{instr : instr}, z', val*{val : val}) + -- Steps: `%~>*%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z', (val : val <: admininstr)*{val : val})) ;; 9-module.watsup rec { @@ -5126,7 +5149,7 @@ def $alloctypes(type*) : deftype* def $allocfunc(store : store, moduleinst : moduleinst, func : func) : (store, funcaddr) ;; 9-module.watsup def $allocfunc{s : store, mm : moduleinst, func : func, fi : funcinst, x : idx, local* : local*, expr : expr}(s, mm, func) = (s[FUNC_store =.. [fi]], |s.FUNC_store|) - -- if (func = `FUNC%%*%`(x, local*{local : local}, expr)) + -- if (func = FUNC(x, local*{local : local}, expr)) -- if (fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func}) ;; 9-module.watsup @@ -5252,7 +5275,7 @@ def $instexport(funcaddr*, globaladdr*, tableaddr*, memaddr*, export : export) : def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) : (store, moduleinst) ;; 9-module.watsup def $allocmodule{s : store, module : module, externval* : externval*, val_g* : val*, ref_t* : ref*, ref_e** : ref**, s_6 : store, mm : moduleinst, type* : type*, import* : import*, func^n_f : func^n_f, n_f : n, globaltype^n_g : globaltype^n_g, expr_g^n_g : expr^n_g, n_g : n, tabletype^n_t : tabletype^n_t, expr_t^n_t : expr^n_t, n_t : n, memtype^n_m : memtype^n_m, n_m : n, reftype^n_e : reftype^n_e, expr_e*^n_e : expr*^n_e, elemmode^n_e : elemmode^n_e, n_e : n, byte*^n_d : byte*^n_d, datamode^n_d : datamode^n_d, n_d : n, start? : start?, export* : export*, fa_ex* : funcaddr*, ga_ex* : globaladdr*, ta_ex* : tableaddr*, ma_ex* : memaddr*, fa* : funcaddr*, i_f^n_f : nat^n_f, ga* : globaladdr*, i_g^n_g : nat^n_g, ta* : tableaddr*, i_t^n_t : nat^n_t, ma* : memaddr*, i_m^n_m : nat^n_m, ea* : elemaddr*, i_e^n_e : nat^n_e, da* : dataaddr*, i_d^n_d : nat^n_d, xi* : exportinst*, dt* : deftype*, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store}(s, module, externval*{externval : externval}, val_g*{val_g : val}, ref_t*{ref_t : ref}, ref_e*{ref_e : ref}*{ref_e : ref}) = (s_6, mm) - -- if (module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func^n_f{func : func}, GLOBAL(globaltype, expr_g)^n_g{expr_g : expr globaltype : globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t : expr tabletype : tabletype}, MEMORY(memtype)^n_m{memtype : memtype}, `ELEM%%*%`(reftype, expr_e*{expr_e : expr}, elemmode)^n_e{elemmode : elemmode expr_e : expr reftype : reftype}, `DATA%*%`(byte*{byte : byte}, datamode)^n_d{byte : byte datamode : datamode}, start?{start : start}, export*{export : export})) + -- if (module = MODULE(type*{type : type}, import*{import : import}, func^n_f{func : func}, GLOBAL(globaltype, expr_g)^n_g{expr_g : expr globaltype : globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t : expr tabletype : tabletype}, MEMORY(memtype)^n_m{memtype : memtype}, ELEM(reftype, expr_e*{expr_e : expr}, elemmode)^n_e{elemmode : elemmode expr_e : expr reftype : reftype}, DATA(byte*{byte : byte}, datamode)^n_d{byte : byte datamode : datamode}, start?{start : start}, export*{export : export})) -- if (fa_ex*{fa_ex : funcaddr} = $funcsxv(externval*{externval : externval})) -- if (ga_ex*{ga_ex : globaladdr} = $globalsxv(externval*{externval : externval})) -- if (ta_ex*{ta_ex : tableaddr} = $tablesxv(externval*{externval : externval})) @@ -5276,36 +5299,36 @@ def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) ;; 9-module.watsup def $runelem(elem : elem, idx : idx) : instr* ;; 9-module.watsup - def $runelem{reftype : reftype, expr* : expr*, y : idx}(`ELEM%%*%`(reftype, expr*{expr : expr}, PASSIVE_elemmode), y) = [] + def $runelem{reftype : reftype, expr* : expr*, y : idx}(ELEM(reftype, expr*{expr : expr}, PASSIVE_elemmode), y) = [] ;; 9-module.watsup - def $runelem{reftype : reftype, expr* : expr*, y : idx}(`ELEM%%*%`(reftype, expr*{expr : expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] + def $runelem{reftype : reftype, expr* : expr*, y : idx}(ELEM(reftype, expr*{expr : expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] ;; 9-module.watsup - def $runelem{reftype : reftype, expr* : expr*, x : idx, instr* : instr*, y : idx}(`ELEM%%*%`(reftype, expr*{expr : expr}, ACTIVE_elemmode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|expr*{expr : expr}|)) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] + def $runelem{reftype : reftype, expr* : expr*, x : idx, instr* : instr*, y : idx}(ELEM(reftype, expr*{expr : expr}, ACTIVE_elemmode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|expr*{expr : expr}|)) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] ;; 9-module.watsup def $rundata(data : data, idx : idx) : instr* ;; 9-module.watsup - def $rundata{byte* : byte*, y : idx}(`DATA%*%`(byte*{byte : byte}, PASSIVE_datamode), y) = [] + def $rundata{byte* : byte*, y : idx}(DATA(byte*{byte : byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup - def $rundata{byte* : byte*, x : idx, instr* : instr*, y : idx}(`DATA%*%`(byte*{byte : byte}, ACTIVE_datamode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|byte*{byte : byte}|)) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] + def $rundata{byte* : byte*, x : idx, instr* : instr*, y : idx}(DATA(byte*{byte : byte}, ACTIVE_datamode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|byte*{byte : byte}|)) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] ;; 9-module.watsup def $instantiate(store : store, module : module, externval*) : config ;; 9-module.watsup - def $instantiate{s : store, module : module, externval* : externval*, s' : store, f : frame, instr_E* : instr*, instr_D* : instr*, x? : idx?, type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start? : start?, export* : export*, globaltype* : globaltype*, expr_G* : expr*, tabletype* : tabletype*, expr_T* : expr*, reftype* : reftype*, expr_E** : expr**, elemmode* : elemmode*, n_F : n, n_E : n, n_D : n, mm_init : moduleinst, i_F^n_F : nat^n_F, z : state, val_G* : val*, ref_T* : ref*, ref_E** : ref**, mm : moduleinst, i^n_E : nat^n_E, j^n_D : nat^n_D}(s, module, externval*{externval : externval}) = `%;%*`(`%;%`(s', f), (instr_E : instr <: admininstr)*{instr_E : instr} :: (instr_D : instr <: admininstr)*{instr_D : instr} :: CALL_admininstr(x)?{x : funcidx}) - -- if (module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data*{data : data}, start?{start : start}, export*{export : export})) + def $instantiate{s : store, module : module, externval* : externval*, s' : store, f : frame, instr_E* : instr*, instr_D* : instr*, x? : idx?, type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start? : start?, export* : export*, globaltype* : globaltype*, expr_G* : expr*, tabletype* : tabletype*, expr_T* : expr*, reftype* : reftype*, expr_E** : expr**, elemmode* : elemmode*, n_F : n, n_E : n, n_D : n, mm_init : moduleinst, i_F^n_F : nat^n_F, z : state, val_G* : val*, ref_T* : ref*, ref_E** : ref**, mm : moduleinst, i^n_E : nat^n_E, j^n_D : nat^n_D}(s, module, externval*{externval : externval}) = `%;%`(`%;%`(s', f), (instr_E : instr <: admininstr)*{instr_E : instr} :: (instr_D : instr <: admininstr)*{instr_D : instr} :: CALL_admininstr(x)?{x : funcidx}) + -- if (module = MODULE(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data*{data : data}, start?{start : start}, export*{export : export})) -- if (global*{global : global} = GLOBAL(globaltype, expr_G)*{expr_G : expr globaltype : globaltype}) -- if (table*{table : table} = TABLE(tabletype, expr_T)*{expr_T : expr tabletype : tabletype}) - -- if (elem*{elem : elem} = `ELEM%%*%`(reftype, expr_E*{expr_E : expr}, elemmode)*{elemmode : elemmode expr_E : expr reftype : reftype}) + -- if (elem*{elem : elem} = ELEM(reftype, expr_E*{expr_E : expr}, elemmode)*{elemmode : elemmode expr_E : expr reftype : reftype}) -- if (start?{start : start} = START(x)?{x : funcidx}) -- if (n_F = |func*{func : func}|) -- if (n_E = |elem*{elem : elem}|) -- if (n_D = |data*{data : data}|) -- if (mm_init = {TYPE $alloctypes(type*{type : type}), FUNC $funcsxv(externval*{externval : externval}) :: (|s.FUNC_store| + i_F)^(i_F*%;%*`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} + -- (Eval_expr: `%;%~>*%;%`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} + -- (Eval_expr: `%;%~>*%;%`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} + -- (Eval_expr: `%;%~>*%;%`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} -- if ((s', mm) = $allocmodule(s, module, externval*{externval : externval}, val_G*{val_G : val}, ref_T*{ref_T : ref}, ref_E*{ref_E : ref}*{ref_E : ref})) -- if (f = {LOCAL [], MODULE mm}) -- if (instr_E*{instr_E : instr} = $concat_(syntax instr, $runelem(elem*{elem : elem}[i], `%`(i))^(i%`(t_1^n{t_1 : valtype}, t_2*{t_2 : valtype}))) - -;; A-binary.watsup -rec { - -;; A-binary.watsup:49.1-49.24 -def $utf8(name : name) : byte* - ;; A-binary.watsup:50.1-50.47 - def $utf8{ch : nat, b : byte}([`%`(ch)]) = [b] - -- if ((ch < 128) /\ (ch = b.`%`.0)) - ;; A-binary.watsup:51.1-51.96 - def $utf8{ch : nat, b_1 : byte, b_2 : byte}([`%`(ch)]) = [b_1 b_2] - -- if (((128 <= ch) /\ (ch < 2048)) /\ (ch = (((2 ^ 6) * (b_1.`%`.0 - 192)) + (b_2.`%`.0 - 128)))) - ;; A-binary.watsup:52.1-52.148 - def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte}([`%`(ch)]) = [b_1 b_2 b_3] - -- if ((((2048 <= ch) /\ (ch < 55296)) \/ ((57344 <= ch) /\ (ch < 65536))) /\ (ch = ((((2 ^ 12) * (b_1.`%`.0 - 224)) + ((2 ^ 6) * (b_2.`%`.0 - 128))) + (b_3.`%`.0 - 128)))) - ;; A-binary.watsup:53.1-53.148 - def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([`%`(ch)]) = [b_1 b_2 b_3 b_4] - -- if (((65536 <= ch) /\ (ch < 69632)) /\ (ch = (((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128)))) - ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(`%`(ch)*{ch : nat}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch : nat}) -} + -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = FUNC(x, local*{local : local}, expr)) + -- Expand: `%~~%`(s.FUNC_store[fa].TYPE_funcinst, FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; A-binary.watsup syntax castop = (nul, nul) diff --git a/spectec/test-middlend/TEST.md b/spectec/test-middlend/TEST.md index 32956b4845..0637489531 100644 --- a/spectec/test-middlend/TEST.md +++ b/spectec/test-middlend/TEST.md @@ -58,14 +58,8 @@ def $concat_(syntax X, X**) : X* } ;; 1-syntax.watsup -syntax list{syntax X}(syntax X) = X* - -;; 1-syntax.watsup -syntax char = `%`{i : nat}(i : nat) - -- if (((i >= 0) /\ (i <= 55295)) \/ ((i >= 57344) /\ (i <= 1114111))) - -;; 1-syntax.watsup -syntax name = char* +syntax list{syntax X}(syntax X) = `%`{X* : X*}(X*{X : X} : X*) + -- if (|X*{X : X}| < (2 ^ 32)) ;; 1-syntax.watsup syntax bit = `%`{i : nat}(i : nat) @@ -170,6 +164,35 @@ def $canon_(N : N) : nat ;; 1-syntax.watsup syntax vN{N : N}(N) = iN(N) +;; 1-syntax.watsup +syntax char = `%`{i : nat}(i : nat) + -- if (((i >= 0) /\ (i <= 55295)) \/ ((i >= 57344) /\ (i <= 1114111))) + +;; 1-syntax.watsup +rec { + +;; 1-syntax.watsup:87.1-87.25 +def $utf8(char*) : byte* + ;; A-binary.watsup:50.1-50.47 + def $utf8{ch : char, b : byte}([ch]) = [b] + -- if ((ch.`%`.0 < 128) /\ (ch = `%`(b.`%`.0))) + ;; A-binary.watsup:51.1-51.96 + def $utf8{ch : char, b_1 : byte, b_2 : byte}([ch]) = [b_1 b_2] + -- if (((128 <= ch.`%`.0) /\ (ch.`%`.0 < 2048)) /\ (ch = `%`((((2 ^ 6) * (b_1.`%`.0 - 192)) + (b_2.`%`.0 - 128))))) + ;; A-binary.watsup:52.1-52.148 + def $utf8{ch : char, b_1 : byte, b_2 : byte, b_3 : byte}([ch]) = [b_1 b_2 b_3] + -- if ((((2048 <= ch.`%`.0) /\ (ch.`%`.0 < 55296)) \/ ((57344 <= ch.`%`.0) /\ (ch.`%`.0 < 65536))) /\ (ch = `%`(((((2 ^ 12) * (b_1.`%`.0 - 224)) + ((2 ^ 6) * (b_2.`%`.0 - 128))) + (b_3.`%`.0 - 128))))) + ;; A-binary.watsup:53.1-53.148 + def $utf8{ch : char, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([ch]) = [b_1 b_2 b_3 b_4] + -- if (((65536 <= ch.`%`.0) /\ (ch.`%`.0 < 69632)) /\ (ch = `%`((((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128))))) + ;; A-binary.watsup:54.1-54.44 + def $utf8{ch* : char*}(ch*{ch : char}) = $concat_(syntax byte, $utf8([ch])*{ch : char}) +} + +;; 1-syntax.watsup +syntax name = `%`{char* : char*}(char*{char : char} : char*) + -- if (|$utf8(char*{char : char})| < (2 ^ 32)) + ;; 1-syntax.watsup syntax idx = u32 @@ -240,7 +263,7 @@ syntax fin = `FINAL%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:146.1-147.14 +;; 1-syntax.watsup:147.1-148.14 syntax valtype = | I32 | I64 @@ -250,10 +273,10 @@ syntax valtype = | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | BOT -;; 1-syntax.watsup:154.1-155.16 +;; 1-syntax.watsup:155.1-156.16 syntax resulttype = list(syntax valtype) -;; 1-syntax.watsup:162.1-162.68 +;; 1-syntax.watsup:163.1-163.68 syntax storagetype = | BOT | I32 @@ -265,34 +288,34 @@ syntax storagetype = | I8 | I16 -;; 1-syntax.watsup:175.1-176.18 +;; 1-syntax.watsup:176.1-177.18 syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) -;; 1-syntax.watsup:178.1-178.70 +;; 1-syntax.watsup:179.1-179.70 syntax functype = `%->%`{resulttype : resulttype}(resulttype : resulttype, resulttype) -;; 1-syntax.watsup:179.1-179.64 +;; 1-syntax.watsup:180.1-180.64 syntax structtype = list(syntax fieldtype) -;; 1-syntax.watsup:180.1-180.53 +;; 1-syntax.watsup:181.1-181.53 syntax arraytype = fieldtype -;; 1-syntax.watsup:182.1-185.18 +;; 1-syntax.watsup:183.1-186.18 syntax comptype = | STRUCT{structtype : structtype}(structtype : structtype) | ARRAY{arraytype : arraytype}(arraytype : arraytype) | FUNC{functype : functype}(functype : functype) -;; 1-syntax.watsup:189.1-190.60 +;; 1-syntax.watsup:190.1-191.60 syntax subtype = | SUB{fin : fin, typeidx* : typeidx*, comptype : comptype}(fin : fin, typeidx*{typeidx : typeidx} : typeidx*, comptype : comptype) | SUBD{fin : fin, heaptype* : heaptype*, comptype : comptype}(fin : fin, heaptype*{heaptype : heaptype} : heaptype*, comptype : comptype) -;; 1-syntax.watsup:192.1-193.22 +;; 1-syntax.watsup:193.1-194.22 syntax rectype = | REC{list : list(syntax subtype)}(list : list(syntax subtype)) -;; 1-syntax.watsup:198.1-199.26 +;; 1-syntax.watsup:199.1-200.26 syntax heaptype = | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY @@ -751,7 +774,7 @@ syntax zero = `ZERO%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:522.1-534.78 +;; 1-syntax.watsup:523.1-535.78 syntax instr = | UNREACHABLE | NOP @@ -881,7 +904,7 @@ syntax type = TYPE{rectype : rectype}(rectype : rectype) syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) +syntax func = FUNC{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) ;; 1-syntax.watsup syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) @@ -893,10 +916,10 @@ syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) +syntax elem = ELEM{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) ;; 1-syntax.watsup -syntax data = `DATA%*%`{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) +syntax data = DATA{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup syntax start = START{funcidx : funcidx}(funcidx : funcidx) @@ -915,7 +938,7 @@ syntax export = EXPORT{name : name, externidx : externidx}(name : name, externid syntax import = IMPORT{name : name, externtype : externtype}(name : name, name, externtype : externtype) ;; 1-syntax.watsup -syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) +syntax module = MODULE{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) ;; 2-syntax-aux.watsup rec { @@ -971,7 +994,7 @@ def $free_dataidx_expr(expr : expr) : dataidx* ;; 2-syntax-aux.watsup def $free_dataidx_func(func : func) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) + def $free_dataidx_func{x : idx, loc* : local*, e : expr}(FUNC(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) ;; 2-syntax-aux.watsup rec { @@ -1108,7 +1131,7 @@ def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype ;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype ;; 2-syntax-aux.watsup:175.1-175.85 - def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt : fieldtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype}) + def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(`%`(yt*{yt : fieldtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype(`%`($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype})) ;; 2-syntax-aux.watsup:176.1-176.81 def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx : typevar}, ht*{ht : heaptype}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:177.1-177.78 @@ -1124,7 +1147,7 @@ def $subst_subtype(subtype : subtype, typevar*, heaptype*) : subtype ;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype ;; 2-syntax-aux.watsup:184.1-184.76 - def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st : subtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype}) + def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(`%`(st*{st : subtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype(`%`($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype})) ;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype @@ -1134,7 +1157,7 @@ def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype ;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype ;; 2-syntax-aux.watsup:189.1-189.113 - def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}, $subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype}) + def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`(`%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}), `%`($subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype})) } ;; 2-syntax-aux.watsup @@ -1187,25 +1210,25 @@ def $subst_all_deftypes(deftype*, heaptype*) : deftype* ;; 2-syntax-aux.watsup def $rollrt(typeidx : typeidx, rectype : rectype) : rectype ;; 2-syntax-aux.watsup - def $rollrt{x : idx, st^n : subtype^n, n : n, i^n : nat^n}(x, REC_rectype(st^n{st : subtype})) = REC_rectype($subst_subtype(st, $idx(`%`((x.`%`.0 + i)))^(i%*%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) +syntax instrtype = `%->%%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) ;; 6-typing.watsup syntax context = @@ -2676,16 +2699,16 @@ relation Valtype_ok: `%|-%:_OK`(context, valtype) relation Resulttype_ok: `%|-%:_OK`(context, resulttype) ;; 6-typing.watsup rule _{C : context, t* : valtype*}: - `%|-%:_OK`(C, t*{t : valtype}) + `%|-%:_OK`(C, `%`(t*{t : valtype})) -- (Valtype_ok: `%|-%:_OK`(C, t))*{t : valtype} ;; 6-typing.watsup relation Instrtype_ok: `%|-%:_OK`(context, instrtype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, x* : idx*, t_2* : valtype*, lt* : localtype*}: - `%|-%:_OK`(C, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + `%|-%:_OK`(C, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_1*{t_1 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_2*{t_2 : valtype})) -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt : localtype x : idx} ;; 6-typing.watsup @@ -2725,15 +2748,15 @@ relation Fieldtype_ok: `%|-%:_OK`(context, fieldtype) relation Functype_ok: `%|-%:_OK`(context, functype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:_OK`(C, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + `%|-%:_OK`(C, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_1*{t_1 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Comptype_ok: `%|-%:_OK`(context, comptype) ;; 6-typing.watsup rule struct{C : context, yt* : fieldtype*}: - `%|-%:_OK`(C, STRUCT_comptype(yt*{yt : fieldtype})) + `%|-%:_OK`(C, STRUCT_comptype(`%`(yt*{yt : fieldtype}))) -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt : fieldtype} ;; 6-typing.watsup @@ -2806,7 +2829,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:303.1-305.35 rule struct{C : context, deftype : deftype, yt* : fieldtype*}: `%|-%<:%`(C, (deftype : deftype <: heaptype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt : fieldtype})) + -- Expand: `%~~%`(deftype, STRUCT_comptype(`%`(yt*{yt : fieldtype}))) ;; 6-typing.watsup:307.1-309.33 rule array{C : context, deftype : deftype, yt : fieldtype}: @@ -2932,7 +2955,7 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) ;; 6-typing.watsup rule struct{C : context, yt_1* : fieldtype*, yt'_1 : fieldtype, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1 : fieldtype} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2 : fieldtype})) + `%|-%<:%`(C, STRUCT_comptype(`%`(yt_1*{yt_1 : fieldtype} :: [yt'_1])), STRUCT_comptype(`%`(yt_2*{yt_2 : fieldtype}))) -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 : fieldtype yt_2 : fieldtype} ;; 6-typing.watsup @@ -2992,13 +3015,13 @@ rec { relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) ;; 6-typing.watsup:196.1-197.24 rule empty{C : context, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) + `%|-%:%`(C, REC_rectype(`%`([])), OK_oktypeidxnat(x, i)) ;; 6-typing.watsup:199.1-202.50 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidxnat(x, i)) + `%|-%:%`(C, REC_rectype(`%`([st_1] :: st*{st : subtype})), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) - -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) } ;; 6-typing.watsup @@ -3008,18 +3031,18 @@ rec { relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) ;; 6-typing.watsup:184.1-185.23 rule empty{C : context, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) + `%|-%:%`(C, REC_rectype(`%`([])), OK_oktypeidx(x)) ;; 6-typing.watsup:187.1-190.43 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidx(x)) + `%|-%:%`(C, REC_rectype(`%`([st_1] :: st*{st : subtype})), OK_oktypeidx(x)) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) - -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) + -- Rectype_ok: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidx(`%`((x.`%`.0 + 1)))) ;; 6-typing.watsup:192.1-194.49 rule rec2{C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(x, 0)) + `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(x, 0)) } ;; 6-typing.watsup @@ -3028,7 +3051,7 @@ relation Deftype_ok: `%|-%:_OK`(context, deftype) rule _{C : context, qt : rectype, i : nat, x : idx, st^n : subtype^n, n : n}: `%|-%:_OK`(C, DEF_deftype(qt, i)) -- Rectype_ok: `%|-%:%`(C, qt, OK_oktypeidx(x)) - -- if (qt = REC_rectype(st^n{st : subtype})) + -- if (qt = REC_rectype(`%`(st^n{st : subtype}))) -- if (i < n) ;; 6-typing.watsup @@ -3084,19 +3107,19 @@ relation Externtype_ok: `%|-%:_OK`(context, externtype) -- Memtype_ok: `%|-%:_OK`(C, mt) ;; 6-typing.watsup -relation Resulttype_sub: `%|-%*_<:%*`(context, valtype*, valtype*) +relation Resulttype_sub: `%|-%<:%`(context, valtype*, valtype*) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%*_<:%*`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) + `%|-%<:%`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 : valtype t_2 : valtype} ;; 6-typing.watsup relation Instrtype_sub: `%|-%<:%`(context, instrtype, instrtype) ;; 6-typing.watsup rule _{C : context, t_11* : valtype*, x_1* : idx*, t_12* : valtype*, t_21* : valtype*, x_2* : idx*, t_22* : valtype*, x* : idx*, t* : valtype*}: - `%|-%<:%`(C, `%->%*%`(t_11*{t_11 : valtype}, x_1*{x_1 : localidx}, t_12*{t_12 : valtype}), `%->%*%`(t_21*{t_21 : valtype}, x_2*{x_2 : localidx}, t_22*{t_22 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) + `%|-%<:%`(C, `%->%%`(`%`(t_11*{t_11 : valtype}), x_1*{x_1 : localidx}, `%`(t_12*{t_12 : valtype})), `%->%%`(`%`(t_21*{t_21 : valtype}), x_2*{x_2 : localidx}, `%`(t_22*{t_22 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) + -- Resulttype_sub: `%|-%<:%`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) -- if (x*{x : idx} = $setminus(x_2*{x_2 : idx}, x_1*{x_1 : idx})) -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t : valtype x : idx} @@ -3163,11 +3186,11 @@ relation Externtype_sub: `%|-%<:%`(context, externtype, externtype) relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) ;; 6-typing.watsup rule void{C : context}: - `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) + `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`(`%`([]), `%`([]))) ;; 6-typing.watsup rule result{C : context, t : valtype}: - `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`([], [t])) + `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`(`%`([]), `%`([t]))) ;; 6-typing.watsup rule typeidx{C : context, x : idx, ft : functype}: @@ -3181,77 +3204,77 @@ rec { relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:544.1-545.34 rule unreachable{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:547.1-548.24 rule nop{C : context}: - `%|-%:%`(C, NOP_instr, `%->%`([], [])) + `%|-%:%`(C, NOP_instr, `%->%`(`%`([]), `%`([]))) ;; 6-typing.watsup:550.1-551.23 rule drop{C : context, t : valtype}: - `%|-%:%`(C, DROP_instr, `%->%`([t], [])) + `%|-%:%`(C, DROP_instr, `%->%`(`%`([t]), `%`([]))) ;; 6-typing.watsup:554.1-555.31 rule select-expl{C : context, t : valtype}: - `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) + `%|-%:%`(C, SELECT_instr(?([t])), `%->%`(`%`([t t I32_valtype]), `%`([t]))) ;; 6-typing.watsup:557.1-560.37 rule select-impl{C : context, t : valtype, t' : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) + `%|-%:%`(C, SELECT_instr(?()), `%->%`(`%`([t t I32_valtype]), `%`([t]))) -- Valtype_sub: `%|-%<:%`(C, t, t') -- if ((t' = (numtype : numtype <: valtype)) \/ (t' = (vectype : vectype <: valtype))) ;; 6-typing.watsup:578.1-581.61 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:583.1-586.61 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_1*{t_1 : valtype})], RETURN ?()}, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:588.1-592.65 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_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_2*{x_2 : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(`%`(t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_2*{x_2 : localidx}, `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:597.1-599.24 rule br{C : context, l : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) + `%|-%:%`(C, BR_instr(l), `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype})) ;; 6-typing.watsup:601.1-603.24 rule br_if{C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t : valtype} :: [I32_valtype], t*{t : valtype})) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) + `%|-%:%`(C, BR_IF_instr(l), `%->%`(`%`(t*{t : valtype} :: [I32_valtype]), `%`(t*{t : valtype}))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype})) ;; 6-typing.watsup:605.1-608.44 rule br_table{C : context, l* : labelidx*, l' : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) - -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0]))*{l : labelidx} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0]) + `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) + -- (Resulttype_sub: `%|-%<:%`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0].`%`.0))*{l : labelidx} + -- Resulttype_sub: `%|-%<:%`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0].`%`.0) ;; 6-typing.watsup:610.1-613.31 rule br_on_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(`%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)]), `%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype})) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:615.1-618.31 rule br_on_non_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype})) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]) + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(`%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)]), `%`(t*{t : valtype}))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:620.1-626.34 rule br_on_cast{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(`%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)]), `%`(t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)]))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype} :: [(rt : reftype <: valtype)])) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -3259,8 +3282,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:628.1-634.49 rule br_on_cast_fail{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [(rt_2 : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(`%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)]), `%`(t*{t : valtype} :: [(rt_2 : reftype <: valtype)]))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype} :: [(rt : reftype <: valtype)])) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -3268,414 +3291,414 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:639.1-641.24 rule return{C : context, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) - -- if (C.RETURN_context = ?(t*{t : valtype})) + `%|-%:%`(C, RETURN_instr, `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(`%`(t*{t : valtype}))) ;; 6-typing.watsup:643.1-645.46 rule call{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + `%|-%:%`(C, CALL_instr(x), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; 6-typing.watsup:647.1-649.46 rule call_ref{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2 : valtype})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(`%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`(t_2*{t_2 : valtype}))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; 6-typing.watsup:651.1-655.46 rule call_indirect{C : context, x : idx, y : idx, t_1* : valtype*, t_2* : valtype*, lim : limits, rt : reftype}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(`%`(t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_2*{t_2 : valtype}))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; 6-typing.watsup:657.1-661.40 rule return_call{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}, t_4*{t_4 : valtype})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}), `%`(t_4*{t_4 : valtype}))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:663.1-667.40 rule return_call_ref{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4 : valtype})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`(t_4*{t_4 : valtype}))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:669.1-675.40 rule return_call_indirect{C : context, x : idx, y : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, lim : limits, rt : reftype, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype], t_4*{t_4 : valtype})) + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_4*{t_4 : valtype}))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:680.1-681.33 rule const{C : context, nt : numtype, c_nt : num_(nt)}: - `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [(nt : numtype <: valtype)])) + `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`(`%`([]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:683.1-684.34 rule unop{C : context, nt : numtype, unop_nt : unop_(nt)}: - `%|-%:%`(C, UNOP_instr(nt, unop_nt), `%->%`([(nt : numtype <: valtype)], [(nt : numtype <: valtype)])) + `%|-%:%`(C, UNOP_instr(nt, unop_nt), `%->%`(`%`([(nt : numtype <: valtype)]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:686.1-687.39 rule binop{C : context, nt : numtype, binop_nt : binop_(nt)}: - `%|-%:%`(C, BINOP_instr(nt, binop_nt), `%->%`([(nt : numtype <: valtype) (nt : numtype <: valtype)], [(nt : numtype <: valtype)])) + `%|-%:%`(C, BINOP_instr(nt, binop_nt), `%->%`(`%`([(nt : numtype <: valtype) (nt : numtype <: valtype)]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:689.1-690.39 rule testop{C : context, nt : numtype, testop_nt : testop_(nt)}: - `%|-%:%`(C, TESTOP_instr(nt, testop_nt), `%->%`([(nt : numtype <: valtype)], [I32_valtype])) + `%|-%:%`(C, TESTOP_instr(nt, testop_nt), `%->%`(`%`([(nt : numtype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:692.1-693.40 rule relop{C : context, nt : numtype, relop_nt : relop_(nt)}: - `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->%`([(nt : numtype <: valtype) (nt : numtype <: valtype)], [I32_valtype])) + `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->%`(`%`([(nt : numtype <: valtype) (nt : numtype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:696.1-699.34 rule reinterpret{C : context, nt_1 : numtype, nt_2 : numtype}: - `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([(nt_2 : numtype <: valtype)], [(nt_1 : numtype <: valtype)])) + `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`(`%`([(nt_2 : numtype <: valtype)]), `%`([(nt_1 : numtype <: valtype)]))) -- if (nt_1 =/= nt_2) -- if ($size(nt_1) = $size(nt_2)) ;; 6-typing.watsup:701.1-704.50 rule convert-i{C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: - `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`(`%`([(inn_2 : inn <: valtype)]), `%`([(inn_1 : inn <: valtype)]))) -- if (inn_1 =/= inn_2) -- if ((sx?{sx : sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) ;; 6-typing.watsup:706.1-708.24 rule convert-f{C : context, fnn_1 : fnn, fnn_2 : fnn}: - `%|-%:%`(C, CVTOP_instr((fnn_1 : fnn <: numtype), CONVERT_cvtop, (fnn_2 : fnn <: numtype), ?()), `%->%`([(fnn_2 : fnn <: valtype)], [(fnn_1 : fnn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((fnn_1 : fnn <: numtype), CONVERT_cvtop, (fnn_2 : fnn <: numtype), ?()), `%->%`(`%`([(fnn_2 : fnn <: valtype)]), `%`([(fnn_1 : fnn <: valtype)]))) -- if (fnn_1 =/= fnn_2) ;; 6-typing.watsup:713.1-715.31 rule ref.null{C : context, ht : heaptype}: - `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) + `%|-%:%`(C, REF.NULL_instr(ht), `%->%`(`%`([]), `%`([REF_valtype(`NULL%?`(?(())), ht)]))) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:718.1-720.23 rule ref.func{C : context, x : idx, epsilon : resulttype, dt : deftype}: - `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), (dt : deftype <: heaptype))])) + `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, `%`([REF_valtype(`NULL%?`(?()), (dt : deftype <: heaptype))]))) -- if (C.FUNC_context[x.`%`.0] = dt) ;; 6-typing.watsup:722.1-723.34 rule ref.i31{C : context}: - `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) + `%|-%:%`(C, REF.I31_instr, `%->%`(`%`([I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), I31_heaptype)]))) ;; 6-typing.watsup:725.1-726.31 rule ref.is_null{C : context, rt : reftype}: - `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([(rt : reftype <: valtype)], [I32_valtype])) + `%|-%:%`(C, REF.IS_NULL_instr, `%->%`(`%`([(rt : reftype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:728.1-730.31 rule ref.as_non_null{C : context, ht : heaptype}: - `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) + `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ht)]), `%`([REF_valtype(`NULL%?`(?()), ht)]))) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:732.1-733.51 rule ref.eq{C : context}: - `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) + `%|-%:%`(C, REF.EQ_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:735.1-739.33 rule ref.test{C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([(rt' : reftype <: valtype)], [I32_valtype])) + `%|-%:%`(C, REF.TEST_instr(rt), `%->%`(`%`([(rt' : reftype <: valtype)]), `%`([I32_valtype]))) -- Reftype_ok: `%|-%:_OK`(C, rt) -- Reftype_ok: `%|-%:_OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') ;; 6-typing.watsup:741.1-745.33 rule ref.cast{C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.CAST_instr(rt), `%->%`([(rt' : reftype <: valtype)], [(rt : reftype <: valtype)])) + `%|-%:%`(C, REF.CAST_instr(rt), `%->%`(`%`([(rt' : reftype <: valtype)]), `%`([(rt : reftype <: valtype)]))) -- Reftype_ok: `%|-%:_OK`(C, rt) -- Reftype_ok: `%|-%:_OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') ;; 6-typing.watsup:750.1-751.42 rule i31.get{C : context, sx : sx}: - `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) + `%|-%:%`(C, I31.GET_instr(sx), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:756.1-758.43 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`(`%`($unpack(zt)*{zt : storagetype}), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) ;; 6-typing.watsup:760.1-763.39 rule struct.new_default{C : context, x : idx, zt* : storagetype*, mut* : mut*, val* : val*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`(`%`($unpack(zt)*{zt : storagetype}), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 6-typing.watsup:765.1-769.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: - `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`([$unpack(zt)]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`(mut, zt)) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:771.1-774.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: - `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)]), `%`([]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`(`MUT%?`(?(())), zt)) ;; 6-typing.watsup:779.1-781.41 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpack(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`(`%`([$unpack(zt) I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) ;; 6-typing.watsup:783.1-786.36 rule array.new_default{C : context, x : idx, mut : mut, zt : storagetype, val : val}: - `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`(`%`([I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) -- if ($default($unpack(zt)) = ?(val)) ;; 6-typing.watsup:788.1-790.41 rule array.new_fixed{C : context, x : idx, n : n, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpack(zt)], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`(`%`([$unpack(zt)]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) ;; 6-typing.watsup:792.1-795.39 rule array.new_elem{C : context, x : idx, y : idx, mut : mut, rt : reftype}: - `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, (rt : reftype <: storagetype)))) -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y.`%`.0], rt) ;; 6-typing.watsup:797.1-801.23 rule array.new_data{C : context, x : idx, y : idx, mut : mut, t : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, (t : valtype <: storagetype)))) -- if ((t = (numtype : numtype <: valtype)) \/ (t = (vectype : vectype <: valtype))) -- if (C.DATA_context[y.`%`.0] = OK) ;; 6-typing.watsup:803.1-806.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype]), `%`([$unpack(zt)]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:808.1-810.41 rule array.set{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)], [])) + `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 6-typing.watsup:812.1-814.41 rule array.len{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) + `%|-%:%`(C, ARRAY.LEN_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)]), `%`([I32_valtype]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 6-typing.watsup:816.1-818.41 rule array.fill{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype], [])) + `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 6-typing.watsup:820.1-824.40 rule array.copy{C : context, x_1 : idx, x_2 : idx, zt_1 : storagetype, mut : mut, zt_2 : storagetype}: - `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x_1.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) -- Expand: `%~~%`(C.TYPE_context[x_2.`%`.0], ARRAY_comptype(`%%`(mut, zt_2))) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) ;; 6-typing.watsup:826.1-829.43 rule array.init_elem{C : context, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) -- Storagetype_sub: `%|-%<:%`(C, (C.ELEM_context[y.`%`.0] : reftype <: storagetype), zt) ;; 6-typing.watsup:831.1-835.23 rule array.init_data{C : context, x : idx, y : idx, zt : storagetype, t : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) -- if ((t = (numtype : numtype <: valtype)) \/ (t = (vectype : vectype <: valtype))) -- if (C.DATA_context[y.`%`.0] = OK) ;; 6-typing.watsup:840.1-841.62 rule extern.convert_any{C : context, nul : nul}: - `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) + `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`(`%`([REF_valtype(nul, ANY_heaptype)]), `%`([REF_valtype(nul, EXTERN_heaptype)]))) ;; 6-typing.watsup:843.1-844.62 rule any.convert_extern{C : context, nul : nul}: - `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) + `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`(`%`([REF_valtype(nul, EXTERN_heaptype)]), `%`([REF_valtype(nul, ANY_heaptype)]))) ;; 6-typing.watsup:849.1-850.35 rule vconst{C : context, c : vec_(V128_vnn)}: - `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->%`([], [V128_valtype])) + `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->%`(`%`([]), `%`([V128_valtype]))) ;; 6-typing.watsup:852.1-853.41 rule vvunop{C : context, vvunop : vvunop}: - `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:855.1-856.48 rule vvbinop{C : context, vvbinop : vvbinop}: - `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:858.1-859.55 rule vvternop{C : context, vvternop : vvternop}: - `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->%`([V128_valtype V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->%`(`%`([V128_valtype V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:861.1-862.44 rule vvtestop{C : context, vvtestop : vvtestop}: - `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:864.1-865.33 rule vbitmask{C : context, sh : ishape}: - `%|-%:%`(C, VBITMASK_instr(sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VBITMASK_instr(sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:867.1-868.39 rule vswizzle{C : context, sh : ishape}: - `%|-%:%`(C, VSWIZZLE_instr(sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VSWIZZLE_instr(sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:870.1-872.22 rule vshuffle{C : context, imm : imm, N : N, i* : nat*}: - `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) -- (if (i < (N * 2)))*{i : nat} ;; 6-typing.watsup:874.1-875.48 rule vsplat{C : context, lnn : lnn, N : N}: - `%|-%:%`(C, VSPLAT_instr(`%X%`(lnn, `%`(N))), `%->%`([($lunpack(lnn) : numtype <: valtype)], [V128_valtype])) + `%|-%:%`(C, VSPLAT_instr(`%X%`(lnn, `%`(N))), `%->%`(`%`([($lunpack(lnn) : numtype <: valtype)]), `%`([V128_valtype]))) ;; 6-typing.watsup:878.1-880.14 rule vextract_lane{C : context, lnn : lnn, N : N, sx? : sx?, i : nat}: - `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) + `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`(`%`([V128_valtype]), `%`([($lunpack(lnn) : numtype <: valtype)]))) -- if (i < N) ;; 6-typing.watsup:882.1-884.14 rule vreplace_lane{C : context, lnn : lnn, N : N, i : nat}: - `%|-%:%`(C, VREPLACE_LANE_instr(`%X%`(lnn, `%`(N)), `%`(i)), `%->%`([V128_valtype ($lunpack(lnn) : numtype <: valtype)], [V128_valtype])) + `%|-%:%`(C, VREPLACE_LANE_instr(`%X%`(lnn, `%`(N)), `%`(i)), `%->%`(`%`([V128_valtype ($lunpack(lnn) : numtype <: valtype)]), `%`([V128_valtype]))) -- if (i < N) ;; 6-typing.watsup:886.1-887.40 rule vunop{C : context, sh : shape, vunop_sh : vunop_(sh)}: - `%|-%:%`(C, VUNOP_instr(sh, vunop_sh), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VUNOP_instr(sh, vunop_sh), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:889.1-890.47 rule vbinop{C : context, sh : shape, vbinop_sh : vbinop_(sh)}: - `%|-%:%`(C, VBINOP_instr(sh, vbinop_sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VBINOP_instr(sh, vbinop_sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:892.1-893.43 rule vtestop{C : context, sh : shape, vtestop_sh : vtestop_(sh)}: - `%|-%:%`(C, VTESTOP_instr(sh, vtestop_sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VTESTOP_instr(sh, vtestop_sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:895.1-896.47 rule vrelop{C : context, sh : shape, vrelop_sh : vrelop_(sh)}: - `%|-%:%`(C, VRELOP_instr(sh, vrelop_sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VRELOP_instr(sh, vrelop_sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:898.1-899.50 rule vshiftop{C : context, sh : ishape, vshiftop_sh : vshiftop_(sh)}: - `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop_sh), `%->%`([V128_valtype I32_valtype], [V128_valtype])) + `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop_sh), `%->%`(`%`([V128_valtype I32_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:902.1-903.55 rule vcvtop{C : context, sh : shape, vcvtop : vcvtop, hf? : half?, sx? : sx?, zero : zero}: - `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:905.1-906.44 rule vnarrow{C : context, sh : ishape, sx : sx}: - `%|-%:%`(C, VNARROW_instr(sh, sh, sx), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VNARROW_instr(sh, sh, sx), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:908.1-909.49 rule vextunop{C : context, sh : ishape, vextunop : vextunop_(sh, sh), sx : sx}: - `%|-%:%`(C, VEXTUNOP_instr(sh, sh, vextunop, sx), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VEXTUNOP_instr(sh, sh, vextunop, sx), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:911.1-912.56 rule vextbinop{C : context, sh : ishape, vextbinop : vextbinop_(sh, sh), sx : sx}: - `%|-%:%`(C, VEXTBINOP_instr(sh, sh, vextbinop, sx), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VEXTBINOP_instr(sh, sh, vextbinop, sx), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:914.1-915.33 rule vbitmask{C : context, sh : ishape}: - `%|-%:%`(C, VBITMASK_instr(sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VBITMASK_instr(sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:920.1-922.28 rule local.get{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) + `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`(`%`([]), `%`([t]))) -- if (C.LOCAL_context[x.`%`.0] = `%%`(init, t)) ;; 6-typing.watsup:935.1-937.28 rule global.get{C : context, x : idx, t : valtype, mut : mut}: - `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) + `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`(`%`([]), `%`([t]))) -- if (C.GLOBAL_context[x.`%`.0] = `%%`(mut, t)) ;; 6-typing.watsup:939.1-941.28 rule global.set{C : context, x : idx, t : valtype}: - `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) + `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`(`%`([t]), `%`([]))) -- if (C.GLOBAL_context[x.`%`.0] = `%%`(`MUT%?`(?(())), t)) ;; 6-typing.watsup:946.1-948.28 rule table.get{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [(rt : reftype <: valtype)])) + `%|-%:%`(C, TABLE.GET_instr(x), `%->%`(`%`([I32_valtype]), `%`([(rt : reftype <: valtype)]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:950.1-952.28 rule table.set{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype (rt : reftype <: valtype)], [])) + `%|-%:%`(C, TABLE.SET_instr(x), `%->%`(`%`([I32_valtype (rt : reftype <: valtype)]), `%`([]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:954.1-956.24 rule table.size{C : context, x : idx, tt : tabletype}: - `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) + `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`(`%`([]), `%`([I32_valtype]))) -- if (C.TABLE_context[x.`%`.0] = tt) ;; 6-typing.watsup:958.1-960.28 rule table.grow{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([(rt : reftype <: valtype) I32_valtype], [I32_valtype])) + `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`(`%`([(rt : reftype <: valtype) I32_valtype]), `%`([I32_valtype]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:962.1-964.28 rule table.fill{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype (rt : reftype <: valtype) I32_valtype], [])) + `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`(`%`([I32_valtype (rt : reftype <: valtype) I32_valtype]), `%`([]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:966.1-970.36 rule table.copy{C : context, x_1 : idx, x_2 : idx, lim_1 : limits, rt_1 : reftype, lim_2 : limits, rt_2 : reftype}: - `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.TABLE_context[x_1.`%`.0] = `%%`(lim_1, rt_1)) -- if (C.TABLE_context[x_2.`%`.0] = `%%`(lim_2, rt_2)) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) ;; 6-typing.watsup:972.1-976.36 rule table.init{C : context, x : idx, y : idx, lim : limits, rt_1 : reftype, rt_2 : reftype}: - `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt_1)) -- if (C.ELEM_context[y.`%`.0] = rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) ;; 6-typing.watsup:978.1-980.23 rule elem.drop{C : context, x : idx, rt : reftype}: - `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) + `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`(`%`([]), `%`([]))) -- if (C.ELEM_context[x.`%`.0] = rt) ;; 6-typing.watsup:985.1-987.22 rule memory.size{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) + `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`(`%`([]), `%`([I32_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup:989.1-991.22 rule memory.grow{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) + `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`(`%`([I32_valtype]), `%`([I32_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup:993.1-995.22 rule memory.fill{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup:997.1-1000.26 rule memory.copy{C : context, x_1 : idx, x_2 : idx, mt_1 : memtype, mt_2 : memtype}: - `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.MEM_context[x_1.`%`.0] = mt_1) -- if (C.MEM_context[x_2.`%`.0] = mt_2) ;; 6-typing.watsup:1002.1-1005.23 rule memory.init{C : context, x : idx, y : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if (C.DATA_context[y.`%`.0] = OK) ;; 6-typing.watsup:1007.1-1009.23 rule data.drop{C : context, x : idx}: - `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) + `%|-%:%`(C, DATA.DROP_instr(x), `%->%`(`%`([]), `%`([]))) -- if (C.DATA_context[x.`%`.0] = OK) ;; 6-typing.watsup:1011.1-1016.29 rule load{C : context, nt : numtype, n? : n?, sx? : sx?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([(nt : numtype <: valtype)]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} @@ -3683,7 +3706,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1018.1-1023.29 rule store{C : context, nt : numtype, n? : n?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) + `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype (nt : numtype <: valtype)]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} @@ -3691,38 +3714,38 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1025.1-1028.30 rule vload{C : context, M : M, N : N, sx : sx, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ((M / 8) * N)) ;; 6-typing.watsup:1030.1-1033.26 rule vload-splat{C : context, n : n, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(SPLAT_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(SPLAT_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= (n / 8)) ;; 6-typing.watsup:1035.1-1038.25 rule vload-zero{C : context, n : n, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(ZERO_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(ZERO_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) < (n / 8)) ;; 6-typing.watsup:1040.1-1044.29 rule vload_lane{C : context, n : n, x : idx, n_A : n, n_O : n, laneidx : laneidx, mt : memtype}: - `%|-%:%`(C, VLOAD_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`([I32_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`(`%`([I32_valtype V128_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) < (n / 8)) -- if (laneidx.`%`.0 < (128 / n)) ;; 6-typing.watsup:1046.1-1049.37 rule vstore{C : context, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VSTORE_instr(x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype V128_valtype], [])) + `%|-%:%`(C, VSTORE_instr(x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype V128_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($vsize(V128_vectype) / 8)) ;; 6-typing.watsup:1051.1-1055.29 rule vstore_lane{C : context, n : n, x : idx, n_A : n, n_O : n, laneidx : laneidx, mt : memtype}: - `%|-%:%`(C, VSTORE_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`([I32_valtype V128_valtype], [])) + `%|-%:%`(C, VSTORE_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`(`%`([I32_valtype V128_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) < (n / 8)) -- if (laneidx.`%`.0 < (128 / n)) @@ -3731,51 +3754,51 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) relation Instrf_ok: `%|-%:%`(context, instr, instrtype) ;; 6-typing.watsup:518.1-520.41 rule instr{C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1 : valtype}, [], t_2*{t_2 : valtype})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, instr, `%->%%`(`%`(t_1*{t_1 : valtype}), [], `%`(t_2*{t_2 : valtype}))) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:924.1-926.28 rule local.set{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) + `%|-%:%`(C, LOCAL.SET_instr(x), `%->%%`(`%`([t]), [x], `%`([]))) -- if (C.LOCAL_context[x.`%`.0] = `%%`(init, t)) ;; 6-typing.watsup:928.1-930.28 rule local.tee{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) + `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%%`(`%`([t]), [x], `%`([t]))) -- if (C.LOCAL_context[x.`%`.0] = `%%`(init, t)) ;; 6-typing.watsup:505.1-505.74 -relation Instrs_ok: `%|-%*_:%`(context, instr*, instrtype) +relation Instrs_ok: `%|-%:%`(context, instr*, instrtype) ;; 6-typing.watsup:522.1-523.29 rule empty{C : context}: - `%|-%*_:%`(C, [], `%->%*%`([], [], [])) + `%|-%:%`(C, [], `%->%%`(`%`([]), [], `%`([]))) ;; 6-typing.watsup:525.1-530.52 rule seq{C : context, instr_1 : instr, instr_2* : instr*, t_1* : valtype*, x_1* : idx*, x_2* : idx*, t_3* : valtype*, init* : init*, t* : valtype*, C' : context, t_2* : valtype*}: - `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + `%|-%:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, `%`(t_3*{t_3 : valtype}))) -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init : init t : valtype x_1 : idx} -- if (C' = $with_locals(C, x_1*{x_1 : localidx}, `%%`(SET_init, t)*{t : valtype})) - -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2 : instr}, `%->%*%`(t_2*{t_2 : valtype}, x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C', instr_2*{instr_2 : instr}, `%->%%`(`%`(t_2*{t_2 : valtype}), x_2*{x_2 : localidx}, `%`(t_3*{t_3 : valtype}))) ;; 6-typing.watsup:532.1-535.35 rule sub{C : context, instr* : instr*, it' : instrtype, it : instrtype}: - `%|-%*_:%`(C, instr*{instr : instr}, it') - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, it) + `%|-%:%`(C, instr*{instr : instr}, it') + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, it) -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:537.1-539.47 rule frame{C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, x* : idx*, t_2* : valtype*}: - `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t*{t : valtype} :: t_1*{t_1 : valtype}, x*{x : localidx}, t*{t : valtype} :: t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`(t*{t : valtype} :: t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t*{t : valtype} :: t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) } ;; 6-typing.watsup relation Expr_ok: `%|-%:%`(context, expr, resulttype) ;; 6-typing.watsup rule _{C : context, instr* : instr*, t* : valtype*}: - `%|-%:%`(C, instr*{instr : instr}, t*{t : valtype}) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`([], [], t*{t : valtype})) + `%|-%:%`(C, instr*{instr : instr}, `%`(t*{t : valtype})) + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`([]), [], `%`(t*{t : valtype}))) ;; 6-typing.watsup rec { @@ -3840,14 +3863,14 @@ relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) ;; 6-typing.watsup rule _{C : context, expr : expr, t : valtype}: `%|-%:%CONST`(C, expr, t) - -- Expr_ok: `%|-%:%`(C, expr, [t]) + -- Expr_ok: `%|-%:%`(C, expr, `%`([t])) -- Expr_const: `%|-%CONST`(C, expr) ;; 6-typing.watsup -relation Type_ok: `%|-%:%*`(context, type, deftype*) +relation Type_ok: `%|-%:%`(context, type, deftype*) ;; 6-typing.watsup rule _{C : context, rectype : rectype, dt* : deftype*, x : idx}: - `%|-%:%*`(C, TYPE(rectype), dt*{dt : deftype}) + `%|-%:%`(C, TYPE(rectype), dt*{dt : deftype}) -- if (x = `%`(|C.TYPE_context|)) -- if (dt*{dt : deftype} = $rolldt(x, rectype)) -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt : deftype}], rectype, OK_oktypeidx(x)) @@ -3868,10 +3891,10 @@ relation Local_ok: `%|-%:%`(context, local, localtype) relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup rule _{C : context, x : idx, local* : local*, expr : expr, t_1* : valtype*, t_2* : valtype*, lt* : localtype*}: - `%|-%:%`(C, `FUNC%%*%`(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + `%|-%:%`(C, FUNC(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) -- (Local_ok: `%|-%:%`(C, local, lt))*{local : local lt : localtype} - -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2 : valtype})}, expr, t_2*{t_2 : valtype}) + -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(`%`(t_2*{t_2 : valtype}))}, expr, `%`(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -3918,7 +3941,7 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup rule _{C : context, rt : reftype, expr* : expr*, elemmode : elemmode}: - `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr : expr}, elemmode), rt) + `%|-%:%`(C, ELEM(rt, expr*{expr : expr}, elemmode), rt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr : expr} -- Elemmode_ok: `%|-%:%`(C, elemmode, rt) @@ -3938,7 +3961,7 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) relation Data_ok: `%|-%:_OK`(context, data) ;; 6-typing.watsup rule _{C : context, b* : byte*, datamode : datamode}: - `%|-%:_OK`(C, `DATA%*%`(b*{b : byte}, datamode)) + `%|-%:_OK`(C, DATA(b*{b : byte}, datamode)) -- Datamode_ok: `%|-%:_OK`(C, datamode) ;; 6-typing.watsup @@ -3946,7 +3969,7 @@ relation Start_ok: `%|-%:_OK`(context, start) ;; 6-typing.watsup rule _{C : context, x : idx}: `%|-%:_OK`(C, START(x)) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`([], []))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`([]), `%`([])))) ;; 6-typing.watsup relation Import_ok: `%|-%:%`(context, import, externtype) @@ -3988,42 +4011,42 @@ relation Export_ok: `%|-%:%`(context, export, externtype) rec { ;; 6-typing.watsup:1229.1-1229.77 -relation Globals_ok: `%|-%*_:%*`(context, global*, globaltype*) +relation Globals_ok: `%|-%:%`(context, global*, globaltype*) ;; 6-typing.watsup:1272.1-1273.17 rule empty{C : context}: - `%|-%*_:%*`(C, [], []) + `%|-%:%`(C, [], []) ;; 6-typing.watsup:1275.1-1278.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: - `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) + `%|-%:%`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) - -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) + -- Globals_ok: `%|-%:%`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) } ;; 6-typing.watsup rec { ;; 6-typing.watsup:1228.1-1228.75 -relation Types_ok: `%|-%*_:%*`(context, type*, deftype*) +relation Types_ok: `%|-%:%`(context, type*, deftype*) ;; 6-typing.watsup:1264.1-1265.17 rule empty{C : context}: - `%|-%*_:%*`(C, [], []) + `%|-%:%`(C, [], []) ;; 6-typing.watsup:1267.1-1270.49 rule cons{C : context, type_1 : type, type* : type*, dt_1 : deftype, dt* : deftype*}: - `%|-%*_:%*`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) - -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) + `%|-%:%`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) + -- Type_ok: `%|-%:%`(C, type_1, [dt_1]) + -- Types_ok: `%|-%:%`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) } ;; 6-typing.watsup relation Module_ok: `|-%:_OK`(module) ;; 6-typing.watsup rule _{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data^n : data^n, n : n, start? : start?, export* : export*, dt'* : deftype*, ixt* : externtype*, C' : context, gt* : globaltype*, tt* : tabletype*, mt* : memtype*, C : context, dt* : deftype*, rt* : reftype*, et* : externtype*, idt* : deftype*, igt* : globaltype*, itt* : tabletype*, imt* : memtype*}: - `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) - -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) + `|-%:_OK`(MODULE(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) + -- Types_ok: `%|-%:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) -- (Import_ok: `%|-%:%`({TYPE dt'*{dt' : deftype}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import : import ixt : externtype} - -- Globals_ok: `%|-%*_:%*`(C', global*{global : global}, gt*{gt : globaltype}) + -- Globals_ok: `%|-%:%`(C', global*{global : global}, gt*{gt : globaltype}) -- (Table_ok: `%|-%:%`(C', table, tt))*{table : table tt : tabletype} -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem : mem mt : memtype} -- (Func_ok: `%|-%:%`(C, func, dt))*{dt : deftype func : func} @@ -4072,314 +4095,314 @@ relation Ref_ok: `%|-%:%`(store, ref, reftype) `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) ;; 8-reduction.watsup -relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) +relation Step_pure: `%~>%`(admininstr*, admininstr*) ;; 8-reduction.watsup rule unreachable: - `%*_~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) + `%~>%`([UNREACHABLE_admininstr], [TRAP_admininstr]) ;; 8-reduction.watsup rule nop: - `%*_~>%*`([NOP_admininstr], []) + `%~>%`([NOP_admininstr], []) ;; 8-reduction.watsup rule drop{val : val}: - `%*_~>%*`([(val : val <: admininstr) DROP_admininstr], []) + `%~>%`([(val : val <: admininstr) DROP_admininstr], []) ;; 8-reduction.watsup rule select-true{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) + `%~>%`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule select-false{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) + `%~>%`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule if-true{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) + `%~>%`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule if-false{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) + `%~>%`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule label-vals{n : n, instr* : instr*, val* : val*}: - `%*_~>%*`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) + `%~>%`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) ;; 8-reduction.watsup rule br-zero{n : n, instr'* : instr*, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule br-succ{n : n, instr'* : instr*, val* : val*, l : labelidx, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) + `%~>%`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) ;; 8-reduction.watsup rule br_if-true{c : num_(I32_numtype), l : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) + `%~>%`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule br_if-false{c : num_(I32_numtype), l : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) + `%~>%`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) -- if (c = `%`(0)) ;; 8-reduction.watsup rule br_table-lt{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) -- if (i < |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_table-ge{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) -- if (i >= |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_on_null-null{val : val, l : labelidx, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) + `%~>%`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) -- if (val = REF.NULL_val(ht)) ;; 8-reduction.watsup rule br_on_null-addr{val : val, l : labelidx}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [(val : val <: admininstr)]) + `%~>%`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [(val : val <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule br_on_non_null-null{val : val, l : labelidx, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], []) + `%~>%`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], []) -- if (val = REF.NULL_val(ht)) ;; 8-reduction.watsup rule br_on_non_null-addr{val : val, l : labelidx}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], [(val : val <: admininstr) BR_admininstr(l)]) + `%~>%`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], [(val : val <: admininstr) BR_admininstr(l)]) -- otherwise ;; 8-reduction.watsup rule call_indirect-call{x : idx, y : idx}: - `%*_~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) CALL_REF_admininstr(?(y))]) + `%~>%`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) CALL_REF_admininstr(?(y))]) ;; 8-reduction.watsup rule return_call_indirect{x : idx, y : idx}: - `%*_~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) RETURN_CALL_REF_admininstr(?(y))]) + `%~>%`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) RETURN_CALL_REF_admininstr(?(y))]) ;; 8-reduction.watsup rule frame-vals{n : n, f : frame, val^n : val^n}: - `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) + `%~>%`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-frame{n : n, f : frame, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) + `%~>%`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-label{k : nat, instr'* : instr*, val* : val*, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) + `%~>%`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) ;; 8-reduction.watsup rule unop-val{nt : numtype, c_1 : num_(nt), unop : unop_(nt), c : num_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) + `%~>%`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) -- if ($unop(nt, unop, c_1) = [c]) ;; 8-reduction.watsup rule unop-trap{nt : numtype, c_1 : num_(nt), unop : unop_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) -- if ($unop(nt, unop, c_1) = []) ;; 8-reduction.watsup rule binop-val{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), binop : binop_(nt), c : num_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- if ($binop(nt, binop, c_1, c_2) = [c]) ;; 8-reduction.watsup rule binop-trap{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), binop : binop_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) -- if ($binop(nt, binop, c_1, c_2) = []) ;; 8-reduction.watsup rule testop{nt : numtype, c_1 : num_(nt), testop : testop_(nt), c : num_(I32_numtype)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $testop(nt, testop, c_1)) ;; 8-reduction.watsup rule relop{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), relop : relop_(nt), c : num_(I32_numtype)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $relop(nt, relop, c_1, c_2)) ;; 8-reduction.watsup rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?, c : num_(nt_2)}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) + `%~>%`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = [c]) ;; 8-reduction.watsup rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, `%`(i)))]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, `%`(i)))]) ;; 8-reduction.watsup rule ref.is_null-true{val : val, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- if (val = REF.NULL_val(ht)) ;; 8-reduction.watsup rule ref.is_null-false{val : val}: - `%*_~>%*`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule ref.as_non_null-null{ref : ref, ht : heaptype}: - `%*_~>%*`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) + `%~>%`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) -- if (ref = REF.NULL_ref(ht)) ;; 8-reduction.watsup rule ref.as_non_null-addr{ref : ref}: - `%*_~>%*`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [(ref : ref <: admininstr)]) + `%~>%`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [(ref : ref <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule ref.eq-null{ref_1 : ref, ref_2 : ref, ht_1 : heaptype, ht_2 : heaptype}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) ;; 8-reduction.watsup rule ref.eq-true{ref_1 : ref, ref_2 : ref}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- otherwise -- if (ref_1 = ref_2) ;; 8-reduction.watsup rule ref.eq-false{ref_1 : ref, ref_2 : ref}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule i31.get-null{ht : heaptype, sx : sx}: - `%*_~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) + `%~>%`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) ;; 8-reduction.watsup rule i31.get-num{i : nat, sx : sx}: - `%*_~>%*`([REF.I31_NUM_admininstr(`%`(i)) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, `%`(i)))]) + `%~>%`([REF.I31_NUM_admininstr(`%`(i)) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, `%`(i)))]) ;; 8-reduction.watsup rule extern.convert_any-null{ht : heaptype}: - `%*_~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) + `%~>%`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) ;; 8-reduction.watsup rule extern.convert_any-addr{addrref : addrref}: - `%*_~>%*`([(addrref : addrref <: admininstr) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) + `%~>%`([(addrref : addrref <: admininstr) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) ;; 8-reduction.watsup rule any.convert_extern-null{ht : heaptype}: - `%*_~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) + `%~>%`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) ;; 8-reduction.watsup rule any.convert_extern-addr{addrref : addrref}: - `%*_~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [(addrref : addrref <: admininstr)]) + `%~>%`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [(addrref : addrref <: admininstr)]) ;; 8-reduction.watsup rule vvunop{c_1 : vec_(V128_vnn), vvunop : vvunop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VVUNOP_admininstr(V128_vectype, vvunop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VVUNOP_admininstr(V128_vectype, vvunop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vvunop(V128_vectype, vvunop, c_1) = c) ;; 8-reduction.watsup rule vvbinop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), vvbinop : vvbinop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VVBINOP_admininstr(V128_vectype, vvbinop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VVBINOP_admininstr(V128_vectype, vvbinop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vvbinop(V128_vectype, vvbinop, c_1, c_2) = c) ;; 8-reduction.watsup rule vvternop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), c_3 : vec_(V128_vnn), vvternop : vvternop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VCONST_admininstr(V128_vectype, c_3) VVTERNOP_admininstr(V128_vectype, vvternop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VCONST_admininstr(V128_vectype, c_3) VVTERNOP_admininstr(V128_vectype, vvternop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vvternop(V128_vectype, vvternop, c_1, c_2, c_3) = c) ;; 8-reduction.watsup rule vvtestop{c_1 : vec_(V128_vnn), c : num_(I32_numtype)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VVTESTOP_admininstr(V128_vectype, ANY_TRUE_vvtestop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VVTESTOP_admininstr(V128_vectype, ANY_TRUE_vvtestop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $ine($vsize(V128_vectype), c_1, `%`(0))) ;; 8-reduction.watsup rule vswizzle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn : inn, N : N, c' : vec_(V128_vnn), c : iN($size((inn : inn <: numtype))), ci* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*, k^N : nat^N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) -- if (ci*{ci : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) -- if (c*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: `%`(0)^(256 - N){}) -- if (c' = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c*{}[ci*{ci : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))}[k].`%`.0]^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) -- if (c = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c'*{}[i*{i : nat}[k]]^(k%*`([CONST_admininstr($lunpack(lnn), c_1) VSPLAT_admininstr(`%X%`(lnn, `%`(N)))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([CONST_admininstr($lunpack(lnn), c_1) VSPLAT_admininstr(`%X%`(lnn, `%`(N)))], [VCONST_admininstr(V128_vectype, c)]) -- if (c = $invlanes_(`%X%`(lnn, `%`(N)), $packnum(lnn, c_1)^N{})) ;; 8-reduction.watsup rule vextract_lane-num{c_1 : vec_(V128_vnn), nt : numtype, N : N, i : nat, c_2 : num_(nt)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((nt : numtype <: lanetype), `%`(N)), ?(), `%`(i))], [CONST_admininstr(nt, c_2)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((nt : numtype <: lanetype), `%`(N)), ?(), `%`(i))], [CONST_admininstr(nt, c_2)]) -- if (c_2 = $lanes_(`%X%`((nt : numtype <: lanetype), `%`(N)), c_1)[i]) ;; 8-reduction.watsup rule vextract_lane-pack{c_1 : vec_(V128_vnn), pt : packtype, N : N, sx : sx, i : nat, c_2 : num_(I32_numtype)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((pt : packtype <: lanetype), `%`(N)), ?(sx), `%`(i))], [CONST_admininstr(I32_numtype, c_2)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((pt : packtype <: lanetype), `%`(N)), ?(sx), `%`(i))], [CONST_admininstr(I32_numtype, c_2)]) -- if (c_2 = $ext($psize(pt), 32, sx, $lanes_(`%X%`((pt : packtype <: lanetype), `%`(N)), c_1)[i])) ;; 8-reduction.watsup rule vreplace_lane{c_1 : vec_(V128_vnn), lnn : lnn, c_2 : num_($lunpack(lnn)), N : N, i : nat, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr($lunpack(lnn), c_2) VREPLACE_LANE_admininstr(`%X%`(lnn, `%`(N)), `%`(i))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr($lunpack(lnn), c_2) VREPLACE_LANE_admininstr(`%X%`(lnn, `%`(N)), `%`(i))], [VCONST_admininstr(V128_vectype, c)]) -- if (c = $invlanes_(`%X%`(lnn, `%`(N)), $lanes_(`%X%`(lnn, `%`(N)), c_1)[[i] = $packnum(lnn, c_2)])) ;; 8-reduction.watsup rule vunop{c_1 : vec_(V128_vnn), sh : shape, vunop : vunop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VUNOP_admininstr(sh, vunop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VUNOP_admininstr(sh, vunop)], [VCONST_admininstr(V128_vectype, c)]) -- if (c = $vunop(sh, vunop, c_1)) ;; 8-reduction.watsup rule vbinop-val{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vbinop : vbinop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vbinop(sh, vbinop, c_1, c_2) = [c]) ;; 8-reduction.watsup rule vbinop-trap{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vbinop : vbinop_(sh)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [TRAP_admininstr]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [TRAP_admininstr]) -- if ($vbinop(sh, vbinop, c_1, c_2) = []) ;; 8-reduction.watsup rule vrelop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vrelop : vrelop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VRELOP_admininstr(sh, vrelop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VRELOP_admininstr(sh, vrelop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vrelop(sh, vrelop, c_1, c_2) = c) ;; 8-reduction.watsup rule vshiftop{c_1 : vec_(V128_vnn), n : n, imm : imm, N : N, vshiftop : vshiftop_(`%X%`(imm, `%`(N))), c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1)) -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))})) ;; 8-reduction.watsup rule vtestop-true{c : vec_(V128_vnn), inn : inn, N : N, ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), inn : inn, N : N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule vbitmask{c : vec_(V128_vnn), inn : inn, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) -- if ($ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($size((inn : inn <: numtype)))}) ;; 8-reduction.watsup rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn_1 : inn, N_1 : N, inn_2 : inn, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, cj_1* : iN($size((inn_2 : inn <: numtype)))*, cj_2* : iN($size((inn_2 : inn <: numtype)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) -- if (ci_2*{ci_2 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2)) -- if (cj_1*{cj_1 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1 : iN($size((inn_1 : inn <: numtype)))}) @@ -4388,266 +4411,266 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vcvtop-normal{c_1 : vec_(V128_vnn), lnn_2 : lnn, N_2 : N, vcvtop : vcvtop, lnn_1 : lnn, N_1 : N, sx : sx, c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1)) -- if (c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-half{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, hf : half, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-zero{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} :: `%`(0)^N_1{})) ;; 8-reduction.watsup rule vextunop{c_1 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTUNOP_admininstr(sh_1, sh_2, vextunop, sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTUNOP_admininstr(sh_1, sh_2, vextunop, sx)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vextunop(sh_1, sh_2, vextunop, sx, c_1) = c) ;; 8-reduction.watsup rule vextbinop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextbinop : vextbinop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VEXTBINOP_admininstr(sh_1, sh_2, vextbinop, sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VEXTBINOP_admininstr(sh_1, sh_2, vextbinop, sx)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vextbinop(sh_1, sh_2, vextbinop, sx, c_1, c_2) = c) ;; 8-reduction.watsup rule local.tee{val : val, x : idx}: - `%*_~>%*`([(val : val <: admininstr) LOCAL.TEE_admininstr(x)], [(val : val <: admininstr) (val : val <: admininstr) LOCAL.SET_admininstr(x)]) + `%~>%`([(val : val <: admininstr) LOCAL.TEE_admininstr(x)], [(val : val <: admininstr) (val : val <: admininstr) LOCAL.SET_admininstr(x)]) ;; 8-reduction.watsup def $blocktype(state : state, blocktype : blocktype) : functype ;; 8-reduction.watsup - def $blocktype{z : state}(z, _RESULT_blocktype(?())) = `%->%`([], []) + def $blocktype{z : state}(z, _RESULT_blocktype(?())) = `%->%`(`%`([]), `%`([])) ;; 8-reduction.watsup - def $blocktype{z : state, t : valtype}(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) + def $blocktype{z : state, t : valtype}(z, _RESULT_blocktype(?(t))) = `%->%`(`%`([]), `%`([t])) ;; 8-reduction.watsup def $blocktype{z : state, x : idx, ft : functype}(z, _IDX_blocktype(x)) = ft -- Expand: `%~~%`($type(z, x), FUNC_comptype(ft)) ;; 8-reduction.watsup -relation Step_read: `%~>%*`(config, admininstr*) +relation Step_read: `%~>%`(config, admininstr*) ;; 8-reduction.watsup rule block{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, n : n, t_1^k : valtype^k, t_2^n : valtype^n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) + `%~>%`(`%;%`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(`%`(t_1^k{t_1 : valtype}), `%`(t_2^n{t_2 : valtype}))) ;; 8-reduction.watsup rule loop{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, t_1^k : valtype^k, t_2^n : valtype^n, n : n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) + `%~>%`(`%;%`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(`%`(t_1^k{t_1 : valtype}), `%`(t_2^n{t_2 : valtype}))) ;; 8-reduction.watsup rule br_on_cast-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt) -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) ;; 8-reduction.watsup rule br_on_cast-fail{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule br_on_cast_fail-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt) -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) ;; 8-reduction.watsup rule br_on_cast_fail-fail{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) -- otherwise ;; 8-reduction.watsup rule call{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) CALL_REF_admininstr(?())]) + `%~>%`(`%;%`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) CALL_REF_admininstr(?())]) ;; 8-reduction.watsup rule call_ref-null{z : state, ht : heaptype, x? : idx?}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule call_ref-func{z : state, val^n : val^n, n : n, a : addr, x? : idx?, m : m, f : frame, instr* : instr*, fi : funcinst, t_1^n : valtype^n, t_2^m : valtype^m, y : idx, t* : valtype*}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) -- if ($funcinst(z)[a] = fi) - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) - -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t : valtype}, instr*{instr : instr})) + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2^m{t_2 : valtype})))) + -- if (fi.CODE_funcinst = FUNC(y, LOCAL(t)*{t : valtype}, instr*{instr : instr})) -- if (f = {LOCAL ?(val)^n{val : val} :: $default(t)*{t : valtype}, MODULE fi.MODULE_funcinst}) ;; 8-reduction.watsup rule return_call{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) RETURN_CALL_REF_admininstr(?())]) + `%~>%`(`%;%`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) RETURN_CALL_REF_admininstr(?())]) ;; 8-reduction.watsup rule return_call_ref-label{z : state, k : nat, instr'* : instr*, val* : val*, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) + `%~>%`(`%;%`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) ;; 8-reduction.watsup rule return_call_ref-frame-addr{z : state, k : nat, f : frame, val'* : val*, val^n : val^n, n : n, a : addr, x? : idx?, instr* : instr*, t_1^n : valtype^n, t_2^m : valtype^m, m : m}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) + `%~>%`(`%;%`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2^m{t_2 : valtype})))) ;; 8-reduction.watsup rule return_call_ref-frame-null{z : state, k : nat, f : frame, val* : val*, ht : heaptype, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule ref.func{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0])]) + `%~>%`(`%;%`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0])]) ;; 8-reduction.watsup rule ref.test-true{z : state, ref : ref, rt : reftype, rt' : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(1))]) -- Ref_ok: `%|-%:%`($store(z), ref, rt') -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) ;; 8-reduction.watsup rule ref.test-false{z : state, ref : ref, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule ref.cast-succeed{z : state, ref : ref, rt : reftype, rt' : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [(ref : ref <: admininstr)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt') -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) ;; 8-reduction.watsup rule ref.cast-fail{z : state, ref : ref, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) -- otherwise ;; 8-reduction.watsup rule struct.new_default{z : state, x : idx, val* : val*, mut* : mut*, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%~>%`(`%;%`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 8-reduction.watsup rule struct.get-null{z : state, ht : heaptype, sx? : sx?, x : idx, i : nat}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) ;; 8-reduction.watsup rule struct.get-struct{z : state, a : addr, sx? : sx?, x : idx, i : nat, zt* : storagetype*, si : structinst, mut* : mut*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) + `%~>%`(`%;%`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) -- if ($structinst(z)[a] = si) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) ;; 8-reduction.watsup rule array.new{z : state, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [(val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [(val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) ;; 8-reduction.watsup rule array.new_default{z : state, n : n, x : idx, val : val, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if ($default($unpack(zt)) = ?(val)) ;; 8-reduction.watsup rule array.new_elem-oob{z : state, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) ;; 8-reduction.watsup rule array.new_elem-alloc{z : state, i : nat, n : n, x : idx, y : idx, ref^n : ref^n}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- if (ref^n{ref : ref} = $elem(z, y).ELEM_eleminst[i : n]) ;; 8-reduction.watsup rule array.new_data-oob{z : state, i : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if ((i + ((n * $zsize(zt)) / 8)) > |$data(z, y).DATA_datainst|) ;; 8-reduction.watsup rule array.new_data-num{z : state, i : nat, n : n, x : idx, y : idx, nt : numtype, c^n : num_(nt)^n, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (nt = $nunpack(zt)) -- if ($concat_(syntax byte, $nbytes(nt, c)^n{c : num_(nt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) ;; 8-reduction.watsup rule array.new_data-vec{z : state, i : nat, n : n, x : idx, y : idx, vt : vectype, c^n : vec_(vt)^n, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (vt = $vunpack(zt)) -- if ($concat_(syntax byte, $vbytes(vt, c)^n{c : vec_(vt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) ;; 8-reduction.watsup rule array.get-null{z : state, ht : heaptype, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.get-oob{z : state, a : addr, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.get-array{z : state, a : addr, i : nat, sx? : sx?, x : idx, zt : storagetype, fv : fieldval, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) ;; 8-reduction.watsup rule array.len-null{z : state, ht : heaptype}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.len-array{z : state, a : addr, n : n}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, `%`(n))]) -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.fill-null{z : state, ht : heaptype, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.fill-oob{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.fill-zero{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.fill-succ{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule array.copy-null1{z : state, ht_1 : heaptype, i_1 : nat, ref : ref, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, `%`(i_1)) (ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, `%`(i_1)) (ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.copy-null2{z : state, ref : ref, i_1 : nat, ht_2 : heaptype, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_1)) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_1)) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.copy-oob1{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.copy-oob2{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.copy-zero{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.copy-le{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) -- if (sx?{sx : sx} = $sxfield(zt_2)) @@ -4655,61 +4678,61 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.copy-gt{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) -- if (sx?{sx : sx} = $sxfield(zt_2)) ;; 8-reduction.watsup rule array.init_elem-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.init_elem-oob1{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.init_elem-oob2{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) ;; 8-reduction.watsup rule array.init_elem-zero{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.init_elem-succ{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, ref : ref}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_ELEM_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_ELEM_admininstr(x, y)]) -- otherwise -- if (ref = $elem(z, y).ELEM_eleminst[j]) ;; 8-reduction.watsup rule array.init_data-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.init_data-oob1{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.init_data-oob2{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if ((j + ((n * $zsize(zt)) / 8)) > |$data(z, y).DATA_datainst|) ;; 8-reduction.watsup rule array.init_data-zero{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.init_data-num{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, nt : numtype, c : num_(nt), zt : storagetype, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) -- otherwise -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (nt = $nunpack(zt)) @@ -4717,7 +4740,7 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.init_data-num{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, vt : vectype, c : vec_(vt), zt : storagetype, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) -- otherwise -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (vt = $vunpack((vt : vectype <: storagetype))) @@ -4725,132 +4748,132 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule local.get{z : state, x : idx, val : val}: - `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [(val : val <: admininstr)]) + `%~>%`(`%;%`(z, [LOCAL.GET_admininstr(x)]), [(val : val <: admininstr)]) -- if ($local(z, x) = ?(val)) ;; 8-reduction.watsup rule global.get{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst : val <: admininstr)]) + `%~>%`(`%;%`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst : val <: admininstr)]) ;; 8-reduction.watsup rule table.get-oob{z : state, i : nat, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) -- if (i >= |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.get-val{z : state, i : nat, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] : ref <: admininstr)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] : ref <: admininstr)]) -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.size{z : state, x : idx, n : n}: - `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) -- if (|$table(z, x).ELEM_tableinst| = n) ;; 8-reduction.watsup rule table.fill-oob{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.fill-zero{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.fill-succ{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule table.copy-oob{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) ;; 8-reduction.watsup rule table.copy-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.copy-le{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) -- otherwise -- if (j <= i) ;; 8-reduction.watsup rule table.copy-gt{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(((j + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i + n) - 1))) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(((j + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i + n) - 1))) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) -- otherwise ;; 8-reduction.watsup rule table.init-oob{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) ;; 8-reduction.watsup rule table.init-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.init-succ{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) ($elem(z, y).ELEM_eleminst[i] : ref <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.INIT_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) ($elem(z, y).ELEM_eleminst[i] : ref <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.INIT_admininstr(x, y)]) -- otherwise ;; 8-reduction.watsup rule load-num-oob{z : state, i : nat, nt : numtype, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ($size(nt) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule load-num-val{z : state, i : nat, nt : numtype, x : idx, mo : memop, c : num_(nt)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) -- if ($nbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : ($size(nt) / 8)]) ;; 8-reduction.watsup rule load-pack-oob{z : state, i : nat, inn : inn, n : n, sx : sx, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (n / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule load-pack-val{z : state, i : nat, inn : inn, n : n, sx : sx, x : idx, mo : memop, c : iN(n)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [CONST_admininstr((inn : inn <: numtype), $ext(n, $size((inn : inn <: numtype)), sx, c))]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [CONST_admininstr((inn : inn <: numtype), $ext(n, $size((inn : inn <: numtype)), sx, c))]) -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (n / 8)]) ;; 8-reduction.watsup rule vload-oob{z : state, i : nat, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ($vsize(V128_vectype) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-val{z : state, i : nat, x : idx, mo : memop, c : vec_(V128_vnn)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- if ($vbytes(V128_vectype, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : ($vsize(V128_vectype) / 8)]) ;; 8-reduction.watsup rule vload-shape-oob{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ((M * N) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-shape-val{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop, c : vec_(V128_vnn), j^N : nat^N, k^N : nat^N, inn : inn}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- (if ($ibytes(M, `%`(j)) = $mem(z, x).DATA_meminst[((i + mo.OFFSET_memop.`%`.0) + ((k * M) / 8)) : (M / 8)]))^(k%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-splat-val{z : state, i : nat, N : N, x : idx, mo : memop, c : vec_(V128_vnn), j : nat, imm : imm, M : M}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- if ($ibytes(N, `%`(j)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)]) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = (128 / N)) @@ -4858,23 +4881,23 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule vload-zero-oob{z : state, i : nat, N : N, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-zero-val{z : state, i : nat, N : N, x : idx, mo : memop, c : vec_(V128_vnn), j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- if ($ibytes(N, `%`(j)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)]) -- if (c = $ext(N, 128, U_sx, `%`(j))) ;; 8-reduction.watsup rule vload_lane-oob{z : state, i : nat, vt : vectype, c_1 : vec_(vt), N : N, x : idx, mo : memop, j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload_lane-val{z : state, i : nat, vt : vectype, c_1 : vec_(vt), N : N, x : idx, mo : memop, j : nat, c : vec_(vt), k : nat, imm : imm, M : M}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(vt, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(vt, c)]) -- if ($ibytes(N, `%`(k)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)]) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = ($vsize(vt) / N)) @@ -4882,197 +4905,197 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule memory.size{z : state, x : idx, n : n}: - `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule memory.fill-oob{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule memory.fill-zero{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.fill-succ{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule memory.copy-oob{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) ;; 8-reduction.watsup rule memory.copy-zero{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.copy-le{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise -- if (i_1 <= i_2) ;; 8-reduction.watsup rule memory.copy-gt{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise ;; 8-reduction.watsup rule memory.init-oob{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) ;; 8-reduction.watsup rule memory.init-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.init-succ{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`($data(z, y).DATA_datainst[i].`%`.0)) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.INIT_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`($data(z, y).DATA_datainst[i].`%`.0)) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.INIT_admininstr(x, y)]) -- otherwise ;; 8-reduction.watsup relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule pure{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) - -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_pure: `%~>%`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule read{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) - -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_read: `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule struct.new{z : state, val^n : val^n, n : n, x : idx, si : structinst, mut^n : mut^n, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut : mut zt : storagetype})) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%`(`%%`(mut, zt)^n{mut : mut zt : storagetype}))) -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val zt : storagetype}}) ;; 8-reduction.watsup rule struct.set-null{z : state, ht : heaptype, val : val, x : idx, i : nat}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%`(z, [TRAP_admininstr])) ;; 8-reduction.watsup rule struct.set-struct{z : state, a : addr, val : val, x : idx, i : nat, fv : fieldval, mut* : mut*, zt* : storagetype*}: - `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`($with_struct(z, a, i, fv), [])) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%~>%`(`%;%`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%`($with_struct(z, a, i, fv), [])) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) -- if (fv = $packval(zt*{zt : storagetype}[i], val)) ;; 8-reduction.watsup rule array.new_fixed{z : state, val^n : val^n, n : n, x : idx, ai : arrayinst, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val}}) ;; 8-reduction.watsup rule array.set-null{z : state, ht : heaptype, i : nat, val : val, x : idx}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) ;; 8-reduction.watsup rule array.set-oob{z : state, a : addr, i : nat, val : val, x : idx}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.set-array{z : state, a : addr, i : nat, val : val, x : idx, fv : fieldval, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`($with_array(z, a, i, fv), [])) -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) -- if (fv = $packval(zt, val)) ;; 8-reduction.watsup rule local.set{z : state, val : val, x : idx}: - `%~>%`(`%;%*`(z, [(val : val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) + `%~>%`(`%;%`(z, [(val : val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%`($with_local(z, x, val), [])) ;; 8-reduction.watsup rule global.set{z : state, val : val, x : idx}: - `%~>%`(`%;%*`(z, [(val : val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) + `%~>%`(`%;%`(z, [(val : val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%`($with_global(z, x, val), [])) ;; 8-reduction.watsup rule table.set-oob{z : state, i : nat, ref : ref, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.set-val{z : state, i : nat, ref : ref, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%`($with_table(z, x, i, ref), [])) -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.grow-succeed{z : state, ref : ref, n : n, x : idx, ti : tableinst}: - `%~>%`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, `%`(|$table(z, x).ELEM_tableinst|))])) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, `%`(|$table(z, x).ELEM_tableinst|))])) -- if (ti = $growtable($table(z, x), n, ref)) ;; 8-reduction.watsup rule table.grow-fail{z : state, ref : ref, n : n, x : idx}: - `%~>%`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) ;; 8-reduction.watsup rule elem.drop{z : state, x : idx}: - `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) + `%~>%`(`%;%`(z, [ELEM.DROP_admininstr(x)]), `%;%`($with_elem(z, x, []), [])) ;; 8-reduction.watsup rule store-num-oob{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + ($size(nt) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule store-num-val{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) -- if (b*{b : byte} = $nbytes(nt, c)) ;; 8-reduction.watsup rule store-pack-oob{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + (n / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule store-pack-val{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) -- if (b*{b : byte} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c))) ;; 8-reduction.watsup rule vstore-oob{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + ($vsize(V128_vectype) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vstore-val{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) -- if (b*{b : byte} = $vbytes(V128_vectype, c)) ;; 8-reduction.watsup rule vstore_lane-oob{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + N) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vstore_lane-val{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, b* : byte*, imm : imm, M : M}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = (128 / N)) -- if (b*{b : byte} = $ibytes(N, `%`($lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)[j].`%`.0))) ;; 8-reduction.watsup rule memory.grow-succeed{z : state, n : n, x : idx, mi : meminst}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, `%`((|$mem(z, x).DATA_meminst| / (64 * $Ki))))])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, `%`((|$mem(z, x).DATA_meminst| / (64 * $Ki))))])) -- if (mi = $growmemory($mem(z, x), n)) ;; 8-reduction.watsup rule memory.grow-fail{z : state, n : n, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) ;; 8-reduction.watsup rule data.drop{z : state, x : idx}: - `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) + `%~>%`(`%;%`(z, [DATA.DROP_admininstr(x)]), `%;%`($with_data(z, x, []), [])) ;; 8-reduction.watsup rec { @@ -5081,21 +5104,21 @@ rec { relation Steps: `%~>*%`(config, config) ;; 8-reduction.watsup:18.1-19.36 rule refl{z : state, admininstr* : admininstr*}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z, admininstr*{admininstr : admininstr})) + `%~>*%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z, admininstr*{admininstr : admininstr})) ;; 8-reduction.watsup:21.1-24.53 rule trans{z : state, admininstr* : admininstr*, z'' : state, admininstr''* : admininstr*, z' : state, admininstr' : admininstr}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) - -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z', admininstr'*{})) - -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) + `%~>*%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z'', admininstr''*{admininstr'' : admininstr})) + -- Step: `%~>%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z', admininstr'*{})) + -- Steps: `%~>*%`(`%;%`(z', [admininstr']), `%;%`(z'', admininstr''*{admininstr'' : admininstr})) } ;; 8-reduction.watsup -relation Eval_expr: `%;%~>*%;%*`(state, expr, state, val*) +relation Eval_expr: `%;%~>*%;%`(state, expr, state, val*) ;; 8-reduction.watsup rule _{z : state, instr* : instr*, z' : state, val* : val*}: - `%;%~>*%;%*`(z, instr*{instr : instr}, z', val*{val : val}) - -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z', (val : val <: admininstr)*{val : val})) + `%;%~>*%;%`(z, instr*{instr : instr}, z', val*{val : val}) + -- Steps: `%~>*%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z', (val : val <: admininstr)*{val : val})) ;; 9-module.watsup rec { @@ -5116,7 +5139,7 @@ def $alloctypes(type*) : deftype* def $allocfunc(store : store, moduleinst : moduleinst, func : func) : (store, funcaddr) ;; 9-module.watsup def $allocfunc{s : store, mm : moduleinst, func : func, fi : funcinst, x : idx, local* : local*, expr : expr}(s, mm, func) = (s[FUNC_store =.. [fi]], |s.FUNC_store|) - -- if (func = `FUNC%%*%`(x, local*{local : local}, expr)) + -- if (func = FUNC(x, local*{local : local}, expr)) -- if (fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func}) ;; 9-module.watsup @@ -5242,7 +5265,7 @@ def $instexport(funcaddr*, globaladdr*, tableaddr*, memaddr*, export : export) : def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) : (store, moduleinst) ;; 9-module.watsup def $allocmodule{s : store, module : module, externval* : externval*, val_g* : val*, ref_t* : ref*, ref_e** : ref**, s_6 : store, mm : moduleinst, type* : type*, import* : import*, func^n_f : func^n_f, n_f : n, globaltype^n_g : globaltype^n_g, expr_g^n_g : expr^n_g, n_g : n, tabletype^n_t : tabletype^n_t, expr_t^n_t : expr^n_t, n_t : n, memtype^n_m : memtype^n_m, n_m : n, reftype^n_e : reftype^n_e, expr_e*^n_e : expr*^n_e, elemmode^n_e : elemmode^n_e, n_e : n, byte*^n_d : byte*^n_d, datamode^n_d : datamode^n_d, n_d : n, start? : start?, export* : export*, fa_ex* : funcaddr*, ga_ex* : globaladdr*, ta_ex* : tableaddr*, ma_ex* : memaddr*, fa* : funcaddr*, i_f^n_f : nat^n_f, ga* : globaladdr*, i_g^n_g : nat^n_g, ta* : tableaddr*, i_t^n_t : nat^n_t, ma* : memaddr*, i_m^n_m : nat^n_m, ea* : elemaddr*, i_e^n_e : nat^n_e, da* : dataaddr*, i_d^n_d : nat^n_d, xi* : exportinst*, dt* : deftype*, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store}(s, module, externval*{externval : externval}, val_g*{val_g : val}, ref_t*{ref_t : ref}, ref_e*{ref_e : ref}*{ref_e : ref}) = (s_6, mm) - -- if (module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func^n_f{func : func}, GLOBAL(globaltype, expr_g)^n_g{expr_g : expr globaltype : globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t : expr tabletype : tabletype}, MEMORY(memtype)^n_m{memtype : memtype}, `ELEM%%*%`(reftype, expr_e*{expr_e : expr}, elemmode)^n_e{elemmode : elemmode expr_e : expr reftype : reftype}, `DATA%*%`(byte*{byte : byte}, datamode)^n_d{byte : byte datamode : datamode}, start?{start : start}, export*{export : export})) + -- if (module = MODULE(type*{type : type}, import*{import : import}, func^n_f{func : func}, GLOBAL(globaltype, expr_g)^n_g{expr_g : expr globaltype : globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t : expr tabletype : tabletype}, MEMORY(memtype)^n_m{memtype : memtype}, ELEM(reftype, expr_e*{expr_e : expr}, elemmode)^n_e{elemmode : elemmode expr_e : expr reftype : reftype}, DATA(byte*{byte : byte}, datamode)^n_d{byte : byte datamode : datamode}, start?{start : start}, export*{export : export})) -- if (fa_ex*{fa_ex : funcaddr} = $funcsxv(externval*{externval : externval})) -- if (ga_ex*{ga_ex : globaladdr} = $globalsxv(externval*{externval : externval})) -- if (ta_ex*{ta_ex : tableaddr} = $tablesxv(externval*{externval : externval})) @@ -5266,36 +5289,36 @@ def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) ;; 9-module.watsup def $runelem(elem : elem, idx : idx) : instr* ;; 9-module.watsup - def $runelem{reftype : reftype, expr* : expr*, y : idx}(`ELEM%%*%`(reftype, expr*{expr : expr}, PASSIVE_elemmode), y) = [] + def $runelem{reftype : reftype, expr* : expr*, y : idx}(ELEM(reftype, expr*{expr : expr}, PASSIVE_elemmode), y) = [] ;; 9-module.watsup - def $runelem{reftype : reftype, expr* : expr*, y : idx}(`ELEM%%*%`(reftype, expr*{expr : expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] + def $runelem{reftype : reftype, expr* : expr*, y : idx}(ELEM(reftype, expr*{expr : expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] ;; 9-module.watsup - def $runelem{reftype : reftype, expr* : expr*, x : idx, instr* : instr*, y : idx}(`ELEM%%*%`(reftype, expr*{expr : expr}, ACTIVE_elemmode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|expr*{expr : expr}|)) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] + def $runelem{reftype : reftype, expr* : expr*, x : idx, instr* : instr*, y : idx}(ELEM(reftype, expr*{expr : expr}, ACTIVE_elemmode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|expr*{expr : expr}|)) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] ;; 9-module.watsup def $rundata(data : data, idx : idx) : instr* ;; 9-module.watsup - def $rundata{byte* : byte*, y : idx}(`DATA%*%`(byte*{byte : byte}, PASSIVE_datamode), y) = [] + def $rundata{byte* : byte*, y : idx}(DATA(byte*{byte : byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup - def $rundata{byte* : byte*, x : idx, instr* : instr*, y : idx}(`DATA%*%`(byte*{byte : byte}, ACTIVE_datamode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|byte*{byte : byte}|)) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] + def $rundata{byte* : byte*, x : idx, instr* : instr*, y : idx}(DATA(byte*{byte : byte}, ACTIVE_datamode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|byte*{byte : byte}|)) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] ;; 9-module.watsup def $instantiate(store : store, module : module, externval*) : config ;; 9-module.watsup - def $instantiate{s : store, module : module, externval* : externval*, s' : store, f : frame, instr_E* : instr*, instr_D* : instr*, x? : idx?, type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start? : start?, export* : export*, globaltype* : globaltype*, expr_G* : expr*, tabletype* : tabletype*, expr_T* : expr*, reftype* : reftype*, expr_E** : expr**, elemmode* : elemmode*, n_F : n, n_E : n, n_D : n, mm_init : moduleinst, i_F^n_F : nat^n_F, z : state, val_G* : val*, ref_T* : ref*, ref_E** : ref**, mm : moduleinst, i^n_E : nat^n_E, j^n_D : nat^n_D}(s, module, externval*{externval : externval}) = `%;%*`(`%;%`(s', f), (instr_E : instr <: admininstr)*{instr_E : instr} :: (instr_D : instr <: admininstr)*{instr_D : instr} :: CALL_admininstr(x)?{x : funcidx}) - -- if (module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data*{data : data}, start?{start : start}, export*{export : export})) + def $instantiate{s : store, module : module, externval* : externval*, s' : store, f : frame, instr_E* : instr*, instr_D* : instr*, x? : idx?, type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start? : start?, export* : export*, globaltype* : globaltype*, expr_G* : expr*, tabletype* : tabletype*, expr_T* : expr*, reftype* : reftype*, expr_E** : expr**, elemmode* : elemmode*, n_F : n, n_E : n, n_D : n, mm_init : moduleinst, i_F^n_F : nat^n_F, z : state, val_G* : val*, ref_T* : ref*, ref_E** : ref**, mm : moduleinst, i^n_E : nat^n_E, j^n_D : nat^n_D}(s, module, externval*{externval : externval}) = `%;%`(`%;%`(s', f), (instr_E : instr <: admininstr)*{instr_E : instr} :: (instr_D : instr <: admininstr)*{instr_D : instr} :: CALL_admininstr(x)?{x : funcidx}) + -- if (module = MODULE(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data*{data : data}, start?{start : start}, export*{export : export})) -- if (global*{global : global} = GLOBAL(globaltype, expr_G)*{expr_G : expr globaltype : globaltype}) -- if (table*{table : table} = TABLE(tabletype, expr_T)*{expr_T : expr tabletype : tabletype}) - -- if (elem*{elem : elem} = `ELEM%%*%`(reftype, expr_E*{expr_E : expr}, elemmode)*{elemmode : elemmode expr_E : expr reftype : reftype}) + -- if (elem*{elem : elem} = ELEM(reftype, expr_E*{expr_E : expr}, elemmode)*{elemmode : elemmode expr_E : expr reftype : reftype}) -- if (start?{start : start} = START(x)?{x : funcidx}) -- if (n_F = |func*{func : func}|) -- if (n_E = |elem*{elem : elem}|) -- if (n_D = |data*{data : data}|) -- if (mm_init = {TYPE $alloctypes(type*{type : type}), FUNC $funcsxv(externval*{externval : externval}) :: (|s.FUNC_store| + i_F)^(i_F*%;%*`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} + -- (Eval_expr: `%;%~>*%;%`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} + -- (Eval_expr: `%;%~>*%;%`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} + -- (Eval_expr: `%;%~>*%;%`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} -- if ((s', mm) = $allocmodule(s, module, externval*{externval : externval}, val_G*{val_G : val}, ref_T*{ref_T : ref}, ref_E*{ref_E : ref}*{ref_E : ref})) -- if (f = {LOCAL [], MODULE mm}) -- if (instr_E*{instr_E : instr} = $concat_(syntax instr, $runelem(elem*{elem : elem}[i], `%`(i))^(i%`(t_1^n{t_1 : valtype}, t_2*{t_2 : valtype}))) - -;; A-binary.watsup -rec { - -;; A-binary.watsup:49.1-49.24 -def $utf8(name : name) : byte* - ;; A-binary.watsup:50.1-50.47 - def $utf8{ch : nat, b : byte}([`%`(ch)]) = [b] - -- if ((ch < 128) /\ (ch = b.`%`.0)) - ;; A-binary.watsup:51.1-51.96 - def $utf8{ch : nat, b_1 : byte, b_2 : byte}([`%`(ch)]) = [b_1 b_2] - -- if (((128 <= ch) /\ (ch < 2048)) /\ (ch = (((2 ^ 6) * (b_1.`%`.0 - 192)) + (b_2.`%`.0 - 128)))) - ;; A-binary.watsup:52.1-52.148 - def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte}([`%`(ch)]) = [b_1 b_2 b_3] - -- if ((((2048 <= ch) /\ (ch < 55296)) \/ ((57344 <= ch) /\ (ch < 65536))) /\ (ch = ((((2 ^ 12) * (b_1.`%`.0 - 224)) + ((2 ^ 6) * (b_2.`%`.0 - 128))) + (b_3.`%`.0 - 128)))) - ;; A-binary.watsup:53.1-53.148 - def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([`%`(ch)]) = [b_1 b_2 b_3 b_4] - -- if (((65536 <= ch) /\ (ch < 69632)) /\ (ch = (((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128)))) - ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(`%`(ch)*{ch : nat}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch : nat}) -} + -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = FUNC(x, local*{local : local}, expr)) + -- Expand: `%~~%`(s.FUNC_store[fa].TYPE_funcinst, FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; A-binary.watsup syntax castop = (nul, nul) @@ -5447,14 +5449,8 @@ def $concat_(syntax X, X**) : X* } ;; 1-syntax.watsup -syntax list{syntax X}(syntax X) = X* - -;; 1-syntax.watsup -syntax char = `%`{i : nat}(i : nat) - -- if (((i >= 0) /\ (i <= 55295)) \/ ((i >= 57344) /\ (i <= 1114111))) - -;; 1-syntax.watsup -syntax name = char* +syntax list{syntax X}(syntax X) = `%`{X* : X*}(X*{X : X} : X*) + -- if (|X*{X : X}| < (2 ^ 32)) ;; 1-syntax.watsup syntax bit = `%`{i : nat}(i : nat) @@ -5559,6 +5555,35 @@ def $canon_(N : N) : nat ;; 1-syntax.watsup syntax vN{N : N}(N) = iN(N) +;; 1-syntax.watsup +syntax char = `%`{i : nat}(i : nat) + -- if (((i >= 0) /\ (i <= 55295)) \/ ((i >= 57344) /\ (i <= 1114111))) + +;; 1-syntax.watsup +rec { + +;; 1-syntax.watsup:87.1-87.25 +def $utf8(char*) : byte* + ;; A-binary.watsup:50.1-50.47 + def $utf8{ch : char, b : byte}([ch]) = [b] + -- if ((ch.`%`.0 < 128) /\ (ch = `%`(b.`%`.0))) + ;; A-binary.watsup:51.1-51.96 + def $utf8{ch : char, b_1 : byte, b_2 : byte}([ch]) = [b_1 b_2] + -- if (((128 <= ch.`%`.0) /\ (ch.`%`.0 < 2048)) /\ (ch = `%`((((2 ^ 6) * (b_1.`%`.0 - 192)) + (b_2.`%`.0 - 128))))) + ;; A-binary.watsup:52.1-52.148 + def $utf8{ch : char, b_1 : byte, b_2 : byte, b_3 : byte}([ch]) = [b_1 b_2 b_3] + -- if ((((2048 <= ch.`%`.0) /\ (ch.`%`.0 < 55296)) \/ ((57344 <= ch.`%`.0) /\ (ch.`%`.0 < 65536))) /\ (ch = `%`(((((2 ^ 12) * (b_1.`%`.0 - 224)) + ((2 ^ 6) * (b_2.`%`.0 - 128))) + (b_3.`%`.0 - 128))))) + ;; A-binary.watsup:53.1-53.148 + def $utf8{ch : char, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([ch]) = [b_1 b_2 b_3 b_4] + -- if (((65536 <= ch.`%`.0) /\ (ch.`%`.0 < 69632)) /\ (ch = `%`((((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128))))) + ;; A-binary.watsup:54.1-54.44 + def $utf8{ch* : char*}(ch*{ch : char}) = $concat_(syntax byte, $utf8([ch])*{ch : char}) +} + +;; 1-syntax.watsup +syntax name = `%`{char* : char*}(char*{char : char} : char*) + -- if (|$utf8(char*{char : char})| < (2 ^ 32)) + ;; 1-syntax.watsup syntax idx = u32 @@ -5629,7 +5654,7 @@ syntax fin = `FINAL%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:146.1-147.14 +;; 1-syntax.watsup:147.1-148.14 syntax valtype = | I32 | I64 @@ -5639,10 +5664,10 @@ syntax valtype = | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | BOT -;; 1-syntax.watsup:154.1-155.16 +;; 1-syntax.watsup:155.1-156.16 syntax resulttype = list(syntax valtype) -;; 1-syntax.watsup:162.1-162.68 +;; 1-syntax.watsup:163.1-163.68 syntax storagetype = | BOT | I32 @@ -5654,34 +5679,34 @@ syntax storagetype = | I8 | I16 -;; 1-syntax.watsup:175.1-176.18 +;; 1-syntax.watsup:176.1-177.18 syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) -;; 1-syntax.watsup:178.1-178.70 +;; 1-syntax.watsup:179.1-179.70 syntax functype = `%->%`{resulttype : resulttype}(resulttype : resulttype, resulttype) -;; 1-syntax.watsup:179.1-179.64 +;; 1-syntax.watsup:180.1-180.64 syntax structtype = list(syntax fieldtype) -;; 1-syntax.watsup:180.1-180.53 +;; 1-syntax.watsup:181.1-181.53 syntax arraytype = fieldtype -;; 1-syntax.watsup:182.1-185.18 +;; 1-syntax.watsup:183.1-186.18 syntax comptype = | STRUCT{structtype : structtype}(structtype : structtype) | ARRAY{arraytype : arraytype}(arraytype : arraytype) | FUNC{functype : functype}(functype : functype) -;; 1-syntax.watsup:189.1-190.60 +;; 1-syntax.watsup:190.1-191.60 syntax subtype = | SUB{fin : fin, typeidx* : typeidx*, comptype : comptype}(fin : fin, typeidx*{typeidx : typeidx} : typeidx*, comptype : comptype) | SUBD{fin : fin, heaptype* : heaptype*, comptype : comptype}(fin : fin, heaptype*{heaptype : heaptype} : heaptype*, comptype : comptype) -;; 1-syntax.watsup:192.1-193.22 +;; 1-syntax.watsup:193.1-194.22 syntax rectype = | REC{list : list(syntax subtype)}(list : list(syntax subtype)) -;; 1-syntax.watsup:198.1-199.26 +;; 1-syntax.watsup:199.1-200.26 syntax heaptype = | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY @@ -6140,7 +6165,7 @@ syntax zero = `ZERO%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:522.1-534.78 +;; 1-syntax.watsup:523.1-535.78 syntax instr = | UNREACHABLE | NOP @@ -6270,7 +6295,7 @@ syntax type = TYPE{rectype : rectype}(rectype : rectype) syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) +syntax func = FUNC{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) ;; 1-syntax.watsup syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) @@ -6282,10 +6307,10 @@ syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) +syntax elem = ELEM{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) ;; 1-syntax.watsup -syntax data = `DATA%*%`{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) +syntax data = DATA{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup syntax start = START{funcidx : funcidx}(funcidx : funcidx) @@ -6304,7 +6329,7 @@ syntax export = EXPORT{name : name, externidx : externidx}(name : name, externid syntax import = IMPORT{name : name, externtype : externtype}(name : name, name, externtype : externtype) ;; 1-syntax.watsup -syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) +syntax module = MODULE{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) ;; 2-syntax-aux.watsup rec { @@ -6360,7 +6385,7 @@ def $free_dataidx_expr(expr : expr) : dataidx* ;; 2-syntax-aux.watsup def $free_dataidx_func(func : func) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) + def $free_dataidx_func{x : idx, loc* : local*, e : expr}(FUNC(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) ;; 2-syntax-aux.watsup rec { @@ -6499,7 +6524,7 @@ def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype ;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype ;; 2-syntax-aux.watsup:175.1-175.85 - def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt : fieldtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype}) + def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(`%`(yt*{yt : fieldtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype(`%`($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype})) ;; 2-syntax-aux.watsup:176.1-176.81 def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx : typevar}, ht*{ht : heaptype}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:177.1-177.78 @@ -6515,7 +6540,7 @@ def $subst_subtype(subtype : subtype, typevar*, heaptype*) : subtype ;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype ;; 2-syntax-aux.watsup:184.1-184.76 - def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st : subtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype}) + def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(`%`(st*{st : subtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype(`%`($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype})) ;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype @@ -6525,7 +6550,7 @@ def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype ;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype ;; 2-syntax-aux.watsup:189.1-189.113 - def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}, $subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype}) + def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`(`%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}), `%`($subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype})) } ;; 2-syntax-aux.watsup @@ -6578,25 +6603,25 @@ def $subst_all_deftypes(deftype*, heaptype*) : deftype* ;; 2-syntax-aux.watsup def $rollrt(typeidx : typeidx, rectype : rectype) : rectype ;; 2-syntax-aux.watsup - def $rollrt{x : idx, st^n : subtype^n, n : n, i^n : nat^n}(x, REC_rectype(st^n{st : subtype})) = REC_rectype($subst_subtype(st, $idx(`%`((x.`%`.0 + i)))^(i%*%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) +syntax instrtype = `%->%%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) ;; 6-typing.watsup syntax context = @@ -8069,16 +8094,16 @@ relation Valtype_ok: `%|-%:_OK`(context, valtype) relation Resulttype_ok: `%|-%:_OK`(context, resulttype) ;; 6-typing.watsup rule _{C : context, t* : valtype*}: - `%|-%:_OK`(C, t*{t : valtype}) + `%|-%:_OK`(C, `%`(t*{t : valtype})) -- (Valtype_ok: `%|-%:_OK`(C, t))*{t : valtype} ;; 6-typing.watsup relation Instrtype_ok: `%|-%:_OK`(context, instrtype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, x* : idx*, t_2* : valtype*, lt* : localtype*}: - `%|-%:_OK`(C, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + `%|-%:_OK`(C, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_1*{t_1 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_2*{t_2 : valtype})) -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt : localtype x : idx} ;; 6-typing.watsup @@ -8118,15 +8143,15 @@ relation Fieldtype_ok: `%|-%:_OK`(context, fieldtype) relation Functype_ok: `%|-%:_OK`(context, functype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:_OK`(C, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + `%|-%:_OK`(C, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_1*{t_1 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Comptype_ok: `%|-%:_OK`(context, comptype) ;; 6-typing.watsup rule struct{C : context, yt* : fieldtype*}: - `%|-%:_OK`(C, STRUCT_comptype(yt*{yt : fieldtype})) + `%|-%:_OK`(C, STRUCT_comptype(`%`(yt*{yt : fieldtype}))) -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt : fieldtype} ;; 6-typing.watsup @@ -8199,7 +8224,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:303.1-305.35 rule struct{C : context, deftype : deftype, yt* : fieldtype*}: `%|-%<:%`(C, (deftype : deftype <: heaptype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt : fieldtype})) + -- Expand: `%~~%`(deftype, STRUCT_comptype(`%`(yt*{yt : fieldtype}))) ;; 6-typing.watsup:307.1-309.33 rule array{C : context, deftype : deftype, yt : fieldtype}: @@ -8325,7 +8350,7 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) ;; 6-typing.watsup rule struct{C : context, yt_1* : fieldtype*, yt'_1 : fieldtype, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1 : fieldtype} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2 : fieldtype})) + `%|-%<:%`(C, STRUCT_comptype(`%`(yt_1*{yt_1 : fieldtype} :: [yt'_1])), STRUCT_comptype(`%`(yt_2*{yt_2 : fieldtype}))) -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 : fieldtype yt_2 : fieldtype} ;; 6-typing.watsup @@ -8385,13 +8410,13 @@ rec { relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) ;; 6-typing.watsup:196.1-197.24 rule empty{C : context, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) + `%|-%:%`(C, REC_rectype(`%`([])), OK_oktypeidxnat(x, i)) ;; 6-typing.watsup:199.1-202.50 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidxnat(x, i)) + `%|-%:%`(C, REC_rectype(`%`([st_1] :: st*{st : subtype})), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) - -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) } ;; 6-typing.watsup @@ -8401,18 +8426,18 @@ rec { relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) ;; 6-typing.watsup:184.1-185.23 rule empty{C : context, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) + `%|-%:%`(C, REC_rectype(`%`([])), OK_oktypeidx(x)) ;; 6-typing.watsup:187.1-190.43 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidx(x)) + `%|-%:%`(C, REC_rectype(`%`([st_1] :: st*{st : subtype})), OK_oktypeidx(x)) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) - -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) + -- Rectype_ok: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidx(`%`((x.`%`.0 + 1)))) ;; 6-typing.watsup:192.1-194.49 rule rec2{C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(x, 0)) + `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(x, 0)) } ;; 6-typing.watsup @@ -8421,7 +8446,7 @@ relation Deftype_ok: `%|-%:_OK`(context, deftype) rule _{C : context, qt : rectype, i : nat, x : idx, st^n : subtype^n, n : n}: `%|-%:_OK`(C, DEF_deftype(qt, i)) -- Rectype_ok: `%|-%:%`(C, qt, OK_oktypeidx(x)) - -- if (qt = REC_rectype(st^n{st : subtype})) + -- if (qt = REC_rectype(`%`(st^n{st : subtype}))) -- if (i < n) ;; 6-typing.watsup @@ -8477,19 +8502,19 @@ relation Externtype_ok: `%|-%:_OK`(context, externtype) -- Memtype_ok: `%|-%:_OK`(C, mt) ;; 6-typing.watsup -relation Resulttype_sub: `%|-%*_<:%*`(context, valtype*, valtype*) +relation Resulttype_sub: `%|-%<:%`(context, valtype*, valtype*) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%*_<:%*`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) + `%|-%<:%`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 : valtype t_2 : valtype} ;; 6-typing.watsup relation Instrtype_sub: `%|-%<:%`(context, instrtype, instrtype) ;; 6-typing.watsup rule _{C : context, t_11* : valtype*, x_1* : idx*, t_12* : valtype*, t_21* : valtype*, x_2* : idx*, t_22* : valtype*, x* : idx*, t* : valtype*}: - `%|-%<:%`(C, `%->%*%`(t_11*{t_11 : valtype}, x_1*{x_1 : localidx}, t_12*{t_12 : valtype}), `%->%*%`(t_21*{t_21 : valtype}, x_2*{x_2 : localidx}, t_22*{t_22 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) + `%|-%<:%`(C, `%->%%`(`%`(t_11*{t_11 : valtype}), x_1*{x_1 : localidx}, `%`(t_12*{t_12 : valtype})), `%->%%`(`%`(t_21*{t_21 : valtype}), x_2*{x_2 : localidx}, `%`(t_22*{t_22 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) + -- Resulttype_sub: `%|-%<:%`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) -- if (x*{x : idx} = $setminus(x_2*{x_2 : idx}, x_1*{x_1 : idx})) -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t : valtype x : idx} @@ -8556,11 +8581,11 @@ relation Externtype_sub: `%|-%<:%`(context, externtype, externtype) relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) ;; 6-typing.watsup rule void{C : context}: - `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) + `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`(`%`([]), `%`([]))) ;; 6-typing.watsup rule result{C : context, t : valtype}: - `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`([], [t])) + `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`(`%`([]), `%`([t]))) ;; 6-typing.watsup rule typeidx{C : context, x : idx, ft : functype}: @@ -8574,77 +8599,77 @@ rec { relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:544.1-545.34 rule unreachable{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:547.1-548.24 rule nop{C : context}: - `%|-%:%`(C, NOP_instr, `%->%`([], [])) + `%|-%:%`(C, NOP_instr, `%->%`(`%`([]), `%`([]))) ;; 6-typing.watsup:550.1-551.23 rule drop{C : context, t : valtype}: - `%|-%:%`(C, DROP_instr, `%->%`([t], [])) + `%|-%:%`(C, DROP_instr, `%->%`(`%`([t]), `%`([]))) ;; 6-typing.watsup:554.1-555.31 rule select-expl{C : context, t : valtype}: - `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) + `%|-%:%`(C, SELECT_instr(?([t])), `%->%`(`%`([t t I32_valtype]), `%`([t]))) ;; 6-typing.watsup:557.1-560.37 rule select-impl{C : context, t : valtype, t' : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) + `%|-%:%`(C, SELECT_instr(?()), `%->%`(`%`([t t I32_valtype]), `%`([t]))) -- Valtype_sub: `%|-%<:%`(C, t, t') -- if ((t' = (numtype : numtype <: valtype)) \/ (t' = (vectype : vectype <: valtype))) ;; 6-typing.watsup:578.1-581.61 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:583.1-586.61 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_1*{t_1 : valtype})], RETURN ?()}, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:588.1-592.65 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_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_2*{x_2 : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(`%`(t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_2*{x_2 : localidx}, `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:597.1-599.24 rule br{C : context, l : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) + `%|-%:%`(C, BR_instr(l), `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype})) ;; 6-typing.watsup:601.1-603.24 rule br_if{C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t : valtype} :: [I32_valtype], t*{t : valtype})) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) + `%|-%:%`(C, BR_IF_instr(l), `%->%`(`%`(t*{t : valtype} :: [I32_valtype]), `%`(t*{t : valtype}))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype})) ;; 6-typing.watsup:605.1-608.44 rule br_table{C : context, l* : labelidx*, l' : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) - -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0]))*{l : labelidx} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0]) + `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) + -- (Resulttype_sub: `%|-%<:%`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0].`%`.0))*{l : labelidx} + -- Resulttype_sub: `%|-%<:%`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0].`%`.0) ;; 6-typing.watsup:610.1-613.31 rule br_on_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(`%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)]), `%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype})) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:615.1-618.31 rule br_on_non_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype})) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]) + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(`%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)]), `%`(t*{t : valtype}))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:620.1-626.34 rule br_on_cast{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(`%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)]), `%`(t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)]))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype} :: [(rt : reftype <: valtype)])) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -8652,8 +8677,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:628.1-634.49 rule br_on_cast_fail{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [(rt_2 : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(`%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)]), `%`(t*{t : valtype} :: [(rt_2 : reftype <: valtype)]))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype} :: [(rt : reftype <: valtype)])) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -8661,414 +8686,414 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:639.1-641.24 rule return{C : context, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) - -- if (C.RETURN_context = ?(t*{t : valtype})) + `%|-%:%`(C, RETURN_instr, `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(`%`(t*{t : valtype}))) ;; 6-typing.watsup:643.1-645.46 rule call{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + `%|-%:%`(C, CALL_instr(x), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; 6-typing.watsup:647.1-649.46 rule call_ref{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2 : valtype})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(`%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`(t_2*{t_2 : valtype}))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; 6-typing.watsup:651.1-655.46 rule call_indirect{C : context, x : idx, y : idx, t_1* : valtype*, t_2* : valtype*, lim : limits, rt : reftype}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(`%`(t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_2*{t_2 : valtype}))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; 6-typing.watsup:657.1-661.40 rule return_call{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}, t_4*{t_4 : valtype})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}), `%`(t_4*{t_4 : valtype}))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:663.1-667.40 rule return_call_ref{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4 : valtype})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`(t_4*{t_4 : valtype}))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:669.1-675.40 rule return_call_indirect{C : context, x : idx, y : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, lim : limits, rt : reftype, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype], t_4*{t_4 : valtype})) + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_4*{t_4 : valtype}))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:680.1-681.33 rule const{C : context, nt : numtype, c_nt : num_(nt)}: - `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [(nt : numtype <: valtype)])) + `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`(`%`([]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:683.1-684.34 rule unop{C : context, nt : numtype, unop_nt : unop_(nt)}: - `%|-%:%`(C, UNOP_instr(nt, unop_nt), `%->%`([(nt : numtype <: valtype)], [(nt : numtype <: valtype)])) + `%|-%:%`(C, UNOP_instr(nt, unop_nt), `%->%`(`%`([(nt : numtype <: valtype)]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:686.1-687.39 rule binop{C : context, nt : numtype, binop_nt : binop_(nt)}: - `%|-%:%`(C, BINOP_instr(nt, binop_nt), `%->%`([(nt : numtype <: valtype) (nt : numtype <: valtype)], [(nt : numtype <: valtype)])) + `%|-%:%`(C, BINOP_instr(nt, binop_nt), `%->%`(`%`([(nt : numtype <: valtype) (nt : numtype <: valtype)]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:689.1-690.39 rule testop{C : context, nt : numtype, testop_nt : testop_(nt)}: - `%|-%:%`(C, TESTOP_instr(nt, testop_nt), `%->%`([(nt : numtype <: valtype)], [I32_valtype])) + `%|-%:%`(C, TESTOP_instr(nt, testop_nt), `%->%`(`%`([(nt : numtype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:692.1-693.40 rule relop{C : context, nt : numtype, relop_nt : relop_(nt)}: - `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->%`([(nt : numtype <: valtype) (nt : numtype <: valtype)], [I32_valtype])) + `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->%`(`%`([(nt : numtype <: valtype) (nt : numtype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:696.1-699.34 rule reinterpret{C : context, nt_1 : numtype, nt_2 : numtype}: - `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([(nt_2 : numtype <: valtype)], [(nt_1 : numtype <: valtype)])) + `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`(`%`([(nt_2 : numtype <: valtype)]), `%`([(nt_1 : numtype <: valtype)]))) -- if (nt_1 =/= nt_2) -- if ($size(nt_1) = $size(nt_2)) ;; 6-typing.watsup:701.1-704.50 rule convert-i{C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: - `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`(`%`([(inn_2 : inn <: valtype)]), `%`([(inn_1 : inn <: valtype)]))) -- if (inn_1 =/= inn_2) -- if ((sx?{sx : sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) ;; 6-typing.watsup:706.1-708.24 rule convert-f{C : context, fnn_1 : fnn, fnn_2 : fnn}: - `%|-%:%`(C, CVTOP_instr((fnn_1 : fnn <: numtype), CONVERT_cvtop, (fnn_2 : fnn <: numtype), ?()), `%->%`([(fnn_2 : fnn <: valtype)], [(fnn_1 : fnn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((fnn_1 : fnn <: numtype), CONVERT_cvtop, (fnn_2 : fnn <: numtype), ?()), `%->%`(`%`([(fnn_2 : fnn <: valtype)]), `%`([(fnn_1 : fnn <: valtype)]))) -- if (fnn_1 =/= fnn_2) ;; 6-typing.watsup:713.1-715.31 rule ref.null{C : context, ht : heaptype}: - `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) + `%|-%:%`(C, REF.NULL_instr(ht), `%->%`(`%`([]), `%`([REF_valtype(`NULL%?`(?(())), ht)]))) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:718.1-720.23 rule ref.func{C : context, x : idx, epsilon : resulttype, dt : deftype}: - `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), (dt : deftype <: heaptype))])) + `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, `%`([REF_valtype(`NULL%?`(?()), (dt : deftype <: heaptype))]))) -- if (C.FUNC_context[x.`%`.0] = dt) ;; 6-typing.watsup:722.1-723.34 rule ref.i31{C : context}: - `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) + `%|-%:%`(C, REF.I31_instr, `%->%`(`%`([I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), I31_heaptype)]))) ;; 6-typing.watsup:725.1-726.31 rule ref.is_null{C : context, rt : reftype}: - `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([(rt : reftype <: valtype)], [I32_valtype])) + `%|-%:%`(C, REF.IS_NULL_instr, `%->%`(`%`([(rt : reftype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:728.1-730.31 rule ref.as_non_null{C : context, ht : heaptype}: - `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) + `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ht)]), `%`([REF_valtype(`NULL%?`(?()), ht)]))) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:732.1-733.51 rule ref.eq{C : context}: - `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) + `%|-%:%`(C, REF.EQ_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:735.1-739.33 rule ref.test{C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([(rt' : reftype <: valtype)], [I32_valtype])) + `%|-%:%`(C, REF.TEST_instr(rt), `%->%`(`%`([(rt' : reftype <: valtype)]), `%`([I32_valtype]))) -- Reftype_ok: `%|-%:_OK`(C, rt) -- Reftype_ok: `%|-%:_OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') ;; 6-typing.watsup:741.1-745.33 rule ref.cast{C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.CAST_instr(rt), `%->%`([(rt' : reftype <: valtype)], [(rt : reftype <: valtype)])) + `%|-%:%`(C, REF.CAST_instr(rt), `%->%`(`%`([(rt' : reftype <: valtype)]), `%`([(rt : reftype <: valtype)]))) -- Reftype_ok: `%|-%:_OK`(C, rt) -- Reftype_ok: `%|-%:_OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') ;; 6-typing.watsup:750.1-751.42 rule i31.get{C : context, sx : sx}: - `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) + `%|-%:%`(C, I31.GET_instr(sx), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:756.1-758.43 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`(`%`($unpack(zt)*{zt : storagetype}), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) ;; 6-typing.watsup:760.1-763.39 rule struct.new_default{C : context, x : idx, zt* : storagetype*, mut* : mut*, val* : val*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`(`%`($unpack(zt)*{zt : storagetype}), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 6-typing.watsup:765.1-769.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: - `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`([$unpack(zt)]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`(mut, zt)) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:771.1-774.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: - `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)]), `%`([]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`(`MUT%?`(?(())), zt)) ;; 6-typing.watsup:779.1-781.41 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpack(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`(`%`([$unpack(zt) I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) ;; 6-typing.watsup:783.1-786.36 rule array.new_default{C : context, x : idx, mut : mut, zt : storagetype, val : val}: - `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`(`%`([I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) -- if ($default($unpack(zt)) = ?(val)) ;; 6-typing.watsup:788.1-790.41 rule array.new_fixed{C : context, x : idx, n : n, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpack(zt)], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`(`%`([$unpack(zt)]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) ;; 6-typing.watsup:792.1-795.39 rule array.new_elem{C : context, x : idx, y : idx, mut : mut, rt : reftype}: - `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, (rt : reftype <: storagetype)))) -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y.`%`.0], rt) ;; 6-typing.watsup:797.1-801.23 rule array.new_data{C : context, x : idx, y : idx, mut : mut, t : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, (t : valtype <: storagetype)))) -- if ((t = (numtype : numtype <: valtype)) \/ (t = (vectype : vectype <: valtype))) -- if (C.DATA_context[y.`%`.0] = OK) ;; 6-typing.watsup:803.1-806.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype]), `%`([$unpack(zt)]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:808.1-810.41 rule array.set{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)], [])) + `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 6-typing.watsup:812.1-814.41 rule array.len{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) + `%|-%:%`(C, ARRAY.LEN_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)]), `%`([I32_valtype]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 6-typing.watsup:816.1-818.41 rule array.fill{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype], [])) + `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 6-typing.watsup:820.1-824.40 rule array.copy{C : context, x_1 : idx, x_2 : idx, zt_1 : storagetype, mut : mut, zt_2 : storagetype}: - `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x_1.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) -- Expand: `%~~%`(C.TYPE_context[x_2.`%`.0], ARRAY_comptype(`%%`(mut, zt_2))) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) ;; 6-typing.watsup:826.1-829.43 rule array.init_elem{C : context, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) -- Storagetype_sub: `%|-%<:%`(C, (C.ELEM_context[y.`%`.0] : reftype <: storagetype), zt) ;; 6-typing.watsup:831.1-835.23 rule array.init_data{C : context, x : idx, y : idx, zt : storagetype, t : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) -- if ((t = (numtype : numtype <: valtype)) \/ (t = (vectype : vectype <: valtype))) -- if (C.DATA_context[y.`%`.0] = OK) ;; 6-typing.watsup:840.1-841.62 rule extern.convert_any{C : context, nul : nul}: - `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) + `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`(`%`([REF_valtype(nul, ANY_heaptype)]), `%`([REF_valtype(nul, EXTERN_heaptype)]))) ;; 6-typing.watsup:843.1-844.62 rule any.convert_extern{C : context, nul : nul}: - `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) + `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`(`%`([REF_valtype(nul, EXTERN_heaptype)]), `%`([REF_valtype(nul, ANY_heaptype)]))) ;; 6-typing.watsup:849.1-850.35 rule vconst{C : context, c : vec_(V128_vnn)}: - `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->%`([], [V128_valtype])) + `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->%`(`%`([]), `%`([V128_valtype]))) ;; 6-typing.watsup:852.1-853.41 rule vvunop{C : context, vvunop : vvunop}: - `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:855.1-856.48 rule vvbinop{C : context, vvbinop : vvbinop}: - `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:858.1-859.55 rule vvternop{C : context, vvternop : vvternop}: - `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->%`([V128_valtype V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->%`(`%`([V128_valtype V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:861.1-862.44 rule vvtestop{C : context, vvtestop : vvtestop}: - `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:864.1-865.33 rule vbitmask{C : context, sh : ishape}: - `%|-%:%`(C, VBITMASK_instr(sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VBITMASK_instr(sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:867.1-868.39 rule vswizzle{C : context, sh : ishape}: - `%|-%:%`(C, VSWIZZLE_instr(sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VSWIZZLE_instr(sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:870.1-872.22 rule vshuffle{C : context, imm : imm, N : N, i* : nat*}: - `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) -- (if (i < (N * 2)))*{i : nat} ;; 6-typing.watsup:874.1-875.48 rule vsplat{C : context, lnn : lnn, N : N}: - `%|-%:%`(C, VSPLAT_instr(`%X%`(lnn, `%`(N))), `%->%`([($lunpack(lnn) : numtype <: valtype)], [V128_valtype])) + `%|-%:%`(C, VSPLAT_instr(`%X%`(lnn, `%`(N))), `%->%`(`%`([($lunpack(lnn) : numtype <: valtype)]), `%`([V128_valtype]))) ;; 6-typing.watsup:878.1-880.14 rule vextract_lane{C : context, lnn : lnn, N : N, sx? : sx?, i : nat}: - `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) + `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`(`%`([V128_valtype]), `%`([($lunpack(lnn) : numtype <: valtype)]))) -- if (i < N) ;; 6-typing.watsup:882.1-884.14 rule vreplace_lane{C : context, lnn : lnn, N : N, i : nat}: - `%|-%:%`(C, VREPLACE_LANE_instr(`%X%`(lnn, `%`(N)), `%`(i)), `%->%`([V128_valtype ($lunpack(lnn) : numtype <: valtype)], [V128_valtype])) + `%|-%:%`(C, VREPLACE_LANE_instr(`%X%`(lnn, `%`(N)), `%`(i)), `%->%`(`%`([V128_valtype ($lunpack(lnn) : numtype <: valtype)]), `%`([V128_valtype]))) -- if (i < N) ;; 6-typing.watsup:886.1-887.40 rule vunop{C : context, sh : shape, vunop_sh : vunop_(sh)}: - `%|-%:%`(C, VUNOP_instr(sh, vunop_sh), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VUNOP_instr(sh, vunop_sh), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:889.1-890.47 rule vbinop{C : context, sh : shape, vbinop_sh : vbinop_(sh)}: - `%|-%:%`(C, VBINOP_instr(sh, vbinop_sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VBINOP_instr(sh, vbinop_sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:892.1-893.43 rule vtestop{C : context, sh : shape, vtestop_sh : vtestop_(sh)}: - `%|-%:%`(C, VTESTOP_instr(sh, vtestop_sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VTESTOP_instr(sh, vtestop_sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:895.1-896.47 rule vrelop{C : context, sh : shape, vrelop_sh : vrelop_(sh)}: - `%|-%:%`(C, VRELOP_instr(sh, vrelop_sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VRELOP_instr(sh, vrelop_sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:898.1-899.50 rule vshiftop{C : context, sh : ishape, vshiftop_sh : vshiftop_(sh)}: - `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop_sh), `%->%`([V128_valtype I32_valtype], [V128_valtype])) + `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop_sh), `%->%`(`%`([V128_valtype I32_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:902.1-903.55 rule vcvtop{C : context, sh : shape, vcvtop : vcvtop, hf? : half?, sx? : sx?, zero : zero}: - `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:905.1-906.44 rule vnarrow{C : context, sh : ishape, sx : sx}: - `%|-%:%`(C, VNARROW_instr(sh, sh, sx), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VNARROW_instr(sh, sh, sx), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:908.1-909.49 rule vextunop{C : context, sh : ishape, vextunop : vextunop_(sh, sh), sx : sx}: - `%|-%:%`(C, VEXTUNOP_instr(sh, sh, vextunop, sx), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VEXTUNOP_instr(sh, sh, vextunop, sx), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:911.1-912.56 rule vextbinop{C : context, sh : ishape, vextbinop : vextbinop_(sh, sh), sx : sx}: - `%|-%:%`(C, VEXTBINOP_instr(sh, sh, vextbinop, sx), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VEXTBINOP_instr(sh, sh, vextbinop, sx), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:914.1-915.33 rule vbitmask{C : context, sh : ishape}: - `%|-%:%`(C, VBITMASK_instr(sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VBITMASK_instr(sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:920.1-922.28 rule local.get{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) + `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`(`%`([]), `%`([t]))) -- if (C.LOCAL_context[x.`%`.0] = `%%`(init, t)) ;; 6-typing.watsup:935.1-937.28 rule global.get{C : context, x : idx, t : valtype, mut : mut}: - `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) + `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`(`%`([]), `%`([t]))) -- if (C.GLOBAL_context[x.`%`.0] = `%%`(mut, t)) ;; 6-typing.watsup:939.1-941.28 rule global.set{C : context, x : idx, t : valtype}: - `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) + `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`(`%`([t]), `%`([]))) -- if (C.GLOBAL_context[x.`%`.0] = `%%`(`MUT%?`(?(())), t)) ;; 6-typing.watsup:946.1-948.28 rule table.get{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [(rt : reftype <: valtype)])) + `%|-%:%`(C, TABLE.GET_instr(x), `%->%`(`%`([I32_valtype]), `%`([(rt : reftype <: valtype)]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:950.1-952.28 rule table.set{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype (rt : reftype <: valtype)], [])) + `%|-%:%`(C, TABLE.SET_instr(x), `%->%`(`%`([I32_valtype (rt : reftype <: valtype)]), `%`([]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:954.1-956.24 rule table.size{C : context, x : idx, tt : tabletype}: - `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) + `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`(`%`([]), `%`([I32_valtype]))) -- if (C.TABLE_context[x.`%`.0] = tt) ;; 6-typing.watsup:958.1-960.28 rule table.grow{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([(rt : reftype <: valtype) I32_valtype], [I32_valtype])) + `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`(`%`([(rt : reftype <: valtype) I32_valtype]), `%`([I32_valtype]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:962.1-964.28 rule table.fill{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype (rt : reftype <: valtype) I32_valtype], [])) + `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`(`%`([I32_valtype (rt : reftype <: valtype) I32_valtype]), `%`([]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:966.1-970.36 rule table.copy{C : context, x_1 : idx, x_2 : idx, lim_1 : limits, rt_1 : reftype, lim_2 : limits, rt_2 : reftype}: - `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.TABLE_context[x_1.`%`.0] = `%%`(lim_1, rt_1)) -- if (C.TABLE_context[x_2.`%`.0] = `%%`(lim_2, rt_2)) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) ;; 6-typing.watsup:972.1-976.36 rule table.init{C : context, x : idx, y : idx, lim : limits, rt_1 : reftype, rt_2 : reftype}: - `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt_1)) -- if (C.ELEM_context[y.`%`.0] = rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) ;; 6-typing.watsup:978.1-980.23 rule elem.drop{C : context, x : idx, rt : reftype}: - `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) + `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`(`%`([]), `%`([]))) -- if (C.ELEM_context[x.`%`.0] = rt) ;; 6-typing.watsup:985.1-987.22 rule memory.size{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) + `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`(`%`([]), `%`([I32_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup:989.1-991.22 rule memory.grow{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) + `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`(`%`([I32_valtype]), `%`([I32_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup:993.1-995.22 rule memory.fill{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup:997.1-1000.26 rule memory.copy{C : context, x_1 : idx, x_2 : idx, mt_1 : memtype, mt_2 : memtype}: - `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.MEM_context[x_1.`%`.0] = mt_1) -- if (C.MEM_context[x_2.`%`.0] = mt_2) ;; 6-typing.watsup:1002.1-1005.23 rule memory.init{C : context, x : idx, y : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if (C.DATA_context[y.`%`.0] = OK) ;; 6-typing.watsup:1007.1-1009.23 rule data.drop{C : context, x : idx}: - `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) + `%|-%:%`(C, DATA.DROP_instr(x), `%->%`(`%`([]), `%`([]))) -- if (C.DATA_context[x.`%`.0] = OK) ;; 6-typing.watsup:1011.1-1016.29 rule load{C : context, nt : numtype, n? : n?, sx? : sx?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([(nt : numtype <: valtype)]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} @@ -9076,7 +9101,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1018.1-1023.29 rule store{C : context, nt : numtype, n? : n?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) + `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype (nt : numtype <: valtype)]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} @@ -9084,38 +9109,38 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1025.1-1028.30 rule vload{C : context, M : M, N : N, sx : sx, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ((M / 8) * N)) ;; 6-typing.watsup:1030.1-1033.26 rule vload-splat{C : context, n : n, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(SPLAT_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(SPLAT_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= (n / 8)) ;; 6-typing.watsup:1035.1-1038.25 rule vload-zero{C : context, n : n, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(ZERO_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(ZERO_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) < (n / 8)) ;; 6-typing.watsup:1040.1-1044.29 rule vload_lane{C : context, n : n, x : idx, n_A : n, n_O : n, laneidx : laneidx, mt : memtype}: - `%|-%:%`(C, VLOAD_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`([I32_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`(`%`([I32_valtype V128_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) < (n / 8)) -- if (laneidx.`%`.0 < (128 / n)) ;; 6-typing.watsup:1046.1-1049.37 rule vstore{C : context, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VSTORE_instr(x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype V128_valtype], [])) + `%|-%:%`(C, VSTORE_instr(x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype V128_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($vsize(V128_vectype) / 8)) ;; 6-typing.watsup:1051.1-1055.29 rule vstore_lane{C : context, n : n, x : idx, n_A : n, n_O : n, laneidx : laneidx, mt : memtype}: - `%|-%:%`(C, VSTORE_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`([I32_valtype V128_valtype], [])) + `%|-%:%`(C, VSTORE_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`(`%`([I32_valtype V128_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) < (n / 8)) -- if (laneidx.`%`.0 < (128 / n)) @@ -9124,51 +9149,51 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) relation Instrf_ok: `%|-%:%`(context, instr, instrtype) ;; 6-typing.watsup:518.1-520.41 rule instr{C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1 : valtype}, [], t_2*{t_2 : valtype})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, instr, `%->%%`(`%`(t_1*{t_1 : valtype}), [], `%`(t_2*{t_2 : valtype}))) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:924.1-926.28 rule local.set{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) + `%|-%:%`(C, LOCAL.SET_instr(x), `%->%%`(`%`([t]), [x], `%`([]))) -- if (C.LOCAL_context[x.`%`.0] = `%%`(init, t)) ;; 6-typing.watsup:928.1-930.28 rule local.tee{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) + `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%%`(`%`([t]), [x], `%`([t]))) -- if (C.LOCAL_context[x.`%`.0] = `%%`(init, t)) ;; 6-typing.watsup:505.1-505.74 -relation Instrs_ok: `%|-%*_:%`(context, instr*, instrtype) +relation Instrs_ok: `%|-%:%`(context, instr*, instrtype) ;; 6-typing.watsup:522.1-523.29 rule empty{C : context}: - `%|-%*_:%`(C, [], `%->%*%`([], [], [])) + `%|-%:%`(C, [], `%->%%`(`%`([]), [], `%`([]))) ;; 6-typing.watsup:525.1-530.52 rule seq{C : context, instr_1 : instr, instr_2* : instr*, t_1* : valtype*, x_1* : idx*, x_2* : idx*, t_3* : valtype*, init* : init*, t* : valtype*, C' : context, t_2* : valtype*}: - `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + `%|-%:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, `%`(t_3*{t_3 : valtype}))) -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init : init t : valtype x_1 : idx} -- if (C' = $with_locals(C, x_1*{x_1 : localidx}, `%%`(SET_init, t)*{t : valtype})) - -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2 : instr}, `%->%*%`(t_2*{t_2 : valtype}, x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C', instr_2*{instr_2 : instr}, `%->%%`(`%`(t_2*{t_2 : valtype}), x_2*{x_2 : localidx}, `%`(t_3*{t_3 : valtype}))) ;; 6-typing.watsup:532.1-535.35 rule sub{C : context, instr* : instr*, it' : instrtype, it : instrtype}: - `%|-%*_:%`(C, instr*{instr : instr}, it') - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, it) + `%|-%:%`(C, instr*{instr : instr}, it') + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, it) -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:537.1-539.47 rule frame{C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, x* : idx*, t_2* : valtype*}: - `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t*{t : valtype} :: t_1*{t_1 : valtype}, x*{x : localidx}, t*{t : valtype} :: t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`(t*{t : valtype} :: t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t*{t : valtype} :: t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) } ;; 6-typing.watsup relation Expr_ok: `%|-%:%`(context, expr, resulttype) ;; 6-typing.watsup rule _{C : context, instr* : instr*, t* : valtype*}: - `%|-%:%`(C, instr*{instr : instr}, t*{t : valtype}) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`([], [], t*{t : valtype})) + `%|-%:%`(C, instr*{instr : instr}, `%`(t*{t : valtype})) + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`([]), [], `%`(t*{t : valtype}))) ;; 6-typing.watsup rec { @@ -9233,14 +9258,14 @@ relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) ;; 6-typing.watsup rule _{C : context, expr : expr, t : valtype}: `%|-%:%CONST`(C, expr, t) - -- Expr_ok: `%|-%:%`(C, expr, [t]) + -- Expr_ok: `%|-%:%`(C, expr, `%`([t])) -- Expr_const: `%|-%CONST`(C, expr) ;; 6-typing.watsup -relation Type_ok: `%|-%:%*`(context, type, deftype*) +relation Type_ok: `%|-%:%`(context, type, deftype*) ;; 6-typing.watsup rule _{C : context, rectype : rectype, dt* : deftype*, x : idx}: - `%|-%:%*`(C, TYPE(rectype), dt*{dt : deftype}) + `%|-%:%`(C, TYPE(rectype), dt*{dt : deftype}) -- if (x = `%`(|C.TYPE_context|)) -- if (dt*{dt : deftype} = $rolldt(x, rectype)) -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt : deftype}], rectype, OK_oktypeidx(x)) @@ -9261,10 +9286,10 @@ relation Local_ok: `%|-%:%`(context, local, localtype) relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup rule _{C : context, x : idx, local* : local*, expr : expr, t_1* : valtype*, t_2* : valtype*, lt* : localtype*}: - `%|-%:%`(C, `FUNC%%*%`(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + `%|-%:%`(C, FUNC(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) -- (Local_ok: `%|-%:%`(C, local, lt))*{local : local lt : localtype} - -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2 : valtype})}, expr, t_2*{t_2 : valtype}) + -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(`%`(t_2*{t_2 : valtype}))}, expr, `%`(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -9311,7 +9336,7 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup rule _{C : context, rt : reftype, expr* : expr*, elemmode : elemmode}: - `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr : expr}, elemmode), rt) + `%|-%:%`(C, ELEM(rt, expr*{expr : expr}, elemmode), rt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr : expr} -- Elemmode_ok: `%|-%:%`(C, elemmode, rt) @@ -9331,7 +9356,7 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) relation Data_ok: `%|-%:_OK`(context, data) ;; 6-typing.watsup rule _{C : context, b* : byte*, datamode : datamode}: - `%|-%:_OK`(C, `DATA%*%`(b*{b : byte}, datamode)) + `%|-%:_OK`(C, DATA(b*{b : byte}, datamode)) -- Datamode_ok: `%|-%:_OK`(C, datamode) ;; 6-typing.watsup @@ -9339,7 +9364,7 @@ relation Start_ok: `%|-%:_OK`(context, start) ;; 6-typing.watsup rule _{C : context, x : idx}: `%|-%:_OK`(C, START(x)) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`([], []))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`([]), `%`([])))) ;; 6-typing.watsup relation Import_ok: `%|-%:%`(context, import, externtype) @@ -9381,42 +9406,42 @@ relation Export_ok: `%|-%:%`(context, export, externtype) rec { ;; 6-typing.watsup:1229.1-1229.77 -relation Globals_ok: `%|-%*_:%*`(context, global*, globaltype*) +relation Globals_ok: `%|-%:%`(context, global*, globaltype*) ;; 6-typing.watsup:1272.1-1273.17 rule empty{C : context}: - `%|-%*_:%*`(C, [], []) + `%|-%:%`(C, [], []) ;; 6-typing.watsup:1275.1-1278.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: - `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) + `%|-%:%`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) - -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) + -- Globals_ok: `%|-%:%`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) } ;; 6-typing.watsup rec { ;; 6-typing.watsup:1228.1-1228.75 -relation Types_ok: `%|-%*_:%*`(context, type*, deftype*) +relation Types_ok: `%|-%:%`(context, type*, deftype*) ;; 6-typing.watsup:1264.1-1265.17 rule empty{C : context}: - `%|-%*_:%*`(C, [], []) + `%|-%:%`(C, [], []) ;; 6-typing.watsup:1267.1-1270.49 rule cons{C : context, type_1 : type, type* : type*, dt_1 : deftype, dt* : deftype*}: - `%|-%*_:%*`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) - -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) + `%|-%:%`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) + -- Type_ok: `%|-%:%`(C, type_1, [dt_1]) + -- Types_ok: `%|-%:%`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) } ;; 6-typing.watsup relation Module_ok: `|-%:_OK`(module) ;; 6-typing.watsup rule _{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data^n : data^n, n : n, start? : start?, export* : export*, dt'* : deftype*, ixt* : externtype*, C' : context, gt* : globaltype*, tt* : tabletype*, mt* : memtype*, C : context, dt* : deftype*, rt* : reftype*, et* : externtype*, idt* : deftype*, igt* : globaltype*, itt* : tabletype*, imt* : memtype*}: - `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) - -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) + `|-%:_OK`(MODULE(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) + -- Types_ok: `%|-%:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) -- (Import_ok: `%|-%:%`({TYPE dt'*{dt' : deftype}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import : import ixt : externtype} - -- Globals_ok: `%|-%*_:%*`(C', global*{global : global}, gt*{gt : globaltype}) + -- Globals_ok: `%|-%:%`(C', global*{global : global}, gt*{gt : globaltype}) -- (Table_ok: `%|-%:%`(C', table, tt))*{table : table tt : tabletype} -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem : mem mt : memtype} -- (Func_ok: `%|-%:%`(C, func, dt))*{dt : deftype func : func} @@ -9465,314 +9490,314 @@ relation Ref_ok: `%|-%:%`(store, ref, reftype) `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) ;; 8-reduction.watsup -relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) +relation Step_pure: `%~>%`(admininstr*, admininstr*) ;; 8-reduction.watsup rule unreachable: - `%*_~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) + `%~>%`([UNREACHABLE_admininstr], [TRAP_admininstr]) ;; 8-reduction.watsup rule nop: - `%*_~>%*`([NOP_admininstr], []) + `%~>%`([NOP_admininstr], []) ;; 8-reduction.watsup rule drop{val : val}: - `%*_~>%*`([(val : val <: admininstr) DROP_admininstr], []) + `%~>%`([(val : val <: admininstr) DROP_admininstr], []) ;; 8-reduction.watsup rule select-true{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) + `%~>%`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule select-false{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) + `%~>%`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule if-true{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) + `%~>%`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule if-false{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) + `%~>%`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule label-vals{n : n, instr* : instr*, val* : val*}: - `%*_~>%*`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) + `%~>%`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) ;; 8-reduction.watsup rule br-zero{n : n, instr'* : instr*, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule br-succ{n : n, instr'* : instr*, val* : val*, l : labelidx, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) + `%~>%`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) ;; 8-reduction.watsup rule br_if-true{c : num_(I32_numtype), l : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) + `%~>%`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule br_if-false{c : num_(I32_numtype), l : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) + `%~>%`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) -- if (c = `%`(0)) ;; 8-reduction.watsup rule br_table-lt{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) -- if (i < |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_table-ge{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) -- if (i >= |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_on_null-null{val : val, l : labelidx, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) + `%~>%`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) -- if (val = REF.NULL_val(ht)) ;; 8-reduction.watsup rule br_on_null-addr{val : val, l : labelidx}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [(val : val <: admininstr)]) + `%~>%`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [(val : val <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule br_on_non_null-null{val : val, l : labelidx, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], []) + `%~>%`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], []) -- if (val = REF.NULL_val(ht)) ;; 8-reduction.watsup rule br_on_non_null-addr{val : val, l : labelidx}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], [(val : val <: admininstr) BR_admininstr(l)]) + `%~>%`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], [(val : val <: admininstr) BR_admininstr(l)]) -- otherwise ;; 8-reduction.watsup rule call_indirect-call{x : idx, y : idx}: - `%*_~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) CALL_REF_admininstr(?(y))]) + `%~>%`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) CALL_REF_admininstr(?(y))]) ;; 8-reduction.watsup rule return_call_indirect{x : idx, y : idx}: - `%*_~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) RETURN_CALL_REF_admininstr(?(y))]) + `%~>%`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) RETURN_CALL_REF_admininstr(?(y))]) ;; 8-reduction.watsup rule frame-vals{n : n, f : frame, val^n : val^n}: - `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) + `%~>%`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-frame{n : n, f : frame, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) + `%~>%`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-label{k : nat, instr'* : instr*, val* : val*, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) + `%~>%`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) ;; 8-reduction.watsup rule unop-val{nt : numtype, c_1 : num_(nt), unop : unop_(nt), c : num_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) + `%~>%`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) -- if ($unop(nt, unop, c_1) = [c]) ;; 8-reduction.watsup rule unop-trap{nt : numtype, c_1 : num_(nt), unop : unop_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) -- if ($unop(nt, unop, c_1) = []) ;; 8-reduction.watsup rule binop-val{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), binop : binop_(nt), c : num_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- if ($binop(nt, binop, c_1, c_2) = [c]) ;; 8-reduction.watsup rule binop-trap{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), binop : binop_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) -- if ($binop(nt, binop, c_1, c_2) = []) ;; 8-reduction.watsup rule testop{nt : numtype, c_1 : num_(nt), testop : testop_(nt), c : num_(I32_numtype)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $testop(nt, testop, c_1)) ;; 8-reduction.watsup rule relop{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), relop : relop_(nt), c : num_(I32_numtype)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $relop(nt, relop, c_1, c_2)) ;; 8-reduction.watsup rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?, c : num_(nt_2)}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) + `%~>%`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = [c]) ;; 8-reduction.watsup rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, `%`(i)))]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, `%`(i)))]) ;; 8-reduction.watsup rule ref.is_null-true{val : val, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- if (val = REF.NULL_val(ht)) ;; 8-reduction.watsup rule ref.is_null-false{val : val}: - `%*_~>%*`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule ref.as_non_null-null{ref : ref, ht : heaptype}: - `%*_~>%*`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) + `%~>%`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) -- if (ref = REF.NULL_ref(ht)) ;; 8-reduction.watsup rule ref.as_non_null-addr{ref : ref}: - `%*_~>%*`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [(ref : ref <: admininstr)]) + `%~>%`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [(ref : ref <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule ref.eq-null{ref_1 : ref, ref_2 : ref, ht_1 : heaptype, ht_2 : heaptype}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) ;; 8-reduction.watsup rule ref.eq-true{ref_1 : ref, ref_2 : ref}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- otherwise -- if (ref_1 = ref_2) ;; 8-reduction.watsup rule ref.eq-false{ref_1 : ref, ref_2 : ref}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule i31.get-null{ht : heaptype, sx : sx}: - `%*_~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) + `%~>%`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) ;; 8-reduction.watsup rule i31.get-num{i : nat, sx : sx}: - `%*_~>%*`([REF.I31_NUM_admininstr(`%`(i)) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, `%`(i)))]) + `%~>%`([REF.I31_NUM_admininstr(`%`(i)) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, `%`(i)))]) ;; 8-reduction.watsup rule extern.convert_any-null{ht : heaptype}: - `%*_~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) + `%~>%`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) ;; 8-reduction.watsup rule extern.convert_any-addr{addrref : addrref}: - `%*_~>%*`([(addrref : addrref <: admininstr) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) + `%~>%`([(addrref : addrref <: admininstr) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) ;; 8-reduction.watsup rule any.convert_extern-null{ht : heaptype}: - `%*_~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) + `%~>%`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) ;; 8-reduction.watsup rule any.convert_extern-addr{addrref : addrref}: - `%*_~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [(addrref : addrref <: admininstr)]) + `%~>%`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [(addrref : addrref <: admininstr)]) ;; 8-reduction.watsup rule vvunop{c_1 : vec_(V128_vnn), vvunop : vvunop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VVUNOP_admininstr(V128_vectype, vvunop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VVUNOP_admininstr(V128_vectype, vvunop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vvunop(V128_vectype, vvunop, c_1) = c) ;; 8-reduction.watsup rule vvbinop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), vvbinop : vvbinop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VVBINOP_admininstr(V128_vectype, vvbinop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VVBINOP_admininstr(V128_vectype, vvbinop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vvbinop(V128_vectype, vvbinop, c_1, c_2) = c) ;; 8-reduction.watsup rule vvternop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), c_3 : vec_(V128_vnn), vvternop : vvternop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VCONST_admininstr(V128_vectype, c_3) VVTERNOP_admininstr(V128_vectype, vvternop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VCONST_admininstr(V128_vectype, c_3) VVTERNOP_admininstr(V128_vectype, vvternop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vvternop(V128_vectype, vvternop, c_1, c_2, c_3) = c) ;; 8-reduction.watsup rule vvtestop{c_1 : vec_(V128_vnn), c : num_(I32_numtype)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VVTESTOP_admininstr(V128_vectype, ANY_TRUE_vvtestop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VVTESTOP_admininstr(V128_vectype, ANY_TRUE_vvtestop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $ine($vsize(V128_vectype), c_1, `%`(0))) ;; 8-reduction.watsup rule vswizzle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn : inn, N : N, c' : vec_(V128_vnn), c : iN($size((inn : inn <: numtype))), ci* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*, k^N : nat^N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) -- if (ci*{ci : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) -- if (c*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: `%`(0)^(256 - N){}) -- if (c' = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c*{}[ci*{ci : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))}[k].`%`.0]^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) -- if (c = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c'*{}[i*{i : nat}[k]]^(k%*`([CONST_admininstr($lunpack(lnn), c_1) VSPLAT_admininstr(`%X%`(lnn, `%`(N)))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([CONST_admininstr($lunpack(lnn), c_1) VSPLAT_admininstr(`%X%`(lnn, `%`(N)))], [VCONST_admininstr(V128_vectype, c)]) -- if (c = $invlanes_(`%X%`(lnn, `%`(N)), $packnum(lnn, c_1)^N{})) ;; 8-reduction.watsup rule vextract_lane-num{c_1 : vec_(V128_vnn), nt : numtype, N : N, i : nat, c_2 : num_(nt)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((nt : numtype <: lanetype), `%`(N)), ?(), `%`(i))], [CONST_admininstr(nt, c_2)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((nt : numtype <: lanetype), `%`(N)), ?(), `%`(i))], [CONST_admininstr(nt, c_2)]) -- if (c_2 = $lanes_(`%X%`((nt : numtype <: lanetype), `%`(N)), c_1)[i]) ;; 8-reduction.watsup rule vextract_lane-pack{c_1 : vec_(V128_vnn), pt : packtype, N : N, sx : sx, i : nat, c_2 : num_(I32_numtype)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((pt : packtype <: lanetype), `%`(N)), ?(sx), `%`(i))], [CONST_admininstr(I32_numtype, c_2)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((pt : packtype <: lanetype), `%`(N)), ?(sx), `%`(i))], [CONST_admininstr(I32_numtype, c_2)]) -- if (c_2 = $ext($psize(pt), 32, sx, $lanes_(`%X%`((pt : packtype <: lanetype), `%`(N)), c_1)[i])) ;; 8-reduction.watsup rule vreplace_lane{c_1 : vec_(V128_vnn), lnn : lnn, c_2 : num_($lunpack(lnn)), N : N, i : nat, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr($lunpack(lnn), c_2) VREPLACE_LANE_admininstr(`%X%`(lnn, `%`(N)), `%`(i))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr($lunpack(lnn), c_2) VREPLACE_LANE_admininstr(`%X%`(lnn, `%`(N)), `%`(i))], [VCONST_admininstr(V128_vectype, c)]) -- if (c = $invlanes_(`%X%`(lnn, `%`(N)), $lanes_(`%X%`(lnn, `%`(N)), c_1)[[i] = $packnum(lnn, c_2)])) ;; 8-reduction.watsup rule vunop{c_1 : vec_(V128_vnn), sh : shape, vunop : vunop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VUNOP_admininstr(sh, vunop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VUNOP_admininstr(sh, vunop)], [VCONST_admininstr(V128_vectype, c)]) -- if (c = $vunop(sh, vunop, c_1)) ;; 8-reduction.watsup rule vbinop-val{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vbinop : vbinop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vbinop(sh, vbinop, c_1, c_2) = [c]) ;; 8-reduction.watsup rule vbinop-trap{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vbinop : vbinop_(sh)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [TRAP_admininstr]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [TRAP_admininstr]) -- if ($vbinop(sh, vbinop, c_1, c_2) = []) ;; 8-reduction.watsup rule vrelop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vrelop : vrelop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VRELOP_admininstr(sh, vrelop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VRELOP_admininstr(sh, vrelop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vrelop(sh, vrelop, c_1, c_2) = c) ;; 8-reduction.watsup rule vshiftop{c_1 : vec_(V128_vnn), n : n, imm : imm, N : N, vshiftop : vshiftop_(`%X%`(imm, `%`(N))), c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1)) -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))})) ;; 8-reduction.watsup rule vtestop-true{c : vec_(V128_vnn), inn : inn, N : N, ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), inn : inn, N : N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule vbitmask{c : vec_(V128_vnn), inn : inn, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) -- if ($ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($size((inn : inn <: numtype)))}) ;; 8-reduction.watsup rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn_1 : inn, N_1 : N, inn_2 : inn, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, cj_1* : iN($size((inn_2 : inn <: numtype)))*, cj_2* : iN($size((inn_2 : inn <: numtype)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) -- if (ci_2*{ci_2 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2)) -- if (cj_1*{cj_1 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1 : iN($size((inn_1 : inn <: numtype)))}) @@ -9781,266 +9806,266 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vcvtop-normal{c_1 : vec_(V128_vnn), lnn_2 : lnn, N_2 : N, vcvtop : vcvtop, lnn_1 : lnn, N_1 : N, sx : sx, c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1)) -- if (c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-half{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, hf : half, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-zero{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} :: `%`(0)^N_1{})) ;; 8-reduction.watsup rule vextunop{c_1 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTUNOP_admininstr(sh_1, sh_2, vextunop, sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTUNOP_admininstr(sh_1, sh_2, vextunop, sx)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vextunop(sh_1, sh_2, vextunop, sx, c_1) = c) ;; 8-reduction.watsup rule vextbinop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextbinop : vextbinop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VEXTBINOP_admininstr(sh_1, sh_2, vextbinop, sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VEXTBINOP_admininstr(sh_1, sh_2, vextbinop, sx)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vextbinop(sh_1, sh_2, vextbinop, sx, c_1, c_2) = c) ;; 8-reduction.watsup rule local.tee{val : val, x : idx}: - `%*_~>%*`([(val : val <: admininstr) LOCAL.TEE_admininstr(x)], [(val : val <: admininstr) (val : val <: admininstr) LOCAL.SET_admininstr(x)]) + `%~>%`([(val : val <: admininstr) LOCAL.TEE_admininstr(x)], [(val : val <: admininstr) (val : val <: admininstr) LOCAL.SET_admininstr(x)]) ;; 8-reduction.watsup def $blocktype(state : state, blocktype : blocktype) : functype ;; 8-reduction.watsup - def $blocktype{z : state}(z, _RESULT_blocktype(?())) = `%->%`([], []) + def $blocktype{z : state}(z, _RESULT_blocktype(?())) = `%->%`(`%`([]), `%`([])) ;; 8-reduction.watsup - def $blocktype{z : state, t : valtype}(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) + def $blocktype{z : state, t : valtype}(z, _RESULT_blocktype(?(t))) = `%->%`(`%`([]), `%`([t])) ;; 8-reduction.watsup def $blocktype{z : state, x : idx, ft : functype}(z, _IDX_blocktype(x)) = ft -- Expand: `%~~%`($type(z, x), FUNC_comptype(ft)) ;; 8-reduction.watsup -relation Step_read: `%~>%*`(config, admininstr*) +relation Step_read: `%~>%`(config, admininstr*) ;; 8-reduction.watsup rule block{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, n : n, t_1^k : valtype^k, t_2^n : valtype^n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) + `%~>%`(`%;%`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(`%`(t_1^k{t_1 : valtype}), `%`(t_2^n{t_2 : valtype}))) ;; 8-reduction.watsup rule loop{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, t_1^k : valtype^k, t_2^n : valtype^n, n : n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) + `%~>%`(`%;%`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(`%`(t_1^k{t_1 : valtype}), `%`(t_2^n{t_2 : valtype}))) ;; 8-reduction.watsup rule br_on_cast-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt) -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) ;; 8-reduction.watsup rule br_on_cast-fail{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule br_on_cast_fail-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt) -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) ;; 8-reduction.watsup rule br_on_cast_fail-fail{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) -- otherwise ;; 8-reduction.watsup rule call{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) CALL_REF_admininstr(?())]) + `%~>%`(`%;%`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) CALL_REF_admininstr(?())]) ;; 8-reduction.watsup rule call_ref-null{z : state, ht : heaptype, x? : idx?}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule call_ref-func{z : state, val^n : val^n, n : n, a : addr, x? : idx?, m : m, f : frame, instr* : instr*, fi : funcinst, t_1^n : valtype^n, t_2^m : valtype^m, y : idx, t* : valtype*}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) -- if ($funcinst(z)[a] = fi) - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) - -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t : valtype}, instr*{instr : instr})) + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2^m{t_2 : valtype})))) + -- if (fi.CODE_funcinst = FUNC(y, LOCAL(t)*{t : valtype}, instr*{instr : instr})) -- if (f = {LOCAL ?(val)^n{val : val} :: $default(t)*{t : valtype}, MODULE fi.MODULE_funcinst}) ;; 8-reduction.watsup rule return_call{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) RETURN_CALL_REF_admininstr(?())]) + `%~>%`(`%;%`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) RETURN_CALL_REF_admininstr(?())]) ;; 8-reduction.watsup rule return_call_ref-label{z : state, k : nat, instr'* : instr*, val* : val*, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) + `%~>%`(`%;%`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) ;; 8-reduction.watsup rule return_call_ref-frame-addr{z : state, k : nat, f : frame, val'* : val*, val^n : val^n, n : n, a : addr, x? : idx?, instr* : instr*, t_1^n : valtype^n, t_2^m : valtype^m, m : m}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) + `%~>%`(`%;%`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2^m{t_2 : valtype})))) ;; 8-reduction.watsup rule return_call_ref-frame-null{z : state, k : nat, f : frame, val* : val*, ht : heaptype, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule ref.func{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0])]) + `%~>%`(`%;%`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0])]) ;; 8-reduction.watsup rule ref.test-true{z : state, ref : ref, rt : reftype, rt' : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(1))]) -- Ref_ok: `%|-%:%`($store(z), ref, rt') -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) ;; 8-reduction.watsup rule ref.test-false{z : state, ref : ref, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule ref.cast-succeed{z : state, ref : ref, rt : reftype, rt' : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [(ref : ref <: admininstr)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt') -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) ;; 8-reduction.watsup rule ref.cast-fail{z : state, ref : ref, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) -- otherwise ;; 8-reduction.watsup rule struct.new_default{z : state, x : idx, val* : val*, mut* : mut*, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%~>%`(`%;%`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 8-reduction.watsup rule struct.get-null{z : state, ht : heaptype, sx? : sx?, x : idx, i : nat}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) ;; 8-reduction.watsup rule struct.get-struct{z : state, a : addr, sx? : sx?, x : idx, i : nat, zt* : storagetype*, si : structinst, mut* : mut*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) + `%~>%`(`%;%`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) -- if ($structinst(z)[a] = si) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) ;; 8-reduction.watsup rule array.new{z : state, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [(val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [(val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) ;; 8-reduction.watsup rule array.new_default{z : state, n : n, x : idx, val : val, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if ($default($unpack(zt)) = ?(val)) ;; 8-reduction.watsup rule array.new_elem-oob{z : state, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) ;; 8-reduction.watsup rule array.new_elem-alloc{z : state, i : nat, n : n, x : idx, y : idx, ref^n : ref^n}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- if (ref^n{ref : ref} = $elem(z, y).ELEM_eleminst[i : n]) ;; 8-reduction.watsup rule array.new_data-oob{z : state, i : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if ((i + ((n * $zsize(zt)) / 8)) > |$data(z, y).DATA_datainst|) ;; 8-reduction.watsup rule array.new_data-num{z : state, i : nat, n : n, x : idx, y : idx, nt : numtype, c^n : num_(nt)^n, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (nt = !($nunpack(zt))) -- if ($concat_(syntax byte, $nbytes(nt, c)^n{c : num_(nt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) ;; 8-reduction.watsup rule array.new_data-vec{z : state, i : nat, n : n, x : idx, y : idx, vt : vectype, c^n : vec_(vt)^n, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (vt = !($vunpack(zt))) -- if ($concat_(syntax byte, $vbytes(vt, c)^n{c : vec_(vt)}) = $data(z, y).DATA_datainst[i : ((n * $zsize(zt)) / 8)]) ;; 8-reduction.watsup rule array.get-null{z : state, ht : heaptype, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.get-oob{z : state, a : addr, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.get-array{z : state, a : addr, i : nat, sx? : sx?, x : idx, zt : storagetype, fv : fieldval, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) ;; 8-reduction.watsup rule array.len-null{z : state, ht : heaptype}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.len-array{z : state, a : addr, n : n}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, `%`(n))]) -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.fill-null{z : state, ht : heaptype, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.fill-oob{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.fill-zero{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.fill-succ{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule array.copy-null1{z : state, ht_1 : heaptype, i_1 : nat, ref : ref, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, `%`(i_1)) (ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, `%`(i_1)) (ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.copy-null2{z : state, ref : ref, i_1 : nat, ht_2 : heaptype, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_1)) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_1)) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.copy-oob1{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.copy-oob2{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.copy-zero{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.copy-le{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) -- if (sx?{sx : sx} = $sxfield(zt_2)) @@ -10048,61 +10073,61 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.copy-gt{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) -- if (sx?{sx : sx} = $sxfield(zt_2)) ;; 8-reduction.watsup rule array.init_elem-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.init_elem-oob1{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.init_elem-oob2{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) ;; 8-reduction.watsup rule array.init_elem-zero{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.init_elem-succ{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, ref : ref}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_ELEM_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_ELEM_admininstr(x, y)]) -- otherwise -- if (ref = $elem(z, y).ELEM_eleminst[j]) ;; 8-reduction.watsup rule array.init_data-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.init_data-oob1{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.init_data-oob2{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if ((j + ((n * $zsize(zt)) / 8)) > |$data(z, y).DATA_datainst|) ;; 8-reduction.watsup rule array.init_data-zero{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.init_data-num{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, nt : numtype, c : num_(nt), zt : storagetype, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) -- otherwise -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (nt = !($nunpack(zt))) @@ -10110,7 +10135,7 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.init_data-num{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, vt : vectype, c : vec_(vt), zt : storagetype, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) -- otherwise -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (vt = !($vunpack((vt : vectype <: storagetype)))) @@ -10118,132 +10143,132 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule local.get{z : state, x : idx, val : val}: - `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [(val : val <: admininstr)]) + `%~>%`(`%;%`(z, [LOCAL.GET_admininstr(x)]), [(val : val <: admininstr)]) -- if ($local(z, x) = ?(val)) ;; 8-reduction.watsup rule global.get{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst : val <: admininstr)]) + `%~>%`(`%;%`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst : val <: admininstr)]) ;; 8-reduction.watsup rule table.get-oob{z : state, i : nat, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) -- if (i >= |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.get-val{z : state, i : nat, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] : ref <: admininstr)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] : ref <: admininstr)]) -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.size{z : state, x : idx, n : n}: - `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) -- if (|$table(z, x).ELEM_tableinst| = n) ;; 8-reduction.watsup rule table.fill-oob{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.fill-zero{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.fill-succ{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule table.copy-oob{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) ;; 8-reduction.watsup rule table.copy-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.copy-le{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) -- otherwise -- if (j <= i) ;; 8-reduction.watsup rule table.copy-gt{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(((j + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i + n) - 1))) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(((j + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i + n) - 1))) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) -- otherwise ;; 8-reduction.watsup rule table.init-oob{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) ;; 8-reduction.watsup rule table.init-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.init-succ{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) ($elem(z, y).ELEM_eleminst[i] : ref <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.INIT_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) ($elem(z, y).ELEM_eleminst[i] : ref <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.INIT_admininstr(x, y)]) -- otherwise ;; 8-reduction.watsup rule load-num-oob{z : state, i : nat, nt : numtype, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ($size(nt) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule load-num-val{z : state, i : nat, nt : numtype, x : idx, mo : memop, c : num_(nt)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) -- if ($nbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : ($size(nt) / 8)]) ;; 8-reduction.watsup rule load-pack-oob{z : state, i : nat, inn : inn, n : n, sx : sx, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (n / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule load-pack-val{z : state, i : nat, inn : inn, n : n, sx : sx, x : idx, mo : memop, c : iN(n)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [CONST_admininstr((inn : inn <: numtype), $ext(n, $size((inn : inn <: numtype)), sx, c))]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [CONST_admininstr((inn : inn <: numtype), $ext(n, $size((inn : inn <: numtype)), sx, c))]) -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (n / 8)]) ;; 8-reduction.watsup rule vload-oob{z : state, i : nat, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ($vsize(V128_vectype) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-val{z : state, i : nat, x : idx, mo : memop, c : vec_(V128_vnn)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- if ($vbytes(V128_vectype, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : ($vsize(V128_vectype) / 8)]) ;; 8-reduction.watsup rule vload-shape-oob{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ((M * N) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-shape-val{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop, c : vec_(V128_vnn), j^N : nat^N, k^N : nat^N, inn : inn}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- (if ($ibytes(M, `%`(j)) = $mem(z, x).DATA_meminst[((i + mo.OFFSET_memop.`%`.0) + ((k * M) / 8)) : (M / 8)]))^(k%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-splat-val{z : state, i : nat, N : N, x : idx, mo : memop, c : vec_(V128_vnn), j : nat, imm : imm, M : M}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- if ($ibytes(N, `%`(j)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)]) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = (128 / N)) @@ -10251,23 +10276,23 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule vload-zero-oob{z : state, i : nat, N : N, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-zero-val{z : state, i : nat, N : N, x : idx, mo : memop, c : vec_(V128_vnn), j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- if ($ibytes(N, `%`(j)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)]) -- if (c = $ext(N, 128, U_sx, `%`(j))) ;; 8-reduction.watsup rule vload_lane-oob{z : state, i : nat, vt : vectype, c_1 : vec_(vt), N : N, x : idx, mo : memop, j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload_lane-val{z : state, i : nat, vt : vectype, c_1 : vec_(vt), N : N, x : idx, mo : memop, j : nat, c : vec_(vt), k : nat, imm : imm, M : M}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(vt, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(vt, c)]) -- if ($ibytes(N, `%`(k)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)]) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = ($vsize(vt) / N)) @@ -10275,197 +10300,197 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule memory.size{z : state, x : idx, n : n}: - `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule memory.fill-oob{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule memory.fill-zero{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.fill-succ{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule memory.copy-oob{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) ;; 8-reduction.watsup rule memory.copy-zero{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.copy-le{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise -- if (i_1 <= i_2) ;; 8-reduction.watsup rule memory.copy-gt{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise ;; 8-reduction.watsup rule memory.init-oob{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) ;; 8-reduction.watsup rule memory.init-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.init-succ{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`($data(z, y).DATA_datainst[i].`%`.0)) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.INIT_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`($data(z, y).DATA_datainst[i].`%`.0)) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.INIT_admininstr(x, y)]) -- otherwise ;; 8-reduction.watsup relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule pure{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) - -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_pure: `%~>%`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule read{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) - -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_read: `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule struct.new{z : state, val^n : val^n, n : n, x : idx, si : structinst, mut^n : mut^n, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut : mut zt : storagetype})) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%`(`%%`(mut, zt)^n{mut : mut zt : storagetype}))) -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val zt : storagetype}}) ;; 8-reduction.watsup rule struct.set-null{z : state, ht : heaptype, val : val, x : idx, i : nat}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%`(z, [TRAP_admininstr])) ;; 8-reduction.watsup rule struct.set-struct{z : state, a : addr, val : val, x : idx, i : nat, fv : fieldval, mut* : mut*, zt* : storagetype*}: - `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`($with_struct(z, a, i, fv), [])) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%~>%`(`%;%`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%`($with_struct(z, a, i, fv), [])) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) -- if (fv = $packval(zt*{zt : storagetype}[i], val)) ;; 8-reduction.watsup rule array.new_fixed{z : state, val^n : val^n, n : n, x : idx, ai : arrayinst, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val}}) ;; 8-reduction.watsup rule array.set-null{z : state, ht : heaptype, i : nat, val : val, x : idx}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) ;; 8-reduction.watsup rule array.set-oob{z : state, a : addr, i : nat, val : val, x : idx}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.set-array{z : state, a : addr, i : nat, val : val, x : idx, fv : fieldval, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`($with_array(z, a, i, fv), [])) -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) -- if (fv = $packval(zt, val)) ;; 8-reduction.watsup rule local.set{z : state, val : val, x : idx}: - `%~>%`(`%;%*`(z, [(val : val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) + `%~>%`(`%;%`(z, [(val : val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%`($with_local(z, x, val), [])) ;; 8-reduction.watsup rule global.set{z : state, val : val, x : idx}: - `%~>%`(`%;%*`(z, [(val : val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) + `%~>%`(`%;%`(z, [(val : val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%`($with_global(z, x, val), [])) ;; 8-reduction.watsup rule table.set-oob{z : state, i : nat, ref : ref, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.set-val{z : state, i : nat, ref : ref, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%`($with_table(z, x, i, ref), [])) -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.grow-succeed{z : state, ref : ref, n : n, x : idx, ti : tableinst}: - `%~>%`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, `%`(|$table(z, x).ELEM_tableinst|))])) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, `%`(|$table(z, x).ELEM_tableinst|))])) -- if (ti = !($growtable($table(z, x), n, ref))) ;; 8-reduction.watsup rule table.grow-fail{z : state, ref : ref, n : n, x : idx}: - `%~>%`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) ;; 8-reduction.watsup rule elem.drop{z : state, x : idx}: - `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) + `%~>%`(`%;%`(z, [ELEM.DROP_admininstr(x)]), `%;%`($with_elem(z, x, []), [])) ;; 8-reduction.watsup rule store-num-oob{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + ($size(nt) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule store-num-val{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) -- if (b*{b : byte} = $nbytes(nt, c)) ;; 8-reduction.watsup rule store-pack-oob{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + (n / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule store-pack-val{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) -- if (b*{b : byte} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c))) ;; 8-reduction.watsup rule vstore-oob{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + ($vsize(V128_vectype) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vstore-val{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) -- if (b*{b : byte} = $vbytes(V128_vectype, c)) ;; 8-reduction.watsup rule vstore_lane-oob{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + N) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vstore_lane-val{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, b* : byte*, imm : imm, M : M}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = (128 / N)) -- if (b*{b : byte} = $ibytes(N, `%`($lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)[j].`%`.0))) ;; 8-reduction.watsup rule memory.grow-succeed{z : state, n : n, x : idx, mi : meminst}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, `%`((|$mem(z, x).DATA_meminst| / (64 * $Ki))))])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, `%`((|$mem(z, x).DATA_meminst| / (64 * $Ki))))])) -- if (mi = !($growmemory($mem(z, x), n))) ;; 8-reduction.watsup rule memory.grow-fail{z : state, n : n, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) ;; 8-reduction.watsup rule data.drop{z : state, x : idx}: - `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) + `%~>%`(`%;%`(z, [DATA.DROP_admininstr(x)]), `%;%`($with_data(z, x, []), [])) ;; 8-reduction.watsup rec { @@ -10474,21 +10499,21 @@ rec { relation Steps: `%~>*%`(config, config) ;; 8-reduction.watsup:18.1-19.36 rule refl{z : state, admininstr* : admininstr*}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z, admininstr*{admininstr : admininstr})) + `%~>*%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z, admininstr*{admininstr : admininstr})) ;; 8-reduction.watsup:21.1-24.53 rule trans{z : state, admininstr* : admininstr*, z'' : state, admininstr''* : admininstr*, z' : state, admininstr' : admininstr}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) - -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z', admininstr'*{})) - -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) + `%~>*%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z'', admininstr''*{admininstr'' : admininstr})) + -- Step: `%~>%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z', admininstr'*{})) + -- Steps: `%~>*%`(`%;%`(z', [admininstr']), `%;%`(z'', admininstr''*{admininstr'' : admininstr})) } ;; 8-reduction.watsup -relation Eval_expr: `%;%~>*%;%*`(state, expr, state, val*) +relation Eval_expr: `%;%~>*%;%`(state, expr, state, val*) ;; 8-reduction.watsup rule _{z : state, instr* : instr*, z' : state, val* : val*}: - `%;%~>*%;%*`(z, instr*{instr : instr}, z', val*{val : val}) - -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z', (val : val <: admininstr)*{val : val})) + `%;%~>*%;%`(z, instr*{instr : instr}, z', val*{val : val}) + -- Steps: `%~>*%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z', (val : val <: admininstr)*{val : val})) ;; 9-module.watsup rec { @@ -10509,7 +10534,7 @@ def $alloctypes(type*) : deftype* def $allocfunc(store : store, moduleinst : moduleinst, func : func) : (store, funcaddr) ;; 9-module.watsup def $allocfunc{s : store, mm : moduleinst, func : func, fi : funcinst, x : idx, local* : local*, expr : expr}(s, mm, func) = (s[FUNC_store =.. [fi]], |s.FUNC_store|) - -- if (func = `FUNC%%*%`(x, local*{local : local}, expr)) + -- if (func = FUNC(x, local*{local : local}, expr)) -- if (fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func}) ;; 9-module.watsup @@ -10635,7 +10660,7 @@ def $instexport(funcaddr*, globaladdr*, tableaddr*, memaddr*, export : export) : def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) : (store, moduleinst) ;; 9-module.watsup def $allocmodule{s : store, module : module, externval* : externval*, val_g* : val*, ref_t* : ref*, ref_e** : ref**, s_6 : store, mm : moduleinst, type* : type*, import* : import*, func^n_f : func^n_f, n_f : n, globaltype^n_g : globaltype^n_g, expr_g^n_g : expr^n_g, n_g : n, tabletype^n_t : tabletype^n_t, expr_t^n_t : expr^n_t, n_t : n, memtype^n_m : memtype^n_m, n_m : n, reftype^n_e : reftype^n_e, expr_e*^n_e : expr*^n_e, elemmode^n_e : elemmode^n_e, n_e : n, byte*^n_d : byte*^n_d, datamode^n_d : datamode^n_d, n_d : n, start? : start?, export* : export*, fa_ex* : funcaddr*, ga_ex* : globaladdr*, ta_ex* : tableaddr*, ma_ex* : memaddr*, fa* : funcaddr*, i_f^n_f : nat^n_f, ga* : globaladdr*, i_g^n_g : nat^n_g, ta* : tableaddr*, i_t^n_t : nat^n_t, ma* : memaddr*, i_m^n_m : nat^n_m, ea* : elemaddr*, i_e^n_e : nat^n_e, da* : dataaddr*, i_d^n_d : nat^n_d, xi* : exportinst*, dt* : deftype*, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store}(s, module, externval*{externval : externval}, val_g*{val_g : val}, ref_t*{ref_t : ref}, ref_e*{ref_e : ref}*{ref_e : ref}) = (s_6, mm) - -- if (module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func^n_f{func : func}, GLOBAL(globaltype, expr_g)^n_g{expr_g : expr globaltype : globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t : expr tabletype : tabletype}, MEMORY(memtype)^n_m{memtype : memtype}, `ELEM%%*%`(reftype, expr_e*{expr_e : expr}, elemmode)^n_e{elemmode : elemmode expr_e : expr reftype : reftype}, `DATA%*%`(byte*{byte : byte}, datamode)^n_d{byte : byte datamode : datamode}, start?{start : start}, export*{export : export})) + -- if (module = MODULE(type*{type : type}, import*{import : import}, func^n_f{func : func}, GLOBAL(globaltype, expr_g)^n_g{expr_g : expr globaltype : globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t : expr tabletype : tabletype}, MEMORY(memtype)^n_m{memtype : memtype}, ELEM(reftype, expr_e*{expr_e : expr}, elemmode)^n_e{elemmode : elemmode expr_e : expr reftype : reftype}, DATA(byte*{byte : byte}, datamode)^n_d{byte : byte datamode : datamode}, start?{start : start}, export*{export : export})) -- if (fa_ex*{fa_ex : funcaddr} = $funcsxv(externval*{externval : externval})) -- if (ga_ex*{ga_ex : globaladdr} = $globalsxv(externval*{externval : externval})) -- if (ta_ex*{ta_ex : tableaddr} = $tablesxv(externval*{externval : externval})) @@ -10659,36 +10684,36 @@ def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) ;; 9-module.watsup def $runelem(elem : elem, idx : idx) : instr* ;; 9-module.watsup - def $runelem{reftype : reftype, expr* : expr*, y : idx}(`ELEM%%*%`(reftype, expr*{expr : expr}, PASSIVE_elemmode), y) = [] + def $runelem{reftype : reftype, expr* : expr*, y : idx}(ELEM(reftype, expr*{expr : expr}, PASSIVE_elemmode), y) = [] ;; 9-module.watsup - def $runelem{reftype : reftype, expr* : expr*, y : idx}(`ELEM%%*%`(reftype, expr*{expr : expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] + def $runelem{reftype : reftype, expr* : expr*, y : idx}(ELEM(reftype, expr*{expr : expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] ;; 9-module.watsup - def $runelem{reftype : reftype, expr* : expr*, x : idx, instr* : instr*, y : idx}(`ELEM%%*%`(reftype, expr*{expr : expr}, ACTIVE_elemmode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|expr*{expr : expr}|)) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] + def $runelem{reftype : reftype, expr* : expr*, x : idx, instr* : instr*, y : idx}(ELEM(reftype, expr*{expr : expr}, ACTIVE_elemmode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|expr*{expr : expr}|)) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] ;; 9-module.watsup def $rundata(data : data, idx : idx) : instr* ;; 9-module.watsup - def $rundata{byte* : byte*, y : idx}(`DATA%*%`(byte*{byte : byte}, PASSIVE_datamode), y) = [] + def $rundata{byte* : byte*, y : idx}(DATA(byte*{byte : byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup - def $rundata{byte* : byte*, x : idx, instr* : instr*, y : idx}(`DATA%*%`(byte*{byte : byte}, ACTIVE_datamode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|byte*{byte : byte}|)) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] + def $rundata{byte* : byte*, x : idx, instr* : instr*, y : idx}(DATA(byte*{byte : byte}, ACTIVE_datamode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|byte*{byte : byte}|)) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] ;; 9-module.watsup def $instantiate(store : store, module : module, externval*) : config ;; 9-module.watsup - def $instantiate{s : store, module : module, externval* : externval*, s' : store, f : frame, instr_E* : instr*, instr_D* : instr*, x? : idx?, type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start? : start?, export* : export*, globaltype* : globaltype*, expr_G* : expr*, tabletype* : tabletype*, expr_T* : expr*, reftype* : reftype*, expr_E** : expr**, elemmode* : elemmode*, n_F : n, n_E : n, n_D : n, mm_init : moduleinst, i_F^n_F : nat^n_F, z : state, val_G* : val*, ref_T* : ref*, ref_E** : ref**, mm : moduleinst, i^n_E : nat^n_E, j^n_D : nat^n_D}(s, module, externval*{externval : externval}) = `%;%*`(`%;%`(s', f), (instr_E : instr <: admininstr)*{instr_E : instr} :: (instr_D : instr <: admininstr)*{instr_D : instr} :: CALL_admininstr(x)?{x : funcidx}) - -- if (module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data*{data : data}, start?{start : start}, export*{export : export})) + def $instantiate{s : store, module : module, externval* : externval*, s' : store, f : frame, instr_E* : instr*, instr_D* : instr*, x? : idx?, type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start? : start?, export* : export*, globaltype* : globaltype*, expr_G* : expr*, tabletype* : tabletype*, expr_T* : expr*, reftype* : reftype*, expr_E** : expr**, elemmode* : elemmode*, n_F : n, n_E : n, n_D : n, mm_init : moduleinst, i_F^n_F : nat^n_F, z : state, val_G* : val*, ref_T* : ref*, ref_E** : ref**, mm : moduleinst, i^n_E : nat^n_E, j^n_D : nat^n_D}(s, module, externval*{externval : externval}) = `%;%`(`%;%`(s', f), (instr_E : instr <: admininstr)*{instr_E : instr} :: (instr_D : instr <: admininstr)*{instr_D : instr} :: CALL_admininstr(x)?{x : funcidx}) + -- if (module = MODULE(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data*{data : data}, start?{start : start}, export*{export : export})) -- if (global*{global : global} = GLOBAL(globaltype, expr_G)*{expr_G : expr globaltype : globaltype}) -- if (table*{table : table} = TABLE(tabletype, expr_T)*{expr_T : expr tabletype : tabletype}) - -- if (elem*{elem : elem} = `ELEM%%*%`(reftype, expr_E*{expr_E : expr}, elemmode)*{elemmode : elemmode expr_E : expr reftype : reftype}) + -- if (elem*{elem : elem} = ELEM(reftype, expr_E*{expr_E : expr}, elemmode)*{elemmode : elemmode expr_E : expr reftype : reftype}) -- if (start?{start : start} = START(x)?{x : funcidx}) -- if (n_F = |func*{func : func}|) -- if (n_E = |elem*{elem : elem}|) -- if (n_D = |data*{data : data}|) -- if (mm_init = {TYPE $alloctypes(type*{type : type}), FUNC $funcsxv(externval*{externval : externval}) :: (|s.FUNC_store| + i_F)^(i_F*%;%*`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} + -- (Eval_expr: `%;%~>*%;%`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} + -- (Eval_expr: `%;%~>*%;%`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} + -- (Eval_expr: `%;%~>*%;%`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} -- if ((s', mm) = $allocmodule(s, module, externval*{externval : externval}, val_G*{val_G : val}, ref_T*{ref_T : ref}, ref_E*{ref_E : ref}*{ref_E : ref})) -- if (f = {LOCAL [], MODULE mm}) -- if (instr_E*{instr_E : instr} = $concat_(syntax instr, $runelem(elem*{elem : elem}[i], `%`(i))^(i%`(t_1^n{t_1 : valtype}, t_2*{t_2 : valtype}))) - -;; A-binary.watsup -rec { - -;; A-binary.watsup:49.1-49.24 -def $utf8(name : name) : byte* - ;; A-binary.watsup:50.1-50.47 - def $utf8{ch : nat, b : byte}([`%`(ch)]) = [b] - -- if ((ch < 128) /\ (ch = b.`%`.0)) - ;; A-binary.watsup:51.1-51.96 - def $utf8{ch : nat, b_1 : byte, b_2 : byte}([`%`(ch)]) = [b_1 b_2] - -- if (((128 <= ch) /\ (ch < 2048)) /\ (ch = (((2 ^ 6) * (b_1.`%`.0 - 192)) + (b_2.`%`.0 - 128)))) - ;; A-binary.watsup:52.1-52.148 - def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte}([`%`(ch)]) = [b_1 b_2 b_3] - -- if ((((2048 <= ch) /\ (ch < 55296)) \/ ((57344 <= ch) /\ (ch < 65536))) /\ (ch = ((((2 ^ 12) * (b_1.`%`.0 - 224)) + ((2 ^ 6) * (b_2.`%`.0 - 128))) + (b_3.`%`.0 - 128)))) - ;; A-binary.watsup:53.1-53.148 - def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([`%`(ch)]) = [b_1 b_2 b_3 b_4] - -- if (((65536 <= ch) /\ (ch < 69632)) /\ (ch = (((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128)))) - ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(`%`(ch)*{ch : nat}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch : nat}) -} + -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = FUNC(x, local*{local : local}, expr)) + -- Expand: `%~~%`(s.FUNC_store[fa].TYPE_funcinst, FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; A-binary.watsup syntax castop = (nul, nul) @@ -10840,14 +10844,8 @@ def $concat_(syntax X, X**) : X* } ;; 1-syntax.watsup -syntax list{syntax X}(syntax X) = X* - -;; 1-syntax.watsup -syntax char = `%`{i : nat}(i : nat) - -- if (((i >= 0) /\ (i <= 55295)) \/ ((i >= 57344) /\ (i <= 1114111))) - -;; 1-syntax.watsup -syntax name = char* +syntax list{syntax X}(syntax X) = `%`{X* : X*}(X*{X : X} : X*) + -- if (|X*{X : X}| < (2 ^ 32)) ;; 1-syntax.watsup syntax bit = `%`{i : nat}(i : nat) @@ -10952,6 +10950,35 @@ def $canon_(N : N) : nat ;; 1-syntax.watsup syntax vN{N : N}(N) = iN(N) +;; 1-syntax.watsup +syntax char = `%`{i : nat}(i : nat) + -- if (((i >= 0) /\ (i <= 55295)) \/ ((i >= 57344) /\ (i <= 1114111))) + +;; 1-syntax.watsup +rec { + +;; 1-syntax.watsup:87.1-87.25 +def $utf8(char*) : byte* + ;; A-binary.watsup:50.1-50.47 + def $utf8{ch : char, b : byte}([ch]) = [b] + -- if ((ch.`%`.0 < 128) /\ (ch = `%`(b.`%`.0))) + ;; A-binary.watsup:51.1-51.96 + def $utf8{ch : char, b_1 : byte, b_2 : byte}([ch]) = [b_1 b_2] + -- if (((128 <= ch.`%`.0) /\ (ch.`%`.0 < 2048)) /\ (ch = `%`((((2 ^ 6) * (b_1.`%`.0 - 192)) + (b_2.`%`.0 - 128))))) + ;; A-binary.watsup:52.1-52.148 + def $utf8{ch : char, b_1 : byte, b_2 : byte, b_3 : byte}([ch]) = [b_1 b_2 b_3] + -- if ((((2048 <= ch.`%`.0) /\ (ch.`%`.0 < 55296)) \/ ((57344 <= ch.`%`.0) /\ (ch.`%`.0 < 65536))) /\ (ch = `%`(((((2 ^ 12) * (b_1.`%`.0 - 224)) + ((2 ^ 6) * (b_2.`%`.0 - 128))) + (b_3.`%`.0 - 128))))) + ;; A-binary.watsup:53.1-53.148 + def $utf8{ch : char, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([ch]) = [b_1 b_2 b_3 b_4] + -- if (((65536 <= ch.`%`.0) /\ (ch.`%`.0 < 69632)) /\ (ch = `%`((((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128))))) + ;; A-binary.watsup:54.1-54.44 + def $utf8{ch* : char*}(ch*{ch : char}) = $concat_(syntax byte, $utf8([ch])*{ch : char}) +} + +;; 1-syntax.watsup +syntax name = `%`{char* : char*}(char*{char : char} : char*) + -- if (|$utf8(char*{char : char})| < (2 ^ 32)) + ;; 1-syntax.watsup syntax idx = u32 @@ -11022,7 +11049,7 @@ syntax fin = `FINAL%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:146.1-147.14 +;; 1-syntax.watsup:147.1-148.14 syntax valtype = | I32 | I64 @@ -11032,10 +11059,10 @@ syntax valtype = | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | BOT -;; 1-syntax.watsup:154.1-155.16 +;; 1-syntax.watsup:155.1-156.16 syntax resulttype = list(syntax valtype) -;; 1-syntax.watsup:162.1-162.68 +;; 1-syntax.watsup:163.1-163.68 syntax storagetype = | BOT | I32 @@ -11047,34 +11074,34 @@ syntax storagetype = | I8 | I16 -;; 1-syntax.watsup:175.1-176.18 +;; 1-syntax.watsup:176.1-177.18 syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) -;; 1-syntax.watsup:178.1-178.70 +;; 1-syntax.watsup:179.1-179.70 syntax functype = `%->%`{resulttype : resulttype}(resulttype : resulttype, resulttype) -;; 1-syntax.watsup:179.1-179.64 +;; 1-syntax.watsup:180.1-180.64 syntax structtype = list(syntax fieldtype) -;; 1-syntax.watsup:180.1-180.53 +;; 1-syntax.watsup:181.1-181.53 syntax arraytype = fieldtype -;; 1-syntax.watsup:182.1-185.18 +;; 1-syntax.watsup:183.1-186.18 syntax comptype = | STRUCT{structtype : structtype}(structtype : structtype) | ARRAY{arraytype : arraytype}(arraytype : arraytype) | FUNC{functype : functype}(functype : functype) -;; 1-syntax.watsup:189.1-190.60 +;; 1-syntax.watsup:190.1-191.60 syntax subtype = | SUB{fin : fin, typeidx* : typeidx*, comptype : comptype}(fin : fin, typeidx*{typeidx : typeidx} : typeidx*, comptype : comptype) | SUBD{fin : fin, heaptype* : heaptype*, comptype : comptype}(fin : fin, heaptype*{heaptype : heaptype} : heaptype*, comptype : comptype) -;; 1-syntax.watsup:192.1-193.22 +;; 1-syntax.watsup:193.1-194.22 syntax rectype = | REC{list : list(syntax subtype)}(list : list(syntax subtype)) -;; 1-syntax.watsup:198.1-199.26 +;; 1-syntax.watsup:199.1-200.26 syntax heaptype = | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY @@ -11533,7 +11560,7 @@ syntax zero = `ZERO%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:522.1-534.78 +;; 1-syntax.watsup:523.1-535.78 syntax instr = | UNREACHABLE | NOP @@ -11663,7 +11690,7 @@ syntax type = TYPE{rectype : rectype}(rectype : rectype) syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) +syntax func = FUNC{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) ;; 1-syntax.watsup syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) @@ -11675,10 +11702,10 @@ syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) +syntax elem = ELEM{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) ;; 1-syntax.watsup -syntax data = `DATA%*%`{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) +syntax data = DATA{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup syntax start = START{funcidx : funcidx}(funcidx : funcidx) @@ -11697,7 +11724,7 @@ syntax export = EXPORT{name : name, externidx : externidx}(name : name, externid syntax import = IMPORT{name : name, externtype : externtype}(name : name, name, externtype : externtype) ;; 1-syntax.watsup -syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) +syntax module = MODULE{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) ;; 2-syntax-aux.watsup rec { @@ -11753,7 +11780,7 @@ def $free_dataidx_expr(expr : expr) : dataidx* ;; 2-syntax-aux.watsup def $free_dataidx_func(func : func) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) + def $free_dataidx_func{x : idx, loc* : local*, e : expr}(FUNC(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) ;; 2-syntax-aux.watsup rec { @@ -11892,7 +11919,7 @@ def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype ;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype ;; 2-syntax-aux.watsup:175.1-175.85 - def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt : fieldtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype}) + def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(`%`(yt*{yt : fieldtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype(`%`($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype})) ;; 2-syntax-aux.watsup:176.1-176.81 def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx : typevar}, ht*{ht : heaptype}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:177.1-177.78 @@ -11908,7 +11935,7 @@ def $subst_subtype(subtype : subtype, typevar*, heaptype*) : subtype ;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype ;; 2-syntax-aux.watsup:184.1-184.76 - def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st : subtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype}) + def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(`%`(st*{st : subtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype(`%`($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype})) ;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype @@ -11918,7 +11945,7 @@ def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype ;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype ;; 2-syntax-aux.watsup:189.1-189.113 - def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}, $subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype}) + def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`(`%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}), `%`($subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype})) } ;; 2-syntax-aux.watsup @@ -11971,25 +11998,25 @@ def $subst_all_deftypes(deftype*, heaptype*) : deftype* ;; 2-syntax-aux.watsup def $rollrt(typeidx : typeidx, rectype : rectype) : rectype ;; 2-syntax-aux.watsup - def $rollrt{x : idx, st^n : subtype^n, n : n, i^n : nat^n}(x, REC_rectype(st^n{st : subtype})) = REC_rectype($subst_subtype(st, $idx(`%`((x.`%`.0 + i)))^(i%*%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) +syntax instrtype = `%->%%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) ;; 6-typing.watsup syntax context = @@ -13462,16 +13489,16 @@ relation Valtype_ok: `%|-%:_OK`(context, valtype) relation Resulttype_ok: `%|-%:_OK`(context, resulttype) ;; 6-typing.watsup rule _{C : context, t* : valtype*}: - `%|-%:_OK`(C, t*{t : valtype}) + `%|-%:_OK`(C, `%`(t*{t : valtype})) -- (Valtype_ok: `%|-%:_OK`(C, t))*{t : valtype} ;; 6-typing.watsup relation Instrtype_ok: `%|-%:_OK`(context, instrtype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, x* : idx*, t_2* : valtype*, lt* : localtype*}: - `%|-%:_OK`(C, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + `%|-%:_OK`(C, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_1*{t_1 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_2*{t_2 : valtype})) -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt : localtype x : idx} ;; 6-typing.watsup @@ -13511,15 +13538,15 @@ relation Fieldtype_ok: `%|-%:_OK`(context, fieldtype) relation Functype_ok: `%|-%:_OK`(context, functype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:_OK`(C, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + `%|-%:_OK`(C, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_1*{t_1 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Comptype_ok: `%|-%:_OK`(context, comptype) ;; 6-typing.watsup rule struct{C : context, yt* : fieldtype*}: - `%|-%:_OK`(C, STRUCT_comptype(yt*{yt : fieldtype})) + `%|-%:_OK`(C, STRUCT_comptype(`%`(yt*{yt : fieldtype}))) -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt : fieldtype} ;; 6-typing.watsup @@ -13592,7 +13619,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:303.1-305.35 rule struct{C : context, deftype : deftype, yt* : fieldtype*}: `%|-%<:%`(C, (deftype : deftype <: heaptype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt : fieldtype})) + -- Expand: `%~~%`(deftype, STRUCT_comptype(`%`(yt*{yt : fieldtype}))) ;; 6-typing.watsup:307.1-309.33 rule array{C : context, deftype : deftype, yt : fieldtype}: @@ -13718,7 +13745,7 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) ;; 6-typing.watsup rule struct{C : context, yt_1* : fieldtype*, yt'_1 : fieldtype, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1 : fieldtype} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2 : fieldtype})) + `%|-%<:%`(C, STRUCT_comptype(`%`(yt_1*{yt_1 : fieldtype} :: [yt'_1])), STRUCT_comptype(`%`(yt_2*{yt_2 : fieldtype}))) -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 : fieldtype yt_2 : fieldtype} ;; 6-typing.watsup @@ -13778,13 +13805,13 @@ rec { relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) ;; 6-typing.watsup:196.1-197.24 rule empty{C : context, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) + `%|-%:%`(C, REC_rectype(`%`([])), OK_oktypeidxnat(x, i)) ;; 6-typing.watsup:199.1-202.50 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidxnat(x, i)) + `%|-%:%`(C, REC_rectype(`%`([st_1] :: st*{st : subtype})), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) - -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) } ;; 6-typing.watsup @@ -13794,18 +13821,18 @@ rec { relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) ;; 6-typing.watsup:184.1-185.23 rule empty{C : context, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) + `%|-%:%`(C, REC_rectype(`%`([])), OK_oktypeidx(x)) ;; 6-typing.watsup:187.1-190.43 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidx(x)) + `%|-%:%`(C, REC_rectype(`%`([st_1] :: st*{st : subtype})), OK_oktypeidx(x)) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) - -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) + -- Rectype_ok: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidx(`%`((x.`%`.0 + 1)))) ;; 6-typing.watsup:192.1-194.49 rule rec2{C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(x, 0)) + `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(x, 0)) } ;; 6-typing.watsup @@ -13814,7 +13841,7 @@ relation Deftype_ok: `%|-%:_OK`(context, deftype) rule _{C : context, qt : rectype, i : nat, x : idx, st^n : subtype^n, n : n}: `%|-%:_OK`(C, DEF_deftype(qt, i)) -- Rectype_ok: `%|-%:%`(C, qt, OK_oktypeidx(x)) - -- if (qt = REC_rectype(st^n{st : subtype})) + -- if (qt = REC_rectype(`%`(st^n{st : subtype}))) -- if (i < n) ;; 6-typing.watsup @@ -13870,19 +13897,19 @@ relation Externtype_ok: `%|-%:_OK`(context, externtype) -- Memtype_ok: `%|-%:_OK`(C, mt) ;; 6-typing.watsup -relation Resulttype_sub: `%|-%*_<:%*`(context, valtype*, valtype*) +relation Resulttype_sub: `%|-%<:%`(context, valtype*, valtype*) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%*_<:%*`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) + `%|-%<:%`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 : valtype t_2 : valtype} ;; 6-typing.watsup relation Instrtype_sub: `%|-%<:%`(context, instrtype, instrtype) ;; 6-typing.watsup rule _{C : context, t_11* : valtype*, x_1* : idx*, t_12* : valtype*, t_21* : valtype*, x_2* : idx*, t_22* : valtype*, x* : idx*, t* : valtype*}: - `%|-%<:%`(C, `%->%*%`(t_11*{t_11 : valtype}, x_1*{x_1 : localidx}, t_12*{t_12 : valtype}), `%->%*%`(t_21*{t_21 : valtype}, x_2*{x_2 : localidx}, t_22*{t_22 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) + `%|-%<:%`(C, `%->%%`(`%`(t_11*{t_11 : valtype}), x_1*{x_1 : localidx}, `%`(t_12*{t_12 : valtype})), `%->%%`(`%`(t_21*{t_21 : valtype}), x_2*{x_2 : localidx}, `%`(t_22*{t_22 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) + -- Resulttype_sub: `%|-%<:%`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) -- if (x*{x : idx} = $setminus(x_2*{x_2 : idx}, x_1*{x_1 : idx})) -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t : valtype x : idx} @@ -13949,11 +13976,11 @@ relation Externtype_sub: `%|-%<:%`(context, externtype, externtype) relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) ;; 6-typing.watsup rule void{C : context}: - `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) + `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`(`%`([]), `%`([]))) ;; 6-typing.watsup rule result{C : context, t : valtype}: - `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`([], [t])) + `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`(`%`([]), `%`([t]))) ;; 6-typing.watsup rule typeidx{C : context, x : idx, ft : functype}: @@ -13967,77 +13994,77 @@ rec { relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:544.1-545.34 rule unreachable{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:547.1-548.24 rule nop{C : context}: - `%|-%:%`(C, NOP_instr, `%->%`([], [])) + `%|-%:%`(C, NOP_instr, `%->%`(`%`([]), `%`([]))) ;; 6-typing.watsup:550.1-551.23 rule drop{C : context, t : valtype}: - `%|-%:%`(C, DROP_instr, `%->%`([t], [])) + `%|-%:%`(C, DROP_instr, `%->%`(`%`([t]), `%`([]))) ;; 6-typing.watsup:554.1-555.31 rule select-expl{C : context, t : valtype}: - `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) + `%|-%:%`(C, SELECT_instr(?([t])), `%->%`(`%`([t t I32_valtype]), `%`([t]))) ;; 6-typing.watsup:557.1-560.37 rule select-impl{C : context, t : valtype, t' : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) + `%|-%:%`(C, SELECT_instr(?()), `%->%`(`%`([t t I32_valtype]), `%`([t]))) -- Valtype_sub: `%|-%<:%`(C, t, t') -- if ((t' = (numtype : numtype <: valtype)) \/ (t' = (vectype : vectype <: valtype))) ;; 6-typing.watsup:578.1-581.61 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:583.1-586.61 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_1*{t_1 : valtype})], RETURN ?()}, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:588.1-592.65 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_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_2*{x_2 : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(`%`(t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_2*{x_2 : localidx}, `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:597.1-599.24 rule br{C : context, l : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) + `%|-%:%`(C, BR_instr(l), `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype})) ;; 6-typing.watsup:601.1-603.24 rule br_if{C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t : valtype} :: [I32_valtype], t*{t : valtype})) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) + `%|-%:%`(C, BR_IF_instr(l), `%->%`(`%`(t*{t : valtype} :: [I32_valtype]), `%`(t*{t : valtype}))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype})) ;; 6-typing.watsup:605.1-608.44 rule br_table{C : context, l* : labelidx*, l' : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) - -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0]))*{l : labelidx} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0]) + `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) + -- (Resulttype_sub: `%|-%<:%`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0].`%`.0))*{l : labelidx} + -- Resulttype_sub: `%|-%<:%`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0].`%`.0) ;; 6-typing.watsup:610.1-613.31 rule br_on_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(`%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)]), `%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype})) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:615.1-618.31 rule br_on_non_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype})) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]) + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(`%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)]), `%`(t*{t : valtype}))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:620.1-626.34 rule br_on_cast{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(`%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)]), `%`(t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)]))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype} :: [(rt : reftype <: valtype)])) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -14045,8 +14072,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:628.1-634.49 rule br_on_cast_fail{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [(rt_2 : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(`%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)]), `%`(t*{t : valtype} :: [(rt_2 : reftype <: valtype)]))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype} :: [(rt : reftype <: valtype)])) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -14054,414 +14081,414 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:639.1-641.24 rule return{C : context, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) - -- if (C.RETURN_context = ?(t*{t : valtype})) + `%|-%:%`(C, RETURN_instr, `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(`%`(t*{t : valtype}))) ;; 6-typing.watsup:643.1-645.46 rule call{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + `%|-%:%`(C, CALL_instr(x), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; 6-typing.watsup:647.1-649.46 rule call_ref{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2 : valtype})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(`%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`(t_2*{t_2 : valtype}))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; 6-typing.watsup:651.1-655.46 rule call_indirect{C : context, x : idx, y : idx, t_1* : valtype*, t_2* : valtype*, lim : limits, rt : reftype}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(`%`(t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_2*{t_2 : valtype}))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; 6-typing.watsup:657.1-661.40 rule return_call{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}, t_4*{t_4 : valtype})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}), `%`(t_4*{t_4 : valtype}))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:663.1-667.40 rule return_call_ref{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4 : valtype})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`(t_4*{t_4 : valtype}))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:669.1-675.40 rule return_call_indirect{C : context, x : idx, y : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, lim : limits, rt : reftype, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype], t_4*{t_4 : valtype})) + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_4*{t_4 : valtype}))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:680.1-681.33 rule const{C : context, nt : numtype, c_nt : num_(nt)}: - `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [(nt : numtype <: valtype)])) + `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`(`%`([]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:683.1-684.34 rule unop{C : context, nt : numtype, unop_nt : unop_(nt)}: - `%|-%:%`(C, UNOP_instr(nt, unop_nt), `%->%`([(nt : numtype <: valtype)], [(nt : numtype <: valtype)])) + `%|-%:%`(C, UNOP_instr(nt, unop_nt), `%->%`(`%`([(nt : numtype <: valtype)]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:686.1-687.39 rule binop{C : context, nt : numtype, binop_nt : binop_(nt)}: - `%|-%:%`(C, BINOP_instr(nt, binop_nt), `%->%`([(nt : numtype <: valtype) (nt : numtype <: valtype)], [(nt : numtype <: valtype)])) + `%|-%:%`(C, BINOP_instr(nt, binop_nt), `%->%`(`%`([(nt : numtype <: valtype) (nt : numtype <: valtype)]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:689.1-690.39 rule testop{C : context, nt : numtype, testop_nt : testop_(nt)}: - `%|-%:%`(C, TESTOP_instr(nt, testop_nt), `%->%`([(nt : numtype <: valtype)], [I32_valtype])) + `%|-%:%`(C, TESTOP_instr(nt, testop_nt), `%->%`(`%`([(nt : numtype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:692.1-693.40 rule relop{C : context, nt : numtype, relop_nt : relop_(nt)}: - `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->%`([(nt : numtype <: valtype) (nt : numtype <: valtype)], [I32_valtype])) + `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->%`(`%`([(nt : numtype <: valtype) (nt : numtype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:696.1-699.34 rule reinterpret{C : context, nt_1 : numtype, nt_2 : numtype}: - `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([(nt_2 : numtype <: valtype)], [(nt_1 : numtype <: valtype)])) + `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`(`%`([(nt_2 : numtype <: valtype)]), `%`([(nt_1 : numtype <: valtype)]))) -- if (nt_1 =/= nt_2) -- if ($size(nt_1) = $size(nt_2)) ;; 6-typing.watsup:701.1-704.50 rule convert-i{C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: - `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`(`%`([(inn_2 : inn <: valtype)]), `%`([(inn_1 : inn <: valtype)]))) -- if (inn_1 =/= inn_2) -- if ((sx?{sx : sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) ;; 6-typing.watsup:706.1-708.24 rule convert-f{C : context, fnn_1 : fnn, fnn_2 : fnn}: - `%|-%:%`(C, CVTOP_instr((fnn_1 : fnn <: numtype), CONVERT_cvtop, (fnn_2 : fnn <: numtype), ?()), `%->%`([(fnn_2 : fnn <: valtype)], [(fnn_1 : fnn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((fnn_1 : fnn <: numtype), CONVERT_cvtop, (fnn_2 : fnn <: numtype), ?()), `%->%`(`%`([(fnn_2 : fnn <: valtype)]), `%`([(fnn_1 : fnn <: valtype)]))) -- if (fnn_1 =/= fnn_2) ;; 6-typing.watsup:713.1-715.31 rule ref.null{C : context, ht : heaptype}: - `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) + `%|-%:%`(C, REF.NULL_instr(ht), `%->%`(`%`([]), `%`([REF_valtype(`NULL%?`(?(())), ht)]))) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:718.1-720.23 rule ref.func{C : context, x : idx, epsilon : resulttype, dt : deftype}: - `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), (dt : deftype <: heaptype))])) + `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, `%`([REF_valtype(`NULL%?`(?()), (dt : deftype <: heaptype))]))) -- if (C.FUNC_context[x.`%`.0] = dt) ;; 6-typing.watsup:722.1-723.34 rule ref.i31{C : context}: - `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) + `%|-%:%`(C, REF.I31_instr, `%->%`(`%`([I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), I31_heaptype)]))) ;; 6-typing.watsup:725.1-726.31 rule ref.is_null{C : context, rt : reftype}: - `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([(rt : reftype <: valtype)], [I32_valtype])) + `%|-%:%`(C, REF.IS_NULL_instr, `%->%`(`%`([(rt : reftype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:728.1-730.31 rule ref.as_non_null{C : context, ht : heaptype}: - `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) + `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ht)]), `%`([REF_valtype(`NULL%?`(?()), ht)]))) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:732.1-733.51 rule ref.eq{C : context}: - `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) + `%|-%:%`(C, REF.EQ_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:735.1-739.33 rule ref.test{C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([(rt' : reftype <: valtype)], [I32_valtype])) + `%|-%:%`(C, REF.TEST_instr(rt), `%->%`(`%`([(rt' : reftype <: valtype)]), `%`([I32_valtype]))) -- Reftype_ok: `%|-%:_OK`(C, rt) -- Reftype_ok: `%|-%:_OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') ;; 6-typing.watsup:741.1-745.33 rule ref.cast{C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.CAST_instr(rt), `%->%`([(rt' : reftype <: valtype)], [(rt : reftype <: valtype)])) + `%|-%:%`(C, REF.CAST_instr(rt), `%->%`(`%`([(rt' : reftype <: valtype)]), `%`([(rt : reftype <: valtype)]))) -- Reftype_ok: `%|-%:_OK`(C, rt) -- Reftype_ok: `%|-%:_OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') ;; 6-typing.watsup:750.1-751.42 rule i31.get{C : context, sx : sx}: - `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) + `%|-%:%`(C, I31.GET_instr(sx), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:756.1-758.43 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`(`%`($unpack(zt)*{zt : storagetype}), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) ;; 6-typing.watsup:760.1-763.39 rule struct.new_default{C : context, x : idx, zt* : storagetype*, mut* : mut*, val* : val*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`(`%`($unpack(zt)*{zt : storagetype}), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 6-typing.watsup:765.1-769.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: - `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`([$unpack(zt)]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`(mut, zt)) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:771.1-774.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: - `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)]), `%`([]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`(`MUT%?`(?(())), zt)) ;; 6-typing.watsup:779.1-781.41 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpack(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`(`%`([$unpack(zt) I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) ;; 6-typing.watsup:783.1-786.36 rule array.new_default{C : context, x : idx, mut : mut, zt : storagetype, val : val}: - `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`(`%`([I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) -- if ($default($unpack(zt)) = ?(val)) ;; 6-typing.watsup:788.1-790.41 rule array.new_fixed{C : context, x : idx, n : n, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpack(zt)], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`(`%`([$unpack(zt)]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) ;; 6-typing.watsup:792.1-795.39 rule array.new_elem{C : context, x : idx, y : idx, mut : mut, rt : reftype}: - `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, (rt : reftype <: storagetype)))) -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y.`%`.0], rt) ;; 6-typing.watsup:797.1-801.23 rule array.new_data{C : context, x : idx, y : idx, mut : mut, t : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, (t : valtype <: storagetype)))) -- if ((t = (numtype : numtype <: valtype)) \/ (t = (vectype : vectype <: valtype))) -- if (C.DATA_context[y.`%`.0] = OK) ;; 6-typing.watsup:803.1-806.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype]), `%`([$unpack(zt)]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:808.1-810.41 rule array.set{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)], [])) + `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 6-typing.watsup:812.1-814.41 rule array.len{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) + `%|-%:%`(C, ARRAY.LEN_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)]), `%`([I32_valtype]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 6-typing.watsup:816.1-818.41 rule array.fill{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype], [])) + `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 6-typing.watsup:820.1-824.40 rule array.copy{C : context, x_1 : idx, x_2 : idx, zt_1 : storagetype, mut : mut, zt_2 : storagetype}: - `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x_1.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) -- Expand: `%~~%`(C.TYPE_context[x_2.`%`.0], ARRAY_comptype(`%%`(mut, zt_2))) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) ;; 6-typing.watsup:826.1-829.43 rule array.init_elem{C : context, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) -- Storagetype_sub: `%|-%<:%`(C, (C.ELEM_context[y.`%`.0] : reftype <: storagetype), zt) ;; 6-typing.watsup:831.1-835.23 rule array.init_data{C : context, x : idx, y : idx, zt : storagetype, t : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) -- if ((t = (numtype : numtype <: valtype)) \/ (t = (vectype : vectype <: valtype))) -- if (C.DATA_context[y.`%`.0] = OK) ;; 6-typing.watsup:840.1-841.62 rule extern.convert_any{C : context, nul : nul}: - `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) + `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`(`%`([REF_valtype(nul, ANY_heaptype)]), `%`([REF_valtype(nul, EXTERN_heaptype)]))) ;; 6-typing.watsup:843.1-844.62 rule any.convert_extern{C : context, nul : nul}: - `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) + `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`(`%`([REF_valtype(nul, EXTERN_heaptype)]), `%`([REF_valtype(nul, ANY_heaptype)]))) ;; 6-typing.watsup:849.1-850.35 rule vconst{C : context, c : vec_(V128_vnn)}: - `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->%`([], [V128_valtype])) + `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->%`(`%`([]), `%`([V128_valtype]))) ;; 6-typing.watsup:852.1-853.41 rule vvunop{C : context, vvunop : vvunop}: - `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:855.1-856.48 rule vvbinop{C : context, vvbinop : vvbinop}: - `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:858.1-859.55 rule vvternop{C : context, vvternop : vvternop}: - `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->%`([V128_valtype V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->%`(`%`([V128_valtype V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:861.1-862.44 rule vvtestop{C : context, vvtestop : vvtestop}: - `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:864.1-865.33 rule vbitmask{C : context, sh : ishape}: - `%|-%:%`(C, VBITMASK_instr(sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VBITMASK_instr(sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:867.1-868.39 rule vswizzle{C : context, sh : ishape}: - `%|-%:%`(C, VSWIZZLE_instr(sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VSWIZZLE_instr(sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:870.1-872.22 rule vshuffle{C : context, imm : imm, N : N, i* : nat*}: - `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) -- (if (i < (N * 2)))*{i : nat} ;; 6-typing.watsup:874.1-875.48 rule vsplat{C : context, lnn : lnn, N : N}: - `%|-%:%`(C, VSPLAT_instr(`%X%`(lnn, `%`(N))), `%->%`([($lunpack(lnn) : numtype <: valtype)], [V128_valtype])) + `%|-%:%`(C, VSPLAT_instr(`%X%`(lnn, `%`(N))), `%->%`(`%`([($lunpack(lnn) : numtype <: valtype)]), `%`([V128_valtype]))) ;; 6-typing.watsup:878.1-880.14 rule vextract_lane{C : context, lnn : lnn, N : N, sx? : sx?, i : nat}: - `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) + `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`(`%`([V128_valtype]), `%`([($lunpack(lnn) : numtype <: valtype)]))) -- if (i < N) ;; 6-typing.watsup:882.1-884.14 rule vreplace_lane{C : context, lnn : lnn, N : N, i : nat}: - `%|-%:%`(C, VREPLACE_LANE_instr(`%X%`(lnn, `%`(N)), `%`(i)), `%->%`([V128_valtype ($lunpack(lnn) : numtype <: valtype)], [V128_valtype])) + `%|-%:%`(C, VREPLACE_LANE_instr(`%X%`(lnn, `%`(N)), `%`(i)), `%->%`(`%`([V128_valtype ($lunpack(lnn) : numtype <: valtype)]), `%`([V128_valtype]))) -- if (i < N) ;; 6-typing.watsup:886.1-887.40 rule vunop{C : context, sh : shape, vunop_sh : vunop_(sh)}: - `%|-%:%`(C, VUNOP_instr(sh, vunop_sh), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VUNOP_instr(sh, vunop_sh), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:889.1-890.47 rule vbinop{C : context, sh : shape, vbinop_sh : vbinop_(sh)}: - `%|-%:%`(C, VBINOP_instr(sh, vbinop_sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VBINOP_instr(sh, vbinop_sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:892.1-893.43 rule vtestop{C : context, sh : shape, vtestop_sh : vtestop_(sh)}: - `%|-%:%`(C, VTESTOP_instr(sh, vtestop_sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VTESTOP_instr(sh, vtestop_sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:895.1-896.47 rule vrelop{C : context, sh : shape, vrelop_sh : vrelop_(sh)}: - `%|-%:%`(C, VRELOP_instr(sh, vrelop_sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VRELOP_instr(sh, vrelop_sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:898.1-899.50 rule vshiftop{C : context, sh : ishape, vshiftop_sh : vshiftop_(sh)}: - `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop_sh), `%->%`([V128_valtype I32_valtype], [V128_valtype])) + `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop_sh), `%->%`(`%`([V128_valtype I32_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:902.1-903.55 rule vcvtop{C : context, sh : shape, vcvtop : vcvtop, hf? : half?, sx? : sx?, zero : zero}: - `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:905.1-906.44 rule vnarrow{C : context, sh : ishape, sx : sx}: - `%|-%:%`(C, VNARROW_instr(sh, sh, sx), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VNARROW_instr(sh, sh, sx), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:908.1-909.49 rule vextunop{C : context, sh : ishape, vextunop : vextunop_(sh, sh), sx : sx}: - `%|-%:%`(C, VEXTUNOP_instr(sh, sh, vextunop, sx), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VEXTUNOP_instr(sh, sh, vextunop, sx), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:911.1-912.56 rule vextbinop{C : context, sh : ishape, vextbinop : vextbinop_(sh, sh), sx : sx}: - `%|-%:%`(C, VEXTBINOP_instr(sh, sh, vextbinop, sx), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VEXTBINOP_instr(sh, sh, vextbinop, sx), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:914.1-915.33 rule vbitmask{C : context, sh : ishape}: - `%|-%:%`(C, VBITMASK_instr(sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VBITMASK_instr(sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:920.1-922.28 rule local.get{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) + `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`(`%`([]), `%`([t]))) -- if (C.LOCAL_context[x.`%`.0] = `%%`(init, t)) ;; 6-typing.watsup:935.1-937.28 rule global.get{C : context, x : idx, t : valtype, mut : mut}: - `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) + `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`(`%`([]), `%`([t]))) -- if (C.GLOBAL_context[x.`%`.0] = `%%`(mut, t)) ;; 6-typing.watsup:939.1-941.28 rule global.set{C : context, x : idx, t : valtype}: - `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) + `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`(`%`([t]), `%`([]))) -- if (C.GLOBAL_context[x.`%`.0] = `%%`(`MUT%?`(?(())), t)) ;; 6-typing.watsup:946.1-948.28 rule table.get{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [(rt : reftype <: valtype)])) + `%|-%:%`(C, TABLE.GET_instr(x), `%->%`(`%`([I32_valtype]), `%`([(rt : reftype <: valtype)]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:950.1-952.28 rule table.set{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype (rt : reftype <: valtype)], [])) + `%|-%:%`(C, TABLE.SET_instr(x), `%->%`(`%`([I32_valtype (rt : reftype <: valtype)]), `%`([]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:954.1-956.24 rule table.size{C : context, x : idx, tt : tabletype}: - `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) + `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`(`%`([]), `%`([I32_valtype]))) -- if (C.TABLE_context[x.`%`.0] = tt) ;; 6-typing.watsup:958.1-960.28 rule table.grow{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([(rt : reftype <: valtype) I32_valtype], [I32_valtype])) + `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`(`%`([(rt : reftype <: valtype) I32_valtype]), `%`([I32_valtype]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:962.1-964.28 rule table.fill{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype (rt : reftype <: valtype) I32_valtype], [])) + `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`(`%`([I32_valtype (rt : reftype <: valtype) I32_valtype]), `%`([]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:966.1-970.36 rule table.copy{C : context, x_1 : idx, x_2 : idx, lim_1 : limits, rt_1 : reftype, lim_2 : limits, rt_2 : reftype}: - `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.TABLE_context[x_1.`%`.0] = `%%`(lim_1, rt_1)) -- if (C.TABLE_context[x_2.`%`.0] = `%%`(lim_2, rt_2)) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) ;; 6-typing.watsup:972.1-976.36 rule table.init{C : context, x : idx, y : idx, lim : limits, rt_1 : reftype, rt_2 : reftype}: - `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt_1)) -- if (C.ELEM_context[y.`%`.0] = rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) ;; 6-typing.watsup:978.1-980.23 rule elem.drop{C : context, x : idx, rt : reftype}: - `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) + `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`(`%`([]), `%`([]))) -- if (C.ELEM_context[x.`%`.0] = rt) ;; 6-typing.watsup:985.1-987.22 rule memory.size{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) + `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`(`%`([]), `%`([I32_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup:989.1-991.22 rule memory.grow{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) + `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`(`%`([I32_valtype]), `%`([I32_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup:993.1-995.22 rule memory.fill{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup:997.1-1000.26 rule memory.copy{C : context, x_1 : idx, x_2 : idx, mt_1 : memtype, mt_2 : memtype}: - `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.MEM_context[x_1.`%`.0] = mt_1) -- if (C.MEM_context[x_2.`%`.0] = mt_2) ;; 6-typing.watsup:1002.1-1005.23 rule memory.init{C : context, x : idx, y : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if (C.DATA_context[y.`%`.0] = OK) ;; 6-typing.watsup:1007.1-1009.23 rule data.drop{C : context, x : idx}: - `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) + `%|-%:%`(C, DATA.DROP_instr(x), `%->%`(`%`([]), `%`([]))) -- if (C.DATA_context[x.`%`.0] = OK) ;; 6-typing.watsup:1011.1-1016.29 rule load{C : context, nt : numtype, n? : n?, sx? : sx?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([(nt : numtype <: valtype)]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} @@ -14469,7 +14496,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1018.1-1023.29 rule store{C : context, nt : numtype, n? : n?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) + `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype (nt : numtype <: valtype)]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} @@ -14477,38 +14504,38 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1025.1-1028.30 rule vload{C : context, M : M, N : N, sx : sx, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ((M / 8) * N)) ;; 6-typing.watsup:1030.1-1033.26 rule vload-splat{C : context, n : n, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(SPLAT_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(SPLAT_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= (n / 8)) ;; 6-typing.watsup:1035.1-1038.25 rule vload-zero{C : context, n : n, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(ZERO_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(ZERO_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) < (n / 8)) ;; 6-typing.watsup:1040.1-1044.29 rule vload_lane{C : context, n : n, x : idx, n_A : n, n_O : n, laneidx : laneidx, mt : memtype}: - `%|-%:%`(C, VLOAD_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`([I32_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`(`%`([I32_valtype V128_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) < (n / 8)) -- if (laneidx.`%`.0 < (128 / n)) ;; 6-typing.watsup:1046.1-1049.37 rule vstore{C : context, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VSTORE_instr(x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype V128_valtype], [])) + `%|-%:%`(C, VSTORE_instr(x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype V128_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($vsize(V128_vectype) / 8)) ;; 6-typing.watsup:1051.1-1055.29 rule vstore_lane{C : context, n : n, x : idx, n_A : n, n_O : n, laneidx : laneidx, mt : memtype}: - `%|-%:%`(C, VSTORE_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`([I32_valtype V128_valtype], [])) + `%|-%:%`(C, VSTORE_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`(`%`([I32_valtype V128_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) < (n / 8)) -- if (laneidx.`%`.0 < (128 / n)) @@ -14517,51 +14544,51 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) relation Instrf_ok: `%|-%:%`(context, instr, instrtype) ;; 6-typing.watsup:518.1-520.41 rule instr{C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1 : valtype}, [], t_2*{t_2 : valtype})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, instr, `%->%%`(`%`(t_1*{t_1 : valtype}), [], `%`(t_2*{t_2 : valtype}))) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:924.1-926.28 rule local.set{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) + `%|-%:%`(C, LOCAL.SET_instr(x), `%->%%`(`%`([t]), [x], `%`([]))) -- if (C.LOCAL_context[x.`%`.0] = `%%`(init, t)) ;; 6-typing.watsup:928.1-930.28 rule local.tee{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) + `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%%`(`%`([t]), [x], `%`([t]))) -- if (C.LOCAL_context[x.`%`.0] = `%%`(init, t)) ;; 6-typing.watsup:505.1-505.74 -relation Instrs_ok: `%|-%*_:%`(context, instr*, instrtype) +relation Instrs_ok: `%|-%:%`(context, instr*, instrtype) ;; 6-typing.watsup:522.1-523.29 rule empty{C : context}: - `%|-%*_:%`(C, [], `%->%*%`([], [], [])) + `%|-%:%`(C, [], `%->%%`(`%`([]), [], `%`([]))) ;; 6-typing.watsup:525.1-530.52 rule seq{C : context, instr_1 : instr, instr_2* : instr*, t_1* : valtype*, x_1* : idx*, x_2* : idx*, t_3* : valtype*, init* : init*, t* : valtype*, C' : context, t_2* : valtype*}: - `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + `%|-%:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, `%`(t_3*{t_3 : valtype}))) -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init : init t : valtype x_1 : idx} -- if (C' = $with_locals(C, x_1*{x_1 : localidx}, `%%`(SET_init, t)*{t : valtype})) - -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2 : instr}, `%->%*%`(t_2*{t_2 : valtype}, x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C', instr_2*{instr_2 : instr}, `%->%%`(`%`(t_2*{t_2 : valtype}), x_2*{x_2 : localidx}, `%`(t_3*{t_3 : valtype}))) ;; 6-typing.watsup:532.1-535.35 rule sub{C : context, instr* : instr*, it' : instrtype, it : instrtype}: - `%|-%*_:%`(C, instr*{instr : instr}, it') - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, it) + `%|-%:%`(C, instr*{instr : instr}, it') + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, it) -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:537.1-539.47 rule frame{C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, x* : idx*, t_2* : valtype*}: - `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t*{t : valtype} :: t_1*{t_1 : valtype}, x*{x : localidx}, t*{t : valtype} :: t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`(t*{t : valtype} :: t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t*{t : valtype} :: t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) } ;; 6-typing.watsup relation Expr_ok: `%|-%:%`(context, expr, resulttype) ;; 6-typing.watsup rule _{C : context, instr* : instr*, t* : valtype*}: - `%|-%:%`(C, instr*{instr : instr}, t*{t : valtype}) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`([], [], t*{t : valtype})) + `%|-%:%`(C, instr*{instr : instr}, `%`(t*{t : valtype})) + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`([]), [], `%`(t*{t : valtype}))) ;; 6-typing.watsup rec { @@ -14626,14 +14653,14 @@ relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) ;; 6-typing.watsup rule _{C : context, expr : expr, t : valtype}: `%|-%:%CONST`(C, expr, t) - -- Expr_ok: `%|-%:%`(C, expr, [t]) + -- Expr_ok: `%|-%:%`(C, expr, `%`([t])) -- Expr_const: `%|-%CONST`(C, expr) ;; 6-typing.watsup -relation Type_ok: `%|-%:%*`(context, type, deftype*) +relation Type_ok: `%|-%:%`(context, type, deftype*) ;; 6-typing.watsup rule _{C : context, rectype : rectype, dt* : deftype*, x : idx}: - `%|-%:%*`(C, TYPE(rectype), dt*{dt : deftype}) + `%|-%:%`(C, TYPE(rectype), dt*{dt : deftype}) -- if (x = `%`(|C.TYPE_context|)) -- if (dt*{dt : deftype} = $rolldt(x, rectype)) -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt : deftype}], rectype, OK_oktypeidx(x)) @@ -14654,10 +14681,10 @@ relation Local_ok: `%|-%:%`(context, local, localtype) relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup rule _{C : context, x : idx, local* : local*, expr : expr, t_1* : valtype*, t_2* : valtype*, lt* : localtype*}: - `%|-%:%`(C, `FUNC%%*%`(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + `%|-%:%`(C, FUNC(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) -- (Local_ok: `%|-%:%`(C, local, lt))*{local : local lt : localtype} - -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2 : valtype})}, expr, t_2*{t_2 : valtype}) + -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(`%`(t_2*{t_2 : valtype}))}, expr, `%`(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -14704,7 +14731,7 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup rule _{C : context, rt : reftype, expr* : expr*, elemmode : elemmode}: - `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr : expr}, elemmode), rt) + `%|-%:%`(C, ELEM(rt, expr*{expr : expr}, elemmode), rt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr : expr} -- Elemmode_ok: `%|-%:%`(C, elemmode, rt) @@ -14724,7 +14751,7 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) relation Data_ok: `%|-%:_OK`(context, data) ;; 6-typing.watsup rule _{C : context, b* : byte*, datamode : datamode}: - `%|-%:_OK`(C, `DATA%*%`(b*{b : byte}, datamode)) + `%|-%:_OK`(C, DATA(b*{b : byte}, datamode)) -- Datamode_ok: `%|-%:_OK`(C, datamode) ;; 6-typing.watsup @@ -14732,7 +14759,7 @@ relation Start_ok: `%|-%:_OK`(context, start) ;; 6-typing.watsup rule _{C : context, x : idx}: `%|-%:_OK`(C, START(x)) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`([], []))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`([]), `%`([])))) ;; 6-typing.watsup relation Import_ok: `%|-%:%`(context, import, externtype) @@ -14774,42 +14801,42 @@ relation Export_ok: `%|-%:%`(context, export, externtype) rec { ;; 6-typing.watsup:1229.1-1229.77 -relation Globals_ok: `%|-%*_:%*`(context, global*, globaltype*) +relation Globals_ok: `%|-%:%`(context, global*, globaltype*) ;; 6-typing.watsup:1272.1-1273.17 rule empty{C : context}: - `%|-%*_:%*`(C, [], []) + `%|-%:%`(C, [], []) ;; 6-typing.watsup:1275.1-1278.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: - `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) + `%|-%:%`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) - -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) + -- Globals_ok: `%|-%:%`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) } ;; 6-typing.watsup rec { ;; 6-typing.watsup:1228.1-1228.75 -relation Types_ok: `%|-%*_:%*`(context, type*, deftype*) +relation Types_ok: `%|-%:%`(context, type*, deftype*) ;; 6-typing.watsup:1264.1-1265.17 rule empty{C : context}: - `%|-%*_:%*`(C, [], []) + `%|-%:%`(C, [], []) ;; 6-typing.watsup:1267.1-1270.49 rule cons{C : context, type_1 : type, type* : type*, dt_1 : deftype, dt* : deftype*}: - `%|-%*_:%*`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) - -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) + `%|-%:%`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) + -- Type_ok: `%|-%:%`(C, type_1, [dt_1]) + -- Types_ok: `%|-%:%`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) } ;; 6-typing.watsup relation Module_ok: `|-%:_OK`(module) ;; 6-typing.watsup rule _{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data^n : data^n, n : n, start? : start?, export* : export*, dt'* : deftype*, ixt* : externtype*, C' : context, gt* : globaltype*, tt* : tabletype*, mt* : memtype*, C : context, dt* : deftype*, rt* : reftype*, et* : externtype*, idt* : deftype*, igt* : globaltype*, itt* : tabletype*, imt* : memtype*}: - `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) - -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) + `|-%:_OK`(MODULE(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) + -- Types_ok: `%|-%:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) -- (Import_ok: `%|-%:%`({TYPE dt'*{dt' : deftype}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import : import ixt : externtype} - -- Globals_ok: `%|-%*_:%*`(C', global*{global : global}, gt*{gt : globaltype}) + -- Globals_ok: `%|-%:%`(C', global*{global : global}, gt*{gt : globaltype}) -- (Table_ok: `%|-%:%`(C', table, tt))*{table : table tt : tabletype} -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem : mem mt : memtype} -- (Func_ok: `%|-%:%`(C, func, dt))*{dt : deftype func : func} @@ -14858,314 +14885,314 @@ relation Ref_ok: `%|-%:%`(store, ref, reftype) `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) ;; 8-reduction.watsup -relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) +relation Step_pure: `%~>%`(admininstr*, admininstr*) ;; 8-reduction.watsup rule unreachable: - `%*_~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) + `%~>%`([UNREACHABLE_admininstr], [TRAP_admininstr]) ;; 8-reduction.watsup rule nop: - `%*_~>%*`([NOP_admininstr], []) + `%~>%`([NOP_admininstr], []) ;; 8-reduction.watsup rule drop{val : val}: - `%*_~>%*`([(val : val <: admininstr) DROP_admininstr], []) + `%~>%`([(val : val <: admininstr) DROP_admininstr], []) ;; 8-reduction.watsup rule select-true{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) + `%~>%`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule select-false{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) + `%~>%`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule if-true{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) + `%~>%`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule if-false{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) + `%~>%`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule label-vals{n : n, instr* : instr*, val* : val*}: - `%*_~>%*`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) + `%~>%`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) ;; 8-reduction.watsup rule br-zero{n : n, instr'* : instr*, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule br-succ{n : n, instr'* : instr*, val* : val*, l : labelidx, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) + `%~>%`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) ;; 8-reduction.watsup rule br_if-true{c : num_(I32_numtype), l : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) + `%~>%`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule br_if-false{c : num_(I32_numtype), l : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) + `%~>%`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) -- if (c = `%`(0)) ;; 8-reduction.watsup rule br_table-lt{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) -- if (i < |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_table-ge{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) -- if (i >= |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_on_null-null{val : val, l : labelidx, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) + `%~>%`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) -- if (val = REF.NULL_val(ht)) ;; 8-reduction.watsup rule br_on_null-addr{val : val, l : labelidx}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [(val : val <: admininstr)]) + `%~>%`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [(val : val <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule br_on_non_null-null{val : val, l : labelidx, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], []) + `%~>%`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], []) -- if (val = REF.NULL_val(ht)) ;; 8-reduction.watsup rule br_on_non_null-addr{val : val, l : labelidx}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], [(val : val <: admininstr) BR_admininstr(l)]) + `%~>%`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], [(val : val <: admininstr) BR_admininstr(l)]) -- otherwise ;; 8-reduction.watsup rule call_indirect-call{x : idx, y : idx}: - `%*_~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) CALL_REF_admininstr(?(y))]) + `%~>%`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) CALL_REF_admininstr(?(y))]) ;; 8-reduction.watsup rule return_call_indirect{x : idx, y : idx}: - `%*_~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) RETURN_CALL_REF_admininstr(?(y))]) + `%~>%`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) RETURN_CALL_REF_admininstr(?(y))]) ;; 8-reduction.watsup rule frame-vals{n : n, f : frame, val^n : val^n}: - `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) + `%~>%`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-frame{n : n, f : frame, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) + `%~>%`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-label{k : nat, instr'* : instr*, val* : val*, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) + `%~>%`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) ;; 8-reduction.watsup rule unop-val{nt : numtype, c_1 : num_(nt), unop : unop_(nt), c : num_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) + `%~>%`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) -- if ($unop(nt, unop, c_1) = [c]) ;; 8-reduction.watsup rule unop-trap{nt : numtype, c_1 : num_(nt), unop : unop_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) -- if ($unop(nt, unop, c_1) = []) ;; 8-reduction.watsup rule binop-val{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), binop : binop_(nt), c : num_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- if ($binop(nt, binop, c_1, c_2) = [c]) ;; 8-reduction.watsup rule binop-trap{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), binop : binop_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) -- if ($binop(nt, binop, c_1, c_2) = []) ;; 8-reduction.watsup rule testop{nt : numtype, c_1 : num_(nt), testop : testop_(nt), c : num_(I32_numtype)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $testop(nt, testop, c_1)) ;; 8-reduction.watsup rule relop{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), relop : relop_(nt), c : num_(I32_numtype)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $relop(nt, relop, c_1, c_2)) ;; 8-reduction.watsup rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?, c : num_(nt_2)}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) + `%~>%`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = [c]) ;; 8-reduction.watsup rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, `%`(i)))]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, `%`(i)))]) ;; 8-reduction.watsup rule ref.is_null-true{val : val, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- if (val = REF.NULL_val(ht)) ;; 8-reduction.watsup rule ref.is_null-false{val : val}: - `%*_~>%*`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule ref.as_non_null-null{ref : ref, ht : heaptype}: - `%*_~>%*`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) + `%~>%`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) -- if (ref = REF.NULL_ref(ht)) ;; 8-reduction.watsup rule ref.as_non_null-addr{ref : ref}: - `%*_~>%*`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [(ref : ref <: admininstr)]) + `%~>%`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [(ref : ref <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule ref.eq-null{ref_1 : ref, ref_2 : ref, ht_1 : heaptype, ht_2 : heaptype}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) ;; 8-reduction.watsup rule ref.eq-true{ref_1 : ref, ref_2 : ref}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- otherwise -- if (ref_1 = ref_2) ;; 8-reduction.watsup rule ref.eq-false{ref_1 : ref, ref_2 : ref}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule i31.get-null{ht : heaptype, sx : sx}: - `%*_~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) + `%~>%`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) ;; 8-reduction.watsup rule i31.get-num{i : nat, sx : sx}: - `%*_~>%*`([REF.I31_NUM_admininstr(`%`(i)) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, `%`(i)))]) + `%~>%`([REF.I31_NUM_admininstr(`%`(i)) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, `%`(i)))]) ;; 8-reduction.watsup rule extern.convert_any-null{ht : heaptype}: - `%*_~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) + `%~>%`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) ;; 8-reduction.watsup rule extern.convert_any-addr{addrref : addrref}: - `%*_~>%*`([(addrref : addrref <: admininstr) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) + `%~>%`([(addrref : addrref <: admininstr) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) ;; 8-reduction.watsup rule any.convert_extern-null{ht : heaptype}: - `%*_~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) + `%~>%`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) ;; 8-reduction.watsup rule any.convert_extern-addr{addrref : addrref}: - `%*_~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [(addrref : addrref <: admininstr)]) + `%~>%`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [(addrref : addrref <: admininstr)]) ;; 8-reduction.watsup rule vvunop{c_1 : vec_(V128_vnn), vvunop : vvunop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VVUNOP_admininstr(V128_vectype, vvunop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VVUNOP_admininstr(V128_vectype, vvunop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vvunop(V128_vectype, vvunop, c_1) = c) ;; 8-reduction.watsup rule vvbinop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), vvbinop : vvbinop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VVBINOP_admininstr(V128_vectype, vvbinop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VVBINOP_admininstr(V128_vectype, vvbinop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vvbinop(V128_vectype, vvbinop, c_1, c_2) = c) ;; 8-reduction.watsup rule vvternop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), c_3 : vec_(V128_vnn), vvternop : vvternop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VCONST_admininstr(V128_vectype, c_3) VVTERNOP_admininstr(V128_vectype, vvternop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VCONST_admininstr(V128_vectype, c_3) VVTERNOP_admininstr(V128_vectype, vvternop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vvternop(V128_vectype, vvternop, c_1, c_2, c_3) = c) ;; 8-reduction.watsup rule vvtestop{c_1 : vec_(V128_vnn), c : num_(I32_numtype)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VVTESTOP_admininstr(V128_vectype, ANY_TRUE_vvtestop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VVTESTOP_admininstr(V128_vectype, ANY_TRUE_vvtestop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $ine($vsize(V128_vectype), c_1, `%`(0))) ;; 8-reduction.watsup rule vswizzle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn : inn, N : N, c' : vec_(V128_vnn), c : iN($size((inn : inn <: numtype))), ci* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*, k^N : nat^N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) -- if (ci*{ci : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) -- if (c*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: `%`(0)^(256 - N){}) -- if (c' = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c*{}[ci*{ci : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))}[k].`%`.0]^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) -- if (c = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c'*{}[i*{i : nat}[k]]^(k%*`([CONST_admininstr($lunpack(lnn), c_1) VSPLAT_admininstr(`%X%`(lnn, `%`(N)))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([CONST_admininstr($lunpack(lnn), c_1) VSPLAT_admininstr(`%X%`(lnn, `%`(N)))], [VCONST_admininstr(V128_vectype, c)]) -- if (c = $invlanes_(`%X%`(lnn, `%`(N)), $packnum(lnn, c_1)^N{})) ;; 8-reduction.watsup rule vextract_lane-num{c_1 : vec_(V128_vnn), nt : numtype, N : N, i : nat, c_2 : num_(nt)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((nt : numtype <: lanetype), `%`(N)), ?(), `%`(i))], [CONST_admininstr(nt, c_2)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((nt : numtype <: lanetype), `%`(N)), ?(), `%`(i))], [CONST_admininstr(nt, c_2)]) -- if (c_2 = $lanes_(`%X%`((nt : numtype <: lanetype), `%`(N)), c_1)[i]) ;; 8-reduction.watsup rule vextract_lane-pack{c_1 : vec_(V128_vnn), pt : packtype, N : N, sx : sx, i : nat, c_2 : num_(I32_numtype)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((pt : packtype <: lanetype), `%`(N)), ?(sx), `%`(i))], [CONST_admininstr(I32_numtype, c_2)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((pt : packtype <: lanetype), `%`(N)), ?(sx), `%`(i))], [CONST_admininstr(I32_numtype, c_2)]) -- if (c_2 = $ext($psize(pt), 32, sx, $lanes_(`%X%`((pt : packtype <: lanetype), `%`(N)), c_1)[i])) ;; 8-reduction.watsup rule vreplace_lane{c_1 : vec_(V128_vnn), lnn : lnn, c_2 : num_($lunpack(lnn)), N : N, i : nat, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr($lunpack(lnn), c_2) VREPLACE_LANE_admininstr(`%X%`(lnn, `%`(N)), `%`(i))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr($lunpack(lnn), c_2) VREPLACE_LANE_admininstr(`%X%`(lnn, `%`(N)), `%`(i))], [VCONST_admininstr(V128_vectype, c)]) -- if (c = $invlanes_(`%X%`(lnn, `%`(N)), $lanes_(`%X%`(lnn, `%`(N)), c_1)[[i] = $packnum(lnn, c_2)])) ;; 8-reduction.watsup rule vunop{c_1 : vec_(V128_vnn), sh : shape, vunop : vunop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VUNOP_admininstr(sh, vunop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VUNOP_admininstr(sh, vunop)], [VCONST_admininstr(V128_vectype, c)]) -- if (c = $vunop(sh, vunop, c_1)) ;; 8-reduction.watsup rule vbinop-val{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vbinop : vbinop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vbinop(sh, vbinop, c_1, c_2) = [c]) ;; 8-reduction.watsup rule vbinop-trap{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vbinop : vbinop_(sh)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [TRAP_admininstr]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [TRAP_admininstr]) -- if ($vbinop(sh, vbinop, c_1, c_2) = []) ;; 8-reduction.watsup rule vrelop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vrelop : vrelop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VRELOP_admininstr(sh, vrelop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VRELOP_admininstr(sh, vrelop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vrelop(sh, vrelop, c_1, c_2) = c) ;; 8-reduction.watsup rule vshiftop{c_1 : vec_(V128_vnn), n : n, imm : imm, N : N, vshiftop : vshiftop_(`%X%`(imm, `%`(N))), c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1)) -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))})) ;; 8-reduction.watsup rule vtestop-true{c : vec_(V128_vnn), inn : inn, N : N, ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), inn : inn, N : N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule vbitmask{c : vec_(V128_vnn), inn : inn, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) -- if ($ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($size((inn : inn <: numtype)))}) ;; 8-reduction.watsup rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn_1 : inn, N_1 : N, inn_2 : inn, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, cj_1* : iN($size((inn_2 : inn <: numtype)))*, cj_2* : iN($size((inn_2 : inn <: numtype)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) -- if (ci_2*{ci_2 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2)) -- if (cj_1*{cj_1 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1 : iN($size((inn_1 : inn <: numtype)))}) @@ -15174,184 +15201,184 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vcvtop-normal{c_1 : vec_(V128_vnn), lnn_2 : lnn, N_2 : N, vcvtop : vcvtop, lnn_1 : lnn, N_1 : N, sx : sx, c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1)) -- if (c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-half{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, hf : half, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-zero{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} :: `%`(0)^N_1{})) ;; 8-reduction.watsup rule vextunop{c_1 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTUNOP_admininstr(sh_1, sh_2, vextunop, sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTUNOP_admininstr(sh_1, sh_2, vextunop, sx)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vextunop(sh_1, sh_2, vextunop, sx, c_1) = c) ;; 8-reduction.watsup rule vextbinop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextbinop : vextbinop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VEXTBINOP_admininstr(sh_1, sh_2, vextbinop, sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VEXTBINOP_admininstr(sh_1, sh_2, vextbinop, sx)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vextbinop(sh_1, sh_2, vextbinop, sx, c_1, c_2) = c) ;; 8-reduction.watsup rule local.tee{val : val, x : idx}: - `%*_~>%*`([(val : val <: admininstr) LOCAL.TEE_admininstr(x)], [(val : val <: admininstr) (val : val <: admininstr) LOCAL.SET_admininstr(x)]) + `%~>%`([(val : val <: admininstr) LOCAL.TEE_admininstr(x)], [(val : val <: admininstr) (val : val <: admininstr) LOCAL.SET_admininstr(x)]) ;; 8-reduction.watsup def $blocktype(state : state, blocktype : blocktype) : functype ;; 8-reduction.watsup - def $blocktype{z : state}(z, _RESULT_blocktype(?())) = `%->%`([], []) + def $blocktype{z : state}(z, _RESULT_blocktype(?())) = `%->%`(`%`([]), `%`([])) ;; 8-reduction.watsup - def $blocktype{z : state, t : valtype}(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) + def $blocktype{z : state, t : valtype}(z, _RESULT_blocktype(?(t))) = `%->%`(`%`([]), `%`([t])) ;; 8-reduction.watsup def $blocktype{z : state, x : idx, ft : functype}(z, _IDX_blocktype(x)) = ft -- Expand: `%~~%`($type(z, x), FUNC_comptype(ft)) ;; 8-reduction.watsup -relation Step_read: `%~>%*`(config, admininstr*) +relation Step_read: `%~>%`(config, admininstr*) ;; 8-reduction.watsup rule block{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, n : n, t_1^k : valtype^k, t_2^n : valtype^n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) + `%~>%`(`%;%`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(`%`(t_1^k{t_1 : valtype}), `%`(t_2^n{t_2 : valtype}))) ;; 8-reduction.watsup rule loop{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, t_1^k : valtype^k, t_2^n : valtype^n, n : n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) + `%~>%`(`%;%`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(`%`(t_1^k{t_1 : valtype}), `%`(t_2^n{t_2 : valtype}))) ;; 8-reduction.watsup rule br_on_cast-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt) -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) ;; 8-reduction.watsup rule br_on_cast-fail{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule br_on_cast_fail-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt) -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) ;; 8-reduction.watsup rule br_on_cast_fail-fail{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) -- otherwise ;; 8-reduction.watsup rule call{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) CALL_REF_admininstr(?())]) + `%~>%`(`%;%`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) CALL_REF_admininstr(?())]) ;; 8-reduction.watsup rule call_ref-null{z : state, ht : heaptype, x? : idx?}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule call_ref-func{z : state, val^n : val^n, n : n, a : addr, x? : idx?, m : m, f : frame, instr* : instr*, fi : funcinst, t_1^n : valtype^n, t_2^m : valtype^m, y : idx, t* : valtype*}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) -- if ($funcinst(z)[a] = fi) - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) - -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t : valtype}, instr*{instr : instr})) + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2^m{t_2 : valtype})))) + -- if (fi.CODE_funcinst = FUNC(y, LOCAL(t)*{t : valtype}, instr*{instr : instr})) -- if (f = {LOCAL ?(val)^n{val : val} :: $default(t)*{t : valtype}, MODULE fi.MODULE_funcinst}) ;; 8-reduction.watsup rule return_call{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) RETURN_CALL_REF_admininstr(?())]) + `%~>%`(`%;%`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) RETURN_CALL_REF_admininstr(?())]) ;; 8-reduction.watsup rule return_call_ref-label{z : state, k : nat, instr'* : instr*, val* : val*, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) + `%~>%`(`%;%`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) ;; 8-reduction.watsup rule return_call_ref-frame-addr{z : state, k : nat, f : frame, val'* : val*, val^n : val^n, n : n, a : addr, x? : idx?, instr* : instr*, t_1^n : valtype^n, t_2^m : valtype^m, m : m}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) + `%~>%`(`%;%`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2^m{t_2 : valtype})))) ;; 8-reduction.watsup rule return_call_ref-frame-null{z : state, k : nat, f : frame, val* : val*, ht : heaptype, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule ref.func{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0])]) + `%~>%`(`%;%`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0])]) ;; 8-reduction.watsup rule ref.test-true{z : state, ref : ref, rt : reftype, rt' : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(1))]) -- Ref_ok: `%|-%:%`($store(z), ref, rt') -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) ;; 8-reduction.watsup rule ref.test-false{z : state, ref : ref, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule ref.cast-succeed{z : state, ref : ref, rt : reftype, rt' : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [(ref : ref <: admininstr)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt') -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) ;; 8-reduction.watsup rule ref.cast-fail{z : state, ref : ref, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) -- otherwise ;; 8-reduction.watsup rule struct.new_default{z : state, x : idx, val* : val*, mut* : mut*, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%~>%`(`%;%`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 8-reduction.watsup rule struct.get-null{z : state, ht : heaptype, sx? : sx?, x : idx, i : nat}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) ;; 8-reduction.watsup rule struct.get-struct{z : state, a : addr, sx? : sx?, x : idx, i : nat, zt* : storagetype*, si : structinst, mut* : mut*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) + `%~>%`(`%;%`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) -- if ($structinst(z)[a] = si) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) ;; 8-reduction.watsup rule array.new{z : state, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [(val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [(val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) ;; 8-reduction.watsup rule array.new_default{z : state, n : n, x : idx, val : val, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if ($default($unpack(zt)) = ?(val)) ;; 8-reduction.watsup rule array.new_elem-oob{z : state, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) ;; 8-reduction.watsup rule array.new_elem-alloc{z : state, i : nat, n : n, x : idx, y : idx, ref^n : ref^n}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- if (ref^n{ref : ref} = $elem(z, y).ELEM_eleminst[i : n]) ;; 8-reduction.watsup rule array.new_data-oob{z : state, i : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if ((i + ((n * $zsize(zt)) / 8)) > |$data(z, y).DATA_datainst|) ;; 8-reduction.watsup rule array.new_data-num{z : state, i : nat, n : n, x : idx, y : idx, nt : numtype, c^n : num_(nt)^n, mut : mut, zt : storagetype, o0 : numtype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- if ($nunpack(zt) = ?(o0)) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (nt = o0) @@ -15359,7 +15386,7 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.new_data-vec{z : state, i : nat, n : n, x : idx, y : idx, vt : vectype, c^n : vec_(vt)^n, mut : mut, zt : storagetype, o0 : vectype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- if ($vunpack(zt) = ?(o0)) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (vt = o0) @@ -15367,75 +15394,75 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.get-null{z : state, ht : heaptype, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.get-oob{z : state, a : addr, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.get-array{z : state, a : addr, i : nat, sx? : sx?, x : idx, zt : storagetype, fv : fieldval, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) ;; 8-reduction.watsup rule array.len-null{z : state, ht : heaptype}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.len-array{z : state, a : addr, n : n}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, `%`(n))]) -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.fill-null{z : state, ht : heaptype, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.fill-oob{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.fill-zero{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.fill-succ{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule array.copy-null1{z : state, ht_1 : heaptype, i_1 : nat, ref : ref, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, `%`(i_1)) (ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, `%`(i_1)) (ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.copy-null2{z : state, ref : ref, i_1 : nat, ht_2 : heaptype, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_1)) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_1)) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.copy-oob1{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.copy-oob2{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.copy-zero{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.copy-le{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) -- if (sx?{sx : sx} = $sxfield(zt_2)) @@ -15443,61 +15470,61 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.copy-gt{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) -- if (sx?{sx : sx} = $sxfield(zt_2)) ;; 8-reduction.watsup rule array.init_elem-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.init_elem-oob1{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.init_elem-oob2{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) ;; 8-reduction.watsup rule array.init_elem-zero{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.init_elem-succ{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, ref : ref}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_ELEM_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_ELEM_admininstr(x, y)]) -- otherwise -- if (ref = $elem(z, y).ELEM_eleminst[j]) ;; 8-reduction.watsup rule array.init_data-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.init_data-oob1{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.init_data-oob2{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if ((j + ((n * $zsize(zt)) / 8)) > |$data(z, y).DATA_datainst|) ;; 8-reduction.watsup rule array.init_data-zero{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.init_data-num{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, nt : numtype, c : num_(nt), zt : storagetype, mut : mut, o0 : numtype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) -- if ($nunpack(zt) = ?(o0)) -- otherwise -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) @@ -15506,7 +15533,7 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.init_data-num{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, vt : vectype, c : vec_(vt), zt : storagetype, mut : mut, o0 : vectype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) -- if ($vunpack((vt : vectype <: storagetype)) = ?(o0)) -- otherwise -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) @@ -15515,132 +15542,132 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule local.get{z : state, x : idx, val : val}: - `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [(val : val <: admininstr)]) + `%~>%`(`%;%`(z, [LOCAL.GET_admininstr(x)]), [(val : val <: admininstr)]) -- if ($local(z, x) = ?(val)) ;; 8-reduction.watsup rule global.get{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst : val <: admininstr)]) + `%~>%`(`%;%`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst : val <: admininstr)]) ;; 8-reduction.watsup rule table.get-oob{z : state, i : nat, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) -- if (i >= |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.get-val{z : state, i : nat, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] : ref <: admininstr)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] : ref <: admininstr)]) -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.size{z : state, x : idx, n : n}: - `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) -- if (|$table(z, x).ELEM_tableinst| = n) ;; 8-reduction.watsup rule table.fill-oob{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.fill-zero{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.fill-succ{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule table.copy-oob{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) ;; 8-reduction.watsup rule table.copy-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.copy-le{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) -- otherwise -- if (j <= i) ;; 8-reduction.watsup rule table.copy-gt{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(((j + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i + n) - 1))) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(((j + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i + n) - 1))) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) -- otherwise ;; 8-reduction.watsup rule table.init-oob{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) ;; 8-reduction.watsup rule table.init-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.init-succ{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) ($elem(z, y).ELEM_eleminst[i] : ref <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.INIT_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) ($elem(z, y).ELEM_eleminst[i] : ref <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.INIT_admininstr(x, y)]) -- otherwise ;; 8-reduction.watsup rule load-num-oob{z : state, i : nat, nt : numtype, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ($size(nt) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule load-num-val{z : state, i : nat, nt : numtype, x : idx, mo : memop, c : num_(nt)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) -- if ($nbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : ($size(nt) / 8)]) ;; 8-reduction.watsup rule load-pack-oob{z : state, i : nat, inn : inn, n : n, sx : sx, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (n / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule load-pack-val{z : state, i : nat, inn : inn, n : n, sx : sx, x : idx, mo : memop, c : iN(n)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [CONST_admininstr((inn : inn <: numtype), $ext(n, $size((inn : inn <: numtype)), sx, c))]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [CONST_admininstr((inn : inn <: numtype), $ext(n, $size((inn : inn <: numtype)), sx, c))]) -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (n / 8)]) ;; 8-reduction.watsup rule vload-oob{z : state, i : nat, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ($vsize(V128_vectype) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-val{z : state, i : nat, x : idx, mo : memop, c : vec_(V128_vnn)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- if ($vbytes(V128_vectype, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : ($vsize(V128_vectype) / 8)]) ;; 8-reduction.watsup rule vload-shape-oob{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ((M * N) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-shape-val{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop, c : vec_(V128_vnn), j^N : nat^N, k^N : nat^N, inn : inn}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- (if ($ibytes(M, `%`(j)) = $mem(z, x).DATA_meminst[((i + mo.OFFSET_memop.`%`.0) + ((k * M) / 8)) : (M / 8)]))^(k%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-splat-val{z : state, i : nat, N : N, x : idx, mo : memop, c : vec_(V128_vnn), j : nat, imm : imm, M : M}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- if ($ibytes(N, `%`(j)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)]) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = (128 / N)) @@ -15648,23 +15675,23 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule vload-zero-oob{z : state, i : nat, N : N, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-zero-val{z : state, i : nat, N : N, x : idx, mo : memop, c : vec_(V128_vnn), j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- if ($ibytes(N, `%`(j)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)]) -- if (c = $ext(N, 128, U_sx, `%`(j))) ;; 8-reduction.watsup rule vload_lane-oob{z : state, i : nat, vt : vectype, c_1 : vec_(vt), N : N, x : idx, mo : memop, j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload_lane-val{z : state, i : nat, vt : vectype, c_1 : vec_(vt), N : N, x : idx, mo : memop, j : nat, c : vec_(vt), k : nat, imm : imm, M : M}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(vt, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(vt, c)]) -- if ($ibytes(N, `%`(k)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)]) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = ($vsize(vt) / N)) @@ -15672,199 +15699,199 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule memory.size{z : state, x : idx, n : n}: - `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule memory.fill-oob{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule memory.fill-zero{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.fill-succ{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule memory.copy-oob{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) ;; 8-reduction.watsup rule memory.copy-zero{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.copy-le{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise -- if (i_1 <= i_2) ;; 8-reduction.watsup rule memory.copy-gt{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise ;; 8-reduction.watsup rule memory.init-oob{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) ;; 8-reduction.watsup rule memory.init-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.init-succ{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`($data(z, y).DATA_datainst[i].`%`.0)) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.INIT_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`($data(z, y).DATA_datainst[i].`%`.0)) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.INIT_admininstr(x, y)]) -- otherwise ;; 8-reduction.watsup relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule pure{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) - -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_pure: `%~>%`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule read{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) - -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_read: `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule struct.new{z : state, val^n : val^n, n : n, x : idx, si : structinst, mut^n : mut^n, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut : mut zt : storagetype})) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%`(`%%`(mut, zt)^n{mut : mut zt : storagetype}))) -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val zt : storagetype}}) ;; 8-reduction.watsup rule struct.set-null{z : state, ht : heaptype, val : val, x : idx, i : nat}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%`(z, [TRAP_admininstr])) ;; 8-reduction.watsup rule struct.set-struct{z : state, a : addr, val : val, x : idx, i : nat, fv : fieldval, mut* : mut*, zt* : storagetype*}: - `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`($with_struct(z, a, i, fv), [])) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%~>%`(`%;%`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%`($with_struct(z, a, i, fv), [])) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) -- if (fv = $packval(zt*{zt : storagetype}[i], val)) ;; 8-reduction.watsup rule array.new_fixed{z : state, val^n : val^n, n : n, x : idx, ai : arrayinst, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val}}) ;; 8-reduction.watsup rule array.set-null{z : state, ht : heaptype, i : nat, val : val, x : idx}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) ;; 8-reduction.watsup rule array.set-oob{z : state, a : addr, i : nat, val : val, x : idx}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.set-array{z : state, a : addr, i : nat, val : val, x : idx, fv : fieldval, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`($with_array(z, a, i, fv), [])) -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) -- if (fv = $packval(zt, val)) ;; 8-reduction.watsup rule local.set{z : state, val : val, x : idx}: - `%~>%`(`%;%*`(z, [(val : val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) + `%~>%`(`%;%`(z, [(val : val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%`($with_local(z, x, val), [])) ;; 8-reduction.watsup rule global.set{z : state, val : val, x : idx}: - `%~>%`(`%;%*`(z, [(val : val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) + `%~>%`(`%;%`(z, [(val : val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%`($with_global(z, x, val), [])) ;; 8-reduction.watsup rule table.set-oob{z : state, i : nat, ref : ref, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.set-val{z : state, i : nat, ref : ref, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%`($with_table(z, x, i, ref), [])) -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.grow-succeed{z : state, ref : ref, n : n, x : idx, ti : tableinst, o0 : tableinst}: - `%~>%`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, `%`(|$table(z, x).ELEM_tableinst|))])) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, `%`(|$table(z, x).ELEM_tableinst|))])) -- if ($growtable($table(z, x), n, ref) = ?(o0)) -- if (ti = o0) ;; 8-reduction.watsup rule table.grow-fail{z : state, ref : ref, n : n, x : idx}: - `%~>%`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) ;; 8-reduction.watsup rule elem.drop{z : state, x : idx}: - `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) + `%~>%`(`%;%`(z, [ELEM.DROP_admininstr(x)]), `%;%`($with_elem(z, x, []), [])) ;; 8-reduction.watsup rule store-num-oob{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + ($size(nt) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule store-num-val{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) -- if (b*{b : byte} = $nbytes(nt, c)) ;; 8-reduction.watsup rule store-pack-oob{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + (n / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule store-pack-val{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) -- if (b*{b : byte} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c))) ;; 8-reduction.watsup rule vstore-oob{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + ($vsize(V128_vectype) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vstore-val{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) -- if (b*{b : byte} = $vbytes(V128_vectype, c)) ;; 8-reduction.watsup rule vstore_lane-oob{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + N) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vstore_lane-val{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, b* : byte*, imm : imm, M : M}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = (128 / N)) -- if (b*{b : byte} = $ibytes(N, `%`($lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)[j].`%`.0))) ;; 8-reduction.watsup rule memory.grow-succeed{z : state, n : n, x : idx, mi : meminst, o0 : meminst}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, `%`((|$mem(z, x).DATA_meminst| / (64 * $Ki))))])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, `%`((|$mem(z, x).DATA_meminst| / (64 * $Ki))))])) -- if ($growmemory($mem(z, x), n) = ?(o0)) -- if (mi = o0) ;; 8-reduction.watsup rule memory.grow-fail{z : state, n : n, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) ;; 8-reduction.watsup rule data.drop{z : state, x : idx}: - `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) + `%~>%`(`%;%`(z, [DATA.DROP_admininstr(x)]), `%;%`($with_data(z, x, []), [])) ;; 8-reduction.watsup rec { @@ -15873,21 +15900,21 @@ rec { relation Steps: `%~>*%`(config, config) ;; 8-reduction.watsup:18.1-19.36 rule refl{z : state, admininstr* : admininstr*}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z, admininstr*{admininstr : admininstr})) + `%~>*%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z, admininstr*{admininstr : admininstr})) ;; 8-reduction.watsup:21.1-24.53 rule trans{z : state, admininstr* : admininstr*, z'' : state, admininstr''* : admininstr*, z' : state, admininstr' : admininstr}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) - -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z', admininstr'*{})) - -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) + `%~>*%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z'', admininstr''*{admininstr'' : admininstr})) + -- Step: `%~>%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z', admininstr'*{})) + -- Steps: `%~>*%`(`%;%`(z', [admininstr']), `%;%`(z'', admininstr''*{admininstr'' : admininstr})) } ;; 8-reduction.watsup -relation Eval_expr: `%;%~>*%;%*`(state, expr, state, val*) +relation Eval_expr: `%;%~>*%;%`(state, expr, state, val*) ;; 8-reduction.watsup rule _{z : state, instr* : instr*, z' : state, val* : val*}: - `%;%~>*%;%*`(z, instr*{instr : instr}, z', val*{val : val}) - -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z', (val : val <: admininstr)*{val : val})) + `%;%~>*%;%`(z, instr*{instr : instr}, z', val*{val : val}) + -- Steps: `%~>*%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z', (val : val <: admininstr)*{val : val})) ;; 9-module.watsup rec { @@ -15908,7 +15935,7 @@ def $alloctypes(type*) : deftype* def $allocfunc(store : store, moduleinst : moduleinst, func : func) : (store, funcaddr) ;; 9-module.watsup def $allocfunc{s : store, mm : moduleinst, func : func, fi : funcinst, x : idx, local* : local*, expr : expr}(s, mm, func) = (s[FUNC_store =.. [fi]], |s.FUNC_store|) - -- if (func = `FUNC%%*%`(x, local*{local : local}, expr)) + -- if (func = FUNC(x, local*{local : local}, expr)) -- if (fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func}) ;; 9-module.watsup @@ -16034,7 +16061,7 @@ def $instexport(funcaddr*, globaladdr*, tableaddr*, memaddr*, export : export) : def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) : (store, moduleinst) ;; 9-module.watsup def $allocmodule{s : store, module : module, externval* : externval*, val_g* : val*, ref_t* : ref*, ref_e** : ref**, s_6 : store, mm : moduleinst, type* : type*, import* : import*, func^n_f : func^n_f, n_f : n, globaltype^n_g : globaltype^n_g, expr_g^n_g : expr^n_g, n_g : n, tabletype^n_t : tabletype^n_t, expr_t^n_t : expr^n_t, n_t : n, memtype^n_m : memtype^n_m, n_m : n, reftype^n_e : reftype^n_e, expr_e*^n_e : expr*^n_e, elemmode^n_e : elemmode^n_e, n_e : n, byte*^n_d : byte*^n_d, datamode^n_d : datamode^n_d, n_d : n, start? : start?, export* : export*, fa_ex* : funcaddr*, ga_ex* : globaladdr*, ta_ex* : tableaddr*, ma_ex* : memaddr*, fa* : funcaddr*, i_f^n_f : nat^n_f, ga* : globaladdr*, i_g^n_g : nat^n_g, ta* : tableaddr*, i_t^n_t : nat^n_t, ma* : memaddr*, i_m^n_m : nat^n_m, ea* : elemaddr*, i_e^n_e : nat^n_e, da* : dataaddr*, i_d^n_d : nat^n_d, xi* : exportinst*, dt* : deftype*, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store}(s, module, externval*{externval : externval}, val_g*{val_g : val}, ref_t*{ref_t : ref}, ref_e*{ref_e : ref}*{ref_e : ref}) = (s_6, mm) - -- if (module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func^n_f{func : func}, GLOBAL(globaltype, expr_g)^n_g{expr_g : expr globaltype : globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t : expr tabletype : tabletype}, MEMORY(memtype)^n_m{memtype : memtype}, `ELEM%%*%`(reftype, expr_e*{expr_e : expr}, elemmode)^n_e{elemmode : elemmode expr_e : expr reftype : reftype}, `DATA%*%`(byte*{byte : byte}, datamode)^n_d{byte : byte datamode : datamode}, start?{start : start}, export*{export : export})) + -- if (module = MODULE(type*{type : type}, import*{import : import}, func^n_f{func : func}, GLOBAL(globaltype, expr_g)^n_g{expr_g : expr globaltype : globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t : expr tabletype : tabletype}, MEMORY(memtype)^n_m{memtype : memtype}, ELEM(reftype, expr_e*{expr_e : expr}, elemmode)^n_e{elemmode : elemmode expr_e : expr reftype : reftype}, DATA(byte*{byte : byte}, datamode)^n_d{byte : byte datamode : datamode}, start?{start : start}, export*{export : export})) -- if (fa_ex*{fa_ex : funcaddr} = $funcsxv(externval*{externval : externval})) -- if (ga_ex*{ga_ex : globaladdr} = $globalsxv(externval*{externval : externval})) -- if (ta_ex*{ta_ex : tableaddr} = $tablesxv(externval*{externval : externval})) @@ -16058,36 +16085,36 @@ def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) ;; 9-module.watsup def $runelem(elem : elem, idx : idx) : instr* ;; 9-module.watsup - def $runelem{reftype : reftype, expr* : expr*, y : idx}(`ELEM%%*%`(reftype, expr*{expr : expr}, PASSIVE_elemmode), y) = [] + def $runelem{reftype : reftype, expr* : expr*, y : idx}(ELEM(reftype, expr*{expr : expr}, PASSIVE_elemmode), y) = [] ;; 9-module.watsup - def $runelem{reftype : reftype, expr* : expr*, y : idx}(`ELEM%%*%`(reftype, expr*{expr : expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] + def $runelem{reftype : reftype, expr* : expr*, y : idx}(ELEM(reftype, expr*{expr : expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] ;; 9-module.watsup - def $runelem{reftype : reftype, expr* : expr*, x : idx, instr* : instr*, y : idx}(`ELEM%%*%`(reftype, expr*{expr : expr}, ACTIVE_elemmode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|expr*{expr : expr}|)) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] + def $runelem{reftype : reftype, expr* : expr*, x : idx, instr* : instr*, y : idx}(ELEM(reftype, expr*{expr : expr}, ACTIVE_elemmode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|expr*{expr : expr}|)) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] ;; 9-module.watsup def $rundata(data : data, idx : idx) : instr* ;; 9-module.watsup - def $rundata{byte* : byte*, y : idx}(`DATA%*%`(byte*{byte : byte}, PASSIVE_datamode), y) = [] + def $rundata{byte* : byte*, y : idx}(DATA(byte*{byte : byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup - def $rundata{byte* : byte*, x : idx, instr* : instr*, y : idx}(`DATA%*%`(byte*{byte : byte}, ACTIVE_datamode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|byte*{byte : byte}|)) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] + def $rundata{byte* : byte*, x : idx, instr* : instr*, y : idx}(DATA(byte*{byte : byte}, ACTIVE_datamode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|byte*{byte : byte}|)) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] ;; 9-module.watsup def $instantiate(store : store, module : module, externval*) : config ;; 9-module.watsup - def $instantiate{s : store, module : module, externval* : externval*, s' : store, f : frame, instr_E* : instr*, instr_D* : instr*, x? : idx?, type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start? : start?, export* : export*, globaltype* : globaltype*, expr_G* : expr*, tabletype* : tabletype*, expr_T* : expr*, reftype* : reftype*, expr_E** : expr**, elemmode* : elemmode*, n_F : n, n_E : n, n_D : n, mm_init : moduleinst, i_F^n_F : nat^n_F, z : state, val_G* : val*, ref_T* : ref*, ref_E** : ref**, mm : moduleinst, i^n_E : nat^n_E, j^n_D : nat^n_D}(s, module, externval*{externval : externval}) = `%;%*`(`%;%`(s', f), (instr_E : instr <: admininstr)*{instr_E : instr} :: (instr_D : instr <: admininstr)*{instr_D : instr} :: CALL_admininstr(x)?{x : funcidx}) - -- if (module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data*{data : data}, start?{start : start}, export*{export : export})) + def $instantiate{s : store, module : module, externval* : externval*, s' : store, f : frame, instr_E* : instr*, instr_D* : instr*, x? : idx?, type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start? : start?, export* : export*, globaltype* : globaltype*, expr_G* : expr*, tabletype* : tabletype*, expr_T* : expr*, reftype* : reftype*, expr_E** : expr**, elemmode* : elemmode*, n_F : n, n_E : n, n_D : n, mm_init : moduleinst, i_F^n_F : nat^n_F, z : state, val_G* : val*, ref_T* : ref*, ref_E** : ref**, mm : moduleinst, i^n_E : nat^n_E, j^n_D : nat^n_D}(s, module, externval*{externval : externval}) = `%;%`(`%;%`(s', f), (instr_E : instr <: admininstr)*{instr_E : instr} :: (instr_D : instr <: admininstr)*{instr_D : instr} :: CALL_admininstr(x)?{x : funcidx}) + -- if (module = MODULE(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data*{data : data}, start?{start : start}, export*{export : export})) -- if (global*{global : global} = GLOBAL(globaltype, expr_G)*{expr_G : expr globaltype : globaltype}) -- if (table*{table : table} = TABLE(tabletype, expr_T)*{expr_T : expr tabletype : tabletype}) - -- if (elem*{elem : elem} = `ELEM%%*%`(reftype, expr_E*{expr_E : expr}, elemmode)*{elemmode : elemmode expr_E : expr reftype : reftype}) + -- if (elem*{elem : elem} = ELEM(reftype, expr_E*{expr_E : expr}, elemmode)*{elemmode : elemmode expr_E : expr reftype : reftype}) -- if (start?{start : start} = START(x)?{x : funcidx}) -- if (n_F = |func*{func : func}|) -- if (n_E = |elem*{elem : elem}|) -- if (n_D = |data*{data : data}|) -- if (mm_init = {TYPE $alloctypes(type*{type : type}), FUNC $funcsxv(externval*{externval : externval}) :: (|s.FUNC_store| + i_F)^(i_F*%;%*`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} + -- (Eval_expr: `%;%~>*%;%`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} + -- (Eval_expr: `%;%~>*%;%`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} + -- (Eval_expr: `%;%~>*%;%`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} -- if ((s', mm) = $allocmodule(s, module, externval*{externval : externval}, val_G*{val_G : val}, ref_T*{ref_T : ref}, ref_E*{ref_E : ref}*{ref_E : ref})) -- if (f = {LOCAL [], MODULE mm}) -- if (instr_E*{instr_E : instr} = $concat_(syntax instr, $runelem(elem*{elem : elem}[i], `%`(i))^(i%`(t_1^n{t_1 : valtype}, t_2*{t_2 : valtype}))) - -;; A-binary.watsup -rec { - -;; A-binary.watsup:49.1-49.24 -def $utf8(name : name) : byte* - ;; A-binary.watsup:50.1-50.47 - def $utf8{ch : nat, b : byte}([`%`(ch)]) = [b] - -- if ((ch < 128) /\ (ch = b.`%`.0)) - ;; A-binary.watsup:51.1-51.96 - def $utf8{ch : nat, b_1 : byte, b_2 : byte}([`%`(ch)]) = [b_1 b_2] - -- if (((128 <= ch) /\ (ch < 2048)) /\ (ch = (((2 ^ 6) * (b_1.`%`.0 - 192)) + (b_2.`%`.0 - 128)))) - ;; A-binary.watsup:52.1-52.148 - def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte}([`%`(ch)]) = [b_1 b_2 b_3] - -- if ((((2048 <= ch) /\ (ch < 55296)) \/ ((57344 <= ch) /\ (ch < 65536))) /\ (ch = ((((2 ^ 12) * (b_1.`%`.0 - 224)) + ((2 ^ 6) * (b_2.`%`.0 - 128))) + (b_3.`%`.0 - 128)))) - ;; A-binary.watsup:53.1-53.148 - def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([`%`(ch)]) = [b_1 b_2 b_3 b_4] - -- if (((65536 <= ch) /\ (ch < 69632)) /\ (ch = (((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128)))) - ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(`%`(ch)*{ch : nat}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch : nat}) -} + -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = FUNC(x, local*{local : local}, expr)) + -- Expand: `%~~%`(s.FUNC_store[fa].TYPE_funcinst, FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; A-binary.watsup syntax castop = (nul, nul) @@ -16239,14 +16245,8 @@ def $concat_(syntax X, X**) : X* } ;; 1-syntax.watsup -syntax list{syntax X}(syntax X) = X* - -;; 1-syntax.watsup -syntax char = `%`{i : nat}(i : nat) - -- if (((i >= 0) /\ (i <= 55295)) \/ ((i >= 57344) /\ (i <= 1114111))) - -;; 1-syntax.watsup -syntax name = char* +syntax list{syntax X}(syntax X) = `%`{X* : X*}(X*{X : X} : X*) + -- if (|X*{X : X}| < (2 ^ 32)) ;; 1-syntax.watsup syntax bit = `%`{i : nat}(i : nat) @@ -16351,6 +16351,35 @@ def $canon_(N : N) : nat ;; 1-syntax.watsup syntax vN{N : N}(N) = iN(N) +;; 1-syntax.watsup +syntax char = `%`{i : nat}(i : nat) + -- if (((i >= 0) /\ (i <= 55295)) \/ ((i >= 57344) /\ (i <= 1114111))) + +;; 1-syntax.watsup +rec { + +;; 1-syntax.watsup:87.1-87.25 +def $utf8(char*) : byte* + ;; A-binary.watsup:50.1-50.47 + def $utf8{ch : char, b : byte}([ch]) = [b] + -- if ((ch.`%`.0 < 128) /\ (ch = `%`(b.`%`.0))) + ;; A-binary.watsup:51.1-51.96 + def $utf8{ch : char, b_1 : byte, b_2 : byte}([ch]) = [b_1 b_2] + -- if (((128 <= ch.`%`.0) /\ (ch.`%`.0 < 2048)) /\ (ch = `%`((((2 ^ 6) * (b_1.`%`.0 - 192)) + (b_2.`%`.0 - 128))))) + ;; A-binary.watsup:52.1-52.148 + def $utf8{ch : char, b_1 : byte, b_2 : byte, b_3 : byte}([ch]) = [b_1 b_2 b_3] + -- if ((((2048 <= ch.`%`.0) /\ (ch.`%`.0 < 55296)) \/ ((57344 <= ch.`%`.0) /\ (ch.`%`.0 < 65536))) /\ (ch = `%`(((((2 ^ 12) * (b_1.`%`.0 - 224)) + ((2 ^ 6) * (b_2.`%`.0 - 128))) + (b_3.`%`.0 - 128))))) + ;; A-binary.watsup:53.1-53.148 + def $utf8{ch : char, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([ch]) = [b_1 b_2 b_3 b_4] + -- if (((65536 <= ch.`%`.0) /\ (ch.`%`.0 < 69632)) /\ (ch = `%`((((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128))))) + ;; A-binary.watsup:54.1-54.44 + def $utf8{ch* : char*}(ch*{ch : char}) = $concat_(syntax byte, $utf8([ch])*{ch : char}) +} + +;; 1-syntax.watsup +syntax name = `%`{char* : char*}(char*{char : char} : char*) + -- if (|$utf8(char*{char : char})| < (2 ^ 32)) + ;; 1-syntax.watsup syntax idx = u32 @@ -16421,7 +16450,7 @@ syntax fin = `FINAL%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:146.1-147.14 +;; 1-syntax.watsup:147.1-148.14 syntax valtype = | I32 | I64 @@ -16431,10 +16460,10 @@ syntax valtype = | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | BOT -;; 1-syntax.watsup:154.1-155.16 +;; 1-syntax.watsup:155.1-156.16 syntax resulttype = list(syntax valtype) -;; 1-syntax.watsup:162.1-162.68 +;; 1-syntax.watsup:163.1-163.68 syntax storagetype = | BOT | I32 @@ -16446,34 +16475,34 @@ syntax storagetype = | I8 | I16 -;; 1-syntax.watsup:175.1-176.18 +;; 1-syntax.watsup:176.1-177.18 syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) -;; 1-syntax.watsup:178.1-178.70 +;; 1-syntax.watsup:179.1-179.70 syntax functype = `%->%`{resulttype : resulttype}(resulttype : resulttype, resulttype) -;; 1-syntax.watsup:179.1-179.64 +;; 1-syntax.watsup:180.1-180.64 syntax structtype = list(syntax fieldtype) -;; 1-syntax.watsup:180.1-180.53 +;; 1-syntax.watsup:181.1-181.53 syntax arraytype = fieldtype -;; 1-syntax.watsup:182.1-185.18 +;; 1-syntax.watsup:183.1-186.18 syntax comptype = | STRUCT{structtype : structtype}(structtype : structtype) | ARRAY{arraytype : arraytype}(arraytype : arraytype) | FUNC{functype : functype}(functype : functype) -;; 1-syntax.watsup:189.1-190.60 +;; 1-syntax.watsup:190.1-191.60 syntax subtype = | SUB{fin : fin, typeidx* : typeidx*, comptype : comptype}(fin : fin, typeidx*{typeidx : typeidx} : typeidx*, comptype : comptype) | SUBD{fin : fin, heaptype* : heaptype*, comptype : comptype}(fin : fin, heaptype*{heaptype : heaptype} : heaptype*, comptype : comptype) -;; 1-syntax.watsup:192.1-193.22 +;; 1-syntax.watsup:193.1-194.22 syntax rectype = | REC{list : list(syntax subtype)}(list : list(syntax subtype)) -;; 1-syntax.watsup:198.1-199.26 +;; 1-syntax.watsup:199.1-200.26 syntax heaptype = | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY @@ -16932,7 +16961,7 @@ syntax zero = `ZERO%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:522.1-534.78 +;; 1-syntax.watsup:523.1-535.78 syntax instr = | UNREACHABLE | NOP @@ -17062,7 +17091,7 @@ syntax type = TYPE{rectype : rectype}(rectype : rectype) syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) +syntax func = FUNC{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) ;; 1-syntax.watsup syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) @@ -17074,10 +17103,10 @@ syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) +syntax elem = ELEM{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) ;; 1-syntax.watsup -syntax data = `DATA%*%`{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) +syntax data = DATA{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup syntax start = START{funcidx : funcidx}(funcidx : funcidx) @@ -17096,7 +17125,7 @@ syntax export = EXPORT{name : name, externidx : externidx}(name : name, externid syntax import = IMPORT{name : name, externtype : externtype}(name : name, name, externtype : externtype) ;; 1-syntax.watsup -syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) +syntax module = MODULE{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) ;; 2-syntax-aux.watsup rec { @@ -17152,7 +17181,7 @@ def $free_dataidx_expr(expr : expr) : dataidx* ;; 2-syntax-aux.watsup def $free_dataidx_func(func : func) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) + def $free_dataidx_func{x : idx, loc* : local*, e : expr}(FUNC(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) ;; 2-syntax-aux.watsup rec { @@ -17291,7 +17320,7 @@ def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype ;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype ;; 2-syntax-aux.watsup:175.1-175.85 - def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt : fieldtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype}) + def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(`%`(yt*{yt : fieldtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype(`%`($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype})) ;; 2-syntax-aux.watsup:176.1-176.81 def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx : typevar}, ht*{ht : heaptype}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:177.1-177.78 @@ -17307,7 +17336,7 @@ def $subst_subtype(subtype : subtype, typevar*, heaptype*) : subtype ;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype ;; 2-syntax-aux.watsup:184.1-184.76 - def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st : subtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype}) + def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(`%`(st*{st : subtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype(`%`($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype})) ;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype @@ -17317,7 +17346,7 @@ def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype ;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype ;; 2-syntax-aux.watsup:189.1-189.113 - def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}, $subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype}) + def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`(`%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}), `%`($subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype})) } ;; 2-syntax-aux.watsup @@ -17370,25 +17399,25 @@ def $subst_all_deftypes(deftype*, heaptype*) : deftype* ;; 2-syntax-aux.watsup def $rollrt(typeidx : typeidx, rectype : rectype) : rectype ;; 2-syntax-aux.watsup - def $rollrt{x : idx, st^n : subtype^n, n : n, i^n : nat^n}(x, REC_rectype(st^n{st : subtype})) = REC_rectype($subst_subtype(st, $idx(`%`((x.`%`.0 + i)))^(i%*%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) +syntax instrtype = `%->%%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) ;; 6-typing.watsup syntax context = @@ -18861,16 +18890,16 @@ relation Valtype_ok: `%|-%:_OK`(context, valtype) relation Resulttype_ok: `%|-%:_OK`(context, resulttype) ;; 6-typing.watsup rule _{C : context, t* : valtype*}: - `%|-%:_OK`(C, t*{t : valtype}) + `%|-%:_OK`(C, `%`(t*{t : valtype})) -- (Valtype_ok: `%|-%:_OK`(C, t))*{t : valtype} ;; 6-typing.watsup relation Instrtype_ok: `%|-%:_OK`(context, instrtype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, x* : idx*, t_2* : valtype*, lt* : localtype*}: - `%|-%:_OK`(C, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + `%|-%:_OK`(C, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_1*{t_1 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_2*{t_2 : valtype})) -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt : localtype x : idx} ;; 6-typing.watsup @@ -18910,15 +18939,15 @@ relation Fieldtype_ok: `%|-%:_OK`(context, fieldtype) relation Functype_ok: `%|-%:_OK`(context, functype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:_OK`(C, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + `%|-%:_OK`(C, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_1*{t_1 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Comptype_ok: `%|-%:_OK`(context, comptype) ;; 6-typing.watsup rule struct{C : context, yt* : fieldtype*}: - `%|-%:_OK`(C, STRUCT_comptype(yt*{yt : fieldtype})) + `%|-%:_OK`(C, STRUCT_comptype(`%`(yt*{yt : fieldtype}))) -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt : fieldtype} ;; 6-typing.watsup @@ -18991,7 +19020,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:303.1-305.35 rule struct{C : context, deftype : deftype, yt* : fieldtype*}: `%|-%<:%`(C, (deftype : deftype <: heaptype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt : fieldtype})) + -- Expand: `%~~%`(deftype, STRUCT_comptype(`%`(yt*{yt : fieldtype}))) ;; 6-typing.watsup:307.1-309.33 rule array{C : context, deftype : deftype, yt : fieldtype}: @@ -19117,7 +19146,7 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) ;; 6-typing.watsup rule struct{C : context, yt_1* : fieldtype*, yt'_1 : fieldtype, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1 : fieldtype} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2 : fieldtype})) + `%|-%<:%`(C, STRUCT_comptype(`%`(yt_1*{yt_1 : fieldtype} :: [yt'_1])), STRUCT_comptype(`%`(yt_2*{yt_2 : fieldtype}))) -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 : fieldtype yt_2 : fieldtype} ;; 6-typing.watsup @@ -19177,13 +19206,13 @@ rec { relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) ;; 6-typing.watsup:196.1-197.24 rule empty{C : context, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) + `%|-%:%`(C, REC_rectype(`%`([])), OK_oktypeidxnat(x, i)) ;; 6-typing.watsup:199.1-202.50 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidxnat(x, i)) + `%|-%:%`(C, REC_rectype(`%`([st_1] :: st*{st : subtype})), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) - -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) } ;; 6-typing.watsup @@ -19193,18 +19222,18 @@ rec { relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) ;; 6-typing.watsup:184.1-185.23 rule empty{C : context, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) + `%|-%:%`(C, REC_rectype(`%`([])), OK_oktypeidx(x)) ;; 6-typing.watsup:187.1-190.43 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidx(x)) + `%|-%:%`(C, REC_rectype(`%`([st_1] :: st*{st : subtype})), OK_oktypeidx(x)) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) - -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) + -- Rectype_ok: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidx(`%`((x.`%`.0 + 1)))) ;; 6-typing.watsup:192.1-194.49 rule rec2{C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(x, 0)) + `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(x, 0)) } ;; 6-typing.watsup @@ -19213,7 +19242,7 @@ relation Deftype_ok: `%|-%:_OK`(context, deftype) rule _{C : context, qt : rectype, i : nat, x : idx, st^n : subtype^n, n : n}: `%|-%:_OK`(C, DEF_deftype(qt, i)) -- Rectype_ok: `%|-%:%`(C, qt, OK_oktypeidx(x)) - -- if (qt = REC_rectype(st^n{st : subtype})) + -- if (qt = REC_rectype(`%`(st^n{st : subtype}))) -- if (i < n) ;; 6-typing.watsup @@ -19269,19 +19298,19 @@ relation Externtype_ok: `%|-%:_OK`(context, externtype) -- Memtype_ok: `%|-%:_OK`(C, mt) ;; 6-typing.watsup -relation Resulttype_sub: `%|-%*_<:%*`(context, valtype*, valtype*) +relation Resulttype_sub: `%|-%<:%`(context, valtype*, valtype*) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%*_<:%*`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) + `%|-%<:%`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 : valtype t_2 : valtype} ;; 6-typing.watsup relation Instrtype_sub: `%|-%<:%`(context, instrtype, instrtype) ;; 6-typing.watsup rule _{C : context, t_11* : valtype*, x_1* : idx*, t_12* : valtype*, t_21* : valtype*, x_2* : idx*, t_22* : valtype*, x* : idx*, t* : valtype*}: - `%|-%<:%`(C, `%->%*%`(t_11*{t_11 : valtype}, x_1*{x_1 : localidx}, t_12*{t_12 : valtype}), `%->%*%`(t_21*{t_21 : valtype}, x_2*{x_2 : localidx}, t_22*{t_22 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) + `%|-%<:%`(C, `%->%%`(`%`(t_11*{t_11 : valtype}), x_1*{x_1 : localidx}, `%`(t_12*{t_12 : valtype})), `%->%%`(`%`(t_21*{t_21 : valtype}), x_2*{x_2 : localidx}, `%`(t_22*{t_22 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) + -- Resulttype_sub: `%|-%<:%`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) -- if (x*{x : idx} = $setminus(x_2*{x_2 : idx}, x_1*{x_1 : idx})) -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t : valtype x : idx} @@ -19348,11 +19377,11 @@ relation Externtype_sub: `%|-%<:%`(context, externtype, externtype) relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) ;; 6-typing.watsup rule void{C : context}: - `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) + `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`(`%`([]), `%`([]))) ;; 6-typing.watsup rule result{C : context, t : valtype}: - `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`([], [t])) + `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`(`%`([]), `%`([t]))) ;; 6-typing.watsup rule typeidx{C : context, x : idx, ft : functype}: @@ -19366,77 +19395,77 @@ rec { relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:544.1-545.34 rule unreachable{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:547.1-548.24 rule nop{C : context}: - `%|-%:%`(C, NOP_instr, `%->%`([], [])) + `%|-%:%`(C, NOP_instr, `%->%`(`%`([]), `%`([]))) ;; 6-typing.watsup:550.1-551.23 rule drop{C : context, t : valtype}: - `%|-%:%`(C, DROP_instr, `%->%`([t], [])) + `%|-%:%`(C, DROP_instr, `%->%`(`%`([t]), `%`([]))) ;; 6-typing.watsup:554.1-555.31 rule select-expl{C : context, t : valtype}: - `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) + `%|-%:%`(C, SELECT_instr(?([t])), `%->%`(`%`([t t I32_valtype]), `%`([t]))) ;; 6-typing.watsup:557.1-560.37 rule select-impl{C : context, t : valtype, t' : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) + `%|-%:%`(C, SELECT_instr(?()), `%->%`(`%`([t t I32_valtype]), `%`([t]))) -- Valtype_sub: `%|-%<:%`(C, t, t') -- if ((t' = (numtype : numtype <: valtype)) \/ (t' = (vectype : vectype <: valtype))) ;; 6-typing.watsup:578.1-581.61 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:583.1-586.61 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_1*{t_1 : valtype})], RETURN ?()}, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:588.1-592.65 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_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_2*{x_2 : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(`%`(t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_2*{x_2 : localidx}, `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:597.1-599.24 rule br{C : context, l : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) + `%|-%:%`(C, BR_instr(l), `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype})) ;; 6-typing.watsup:601.1-603.24 rule br_if{C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t : valtype} :: [I32_valtype], t*{t : valtype})) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) + `%|-%:%`(C, BR_IF_instr(l), `%->%`(`%`(t*{t : valtype} :: [I32_valtype]), `%`(t*{t : valtype}))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype})) ;; 6-typing.watsup:605.1-608.44 rule br_table{C : context, l* : labelidx*, l' : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) - -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0]))*{l : labelidx} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0]) + `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) + -- (Resulttype_sub: `%|-%<:%`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0].`%`.0))*{l : labelidx} + -- Resulttype_sub: `%|-%<:%`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0].`%`.0) ;; 6-typing.watsup:610.1-613.31 rule br_on_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(`%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)]), `%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype})) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:615.1-618.31 rule br_on_non_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype})) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]) + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(`%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)]), `%`(t*{t : valtype}))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:620.1-626.34 rule br_on_cast{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(`%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)]), `%`(t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)]))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype} :: [(rt : reftype <: valtype)])) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -19444,8 +19473,8 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:628.1-634.49 rule br_on_cast_fail{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [(rt_2 : reftype <: valtype)])) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(`%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)]), `%`(t*{t : valtype} :: [(rt_2 : reftype <: valtype)]))) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype} :: [(rt : reftype <: valtype)])) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -19453,414 +19482,414 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:639.1-641.24 rule return{C : context, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) - -- if (C.RETURN_context = ?(t*{t : valtype})) + `%|-%:%`(C, RETURN_instr, `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(`%`(t*{t : valtype}))) ;; 6-typing.watsup:643.1-645.46 rule call{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + `%|-%:%`(C, CALL_instr(x), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; 6-typing.watsup:647.1-649.46 rule call_ref{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2 : valtype})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(`%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`(t_2*{t_2 : valtype}))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; 6-typing.watsup:651.1-655.46 rule call_indirect{C : context, x : idx, y : idx, t_1* : valtype*, t_2* : valtype*, lim : limits, rt : reftype}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(`%`(t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_2*{t_2 : valtype}))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; 6-typing.watsup:657.1-661.40 rule return_call{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}, t_4*{t_4 : valtype})) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}), `%`(t_4*{t_4 : valtype}))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:663.1-667.40 rule return_call_ref{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4 : valtype})) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`(t_4*{t_4 : valtype}))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:669.1-675.40 rule return_call_indirect{C : context, x : idx, y : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, lim : limits, rt : reftype, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype], t_4*{t_4 : valtype})) + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_4*{t_4 : valtype}))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:680.1-681.33 rule const{C : context, nt : numtype, c_nt : num_(nt)}: - `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [(nt : numtype <: valtype)])) + `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`(`%`([]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:683.1-684.34 rule unop{C : context, nt : numtype, unop_nt : unop_(nt)}: - `%|-%:%`(C, UNOP_instr(nt, unop_nt), `%->%`([(nt : numtype <: valtype)], [(nt : numtype <: valtype)])) + `%|-%:%`(C, UNOP_instr(nt, unop_nt), `%->%`(`%`([(nt : numtype <: valtype)]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:686.1-687.39 rule binop{C : context, nt : numtype, binop_nt : binop_(nt)}: - `%|-%:%`(C, BINOP_instr(nt, binop_nt), `%->%`([(nt : numtype <: valtype) (nt : numtype <: valtype)], [(nt : numtype <: valtype)])) + `%|-%:%`(C, BINOP_instr(nt, binop_nt), `%->%`(`%`([(nt : numtype <: valtype) (nt : numtype <: valtype)]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:689.1-690.39 rule testop{C : context, nt : numtype, testop_nt : testop_(nt)}: - `%|-%:%`(C, TESTOP_instr(nt, testop_nt), `%->%`([(nt : numtype <: valtype)], [I32_valtype])) + `%|-%:%`(C, TESTOP_instr(nt, testop_nt), `%->%`(`%`([(nt : numtype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:692.1-693.40 rule relop{C : context, nt : numtype, relop_nt : relop_(nt)}: - `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->%`([(nt : numtype <: valtype) (nt : numtype <: valtype)], [I32_valtype])) + `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->%`(`%`([(nt : numtype <: valtype) (nt : numtype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:696.1-699.34 rule reinterpret{C : context, nt_1 : numtype, nt_2 : numtype}: - `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([(nt_2 : numtype <: valtype)], [(nt_1 : numtype <: valtype)])) + `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`(`%`([(nt_2 : numtype <: valtype)]), `%`([(nt_1 : numtype <: valtype)]))) -- if (nt_1 =/= nt_2) -- if ($size(nt_1) = $size(nt_2)) ;; 6-typing.watsup:701.1-704.50 rule convert-i{C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: - `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`(`%`([(inn_2 : inn <: valtype)]), `%`([(inn_1 : inn <: valtype)]))) -- if (inn_1 =/= inn_2) -- if ((sx?{sx : sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) ;; 6-typing.watsup:706.1-708.24 rule convert-f{C : context, fnn_1 : fnn, fnn_2 : fnn}: - `%|-%:%`(C, CVTOP_instr((fnn_1 : fnn <: numtype), CONVERT_cvtop, (fnn_2 : fnn <: numtype), ?()), `%->%`([(fnn_2 : fnn <: valtype)], [(fnn_1 : fnn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((fnn_1 : fnn <: numtype), CONVERT_cvtop, (fnn_2 : fnn <: numtype), ?()), `%->%`(`%`([(fnn_2 : fnn <: valtype)]), `%`([(fnn_1 : fnn <: valtype)]))) -- if (fnn_1 =/= fnn_2) ;; 6-typing.watsup:713.1-715.31 rule ref.null{C : context, ht : heaptype}: - `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) + `%|-%:%`(C, REF.NULL_instr(ht), `%->%`(`%`([]), `%`([REF_valtype(`NULL%?`(?(())), ht)]))) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:718.1-720.23 rule ref.func{C : context, x : idx, epsilon : resulttype, dt : deftype}: - `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), (dt : deftype <: heaptype))])) + `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, `%`([REF_valtype(`NULL%?`(?()), (dt : deftype <: heaptype))]))) -- if (C.FUNC_context[x.`%`.0] = dt) ;; 6-typing.watsup:722.1-723.34 rule ref.i31{C : context}: - `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) + `%|-%:%`(C, REF.I31_instr, `%->%`(`%`([I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), I31_heaptype)]))) ;; 6-typing.watsup:725.1-726.31 rule ref.is_null{C : context, rt : reftype}: - `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([(rt : reftype <: valtype)], [I32_valtype])) + `%|-%:%`(C, REF.IS_NULL_instr, `%->%`(`%`([(rt : reftype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:728.1-730.31 rule ref.as_non_null{C : context, ht : heaptype}: - `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) + `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ht)]), `%`([REF_valtype(`NULL%?`(?()), ht)]))) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:732.1-733.51 rule ref.eq{C : context}: - `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) + `%|-%:%`(C, REF.EQ_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:735.1-739.33 rule ref.test{C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([(rt' : reftype <: valtype)], [I32_valtype])) + `%|-%:%`(C, REF.TEST_instr(rt), `%->%`(`%`([(rt' : reftype <: valtype)]), `%`([I32_valtype]))) -- Reftype_ok: `%|-%:_OK`(C, rt) -- Reftype_ok: `%|-%:_OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') ;; 6-typing.watsup:741.1-745.33 rule ref.cast{C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.CAST_instr(rt), `%->%`([(rt' : reftype <: valtype)], [(rt : reftype <: valtype)])) + `%|-%:%`(C, REF.CAST_instr(rt), `%->%`(`%`([(rt' : reftype <: valtype)]), `%`([(rt : reftype <: valtype)]))) -- Reftype_ok: `%|-%:_OK`(C, rt) -- Reftype_ok: `%|-%:_OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') ;; 6-typing.watsup:750.1-751.42 rule i31.get{C : context, sx : sx}: - `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) + `%|-%:%`(C, I31.GET_instr(sx), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:756.1-758.43 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`(`%`($unpack(zt)*{zt : storagetype}), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) ;; 6-typing.watsup:760.1-763.39 rule struct.new_default{C : context, x : idx, zt* : storagetype*, mut* : mut*, val* : val*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`(`%`($unpack(zt)*{zt : storagetype}), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 6-typing.watsup:765.1-769.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: - `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`([$unpack(zt)]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`(mut, zt)) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:771.1-774.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: - `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)]), `%`([]))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`(`MUT%?`(?(())), zt)) ;; 6-typing.watsup:779.1-781.41 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpack(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`(`%`([$unpack(zt) I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) ;; 6-typing.watsup:783.1-786.36 rule array.new_default{C : context, x : idx, mut : mut, zt : storagetype, val : val}: - `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`(`%`([I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) -- if ($default($unpack(zt)) = ?(val)) ;; 6-typing.watsup:788.1-790.41 rule array.new_fixed{C : context, x : idx, n : n, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpack(zt)], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`(`%`([$unpack(zt)]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) ;; 6-typing.watsup:792.1-795.39 rule array.new_elem{C : context, x : idx, y : idx, mut : mut, rt : reftype}: - `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, (rt : reftype <: storagetype)))) -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y.`%`.0], rt) ;; 6-typing.watsup:797.1-801.23 rule array.new_data{C : context, x : idx, y : idx, mut : mut, t : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, (t : valtype <: storagetype)))) -- if ((t = (numtype : numtype <: valtype)) \/ (t = (vectype : vectype <: valtype))) -- if (C.DATA_context[y.`%`.0] = OK) ;; 6-typing.watsup:803.1-806.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype]), `%`([$unpack(zt)]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:808.1-810.41 rule array.set{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)], [])) + `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 6-typing.watsup:812.1-814.41 rule array.len{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) + `%|-%:%`(C, ARRAY.LEN_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)]), `%`([I32_valtype]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 6-typing.watsup:816.1-818.41 rule array.fill{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype], [])) + `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 6-typing.watsup:820.1-824.40 rule array.copy{C : context, x_1 : idx, x_2 : idx, zt_1 : storagetype, mut : mut, zt_2 : storagetype}: - `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x_1.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) -- Expand: `%~~%`(C.TYPE_context[x_2.`%`.0], ARRAY_comptype(`%%`(mut, zt_2))) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) ;; 6-typing.watsup:826.1-829.43 rule array.init_elem{C : context, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) -- Storagetype_sub: `%|-%<:%`(C, (C.ELEM_context[y.`%`.0] : reftype <: storagetype), zt) ;; 6-typing.watsup:831.1-835.23 rule array.init_data{C : context, x : idx, y : idx, zt : storagetype, t : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), `%`([]))) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) -- if ((t = (numtype : numtype <: valtype)) \/ (t = (vectype : vectype <: valtype))) -- if (C.DATA_context[y.`%`.0] = OK) ;; 6-typing.watsup:840.1-841.62 rule extern.convert_any{C : context, nul : nul}: - `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) + `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`(`%`([REF_valtype(nul, ANY_heaptype)]), `%`([REF_valtype(nul, EXTERN_heaptype)]))) ;; 6-typing.watsup:843.1-844.62 rule any.convert_extern{C : context, nul : nul}: - `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) + `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`(`%`([REF_valtype(nul, EXTERN_heaptype)]), `%`([REF_valtype(nul, ANY_heaptype)]))) ;; 6-typing.watsup:849.1-850.35 rule vconst{C : context, c : vec_(V128_vnn)}: - `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->%`([], [V128_valtype])) + `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->%`(`%`([]), `%`([V128_valtype]))) ;; 6-typing.watsup:852.1-853.41 rule vvunop{C : context, vvunop : vvunop}: - `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:855.1-856.48 rule vvbinop{C : context, vvbinop : vvbinop}: - `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:858.1-859.55 rule vvternop{C : context, vvternop : vvternop}: - `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->%`([V128_valtype V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->%`(`%`([V128_valtype V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:861.1-862.44 rule vvtestop{C : context, vvtestop : vvtestop}: - `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:864.1-865.33 rule vbitmask{C : context, sh : ishape}: - `%|-%:%`(C, VBITMASK_instr(sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VBITMASK_instr(sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:867.1-868.39 rule vswizzle{C : context, sh : ishape}: - `%|-%:%`(C, VSWIZZLE_instr(sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VSWIZZLE_instr(sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:870.1-872.22 rule vshuffle{C : context, imm : imm, N : N, i* : nat*}: - `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) -- (if (i < (N * 2)))*{i : nat} ;; 6-typing.watsup:874.1-875.48 rule vsplat{C : context, lnn : lnn, N : N}: - `%|-%:%`(C, VSPLAT_instr(`%X%`(lnn, `%`(N))), `%->%`([($lunpack(lnn) : numtype <: valtype)], [V128_valtype])) + `%|-%:%`(C, VSPLAT_instr(`%X%`(lnn, `%`(N))), `%->%`(`%`([($lunpack(lnn) : numtype <: valtype)]), `%`([V128_valtype]))) ;; 6-typing.watsup:878.1-880.14 rule vextract_lane{C : context, lnn : lnn, N : N, sx? : sx?, i : nat}: - `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) + `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`(`%`([V128_valtype]), `%`([($lunpack(lnn) : numtype <: valtype)]))) -- if (i < N) ;; 6-typing.watsup:882.1-884.14 rule vreplace_lane{C : context, lnn : lnn, N : N, i : nat}: - `%|-%:%`(C, VREPLACE_LANE_instr(`%X%`(lnn, `%`(N)), `%`(i)), `%->%`([V128_valtype ($lunpack(lnn) : numtype <: valtype)], [V128_valtype])) + `%|-%:%`(C, VREPLACE_LANE_instr(`%X%`(lnn, `%`(N)), `%`(i)), `%->%`(`%`([V128_valtype ($lunpack(lnn) : numtype <: valtype)]), `%`([V128_valtype]))) -- if (i < N) ;; 6-typing.watsup:886.1-887.40 rule vunop{C : context, sh : shape, vunop_sh : vunop_(sh)}: - `%|-%:%`(C, VUNOP_instr(sh, vunop_sh), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VUNOP_instr(sh, vunop_sh), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:889.1-890.47 rule vbinop{C : context, sh : shape, vbinop_sh : vbinop_(sh)}: - `%|-%:%`(C, VBINOP_instr(sh, vbinop_sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VBINOP_instr(sh, vbinop_sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:892.1-893.43 rule vtestop{C : context, sh : shape, vtestop_sh : vtestop_(sh)}: - `%|-%:%`(C, VTESTOP_instr(sh, vtestop_sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VTESTOP_instr(sh, vtestop_sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:895.1-896.47 rule vrelop{C : context, sh : shape, vrelop_sh : vrelop_(sh)}: - `%|-%:%`(C, VRELOP_instr(sh, vrelop_sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VRELOP_instr(sh, vrelop_sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:898.1-899.50 rule vshiftop{C : context, sh : ishape, vshiftop_sh : vshiftop_(sh)}: - `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop_sh), `%->%`([V128_valtype I32_valtype], [V128_valtype])) + `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop_sh), `%->%`(`%`([V128_valtype I32_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:902.1-903.55 rule vcvtop{C : context, sh : shape, vcvtop : vcvtop, hf? : half?, sx? : sx?, zero : zero}: - `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:905.1-906.44 rule vnarrow{C : context, sh : ishape, sx : sx}: - `%|-%:%`(C, VNARROW_instr(sh, sh, sx), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VNARROW_instr(sh, sh, sx), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:908.1-909.49 rule vextunop{C : context, sh : ishape, vextunop : vextunop_(sh, sh), sx : sx}: - `%|-%:%`(C, VEXTUNOP_instr(sh, sh, vextunop, sx), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VEXTUNOP_instr(sh, sh, vextunop, sx), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:911.1-912.56 rule vextbinop{C : context, sh : ishape, vextbinop : vextbinop_(sh, sh), sx : sx}: - `%|-%:%`(C, VEXTBINOP_instr(sh, sh, vextbinop, sx), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VEXTBINOP_instr(sh, sh, vextbinop, sx), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:914.1-915.33 rule vbitmask{C : context, sh : ishape}: - `%|-%:%`(C, VBITMASK_instr(sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VBITMASK_instr(sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:920.1-922.28 rule local.get{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) + `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`(`%`([]), `%`([t]))) -- if (C.LOCAL_context[x.`%`.0] = `%%`(init, t)) ;; 6-typing.watsup:935.1-937.28 rule global.get{C : context, x : idx, t : valtype, mut : mut}: - `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) + `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`(`%`([]), `%`([t]))) -- if (C.GLOBAL_context[x.`%`.0] = `%%`(mut, t)) ;; 6-typing.watsup:939.1-941.28 rule global.set{C : context, x : idx, t : valtype}: - `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) + `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`(`%`([t]), `%`([]))) -- if (C.GLOBAL_context[x.`%`.0] = `%%`(`MUT%?`(?(())), t)) ;; 6-typing.watsup:946.1-948.28 rule table.get{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [(rt : reftype <: valtype)])) + `%|-%:%`(C, TABLE.GET_instr(x), `%->%`(`%`([I32_valtype]), `%`([(rt : reftype <: valtype)]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:950.1-952.28 rule table.set{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype (rt : reftype <: valtype)], [])) + `%|-%:%`(C, TABLE.SET_instr(x), `%->%`(`%`([I32_valtype (rt : reftype <: valtype)]), `%`([]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:954.1-956.24 rule table.size{C : context, x : idx, tt : tabletype}: - `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) + `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`(`%`([]), `%`([I32_valtype]))) -- if (C.TABLE_context[x.`%`.0] = tt) ;; 6-typing.watsup:958.1-960.28 rule table.grow{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([(rt : reftype <: valtype) I32_valtype], [I32_valtype])) + `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`(`%`([(rt : reftype <: valtype) I32_valtype]), `%`([I32_valtype]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:962.1-964.28 rule table.fill{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype (rt : reftype <: valtype) I32_valtype], [])) + `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`(`%`([I32_valtype (rt : reftype <: valtype) I32_valtype]), `%`([]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:966.1-970.36 rule table.copy{C : context, x_1 : idx, x_2 : idx, lim_1 : limits, rt_1 : reftype, lim_2 : limits, rt_2 : reftype}: - `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.TABLE_context[x_1.`%`.0] = `%%`(lim_1, rt_1)) -- if (C.TABLE_context[x_2.`%`.0] = `%%`(lim_2, rt_2)) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) ;; 6-typing.watsup:972.1-976.36 rule table.init{C : context, x : idx, y : idx, lim : limits, rt_1 : reftype, rt_2 : reftype}: - `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt_1)) -- if (C.ELEM_context[y.`%`.0] = rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) ;; 6-typing.watsup:978.1-980.23 rule elem.drop{C : context, x : idx, rt : reftype}: - `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) + `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`(`%`([]), `%`([]))) -- if (C.ELEM_context[x.`%`.0] = rt) ;; 6-typing.watsup:985.1-987.22 rule memory.size{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) + `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`(`%`([]), `%`([I32_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup:989.1-991.22 rule memory.grow{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) + `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`(`%`([I32_valtype]), `%`([I32_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup:993.1-995.22 rule memory.fill{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup:997.1-1000.26 rule memory.copy{C : context, x_1 : idx, x_2 : idx, mt_1 : memtype, mt_2 : memtype}: - `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.MEM_context[x_1.`%`.0] = mt_1) -- if (C.MEM_context[x_2.`%`.0] = mt_2) ;; 6-typing.watsup:1002.1-1005.23 rule memory.init{C : context, x : idx, y : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if (C.DATA_context[y.`%`.0] = OK) ;; 6-typing.watsup:1007.1-1009.23 rule data.drop{C : context, x : idx}: - `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) + `%|-%:%`(C, DATA.DROP_instr(x), `%->%`(`%`([]), `%`([]))) -- if (C.DATA_context[x.`%`.0] = OK) ;; 6-typing.watsup:1011.1-1016.29 rule load{C : context, nt : numtype, n? : n?, sx? : sx?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([(nt : numtype <: valtype)]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} @@ -19868,7 +19897,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1018.1-1023.29 rule store{C : context, nt : numtype, n? : n?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) + `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype (nt : numtype <: valtype)]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} @@ -19876,38 +19905,38 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1025.1-1028.30 rule vload{C : context, M : M, N : N, sx : sx, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ((M / 8) * N)) ;; 6-typing.watsup:1030.1-1033.26 rule vload-splat{C : context, n : n, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(SPLAT_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(SPLAT_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= (n / 8)) ;; 6-typing.watsup:1035.1-1038.25 rule vload-zero{C : context, n : n, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(ZERO_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(ZERO_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) < (n / 8)) ;; 6-typing.watsup:1040.1-1044.29 rule vload_lane{C : context, n : n, x : idx, n_A : n, n_O : n, laneidx : laneidx, mt : memtype}: - `%|-%:%`(C, VLOAD_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`([I32_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`(`%`([I32_valtype V128_valtype]), `%`([V128_valtype]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) < (n / 8)) -- if (laneidx.`%`.0 < (128 / n)) ;; 6-typing.watsup:1046.1-1049.37 rule vstore{C : context, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VSTORE_instr(x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype V128_valtype], [])) + `%|-%:%`(C, VSTORE_instr(x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype V128_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($vsize(V128_vectype) / 8)) ;; 6-typing.watsup:1051.1-1055.29 rule vstore_lane{C : context, n : n, x : idx, n_A : n, n_O : n, laneidx : laneidx, mt : memtype}: - `%|-%:%`(C, VSTORE_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`([I32_valtype V128_valtype], [])) + `%|-%:%`(C, VSTORE_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`(`%`([I32_valtype V128_valtype]), `%`([]))) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) < (n / 8)) -- if (laneidx.`%`.0 < (128 / n)) @@ -19916,51 +19945,51 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) relation Instrf_ok: `%|-%:%`(context, instr, instrtype) ;; 6-typing.watsup:518.1-520.41 rule instr{C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1 : valtype}, [], t_2*{t_2 : valtype})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, instr, `%->%%`(`%`(t_1*{t_1 : valtype}), [], `%`(t_2*{t_2 : valtype}))) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:924.1-926.28 rule local.set{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) + `%|-%:%`(C, LOCAL.SET_instr(x), `%->%%`(`%`([t]), [x], `%`([]))) -- if (C.LOCAL_context[x.`%`.0] = `%%`(init, t)) ;; 6-typing.watsup:928.1-930.28 rule local.tee{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) + `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%%`(`%`([t]), [x], `%`([t]))) -- if (C.LOCAL_context[x.`%`.0] = `%%`(init, t)) ;; 6-typing.watsup:505.1-505.74 -relation Instrs_ok: `%|-%*_:%`(context, instr*, instrtype) +relation Instrs_ok: `%|-%:%`(context, instr*, instrtype) ;; 6-typing.watsup:522.1-523.29 rule empty{C : context}: - `%|-%*_:%`(C, [], `%->%*%`([], [], [])) + `%|-%:%`(C, [], `%->%%`(`%`([]), [], `%`([]))) ;; 6-typing.watsup:525.1-530.52 rule seq{C : context, instr_1 : instr, instr_2* : instr*, t_1* : valtype*, x_1* : idx*, x_2* : idx*, t_3* : valtype*, init* : init*, t* : valtype*, C' : context, t_2* : valtype*}: - `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + `%|-%:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, `%`(t_3*{t_3 : valtype}))) -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init : init t : valtype x_1 : idx} -- if (C' = $with_locals(C, x_1*{x_1 : localidx}, `%%`(SET_init, t)*{t : valtype})) - -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2 : instr}, `%->%*%`(t_2*{t_2 : valtype}, x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C', instr_2*{instr_2 : instr}, `%->%%`(`%`(t_2*{t_2 : valtype}), x_2*{x_2 : localidx}, `%`(t_3*{t_3 : valtype}))) ;; 6-typing.watsup:532.1-535.35 rule sub{C : context, instr* : instr*, it' : instrtype, it : instrtype}: - `%|-%*_:%`(C, instr*{instr : instr}, it') - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, it) + `%|-%:%`(C, instr*{instr : instr}, it') + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, it) -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:537.1-539.47 rule frame{C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, x* : idx*, t_2* : valtype*}: - `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t*{t : valtype} :: t_1*{t_1 : valtype}, x*{x : localidx}, t*{t : valtype} :: t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`(t*{t : valtype} :: t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t*{t : valtype} :: t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) } ;; 6-typing.watsup relation Expr_ok: `%|-%:%`(context, expr, resulttype) ;; 6-typing.watsup rule _{C : context, instr* : instr*, t* : valtype*}: - `%|-%:%`(C, instr*{instr : instr}, t*{t : valtype}) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`([], [], t*{t : valtype})) + `%|-%:%`(C, instr*{instr : instr}, `%`(t*{t : valtype})) + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`([]), [], `%`(t*{t : valtype}))) ;; 6-typing.watsup rec { @@ -20025,14 +20054,14 @@ relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) ;; 6-typing.watsup rule _{C : context, expr : expr, t : valtype}: `%|-%:%CONST`(C, expr, t) - -- Expr_ok: `%|-%:%`(C, expr, [t]) + -- Expr_ok: `%|-%:%`(C, expr, `%`([t])) -- Expr_const: `%|-%CONST`(C, expr) ;; 6-typing.watsup -relation Type_ok: `%|-%:%*`(context, type, deftype*) +relation Type_ok: `%|-%:%`(context, type, deftype*) ;; 6-typing.watsup rule _{C : context, rectype : rectype, dt* : deftype*, x : idx}: - `%|-%:%*`(C, TYPE(rectype), dt*{dt : deftype}) + `%|-%:%`(C, TYPE(rectype), dt*{dt : deftype}) -- if (x = `%`(|C.TYPE_context|)) -- if (dt*{dt : deftype} = $rolldt(x, rectype)) -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt : deftype}], rectype, OK_oktypeidx(x)) @@ -20053,10 +20082,10 @@ relation Local_ok: `%|-%:%`(context, local, localtype) relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup rule _{C : context, x : idx, local* : local*, expr : expr, t_1* : valtype*, t_2* : valtype*, lt* : localtype*}: - `%|-%:%`(C, `FUNC%%*%`(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + `%|-%:%`(C, FUNC(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) -- (Local_ok: `%|-%:%`(C, local, lt))*{local : local lt : localtype} - -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2 : valtype})}, expr, t_2*{t_2 : valtype}) + -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(`%`(t_2*{t_2 : valtype}))}, expr, `%`(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -20103,7 +20132,7 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup rule _{C : context, rt : reftype, expr* : expr*, elemmode : elemmode}: - `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr : expr}, elemmode), rt) + `%|-%:%`(C, ELEM(rt, expr*{expr : expr}, elemmode), rt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr : expr} -- Elemmode_ok: `%|-%:%`(C, elemmode, rt) @@ -20123,7 +20152,7 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) relation Data_ok: `%|-%:_OK`(context, data) ;; 6-typing.watsup rule _{C : context, b* : byte*, datamode : datamode}: - `%|-%:_OK`(C, `DATA%*%`(b*{b : byte}, datamode)) + `%|-%:_OK`(C, DATA(b*{b : byte}, datamode)) -- Datamode_ok: `%|-%:_OK`(C, datamode) ;; 6-typing.watsup @@ -20131,7 +20160,7 @@ relation Start_ok: `%|-%:_OK`(context, start) ;; 6-typing.watsup rule _{C : context, x : idx}: `%|-%:_OK`(C, START(x)) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`([], []))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`([]), `%`([])))) ;; 6-typing.watsup relation Import_ok: `%|-%:%`(context, import, externtype) @@ -20173,42 +20202,42 @@ relation Export_ok: `%|-%:%`(context, export, externtype) rec { ;; 6-typing.watsup:1229.1-1229.77 -relation Globals_ok: `%|-%*_:%*`(context, global*, globaltype*) +relation Globals_ok: `%|-%:%`(context, global*, globaltype*) ;; 6-typing.watsup:1272.1-1273.17 rule empty{C : context}: - `%|-%*_:%*`(C, [], []) + `%|-%:%`(C, [], []) ;; 6-typing.watsup:1275.1-1278.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: - `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) + `%|-%:%`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) - -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) + -- Globals_ok: `%|-%:%`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) } ;; 6-typing.watsup rec { ;; 6-typing.watsup:1228.1-1228.75 -relation Types_ok: `%|-%*_:%*`(context, type*, deftype*) +relation Types_ok: `%|-%:%`(context, type*, deftype*) ;; 6-typing.watsup:1264.1-1265.17 rule empty{C : context}: - `%|-%*_:%*`(C, [], []) + `%|-%:%`(C, [], []) ;; 6-typing.watsup:1267.1-1270.49 rule cons{C : context, type_1 : type, type* : type*, dt_1 : deftype, dt* : deftype*}: - `%|-%*_:%*`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) - -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) + `%|-%:%`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) + -- Type_ok: `%|-%:%`(C, type_1, [dt_1]) + -- Types_ok: `%|-%:%`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) } ;; 6-typing.watsup relation Module_ok: `|-%:_OK`(module) ;; 6-typing.watsup rule _{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data^n : data^n, n : n, start? : start?, export* : export*, dt'* : deftype*, ixt* : externtype*, C' : context, gt* : globaltype*, tt* : tabletype*, mt* : memtype*, C : context, dt* : deftype*, rt* : reftype*, et* : externtype*, idt* : deftype*, igt* : globaltype*, itt* : tabletype*, imt* : memtype*}: - `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) - -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) + `|-%:_OK`(MODULE(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) + -- Types_ok: `%|-%:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) -- (Import_ok: `%|-%:%`({TYPE dt'*{dt' : deftype}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import : import ixt : externtype} - -- Globals_ok: `%|-%*_:%*`(C', global*{global : global}, gt*{gt : globaltype}) + -- Globals_ok: `%|-%:%`(C', global*{global : global}, gt*{gt : globaltype}) -- (Table_ok: `%|-%:%`(C', table, tt))*{table : table tt : tabletype} -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem : mem mt : memtype} -- (Func_ok: `%|-%:%`(C, func, dt))*{dt : deftype func : func} @@ -20257,314 +20286,314 @@ relation Ref_ok: `%|-%:%`(store, ref, reftype) `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) ;; 8-reduction.watsup -relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) +relation Step_pure: `%~>%`(admininstr*, admininstr*) ;; 8-reduction.watsup rule unreachable: - `%*_~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) + `%~>%`([UNREACHABLE_admininstr], [TRAP_admininstr]) ;; 8-reduction.watsup rule nop: - `%*_~>%*`([NOP_admininstr], []) + `%~>%`([NOP_admininstr], []) ;; 8-reduction.watsup rule drop{val : val}: - `%*_~>%*`([(val : val <: admininstr) DROP_admininstr], []) + `%~>%`([(val : val <: admininstr) DROP_admininstr], []) ;; 8-reduction.watsup rule select-true{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) + `%~>%`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule select-false{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) + `%~>%`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule if-true{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) + `%~>%`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule if-false{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) + `%~>%`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule label-vals{n : n, instr* : instr*, val* : val*}: - `%*_~>%*`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) + `%~>%`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) ;; 8-reduction.watsup rule br-zero{n : n, instr'* : instr*, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule br-succ{n : n, instr'* : instr*, val* : val*, l : labelidx, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) + `%~>%`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) ;; 8-reduction.watsup rule br_if-true{c : num_(I32_numtype), l : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) + `%~>%`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule br_if-false{c : num_(I32_numtype), l : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) + `%~>%`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) -- if (c = `%`(0)) ;; 8-reduction.watsup rule br_table-lt{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) -- if (i < |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_table-ge{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) -- if (i >= |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_on_null-null{val : val, l : labelidx, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) + `%~>%`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) -- if (val = REF.NULL_val(ht)) ;; 8-reduction.watsup rule br_on_null-addr{val : val, l : labelidx}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [(val : val <: admininstr)]) + `%~>%`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [(val : val <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule br_on_non_null-null{val : val, l : labelidx, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], []) + `%~>%`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], []) -- if (val = REF.NULL_val(ht)) ;; 8-reduction.watsup rule br_on_non_null-addr{val : val, l : labelidx}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], [(val : val <: admininstr) BR_admininstr(l)]) + `%~>%`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], [(val : val <: admininstr) BR_admininstr(l)]) -- otherwise ;; 8-reduction.watsup rule call_indirect-call{x : idx, y : idx}: - `%*_~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) CALL_REF_admininstr(?(y))]) + `%~>%`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) CALL_REF_admininstr(?(y))]) ;; 8-reduction.watsup rule return_call_indirect{x : idx, y : idx}: - `%*_~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) RETURN_CALL_REF_admininstr(?(y))]) + `%~>%`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) RETURN_CALL_REF_admininstr(?(y))]) ;; 8-reduction.watsup rule frame-vals{n : n, f : frame, val^n : val^n}: - `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) + `%~>%`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-frame{n : n, f : frame, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) + `%~>%`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-label{k : nat, instr'* : instr*, val* : val*, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) + `%~>%`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) ;; 8-reduction.watsup rule unop-val{nt : numtype, c_1 : num_(nt), unop : unop_(nt), c : num_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) + `%~>%`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) -- if ($unop(nt, unop, c_1) = [c]) ;; 8-reduction.watsup rule unop-trap{nt : numtype, c_1 : num_(nt), unop : unop_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) -- if ($unop(nt, unop, c_1) = []) ;; 8-reduction.watsup rule binop-val{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), binop : binop_(nt), c : num_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- if ($binop(nt, binop, c_1, c_2) = [c]) ;; 8-reduction.watsup rule binop-trap{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), binop : binop_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) -- if ($binop(nt, binop, c_1, c_2) = []) ;; 8-reduction.watsup rule testop{nt : numtype, c_1 : num_(nt), testop : testop_(nt), c : num_(I32_numtype)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $testop(nt, testop, c_1)) ;; 8-reduction.watsup rule relop{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), relop : relop_(nt), c : num_(I32_numtype)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $relop(nt, relop, c_1, c_2)) ;; 8-reduction.watsup rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?, c : num_(nt_2)}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) + `%~>%`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = [c]) ;; 8-reduction.watsup rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, `%`(i)))]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, `%`(i)))]) ;; 8-reduction.watsup rule ref.is_null-true{val : val, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- if (val = REF.NULL_val(ht)) ;; 8-reduction.watsup rule ref.is_null-false{val : val}: - `%*_~>%*`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule ref.as_non_null-null{ref : ref, ht : heaptype}: - `%*_~>%*`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) + `%~>%`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) -- if (ref = REF.NULL_ref(ht)) ;; 8-reduction.watsup rule ref.as_non_null-addr{ref : ref}: - `%*_~>%*`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [(ref : ref <: admininstr)]) + `%~>%`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [(ref : ref <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule ref.eq-null{ref_1 : ref, ref_2 : ref, ht_1 : heaptype, ht_2 : heaptype}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) ;; 8-reduction.watsup rule ref.eq-true{ref_1 : ref, ref_2 : ref}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- otherwise -- if (ref_1 = ref_2) ;; 8-reduction.watsup rule ref.eq-false{ref_1 : ref, ref_2 : ref}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule i31.get-null{ht : heaptype, sx : sx}: - `%*_~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) + `%~>%`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) ;; 8-reduction.watsup rule i31.get-num{i : nat, sx : sx}: - `%*_~>%*`([REF.I31_NUM_admininstr(`%`(i)) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, `%`(i)))]) + `%~>%`([REF.I31_NUM_admininstr(`%`(i)) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, `%`(i)))]) ;; 8-reduction.watsup rule extern.convert_any-null{ht : heaptype}: - `%*_~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) + `%~>%`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) ;; 8-reduction.watsup rule extern.convert_any-addr{addrref : addrref}: - `%*_~>%*`([(addrref : addrref <: admininstr) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) + `%~>%`([(addrref : addrref <: admininstr) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) ;; 8-reduction.watsup rule any.convert_extern-null{ht : heaptype}: - `%*_~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) + `%~>%`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) ;; 8-reduction.watsup rule any.convert_extern-addr{addrref : addrref}: - `%*_~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [(addrref : addrref <: admininstr)]) + `%~>%`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [(addrref : addrref <: admininstr)]) ;; 8-reduction.watsup rule vvunop{c_1 : vec_(V128_vnn), vvunop : vvunop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VVUNOP_admininstr(V128_vectype, vvunop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VVUNOP_admininstr(V128_vectype, vvunop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vvunop(V128_vectype, vvunop, c_1) = c) ;; 8-reduction.watsup rule vvbinop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), vvbinop : vvbinop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VVBINOP_admininstr(V128_vectype, vvbinop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VVBINOP_admininstr(V128_vectype, vvbinop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vvbinop(V128_vectype, vvbinop, c_1, c_2) = c) ;; 8-reduction.watsup rule vvternop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), c_3 : vec_(V128_vnn), vvternop : vvternop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VCONST_admininstr(V128_vectype, c_3) VVTERNOP_admininstr(V128_vectype, vvternop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VCONST_admininstr(V128_vectype, c_3) VVTERNOP_admininstr(V128_vectype, vvternop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vvternop(V128_vectype, vvternop, c_1, c_2, c_3) = c) ;; 8-reduction.watsup rule vvtestop{c_1 : vec_(V128_vnn), c : num_(I32_numtype)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VVTESTOP_admininstr(V128_vectype, ANY_TRUE_vvtestop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VVTESTOP_admininstr(V128_vectype, ANY_TRUE_vvtestop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $ine($vsize(V128_vectype), c_1, `%`(0))) ;; 8-reduction.watsup rule vswizzle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn : inn, N : N, c' : vec_(V128_vnn), c : iN($size((inn : inn <: numtype))), ci* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*, k^N : nat^N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) -- if (ci*{ci : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) -- if (c*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: `%`(0)^(256 - N){}) -- if (c' = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c*{}[ci*{ci : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))}[k].`%`.0]^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2)) -- if (c = $invlanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c'*{}[i*{i : nat}[k]]^(k%*`([CONST_admininstr($lunpack(lnn), c_1) VSPLAT_admininstr(`%X%`(lnn, `%`(N)))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([CONST_admininstr($lunpack(lnn), c_1) VSPLAT_admininstr(`%X%`(lnn, `%`(N)))], [VCONST_admininstr(V128_vectype, c)]) -- if (c = $invlanes_(`%X%`(lnn, `%`(N)), $packnum(lnn, c_1)^N{})) ;; 8-reduction.watsup rule vextract_lane-num{c_1 : vec_(V128_vnn), nt : numtype, N : N, i : nat, c_2 : num_(nt)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((nt : numtype <: lanetype), `%`(N)), ?(), `%`(i))], [CONST_admininstr(nt, c_2)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((nt : numtype <: lanetype), `%`(N)), ?(), `%`(i))], [CONST_admininstr(nt, c_2)]) -- if (c_2 = $lanes_(`%X%`((nt : numtype <: lanetype), `%`(N)), c_1)[i]) ;; 8-reduction.watsup rule vextract_lane-pack{c_1 : vec_(V128_vnn), pt : packtype, N : N, sx : sx, i : nat, c_2 : num_(I32_numtype)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((pt : packtype <: lanetype), `%`(N)), ?(sx), `%`(i))], [CONST_admininstr(I32_numtype, c_2)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((pt : packtype <: lanetype), `%`(N)), ?(sx), `%`(i))], [CONST_admininstr(I32_numtype, c_2)]) -- if (c_2 = $ext($psize(pt), 32, sx, $lanes_(`%X%`((pt : packtype <: lanetype), `%`(N)), c_1)[i])) ;; 8-reduction.watsup rule vreplace_lane{c_1 : vec_(V128_vnn), lnn : lnn, c_2 : num_($lunpack(lnn)), N : N, i : nat, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr($lunpack(lnn), c_2) VREPLACE_LANE_admininstr(`%X%`(lnn, `%`(N)), `%`(i))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr($lunpack(lnn), c_2) VREPLACE_LANE_admininstr(`%X%`(lnn, `%`(N)), `%`(i))], [VCONST_admininstr(V128_vectype, c)]) -- if (c = $invlanes_(`%X%`(lnn, `%`(N)), $lanes_(`%X%`(lnn, `%`(N)), c_1)[[i] = $packnum(lnn, c_2)])) ;; 8-reduction.watsup rule vunop{c_1 : vec_(V128_vnn), sh : shape, vunop : vunop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VUNOP_admininstr(sh, vunop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VUNOP_admininstr(sh, vunop)], [VCONST_admininstr(V128_vectype, c)]) -- if (c = $vunop(sh, vunop, c_1)) ;; 8-reduction.watsup rule vbinop-val{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vbinop : vbinop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vbinop(sh, vbinop, c_1, c_2) = [c]) ;; 8-reduction.watsup rule vbinop-trap{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vbinop : vbinop_(sh)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [TRAP_admininstr]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [TRAP_admininstr]) -- if ($vbinop(sh, vbinop, c_1, c_2) = []) ;; 8-reduction.watsup rule vrelop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vrelop : vrelop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VRELOP_admininstr(sh, vrelop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VRELOP_admininstr(sh, vrelop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vrelop(sh, vrelop, c_1, c_2) = c) ;; 8-reduction.watsup rule vshiftop{c_1 : vec_(V128_vnn), n : n, imm : imm, N : N, vshiftop : vshiftop_(`%X%`(imm, `%`(N))), c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1)) -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))})) ;; 8-reduction.watsup rule vtestop-true{c : vec_(V128_vnn), inn : inn, N : N, ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), inn : inn, N : N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule vbitmask{c : vec_(V128_vnn), inn : inn, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) -- if ($ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($size((inn : inn <: numtype)))}) ;; 8-reduction.watsup rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn_1 : inn, N_1 : N, inn_2 : inn, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, cj_1* : iN($size((inn_2 : inn <: numtype)))*, cj_2* : iN($size((inn_2 : inn <: numtype)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) -- if (ci_2*{ci_2 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2)) -- if (cj_1*{cj_1 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1 : iN($size((inn_1 : inn <: numtype)))}) @@ -20573,184 +20602,184 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vcvtop-normal{c_1 : vec_(V128_vnn), lnn_2 : lnn, N_2 : N, vcvtop : vcvtop, lnn_1 : lnn, N_1 : N, sx : sx, c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1)) -- if (c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-half{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, hf : half, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-zero{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} :: `%`(0)^N_1{})) ;; 8-reduction.watsup rule vextunop{c_1 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTUNOP_admininstr(sh_1, sh_2, vextunop, sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTUNOP_admininstr(sh_1, sh_2, vextunop, sx)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vextunop(sh_1, sh_2, vextunop, sx, c_1) = c) ;; 8-reduction.watsup rule vextbinop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextbinop : vextbinop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VEXTBINOP_admininstr(sh_1, sh_2, vextbinop, sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VEXTBINOP_admininstr(sh_1, sh_2, vextbinop, sx)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vextbinop(sh_1, sh_2, vextbinop, sx, c_1, c_2) = c) ;; 8-reduction.watsup rule local.tee{val : val, x : idx}: - `%*_~>%*`([(val : val <: admininstr) LOCAL.TEE_admininstr(x)], [(val : val <: admininstr) (val : val <: admininstr) LOCAL.SET_admininstr(x)]) + `%~>%`([(val : val <: admininstr) LOCAL.TEE_admininstr(x)], [(val : val <: admininstr) (val : val <: admininstr) LOCAL.SET_admininstr(x)]) ;; 8-reduction.watsup def $blocktype(state : state, blocktype : blocktype) : functype ;; 8-reduction.watsup - def $blocktype{z : state}(z, _RESULT_blocktype(?())) = `%->%`([], []) + def $blocktype{z : state}(z, _RESULT_blocktype(?())) = `%->%`(`%`([]), `%`([])) ;; 8-reduction.watsup - def $blocktype{z : state, t : valtype}(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) + def $blocktype{z : state, t : valtype}(z, _RESULT_blocktype(?(t))) = `%->%`(`%`([]), `%`([t])) ;; 8-reduction.watsup def $blocktype{z : state, x : idx, ft : functype}(z, _IDX_blocktype(x)) = ft -- Expand: `%~~%`($type(z, x), FUNC_comptype(ft)) ;; 8-reduction.watsup -relation Step_read: `%~>%*`(config, admininstr*) +relation Step_read: `%~>%`(config, admininstr*) ;; 8-reduction.watsup rule block{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, n : n, t_1^k : valtype^k, t_2^n : valtype^n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) + `%~>%`(`%;%`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(`%`(t_1^k{t_1 : valtype}), `%`(t_2^n{t_2 : valtype}))) ;; 8-reduction.watsup rule loop{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, t_1^k : valtype^k, t_2^n : valtype^n, n : n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) + `%~>%`(`%;%`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(`%`(t_1^k{t_1 : valtype}), `%`(t_2^n{t_2 : valtype}))) ;; 8-reduction.watsup rule br_on_cast-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt) -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) ;; 8-reduction.watsup rule br_on_cast-fail{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule br_on_cast_fail-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt) -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) ;; 8-reduction.watsup rule br_on_cast_fail-fail{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) -- otherwise ;; 8-reduction.watsup rule call{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) CALL_REF_admininstr(?())]) + `%~>%`(`%;%`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) CALL_REF_admininstr(?())]) ;; 8-reduction.watsup rule call_ref-null{z : state, ht : heaptype, x? : idx?}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule call_ref-func{z : state, val^n : val^n, n : n, a : addr, x? : idx?, m : m, f : frame, instr* : instr*, fi : funcinst, t_1^n : valtype^n, t_2^m : valtype^m, y : idx, t* : valtype*}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) -- if ($funcinst(z)[a] = fi) - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) - -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t : valtype}, instr*{instr : instr})) + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2^m{t_2 : valtype})))) + -- if (fi.CODE_funcinst = FUNC(y, LOCAL(t)*{t : valtype}, instr*{instr : instr})) -- if (f = {LOCAL ?(val)^n{val : val} :: $default(t)*{t : valtype}, MODULE fi.MODULE_funcinst}) ;; 8-reduction.watsup rule return_call{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) RETURN_CALL_REF_admininstr(?())]) + `%~>%`(`%;%`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) RETURN_CALL_REF_admininstr(?())]) ;; 8-reduction.watsup rule return_call_ref-label{z : state, k : nat, instr'* : instr*, val* : val*, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) + `%~>%`(`%;%`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) ;; 8-reduction.watsup rule return_call_ref-frame-addr{z : state, k : nat, f : frame, val'* : val*, val^n : val^n, n : n, a : addr, x? : idx?, instr* : instr*, t_1^n : valtype^n, t_2^m : valtype^m, m : m}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) + `%~>%`(`%;%`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2^m{t_2 : valtype})))) ;; 8-reduction.watsup rule return_call_ref-frame-null{z : state, k : nat, f : frame, val* : val*, ht : heaptype, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule ref.func{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0])]) + `%~>%`(`%;%`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0])]) ;; 8-reduction.watsup rule ref.test-true{z : state, ref : ref, rt : reftype, rt' : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(1))]) -- Ref_ok: `%|-%:%`($store(z), ref, rt') -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) ;; 8-reduction.watsup rule ref.test-false{z : state, ref : ref, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule ref.cast-succeed{z : state, ref : ref, rt : reftype, rt' : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [(ref : ref <: admininstr)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt') -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) ;; 8-reduction.watsup rule ref.cast-fail{z : state, ref : ref, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) -- otherwise ;; 8-reduction.watsup rule struct.new_default{z : state, x : idx, val* : val*, mut* : mut*, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%~>%`(`%;%`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 8-reduction.watsup rule struct.get-null{z : state, ht : heaptype, sx? : sx?, x : idx, i : nat}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) ;; 8-reduction.watsup rule struct.get-struct{z : state, a : addr, sx? : sx?, x : idx, i : nat, zt* : storagetype*, si : structinst, mut* : mut*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) + `%~>%`(`%;%`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) -- if ($structinst(z)[a] = si) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) ;; 8-reduction.watsup rule array.new{z : state, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [(val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [(val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) ;; 8-reduction.watsup rule array.new_default{z : state, n : n, x : idx, val : val, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if ($default($unpack(zt)) = ?(val)) ;; 8-reduction.watsup rule array.new_elem-oob{z : state, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) ;; 8-reduction.watsup rule array.new_elem-alloc{z : state, i : nat, n : n, x : idx, y : idx, ref^n : ref^n}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- if (ref^n{ref : ref} = $elem(z, y).ELEM_eleminst[i : n]) ;; 8-reduction.watsup rule array.new_data-oob{z : state, i : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if ((i + ((n * $zsize(zt)) / 8)) > |$data(z, y).DATA_datainst|) ;; 8-reduction.watsup rule array.new_data-num{z : state, i : nat, n : n, x : idx, y : idx, nt : numtype, c^n : num_(nt)^n, mut : mut, zt : storagetype, o0 : numtype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- if ($nunpack(zt) = ?(o0)) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (nt = o0) @@ -20758,7 +20787,7 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.new_data-vec{z : state, i : nat, n : n, x : idx, y : idx, vt : vectype, c^n : vec_(vt)^n, mut : mut, zt : storagetype, o0 : vectype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- if ($vunpack(zt) = ?(o0)) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (vt = o0) @@ -20766,75 +20795,75 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.get-null{z : state, ht : heaptype, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.get-oob{z : state, a : addr, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.get-array{z : state, a : addr, i : nat, sx? : sx?, x : idx, zt : storagetype, fv : fieldval, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) ;; 8-reduction.watsup rule array.len-null{z : state, ht : heaptype}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.len-array{z : state, a : addr, n : n}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, `%`(n))]) -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.fill-null{z : state, ht : heaptype, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.fill-oob{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.fill-zero{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.fill-succ{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule array.copy-null1{z : state, ht_1 : heaptype, i_1 : nat, ref : ref, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, `%`(i_1)) (ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, `%`(i_1)) (ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.copy-null2{z : state, ref : ref, i_1 : nat, ht_2 : heaptype, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_1)) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_1)) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.copy-oob1{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.copy-oob2{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.copy-zero{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.copy-le{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) -- if (sx?{sx : sx} = $sxfield(zt_2)) @@ -20842,61 +20871,61 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.copy-gt{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) -- if (sx?{sx : sx} = $sxfield(zt_2)) ;; 8-reduction.watsup rule array.init_elem-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.init_elem-oob1{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.init_elem-oob2{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) ;; 8-reduction.watsup rule array.init_elem-zero{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.init_elem-succ{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, ref : ref}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_ELEM_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_ELEM_admininstr(x, y)]) -- otherwise -- if (ref = $elem(z, y).ELEM_eleminst[j]) ;; 8-reduction.watsup rule array.init_data-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.init_data-oob1{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.init_data-oob2{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if ((j + ((n * $zsize(zt)) / 8)) > |$data(z, y).DATA_datainst|) ;; 8-reduction.watsup rule array.init_data-zero{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.init_data-num{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, nt : numtype, c : num_(nt), zt : storagetype, mut : mut, o0 : numtype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) -- if ($nunpack(zt) = ?(o0)) -- otherwise -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) @@ -20905,7 +20934,7 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.init_data-num{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, vt : vectype, c : vec_(vt), zt : storagetype, mut : mut, o0 : vectype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) -- if ($vunpack((vt : vectype <: storagetype)) = ?(o0)) -- otherwise -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) @@ -20914,132 +20943,132 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule local.get{z : state, x : idx, val : val}: - `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [(val : val <: admininstr)]) + `%~>%`(`%;%`(z, [LOCAL.GET_admininstr(x)]), [(val : val <: admininstr)]) -- if ($local(z, x) = ?(val)) ;; 8-reduction.watsup rule global.get{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst : val <: admininstr)]) + `%~>%`(`%;%`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst : val <: admininstr)]) ;; 8-reduction.watsup rule table.get-oob{z : state, i : nat, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) -- if (i >= |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.get-val{z : state, i : nat, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] : ref <: admininstr)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] : ref <: admininstr)]) -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.size{z : state, x : idx, n : n}: - `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) -- if (|$table(z, x).ELEM_tableinst| = n) ;; 8-reduction.watsup rule table.fill-oob{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.fill-zero{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.fill-succ{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule table.copy-oob{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) ;; 8-reduction.watsup rule table.copy-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.copy-le{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) -- otherwise -- if (j <= i) ;; 8-reduction.watsup rule table.copy-gt{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(((j + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i + n) - 1))) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(((j + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i + n) - 1))) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) -- otherwise ;; 8-reduction.watsup rule table.init-oob{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) ;; 8-reduction.watsup rule table.init-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.init-succ{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) ($elem(z, y).ELEM_eleminst[i] : ref <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.INIT_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) ($elem(z, y).ELEM_eleminst[i] : ref <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.INIT_admininstr(x, y)]) -- otherwise ;; 8-reduction.watsup rule load-num-oob{z : state, i : nat, nt : numtype, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ($size(nt) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule load-num-val{z : state, i : nat, nt : numtype, x : idx, mo : memop, c : num_(nt)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) -- if ($nbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : ($size(nt) / 8)]) ;; 8-reduction.watsup rule load-pack-oob{z : state, i : nat, inn : inn, n : n, sx : sx, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (n / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule load-pack-val{z : state, i : nat, inn : inn, n : n, sx : sx, x : idx, mo : memop, c : iN(n)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [CONST_admininstr((inn : inn <: numtype), $ext(n, $size((inn : inn <: numtype)), sx, c))]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [CONST_admininstr((inn : inn <: numtype), $ext(n, $size((inn : inn <: numtype)), sx, c))]) -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (n / 8)]) ;; 8-reduction.watsup rule vload-oob{z : state, i : nat, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ($vsize(V128_vectype) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-val{z : state, i : nat, x : idx, mo : memop, c : vec_(V128_vnn)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- if ($vbytes(V128_vectype, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : ($vsize(V128_vectype) / 8)]) ;; 8-reduction.watsup rule vload-shape-oob{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ((M * N) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-shape-val{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop, c : vec_(V128_vnn), j^N : nat^N, k^N : nat^N, inn : inn}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- (if ($ibytes(M, `%`(j)) = $mem(z, x).DATA_meminst[((i + mo.OFFSET_memop.`%`.0) + ((k * M) / 8)) : (M / 8)]))^(k%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-splat-val{z : state, i : nat, N : N, x : idx, mo : memop, c : vec_(V128_vnn), j : nat, imm : imm, M : M}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- if ($ibytes(N, `%`(j)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)]) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = (128 / N)) @@ -21047,23 +21076,23 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule vload-zero-oob{z : state, i : nat, N : N, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-zero-val{z : state, i : nat, N : N, x : idx, mo : memop, c : vec_(V128_vnn), j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- if ($ibytes(N, `%`(j)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)]) -- if (c = $ext(N, 128, U_sx, `%`(j))) ;; 8-reduction.watsup rule vload_lane-oob{z : state, i : nat, vt : vectype, c_1 : vec_(vt), N : N, x : idx, mo : memop, j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload_lane-val{z : state, i : nat, vt : vectype, c_1 : vec_(vt), N : N, x : idx, mo : memop, j : nat, c : vec_(vt), k : nat, imm : imm, M : M}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(vt, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(vt, c)]) -- if ($ibytes(N, `%`(k)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)]) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = ($vsize(vt) / N)) @@ -21071,199 +21100,199 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule memory.size{z : state, x : idx, n : n}: - `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule memory.fill-oob{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule memory.fill-zero{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.fill-succ{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule memory.copy-oob{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) ;; 8-reduction.watsup rule memory.copy-zero{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.copy-le{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise -- if (i_1 <= i_2) ;; 8-reduction.watsup rule memory.copy-gt{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise ;; 8-reduction.watsup rule memory.init-oob{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) ;; 8-reduction.watsup rule memory.init-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.init-succ{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`($data(z, y).DATA_datainst[i].`%`.0)) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.INIT_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`($data(z, y).DATA_datainst[i].`%`.0)) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.INIT_admininstr(x, y)]) -- otherwise ;; 8-reduction.watsup relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule pure{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) - -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_pure: `%~>%`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule read{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) - -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_read: `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule struct.new{z : state, val^n : val^n, n : n, x : idx, si : structinst, mut^n : mut^n, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut : mut zt : storagetype})) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%`(`%%`(mut, zt)^n{mut : mut zt : storagetype}))) -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val zt : storagetype}}) ;; 8-reduction.watsup rule struct.set-null{z : state, ht : heaptype, val : val, x : idx, i : nat}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%`(z, [TRAP_admininstr])) ;; 8-reduction.watsup rule struct.set-struct{z : state, a : addr, val : val, x : idx, i : nat, fv : fieldval, mut* : mut*, zt* : storagetype*}: - `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`($with_struct(z, a, i, fv), [])) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + `%~>%`(`%;%`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%`($with_struct(z, a, i, fv), [])) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) -- if (fv = $packval(zt*{zt : storagetype}[i], val)) ;; 8-reduction.watsup rule array.new_fixed{z : state, val^n : val^n, n : n, x : idx, ai : arrayinst, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val}}) ;; 8-reduction.watsup rule array.set-null{z : state, ht : heaptype, i : nat, val : val, x : idx}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) ;; 8-reduction.watsup rule array.set-oob{z : state, a : addr, i : nat, val : val, x : idx}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.set-array{z : state, a : addr, i : nat, val : val, x : idx, fv : fieldval, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`($with_array(z, a, i, fv), [])) -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) -- if (fv = $packval(zt, val)) ;; 8-reduction.watsup rule local.set{z : state, val : val, x : idx}: - `%~>%`(`%;%*`(z, [(val : val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) + `%~>%`(`%;%`(z, [(val : val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%`($with_local(z, x, val), [])) ;; 8-reduction.watsup rule global.set{z : state, val : val, x : idx}: - `%~>%`(`%;%*`(z, [(val : val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) + `%~>%`(`%;%`(z, [(val : val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%`($with_global(z, x, val), [])) ;; 8-reduction.watsup rule table.set-oob{z : state, i : nat, ref : ref, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.set-val{z : state, i : nat, ref : ref, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%`($with_table(z, x, i, ref), [])) -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.grow-succeed{z : state, ref : ref, n : n, x : idx, ti : tableinst, o0 : tableinst}: - `%~>%`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, `%`(|$table(z, x).ELEM_tableinst|))])) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, `%`(|$table(z, x).ELEM_tableinst|))])) -- if ($growtable($table(z, x), n, ref) = ?(o0)) -- if (ti = o0) ;; 8-reduction.watsup rule table.grow-fail{z : state, ref : ref, n : n, x : idx}: - `%~>%`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) ;; 8-reduction.watsup rule elem.drop{z : state, x : idx}: - `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) + `%~>%`(`%;%`(z, [ELEM.DROP_admininstr(x)]), `%;%`($with_elem(z, x, []), [])) ;; 8-reduction.watsup rule store-num-oob{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + ($size(nt) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule store-num-val{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) -- if (b*{b : byte} = $nbytes(nt, c)) ;; 8-reduction.watsup rule store-pack-oob{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + (n / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule store-pack-val{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) -- if (b*{b : byte} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c))) ;; 8-reduction.watsup rule vstore-oob{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + ($vsize(V128_vectype) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vstore-val{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) -- if (b*{b : byte} = $vbytes(V128_vectype, c)) ;; 8-reduction.watsup rule vstore_lane-oob{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + N) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vstore_lane-val{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, b* : byte*, imm : imm, M : M}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = (128 / N)) -- if (b*{b : byte} = $ibytes(N, `%`($lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)[j].`%`.0))) ;; 8-reduction.watsup rule memory.grow-succeed{z : state, n : n, x : idx, mi : meminst, o0 : meminst}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, `%`((|$mem(z, x).DATA_meminst| / (64 * $Ki))))])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, `%`((|$mem(z, x).DATA_meminst| / (64 * $Ki))))])) -- if ($growmemory($mem(z, x), n) = ?(o0)) -- if (mi = o0) ;; 8-reduction.watsup rule memory.grow-fail{z : state, n : n, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) ;; 8-reduction.watsup rule data.drop{z : state, x : idx}: - `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) + `%~>%`(`%;%`(z, [DATA.DROP_admininstr(x)]), `%;%`($with_data(z, x, []), [])) ;; 8-reduction.watsup rec { @@ -21272,21 +21301,21 @@ rec { relation Steps: `%~>*%`(config, config) ;; 8-reduction.watsup:18.1-19.36 rule refl{z : state, admininstr* : admininstr*}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z, admininstr*{admininstr : admininstr})) + `%~>*%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z, admininstr*{admininstr : admininstr})) ;; 8-reduction.watsup:21.1-24.53 rule trans{z : state, admininstr* : admininstr*, z'' : state, admininstr''* : admininstr*, z' : state, admininstr' : admininstr}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) - -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z', admininstr'*{})) - -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) + `%~>*%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z'', admininstr''*{admininstr'' : admininstr})) + -- Step: `%~>%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z', admininstr'*{})) + -- Steps: `%~>*%`(`%;%`(z', [admininstr']), `%;%`(z'', admininstr''*{admininstr'' : admininstr})) } ;; 8-reduction.watsup -relation Eval_expr: `%;%~>*%;%*`(state, expr, state, val*) +relation Eval_expr: `%;%~>*%;%`(state, expr, state, val*) ;; 8-reduction.watsup rule _{z : state, instr* : instr*, z' : state, val* : val*}: - `%;%~>*%;%*`(z, instr*{instr : instr}, z', val*{val : val}) - -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z', (val : val <: admininstr)*{val : val})) + `%;%~>*%;%`(z, instr*{instr : instr}, z', val*{val : val}) + -- Steps: `%~>*%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z', (val : val <: admininstr)*{val : val})) ;; 9-module.watsup rec { @@ -21307,7 +21336,7 @@ def $alloctypes(type*) : deftype* def $allocfunc(store : store, moduleinst : moduleinst, func : func) : (store, funcaddr) ;; 9-module.watsup def $allocfunc{s : store, mm : moduleinst, func : func, fi : funcinst, x : idx, local* : local*, expr : expr}(s, mm, func) = (s[FUNC_store =.. [fi]], |s.FUNC_store|) - -- if (func = `FUNC%%*%`(x, local*{local : local}, expr)) + -- if (func = FUNC(x, local*{local : local}, expr)) -- if (fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func}) ;; 9-module.watsup @@ -21433,7 +21462,7 @@ def $instexport(funcaddr*, globaladdr*, tableaddr*, memaddr*, export : export) : def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) : (store, moduleinst) ;; 9-module.watsup def $allocmodule{s : store, module : module, externval* : externval*, val_g* : val*, ref_t* : ref*, ref_e** : ref**, s_6 : store, mm : moduleinst, type* : type*, import* : import*, func^n_f : func^n_f, n_f : n, globaltype^n_g : globaltype^n_g, expr_g^n_g : expr^n_g, n_g : n, tabletype^n_t : tabletype^n_t, expr_t^n_t : expr^n_t, n_t : n, memtype^n_m : memtype^n_m, n_m : n, reftype^n_e : reftype^n_e, expr_e*^n_e : expr*^n_e, elemmode^n_e : elemmode^n_e, n_e : n, byte*^n_d : byte*^n_d, datamode^n_d : datamode^n_d, n_d : n, start? : start?, export* : export*, fa_ex* : funcaddr*, ga_ex* : globaladdr*, ta_ex* : tableaddr*, ma_ex* : memaddr*, fa* : funcaddr*, i_f^n_f : nat^n_f, ga* : globaladdr*, i_g^n_g : nat^n_g, ta* : tableaddr*, i_t^n_t : nat^n_t, ma* : memaddr*, i_m^n_m : nat^n_m, ea* : elemaddr*, i_e^n_e : nat^n_e, da* : dataaddr*, i_d^n_d : nat^n_d, xi* : exportinst*, dt* : deftype*, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store}(s, module, externval*{externval : externval}, val_g*{val_g : val}, ref_t*{ref_t : ref}, ref_e*{ref_e : ref}*{ref_e : ref}) = (s_6, mm) - -- if (module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func^n_f{func : func}, GLOBAL(globaltype, expr_g)^n_g{expr_g : expr globaltype : globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t : expr tabletype : tabletype}, MEMORY(memtype)^n_m{memtype : memtype}, `ELEM%%*%`(reftype, expr_e*{expr_e : expr}, elemmode)^n_e{elemmode : elemmode expr_e : expr reftype : reftype}, `DATA%*%`(byte*{byte : byte}, datamode)^n_d{byte : byte datamode : datamode}, start?{start : start}, export*{export : export})) + -- if (module = MODULE(type*{type : type}, import*{import : import}, func^n_f{func : func}, GLOBAL(globaltype, expr_g)^n_g{expr_g : expr globaltype : globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t : expr tabletype : tabletype}, MEMORY(memtype)^n_m{memtype : memtype}, ELEM(reftype, expr_e*{expr_e : expr}, elemmode)^n_e{elemmode : elemmode expr_e : expr reftype : reftype}, DATA(byte*{byte : byte}, datamode)^n_d{byte : byte datamode : datamode}, start?{start : start}, export*{export : export})) -- if (fa_ex*{fa_ex : funcaddr} = $funcsxv(externval*{externval : externval})) -- if (ga_ex*{ga_ex : globaladdr} = $globalsxv(externval*{externval : externval})) -- if (ta_ex*{ta_ex : tableaddr} = $tablesxv(externval*{externval : externval})) @@ -21457,36 +21486,36 @@ def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) ;; 9-module.watsup def $runelem(elem : elem, idx : idx) : instr* ;; 9-module.watsup - def $runelem{reftype : reftype, expr* : expr*, y : idx}(`ELEM%%*%`(reftype, expr*{expr : expr}, PASSIVE_elemmode), y) = [] + def $runelem{reftype : reftype, expr* : expr*, y : idx}(ELEM(reftype, expr*{expr : expr}, PASSIVE_elemmode), y) = [] ;; 9-module.watsup - def $runelem{reftype : reftype, expr* : expr*, y : idx}(`ELEM%%*%`(reftype, expr*{expr : expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] + def $runelem{reftype : reftype, expr* : expr*, y : idx}(ELEM(reftype, expr*{expr : expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] ;; 9-module.watsup - def $runelem{reftype : reftype, expr* : expr*, x : idx, instr* : instr*, y : idx}(`ELEM%%*%`(reftype, expr*{expr : expr}, ACTIVE_elemmode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|expr*{expr : expr}|)) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] + def $runelem{reftype : reftype, expr* : expr*, x : idx, instr* : instr*, y : idx}(ELEM(reftype, expr*{expr : expr}, ACTIVE_elemmode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|expr*{expr : expr}|)) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] ;; 9-module.watsup def $rundata(data : data, idx : idx) : instr* ;; 9-module.watsup - def $rundata{byte* : byte*, y : idx}(`DATA%*%`(byte*{byte : byte}, PASSIVE_datamode), y) = [] + def $rundata{byte* : byte*, y : idx}(DATA(byte*{byte : byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup - def $rundata{byte* : byte*, x : idx, instr* : instr*, y : idx}(`DATA%*%`(byte*{byte : byte}, ACTIVE_datamode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|byte*{byte : byte}|)) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] + def $rundata{byte* : byte*, x : idx, instr* : instr*, y : idx}(DATA(byte*{byte : byte}, ACTIVE_datamode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|byte*{byte : byte}|)) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] ;; 9-module.watsup def $instantiate(store : store, module : module, externval*) : config ;; 9-module.watsup - def $instantiate{s : store, module : module, externval* : externval*, s' : store, f : frame, instr_E* : instr*, instr_D* : instr*, x? : idx?, type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start? : start?, export* : export*, globaltype* : globaltype*, expr_G* : expr*, tabletype* : tabletype*, expr_T* : expr*, reftype* : reftype*, expr_E** : expr**, elemmode* : elemmode*, n_F : n, n_E : n, n_D : n, mm_init : moduleinst, i_F^n_F : nat^n_F, z : state, val_G* : val*, ref_T* : ref*, ref_E** : ref**, mm : moduleinst, i^n_E : nat^n_E, j^n_D : nat^n_D}(s, module, externval*{externval : externval}) = `%;%*`(`%;%`(s', f), (instr_E : instr <: admininstr)*{instr_E : instr} :: (instr_D : instr <: admininstr)*{instr_D : instr} :: CALL_admininstr(x)?{x : funcidx}) - -- if (module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data*{data : data}, start?{start : start}, export*{export : export})) + def $instantiate{s : store, module : module, externval* : externval*, s' : store, f : frame, instr_E* : instr*, instr_D* : instr*, x? : idx?, type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start? : start?, export* : export*, globaltype* : globaltype*, expr_G* : expr*, tabletype* : tabletype*, expr_T* : expr*, reftype* : reftype*, expr_E** : expr**, elemmode* : elemmode*, n_F : n, n_E : n, n_D : n, mm_init : moduleinst, i_F^n_F : nat^n_F, z : state, val_G* : val*, ref_T* : ref*, ref_E** : ref**, mm : moduleinst, i^n_E : nat^n_E, j^n_D : nat^n_D}(s, module, externval*{externval : externval}) = `%;%`(`%;%`(s', f), (instr_E : instr <: admininstr)*{instr_E : instr} :: (instr_D : instr <: admininstr)*{instr_D : instr} :: CALL_admininstr(x)?{x : funcidx}) + -- if (module = MODULE(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data*{data : data}, start?{start : start}, export*{export : export})) -- if (global*{global : global} = GLOBAL(globaltype, expr_G)*{expr_G : expr globaltype : globaltype}) -- if (table*{table : table} = TABLE(tabletype, expr_T)*{expr_T : expr tabletype : tabletype}) - -- if (elem*{elem : elem} = `ELEM%%*%`(reftype, expr_E*{expr_E : expr}, elemmode)*{elemmode : elemmode expr_E : expr reftype : reftype}) + -- if (elem*{elem : elem} = ELEM(reftype, expr_E*{expr_E : expr}, elemmode)*{elemmode : elemmode expr_E : expr reftype : reftype}) -- if (start?{start : start} = START(x)?{x : funcidx}) -- if (n_F = |func*{func : func}|) -- if (n_E = |elem*{elem : elem}|) -- if (n_D = |data*{data : data}|) -- if (mm_init = {TYPE $alloctypes(type*{type : type}), FUNC $funcsxv(externval*{externval : externval}) :: (|s.FUNC_store| + i_F)^(i_F*%;%*`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} + -- (Eval_expr: `%;%~>*%;%`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} + -- (Eval_expr: `%;%~>*%;%`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} + -- (Eval_expr: `%;%~>*%;%`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} -- if ((s', mm) = $allocmodule(s, module, externval*{externval : externval}, val_G*{val_G : val}, ref_T*{ref_T : ref}, ref_E*{ref_E : ref}*{ref_E : ref})) -- if (f = {LOCAL [], MODULE mm}) -- if (instr_E*{instr_E : instr} = $concat_(syntax instr, $runelem(elem*{elem : elem}[i], `%`(i))^(i%`(t_1^n{t_1 : valtype}, t_2*{t_2 : valtype}))) - -;; A-binary.watsup -rec { - -;; A-binary.watsup:49.1-49.24 -def $utf8(name : name) : byte* - ;; A-binary.watsup:50.1-50.47 - def $utf8{ch : nat, b : byte}([`%`(ch)]) = [b] - -- if ((ch < 128) /\ (ch = b.`%`.0)) - ;; A-binary.watsup:51.1-51.96 - def $utf8{ch : nat, b_1 : byte, b_2 : byte}([`%`(ch)]) = [b_1 b_2] - -- if (((128 <= ch) /\ (ch < 2048)) /\ (ch = (((2 ^ 6) * (b_1.`%`.0 - 192)) + (b_2.`%`.0 - 128)))) - ;; A-binary.watsup:52.1-52.148 - def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte}([`%`(ch)]) = [b_1 b_2 b_3] - -- if ((((2048 <= ch) /\ (ch < 55296)) \/ ((57344 <= ch) /\ (ch < 65536))) /\ (ch = ((((2 ^ 12) * (b_1.`%`.0 - 224)) + ((2 ^ 6) * (b_2.`%`.0 - 128))) + (b_3.`%`.0 - 128)))) - ;; A-binary.watsup:53.1-53.148 - def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([`%`(ch)]) = [b_1 b_2 b_3 b_4] - -- if (((65536 <= ch) /\ (ch < 69632)) /\ (ch = (((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128)))) - ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(`%`(ch)*{ch : nat}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch : nat}) -} + -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = FUNC(x, local*{local : local}, expr)) + -- Expand: `%~~%`(s.FUNC_store[fa].TYPE_funcinst, FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; A-binary.watsup syntax castop = (nul, nul) @@ -21638,14 +21646,8 @@ def $concat_(syntax X, X**) : X* } ;; 1-syntax.watsup -syntax list{syntax X}(syntax X) = X* - -;; 1-syntax.watsup -syntax char = `%`{i : nat}(i : nat) - -- if (((i >= 0) /\ (i <= 55295)) \/ ((i >= 57344) /\ (i <= 1114111))) - -;; 1-syntax.watsup -syntax name = char* +syntax list{syntax X}(syntax X) = `%`{X* : X*}(X*{X : X} : X*) + -- if (|X*{X : X}| < (2 ^ 32)) ;; 1-syntax.watsup syntax bit = `%`{i : nat}(i : nat) @@ -21750,6 +21752,35 @@ def $canon_(N : N) : nat ;; 1-syntax.watsup syntax vN{N : N}(N) = iN(N) +;; 1-syntax.watsup +syntax char = `%`{i : nat}(i : nat) + -- if (((i >= 0) /\ (i <= 55295)) \/ ((i >= 57344) /\ (i <= 1114111))) + +;; 1-syntax.watsup +rec { + +;; 1-syntax.watsup:87.1-87.25 +def $utf8(char*) : byte* + ;; A-binary.watsup:50.1-50.47 + def $utf8{ch : char, b : byte}([ch]) = [b] + -- if ((ch.`%`.0 < 128) /\ (ch = `%`(b.`%`.0))) + ;; A-binary.watsup:51.1-51.96 + def $utf8{ch : char, b_1 : byte, b_2 : byte}([ch]) = [b_1 b_2] + -- if (((128 <= ch.`%`.0) /\ (ch.`%`.0 < 2048)) /\ (ch = `%`((((2 ^ 6) * (b_1.`%`.0 - 192)) + (b_2.`%`.0 - 128))))) + ;; A-binary.watsup:52.1-52.148 + def $utf8{ch : char, b_1 : byte, b_2 : byte, b_3 : byte}([ch]) = [b_1 b_2 b_3] + -- if ((((2048 <= ch.`%`.0) /\ (ch.`%`.0 < 55296)) \/ ((57344 <= ch.`%`.0) /\ (ch.`%`.0 < 65536))) /\ (ch = `%`(((((2 ^ 12) * (b_1.`%`.0 - 224)) + ((2 ^ 6) * (b_2.`%`.0 - 128))) + (b_3.`%`.0 - 128))))) + ;; A-binary.watsup:53.1-53.148 + def $utf8{ch : char, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([ch]) = [b_1 b_2 b_3 b_4] + -- if (((65536 <= ch.`%`.0) /\ (ch.`%`.0 < 69632)) /\ (ch = `%`((((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128))))) + ;; A-binary.watsup:54.1-54.44 + def $utf8{ch* : char*}(ch*{ch : char}) = $concat_(syntax byte, $utf8([ch])*{ch : char}) +} + +;; 1-syntax.watsup +syntax name = `%`{char* : char*}(char*{char : char} : char*) + -- if (|$utf8(char*{char : char})| < (2 ^ 32)) + ;; 1-syntax.watsup syntax idx = u32 @@ -21820,7 +21851,7 @@ syntax fin = `FINAL%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:146.1-147.14 +;; 1-syntax.watsup:147.1-148.14 syntax valtype = | I32 | I64 @@ -21830,10 +21861,10 @@ syntax valtype = | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | BOT -;; 1-syntax.watsup:154.1-155.16 +;; 1-syntax.watsup:155.1-156.16 syntax resulttype = list(syntax valtype) -;; 1-syntax.watsup:162.1-162.68 +;; 1-syntax.watsup:163.1-163.68 syntax storagetype = | BOT | I32 @@ -21845,34 +21876,34 @@ syntax storagetype = | I8 | I16 -;; 1-syntax.watsup:175.1-176.18 +;; 1-syntax.watsup:176.1-177.18 syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) -;; 1-syntax.watsup:178.1-178.70 +;; 1-syntax.watsup:179.1-179.70 syntax functype = `%->%`{resulttype : resulttype}(resulttype : resulttype, resulttype) -;; 1-syntax.watsup:179.1-179.64 +;; 1-syntax.watsup:180.1-180.64 syntax structtype = list(syntax fieldtype) -;; 1-syntax.watsup:180.1-180.53 +;; 1-syntax.watsup:181.1-181.53 syntax arraytype = fieldtype -;; 1-syntax.watsup:182.1-185.18 +;; 1-syntax.watsup:183.1-186.18 syntax comptype = | STRUCT{structtype : structtype}(structtype : structtype) | ARRAY{arraytype : arraytype}(arraytype : arraytype) | FUNC{functype : functype}(functype : functype) -;; 1-syntax.watsup:189.1-190.60 +;; 1-syntax.watsup:190.1-191.60 syntax subtype = | SUB{fin : fin, typeidx* : typeidx*, comptype : comptype}(fin : fin, typeidx*{typeidx : typeidx} : typeidx*, comptype : comptype) | SUBD{fin : fin, heaptype* : heaptype*, comptype : comptype}(fin : fin, heaptype*{heaptype : heaptype} : heaptype*, comptype : comptype) -;; 1-syntax.watsup:192.1-193.22 +;; 1-syntax.watsup:193.1-194.22 syntax rectype = | REC{list : list(syntax subtype)}(list : list(syntax subtype)) -;; 1-syntax.watsup:198.1-199.26 +;; 1-syntax.watsup:199.1-200.26 syntax heaptype = | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY @@ -22331,7 +22362,7 @@ syntax zero = `ZERO%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:522.1-534.78 +;; 1-syntax.watsup:523.1-535.78 syntax instr = | UNREACHABLE | NOP @@ -22461,7 +22492,7 @@ syntax type = TYPE{rectype : rectype}(rectype : rectype) syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) +syntax func = FUNC{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) ;; 1-syntax.watsup syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) @@ -22473,10 +22504,10 @@ syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) +syntax elem = ELEM{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) ;; 1-syntax.watsup -syntax data = `DATA%*%`{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) +syntax data = DATA{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup syntax start = START{funcidx : funcidx}(funcidx : funcidx) @@ -22495,7 +22526,7 @@ syntax export = EXPORT{name : name, externidx : externidx}(name : name, externid syntax import = IMPORT{name : name, externtype : externtype}(name : name, name, externtype : externtype) ;; 1-syntax.watsup -syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) +syntax module = MODULE{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) ;; 2-syntax-aux.watsup rec { @@ -22551,7 +22582,7 @@ def $free_dataidx_expr(expr : expr) : dataidx* ;; 2-syntax-aux.watsup def $free_dataidx_func(func : func) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) + def $free_dataidx_func{x : idx, loc* : local*, e : expr}(FUNC(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) ;; 2-syntax-aux.watsup rec { @@ -22690,7 +22721,7 @@ def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype ;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype ;; 2-syntax-aux.watsup:175.1-175.85 - def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt : fieldtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype}) + def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(`%`(yt*{yt : fieldtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype(`%`($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype})) ;; 2-syntax-aux.watsup:176.1-176.81 def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx : typevar}, ht*{ht : heaptype}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:177.1-177.78 @@ -22706,7 +22737,7 @@ def $subst_subtype(subtype : subtype, typevar*, heaptype*) : subtype ;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype ;; 2-syntax-aux.watsup:184.1-184.76 - def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st : subtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype}) + def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(`%`(st*{st : subtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype(`%`($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype})) ;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype @@ -22716,7 +22747,7 @@ def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype ;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype ;; 2-syntax-aux.watsup:189.1-189.113 - def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}, $subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype}) + def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`(`%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}), `%`($subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype})) } ;; 2-syntax-aux.watsup @@ -22769,25 +22800,25 @@ def $subst_all_deftypes(deftype*, heaptype*) : deftype* ;; 2-syntax-aux.watsup def $rollrt(typeidx : typeidx, rectype : rectype) : rectype ;; 2-syntax-aux.watsup - def $rollrt{x : idx, st^n : subtype^n, n : n, i^n : nat^n}(x, REC_rectype(st^n{st : subtype})) = REC_rectype($subst_subtype(st, $idx(`%`((x.`%`.0 + i)))^(i%*%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) +syntax instrtype = `%->%%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) ;; 6-typing.watsup syntax context = @@ -24262,18 +24293,18 @@ relation Valtype_ok: `%|-%:_OK`(context, valtype) relation Resulttype_ok: `%|-%:_OK`(context, resulttype) ;; 6-typing.watsup rule _{C : context, t* : valtype*}: - `%|-%:_OK`(C, t*{t : valtype}) + `%|-%:_OK`(C, `%`(t*{t : valtype})) -- (Valtype_ok: `%|-%:_OK`(C, t))*{t : valtype} ;; 6-typing.watsup relation Instrtype_ok: `%|-%:_OK`(context, instrtype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, x* : idx*, t_2* : valtype*, lt* : localtype*}: - `%|-%:_OK`(C, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:_OK`(C, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) -- if (|lt*{lt : localtype}| = |x*{x : idx}|) -- (if (x.`%`.0 < |C.LOCAL_context|))*{lt : localtype x : idx} - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_1*{t_1 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_2*{t_2 : valtype})) -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt : localtype x : idx} ;; 6-typing.watsup @@ -24313,15 +24344,15 @@ relation Fieldtype_ok: `%|-%:_OK`(context, fieldtype) relation Functype_ok: `%|-%:_OK`(context, functype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:_OK`(C, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + `%|-%:_OK`(C, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_1*{t_1 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Comptype_ok: `%|-%:_OK`(context, comptype) ;; 6-typing.watsup rule struct{C : context, yt* : fieldtype*}: - `%|-%:_OK`(C, STRUCT_comptype(yt*{yt : fieldtype})) + `%|-%:_OK`(C, STRUCT_comptype(`%`(yt*{yt : fieldtype}))) -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt : fieldtype} ;; 6-typing.watsup @@ -24394,7 +24425,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:303.1-305.35 rule struct{C : context, deftype : deftype, yt* : fieldtype*}: `%|-%<:%`(C, (deftype : deftype <: heaptype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt : fieldtype})) + -- Expand: `%~~%`(deftype, STRUCT_comptype(`%`(yt*{yt : fieldtype}))) ;; 6-typing.watsup:307.1-309.33 rule array{C : context, deftype : deftype, yt : fieldtype}: @@ -24523,7 +24554,7 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) ;; 6-typing.watsup rule struct{C : context, yt_1* : fieldtype*, yt'_1 : fieldtype, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1 : fieldtype} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2 : fieldtype})) + `%|-%<:%`(C, STRUCT_comptype(`%`(yt_1*{yt_1 : fieldtype} :: [yt'_1])), STRUCT_comptype(`%`(yt_2*{yt_2 : fieldtype}))) -- if (|yt_1*{yt_1 : fieldtype}| = |yt_2*{yt_2 : fieldtype}|) -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 : fieldtype yt_2 : fieldtype} @@ -24589,13 +24620,13 @@ rec { relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) ;; 6-typing.watsup:196.1-197.24 rule empty{C : context, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) + `%|-%:%`(C, REC_rectype(`%`([])), OK_oktypeidxnat(x, i)) ;; 6-typing.watsup:199.1-202.50 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidxnat(x, i)) + `%|-%:%`(C, REC_rectype(`%`([st_1] :: st*{st : subtype})), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) - -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) } ;; 6-typing.watsup @@ -24605,18 +24636,18 @@ rec { relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) ;; 6-typing.watsup:184.1-185.23 rule empty{C : context, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) + `%|-%:%`(C, REC_rectype(`%`([])), OK_oktypeidx(x)) ;; 6-typing.watsup:187.1-190.43 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidx(x)) + `%|-%:%`(C, REC_rectype(`%`([st_1] :: st*{st : subtype})), OK_oktypeidx(x)) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) - -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) + -- Rectype_ok: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidx(`%`((x.`%`.0 + 1)))) ;; 6-typing.watsup:192.1-194.49 rule rec2{C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(x, 0)) + `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(x, 0)) } ;; 6-typing.watsup @@ -24625,7 +24656,7 @@ relation Deftype_ok: `%|-%:_OK`(context, deftype) rule _{C : context, qt : rectype, i : nat, x : idx, st^n : subtype^n, n : n}: `%|-%:_OK`(C, DEF_deftype(qt, i)) -- Rectype_ok: `%|-%:%`(C, qt, OK_oktypeidx(x)) - -- if (qt = REC_rectype(st^n{st : subtype})) + -- if (qt = REC_rectype(`%`(st^n{st : subtype}))) -- if (i < n) ;; 6-typing.watsup @@ -24681,10 +24712,10 @@ relation Externtype_ok: `%|-%:_OK`(context, externtype) -- Memtype_ok: `%|-%:_OK`(C, mt) ;; 6-typing.watsup -relation Resulttype_sub: `%|-%*_<:%*`(context, valtype*, valtype*) +relation Resulttype_sub: `%|-%<:%`(context, valtype*, valtype*) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%*_<:%*`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) + `%|-%<:%`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) -- if (|t_1*{t_1 : valtype}| = |t_2*{t_2 : valtype}|) -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 : valtype t_2 : valtype} @@ -24692,11 +24723,11 @@ relation Resulttype_sub: `%|-%*_<:%*`(context, valtype*, valtype*) relation Instrtype_sub: `%|-%<:%`(context, instrtype, instrtype) ;; 6-typing.watsup rule _{C : context, t_11* : valtype*, x_1* : idx*, t_12* : valtype*, t_21* : valtype*, x_2* : idx*, t_22* : valtype*, x* : idx*, t* : valtype*}: - `%|-%<:%`(C, `%->%*%`(t_11*{t_11 : valtype}, x_1*{x_1 : localidx}, t_12*{t_12 : valtype}), `%->%*%`(t_21*{t_21 : valtype}, x_2*{x_2 : localidx}, t_22*{t_22 : valtype})) + `%|-%<:%`(C, `%->%%`(`%`(t_11*{t_11 : valtype}), x_1*{x_1 : localidx}, `%`(t_12*{t_12 : valtype})), `%->%%`(`%`(t_21*{t_21 : valtype}), x_2*{x_2 : localidx}, `%`(t_22*{t_22 : valtype}))) -- if (|t*{t : valtype}| = |x*{x : idx}|) -- (if (x.`%`.0 < |C.LOCAL_context|))*{t : valtype x : idx} - -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) + -- Resulttype_sub: `%|-%<:%`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) + -- Resulttype_sub: `%|-%<:%`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) -- if (x*{x : idx} = $setminus(x_2*{x_2 : idx}, x_1*{x_1 : idx})) -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t : valtype x : idx} @@ -24763,11 +24794,11 @@ relation Externtype_sub: `%|-%<:%`(context, externtype, externtype) relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) ;; 6-typing.watsup rule void{C : context}: - `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) + `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`(`%`([]), `%`([]))) ;; 6-typing.watsup rule result{C : context, t : valtype}: - `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`([], [t])) + `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`(`%`([]), `%`([t]))) ;; 6-typing.watsup rule typeidx{C : context, x : idx, ft : functype}: @@ -24782,84 +24813,84 @@ rec { relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:544.1-545.34 rule unreachable{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:547.1-548.24 rule nop{C : context}: - `%|-%:%`(C, NOP_instr, `%->%`([], [])) + `%|-%:%`(C, NOP_instr, `%->%`(`%`([]), `%`([]))) ;; 6-typing.watsup:550.1-551.23 rule drop{C : context, t : valtype}: - `%|-%:%`(C, DROP_instr, `%->%`([t], [])) + `%|-%:%`(C, DROP_instr, `%->%`(`%`([t]), `%`([]))) ;; 6-typing.watsup:554.1-555.31 rule select-expl{C : context, t : valtype}: - `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) + `%|-%:%`(C, SELECT_instr(?([t])), `%->%`(`%`([t t I32_valtype]), `%`([t]))) ;; 6-typing.watsup:557.1-560.37 rule select-impl{C : context, t : valtype, t' : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) + `%|-%:%`(C, SELECT_instr(?()), `%->%`(`%`([t t I32_valtype]), `%`([t]))) -- Valtype_sub: `%|-%<:%`(C, t, t') -- if ((t' = (numtype : numtype <: valtype)) \/ (t' = (vectype : vectype <: valtype))) ;; 6-typing.watsup:578.1-581.61 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:583.1-586.61 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_1*{t_1 : valtype})], RETURN ?()}, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:588.1-592.65 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_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_2*{x_2 : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(`%`(t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_2*{x_2 : localidx}, `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:597.1-599.24 rule br{C : context, l : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, BR_instr(l), `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) -- if (l.`%`.0 < |C.LABEL_context|) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype})) ;; 6-typing.watsup:601.1-603.24 rule br_if{C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t : valtype} :: [I32_valtype], t*{t : valtype})) + `%|-%:%`(C, BR_IF_instr(l), `%->%`(`%`(t*{t : valtype} :: [I32_valtype]), `%`(t*{t : valtype}))) -- if (l.`%`.0 < |C.LABEL_context|) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype})) ;; 6-typing.watsup:605.1-608.44 rule br_table{C : context, l* : labelidx*, l' : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) -- (if (l.`%`.0 < |C.LABEL_context|))*{l : labelidx} -- if (l'.`%`.0 < |C.LABEL_context|) - -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0]))*{l : labelidx} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0]) + -- (Resulttype_sub: `%|-%<:%`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0].`%`.0))*{l : labelidx} + -- Resulttype_sub: `%|-%<:%`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0].`%`.0) ;; 6-typing.watsup:610.1-613.31 rule br_on_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(`%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)]), `%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]))) -- if (l.`%`.0 < |C.LABEL_context|) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype}) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype})) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:615.1-618.31 rule br_on_non_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype})) + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(`%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)]), `%`(t*{t : valtype}))) -- if (l.`%`.0 < |C.LABEL_context|) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:620.1-626.34 rule br_on_cast{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(`%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)]), `%`(t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)]))) -- if (l.`%`.0 < |C.LABEL_context|) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype} :: [(rt : reftype <: valtype)])) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -24867,9 +24898,9 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:628.1-634.49 rule br_on_cast_fail{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [(rt_2 : reftype <: valtype)])) + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(`%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)]), `%`(t*{t : valtype} :: [(rt_2 : reftype <: valtype)]))) -- if (l.`%`.0 < |C.LABEL_context|) - -- if (C.LABEL_context[l.`%`.0] = t*{t : valtype} :: [(rt : reftype <: valtype)]) + -- if (C.LABEL_context[l.`%`.0] = `%`(t*{t : valtype} :: [(rt : reftype <: valtype)])) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) @@ -24877,195 +24908,195 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:639.1-641.24 rule return{C : context, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) - -- if (C.RETURN_context = ?(t*{t : valtype})) + `%|-%:%`(C, RETURN_instr, `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) + -- if (C.RETURN_context = ?(`%`(t*{t : valtype}))) ;; 6-typing.watsup:643.1-645.46 rule call{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, CALL_instr(x), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) -- if (x.`%`.0 < |C.FUNC_context|) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; 6-typing.watsup:647.1-649.46 rule call_ref{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2 : valtype})) + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(`%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`(t_2*{t_2 : valtype}))) -- if (x.`%`.0 < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; 6-typing.watsup:651.1-655.46 rule call_indirect{C : context, x : idx, y : idx, t_1* : valtype*, t_2* : valtype*, lim : limits, rt : reftype}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(`%`(t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_2*{t_2 : valtype}))) -- if (x.`%`.0 < |C.TABLE_context|) -- if (y.`%`.0 < |C.TYPE_context|) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; 6-typing.watsup:657.1-661.40 rule return_call{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}, t_4*{t_4 : valtype})) + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}), `%`(t_4*{t_4 : valtype}))) -- if (x.`%`.0 < |C.FUNC_context|) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:663.1-667.40 rule return_call_ref{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4 : valtype})) + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`(t_4*{t_4 : valtype}))) -- if (x.`%`.0 < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:669.1-675.40 rule return_call_indirect{C : context, x : idx, y : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, lim : limits, rt : reftype, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype], t_4*{t_4 : valtype})) + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_4*{t_4 : valtype}))) -- if (x.`%`.0 < |C.TABLE_context|) -- if (y.`%`.0 < |C.TYPE_context|) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + -- Expand: `%~~%`(C.TYPE_context[y.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) ;; 6-typing.watsup:680.1-681.33 rule const{C : context, nt : numtype, c_nt : num_(nt)}: - `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [(nt : numtype <: valtype)])) + `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`(`%`([]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:683.1-684.34 rule unop{C : context, nt : numtype, unop_nt : unop_(nt)}: - `%|-%:%`(C, UNOP_instr(nt, unop_nt), `%->%`([(nt : numtype <: valtype)], [(nt : numtype <: valtype)])) + `%|-%:%`(C, UNOP_instr(nt, unop_nt), `%->%`(`%`([(nt : numtype <: valtype)]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:686.1-687.39 rule binop{C : context, nt : numtype, binop_nt : binop_(nt)}: - `%|-%:%`(C, BINOP_instr(nt, binop_nt), `%->%`([(nt : numtype <: valtype) (nt : numtype <: valtype)], [(nt : numtype <: valtype)])) + `%|-%:%`(C, BINOP_instr(nt, binop_nt), `%->%`(`%`([(nt : numtype <: valtype) (nt : numtype <: valtype)]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:689.1-690.39 rule testop{C : context, nt : numtype, testop_nt : testop_(nt)}: - `%|-%:%`(C, TESTOP_instr(nt, testop_nt), `%->%`([(nt : numtype <: valtype)], [I32_valtype])) + `%|-%:%`(C, TESTOP_instr(nt, testop_nt), `%->%`(`%`([(nt : numtype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:692.1-693.40 rule relop{C : context, nt : numtype, relop_nt : relop_(nt)}: - `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->%`([(nt : numtype <: valtype) (nt : numtype <: valtype)], [I32_valtype])) + `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->%`(`%`([(nt : numtype <: valtype) (nt : numtype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:696.1-699.34 rule reinterpret{C : context, nt_1 : numtype, nt_2 : numtype}: - `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([(nt_2 : numtype <: valtype)], [(nt_1 : numtype <: valtype)])) + `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`(`%`([(nt_2 : numtype <: valtype)]), `%`([(nt_1 : numtype <: valtype)]))) -- if (nt_1 =/= nt_2) -- if ($size(nt_1) = $size(nt_2)) ;; 6-typing.watsup:701.1-704.50 rule convert-i{C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: - `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`(`%`([(inn_2 : inn <: valtype)]), `%`([(inn_1 : inn <: valtype)]))) -- if (inn_1 =/= inn_2) -- if ((sx?{sx : sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) ;; 6-typing.watsup:706.1-708.24 rule convert-f{C : context, fnn_1 : fnn, fnn_2 : fnn}: - `%|-%:%`(C, CVTOP_instr((fnn_1 : fnn <: numtype), CONVERT_cvtop, (fnn_2 : fnn <: numtype), ?()), `%->%`([(fnn_2 : fnn <: valtype)], [(fnn_1 : fnn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((fnn_1 : fnn <: numtype), CONVERT_cvtop, (fnn_2 : fnn <: numtype), ?()), `%->%`(`%`([(fnn_2 : fnn <: valtype)]), `%`([(fnn_1 : fnn <: valtype)]))) -- if (fnn_1 =/= fnn_2) ;; 6-typing.watsup:713.1-715.31 rule ref.null{C : context, ht : heaptype}: - `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) + `%|-%:%`(C, REF.NULL_instr(ht), `%->%`(`%`([]), `%`([REF_valtype(`NULL%?`(?(())), ht)]))) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:718.1-720.23 rule ref.func{C : context, x : idx, epsilon : resulttype, dt : deftype}: - `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), (dt : deftype <: heaptype))])) + `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, `%`([REF_valtype(`NULL%?`(?()), (dt : deftype <: heaptype))]))) -- if (x.`%`.0 < |C.FUNC_context|) -- if (C.FUNC_context[x.`%`.0] = dt) ;; 6-typing.watsup:722.1-723.34 rule ref.i31{C : context}: - `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) + `%|-%:%`(C, REF.I31_instr, `%->%`(`%`([I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), I31_heaptype)]))) ;; 6-typing.watsup:725.1-726.31 rule ref.is_null{C : context, rt : reftype}: - `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([(rt : reftype <: valtype)], [I32_valtype])) + `%|-%:%`(C, REF.IS_NULL_instr, `%->%`(`%`([(rt : reftype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:728.1-730.31 rule ref.as_non_null{C : context, ht : heaptype}: - `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) + `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ht)]), `%`([REF_valtype(`NULL%?`(?()), ht)]))) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:732.1-733.51 rule ref.eq{C : context}: - `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) + `%|-%:%`(C, REF.EQ_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:735.1-739.33 rule ref.test{C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([(rt' : reftype <: valtype)], [I32_valtype])) + `%|-%:%`(C, REF.TEST_instr(rt), `%->%`(`%`([(rt' : reftype <: valtype)]), `%`([I32_valtype]))) -- Reftype_ok: `%|-%:_OK`(C, rt) -- Reftype_ok: `%|-%:_OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') ;; 6-typing.watsup:741.1-745.33 rule ref.cast{C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.CAST_instr(rt), `%->%`([(rt' : reftype <: valtype)], [(rt : reftype <: valtype)])) + `%|-%:%`(C, REF.CAST_instr(rt), `%->%`(`%`([(rt' : reftype <: valtype)]), `%`([(rt : reftype <: valtype)]))) -- Reftype_ok: `%|-%:_OK`(C, rt) -- Reftype_ok: `%|-%:_OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') ;; 6-typing.watsup:750.1-751.42 rule i31.get{C : context, sx : sx}: - `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) + `%|-%:%`(C, I31.GET_instr(sx), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:756.1-758.43 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`(`%`($unpack(zt)*{zt : storagetype}), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x.`%`.0 < |C.TYPE_context|) -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) ;; 6-typing.watsup:760.1-763.39 rule struct.new_default{C : context, x : idx, zt* : storagetype*, mut* : mut*, val* : val*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`(`%`($unpack(zt)*{zt : storagetype}), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x.`%`.0 < |C.TYPE_context|) -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) -- if (|val*{val : val}| = |zt*{zt : storagetype}|) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 6-typing.watsup:765.1-769.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: - `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) + `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`([$unpack(zt)]))) -- if (x.`%`.0 < |C.TYPE_context|) -- if (i < |yt*{yt : fieldtype}|) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`(mut, zt)) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:771.1-774.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: - `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)], [])) + `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)]), `%`([]))) -- if (x.`%`.0 < |C.TYPE_context|) -- if (i < |yt*{yt : fieldtype}|) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(yt*{yt : fieldtype})) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], STRUCT_comptype(`%`(yt*{yt : fieldtype}))) -- if (yt*{yt : fieldtype}[i] = `%%`(`MUT%?`(?(())), zt)) ;; 6-typing.watsup:779.1-781.41 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpack(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`(`%`([$unpack(zt) I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x.`%`.0 < |C.TYPE_context|) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) ;; 6-typing.watsup:783.1-786.36 rule array.new_default{C : context, x : idx, mut : mut, zt : storagetype, val : val}: - `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`(`%`([I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x.`%`.0 < |C.TYPE_context|) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) -- if ($default($unpack(zt)) = ?(val)) ;; 6-typing.watsup:788.1-790.41 rule array.new_fixed{C : context, x : idx, n : n, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpack(zt)], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`(`%`([$unpack(zt)]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x.`%`.0 < |C.TYPE_context|) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) ;; 6-typing.watsup:792.1-795.39 rule array.new_elem{C : context, x : idx, y : idx, mut : mut, rt : reftype}: - `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x.`%`.0 < |C.TYPE_context|) -- if (y.`%`.0 < |C.ELEM_context|) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, (rt : reftype <: storagetype)))) @@ -25073,7 +25104,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:797.1-801.23 rule array.new_data{C : context, x : idx, y : idx, mut : mut, t : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x.`%`.0 < |C.TYPE_context|) -- if (y.`%`.0 < |C.DATA_context|) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, (t : valtype <: storagetype)))) @@ -25082,32 +25113,32 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:803.1-806.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype]), `%`([$unpack(zt)]))) -- if (x.`%`.0 < |C.TYPE_context|) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(mut, zt))) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:808.1-810.41 rule array.set{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)], [])) + `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)]), `%`([]))) -- if (x.`%`.0 < |C.TYPE_context|) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 6-typing.watsup:812.1-814.41 rule array.len{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) + `%|-%:%`(C, ARRAY.LEN_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)]), `%`([I32_valtype]))) -- if (x.`%`.0 < |C.TYPE_context|) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 6-typing.watsup:816.1-818.41 rule array.fill{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype], [])) + `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype]), `%`([]))) -- if (x.`%`.0 < |C.TYPE_context|) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 6-typing.watsup:820.1-824.40 rule array.copy{C : context, x_1 : idx, x_2 : idx, zt_1 : storagetype, mut : mut, zt_2 : storagetype}: - `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype]), `%`([]))) -- if (x_1.`%`.0 < |C.TYPE_context|) -- if (x_2.`%`.0 < |C.TYPE_context|) -- Expand: `%~~%`(C.TYPE_context[x_1.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) @@ -25116,7 +25147,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:826.1-829.43 rule array.init_elem{C : context, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (x.`%`.0 < |C.TYPE_context|) -- if (y.`%`.0 < |C.ELEM_context|) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) @@ -25124,7 +25155,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:831.1-835.23 rule array.init_data{C : context, x : idx, y : idx, zt : storagetype, t : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (x.`%`.0 < |C.TYPE_context|) -- if (y.`%`.0 < |C.DATA_context|) -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) @@ -25133,150 +25164,150 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:840.1-841.62 rule extern.convert_any{C : context, nul : nul}: - `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) + `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`(`%`([REF_valtype(nul, ANY_heaptype)]), `%`([REF_valtype(nul, EXTERN_heaptype)]))) ;; 6-typing.watsup:843.1-844.62 rule any.convert_extern{C : context, nul : nul}: - `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) + `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`(`%`([REF_valtype(nul, EXTERN_heaptype)]), `%`([REF_valtype(nul, ANY_heaptype)]))) ;; 6-typing.watsup:849.1-850.35 rule vconst{C : context, c : vec_(V128_vnn)}: - `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->%`([], [V128_valtype])) + `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->%`(`%`([]), `%`([V128_valtype]))) ;; 6-typing.watsup:852.1-853.41 rule vvunop{C : context, vvunop : vvunop}: - `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:855.1-856.48 rule vvbinop{C : context, vvbinop : vvbinop}: - `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:858.1-859.55 rule vvternop{C : context, vvternop : vvternop}: - `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->%`([V128_valtype V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->%`(`%`([V128_valtype V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:861.1-862.44 rule vvtestop{C : context, vvtestop : vvtestop}: - `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:864.1-865.33 rule vbitmask{C : context, sh : ishape}: - `%|-%:%`(C, VBITMASK_instr(sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VBITMASK_instr(sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:867.1-868.39 rule vswizzle{C : context, sh : ishape}: - `%|-%:%`(C, VSWIZZLE_instr(sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VSWIZZLE_instr(sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:870.1-872.22 rule vshuffle{C : context, imm : imm, N : N, i* : nat*}: - `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) -- (if (i < (N * 2)))*{i : nat} ;; 6-typing.watsup:874.1-875.48 rule vsplat{C : context, lnn : lnn, N : N}: - `%|-%:%`(C, VSPLAT_instr(`%X%`(lnn, `%`(N))), `%->%`([($lunpack(lnn) : numtype <: valtype)], [V128_valtype])) + `%|-%:%`(C, VSPLAT_instr(`%X%`(lnn, `%`(N))), `%->%`(`%`([($lunpack(lnn) : numtype <: valtype)]), `%`([V128_valtype]))) ;; 6-typing.watsup:878.1-880.14 rule vextract_lane{C : context, lnn : lnn, N : N, sx? : sx?, i : nat}: - `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) + `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`(`%`([V128_valtype]), `%`([($lunpack(lnn) : numtype <: valtype)]))) -- if (i < N) ;; 6-typing.watsup:882.1-884.14 rule vreplace_lane{C : context, lnn : lnn, N : N, i : nat}: - `%|-%:%`(C, VREPLACE_LANE_instr(`%X%`(lnn, `%`(N)), `%`(i)), `%->%`([V128_valtype ($lunpack(lnn) : numtype <: valtype)], [V128_valtype])) + `%|-%:%`(C, VREPLACE_LANE_instr(`%X%`(lnn, `%`(N)), `%`(i)), `%->%`(`%`([V128_valtype ($lunpack(lnn) : numtype <: valtype)]), `%`([V128_valtype]))) -- if (i < N) ;; 6-typing.watsup:886.1-887.40 rule vunop{C : context, sh : shape, vunop_sh : vunop_(sh)}: - `%|-%:%`(C, VUNOP_instr(sh, vunop_sh), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VUNOP_instr(sh, vunop_sh), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:889.1-890.47 rule vbinop{C : context, sh : shape, vbinop_sh : vbinop_(sh)}: - `%|-%:%`(C, VBINOP_instr(sh, vbinop_sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VBINOP_instr(sh, vbinop_sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:892.1-893.43 rule vtestop{C : context, sh : shape, vtestop_sh : vtestop_(sh)}: - `%|-%:%`(C, VTESTOP_instr(sh, vtestop_sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VTESTOP_instr(sh, vtestop_sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:895.1-896.47 rule vrelop{C : context, sh : shape, vrelop_sh : vrelop_(sh)}: - `%|-%:%`(C, VRELOP_instr(sh, vrelop_sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VRELOP_instr(sh, vrelop_sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:898.1-899.50 rule vshiftop{C : context, sh : ishape, vshiftop_sh : vshiftop_(sh)}: - `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop_sh), `%->%`([V128_valtype I32_valtype], [V128_valtype])) + `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop_sh), `%->%`(`%`([V128_valtype I32_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:902.1-903.55 rule vcvtop{C : context, sh : shape, vcvtop : vcvtop, hf? : half?, sx? : sx?, zero : zero}: - `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:905.1-906.44 rule vnarrow{C : context, sh : ishape, sx : sx}: - `%|-%:%`(C, VNARROW_instr(sh, sh, sx), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VNARROW_instr(sh, sh, sx), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:908.1-909.49 rule vextunop{C : context, sh : ishape, vextunop : vextunop_(sh, sh), sx : sx}: - `%|-%:%`(C, VEXTUNOP_instr(sh, sh, vextunop, sx), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VEXTUNOP_instr(sh, sh, vextunop, sx), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:911.1-912.56 rule vextbinop{C : context, sh : ishape, vextbinop : vextbinop_(sh, sh), sx : sx}: - `%|-%:%`(C, VEXTBINOP_instr(sh, sh, vextbinop, sx), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VEXTBINOP_instr(sh, sh, vextbinop, sx), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:914.1-915.33 rule vbitmask{C : context, sh : ishape}: - `%|-%:%`(C, VBITMASK_instr(sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VBITMASK_instr(sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:920.1-922.28 rule local.get{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) + `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`(`%`([]), `%`([t]))) -- if (x.`%`.0 < |C.LOCAL_context|) -- if (C.LOCAL_context[x.`%`.0] = `%%`(init, t)) ;; 6-typing.watsup:935.1-937.28 rule global.get{C : context, x : idx, t : valtype, mut : mut}: - `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) + `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`(`%`([]), `%`([t]))) -- if (x.`%`.0 < |C.GLOBAL_context|) -- if (C.GLOBAL_context[x.`%`.0] = `%%`(mut, t)) ;; 6-typing.watsup:939.1-941.28 rule global.set{C : context, x : idx, t : valtype}: - `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) + `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`(`%`([t]), `%`([]))) -- if (x.`%`.0 < |C.GLOBAL_context|) -- if (C.GLOBAL_context[x.`%`.0] = `%%`(`MUT%?`(?(())), t)) ;; 6-typing.watsup:946.1-948.28 rule table.get{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [(rt : reftype <: valtype)])) + `%|-%:%`(C, TABLE.GET_instr(x), `%->%`(`%`([I32_valtype]), `%`([(rt : reftype <: valtype)]))) -- if (x.`%`.0 < |C.TABLE_context|) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:950.1-952.28 rule table.set{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype (rt : reftype <: valtype)], [])) + `%|-%:%`(C, TABLE.SET_instr(x), `%->%`(`%`([I32_valtype (rt : reftype <: valtype)]), `%`([]))) -- if (x.`%`.0 < |C.TABLE_context|) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:954.1-956.24 rule table.size{C : context, x : idx, tt : tabletype}: - `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) + `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`(`%`([]), `%`([I32_valtype]))) -- if (x.`%`.0 < |C.TABLE_context|) -- if (C.TABLE_context[x.`%`.0] = tt) ;; 6-typing.watsup:958.1-960.28 rule table.grow{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([(rt : reftype <: valtype) I32_valtype], [I32_valtype])) + `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`(`%`([(rt : reftype <: valtype) I32_valtype]), `%`([I32_valtype]))) -- if (x.`%`.0 < |C.TABLE_context|) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:962.1-964.28 rule table.fill{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype (rt : reftype <: valtype) I32_valtype], [])) + `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`(`%`([I32_valtype (rt : reftype <: valtype) I32_valtype]), `%`([]))) -- if (x.`%`.0 < |C.TABLE_context|) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) ;; 6-typing.watsup:966.1-970.36 rule table.copy{C : context, x_1 : idx, x_2 : idx, lim_1 : limits, rt_1 : reftype, lim_2 : limits, rt_2 : reftype}: - `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (x_1.`%`.0 < |C.TABLE_context|) -- if (x_2.`%`.0 < |C.TABLE_context|) -- if (C.TABLE_context[x_1.`%`.0] = `%%`(lim_1, rt_1)) @@ -25285,7 +25316,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:972.1-976.36 rule table.init{C : context, x : idx, y : idx, lim : limits, rt_1 : reftype, rt_2 : reftype}: - `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (x.`%`.0 < |C.TABLE_context|) -- if (y.`%`.0 < |C.ELEM_context|) -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt_1)) @@ -25294,31 +25325,31 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:978.1-980.23 rule elem.drop{C : context, x : idx, rt : reftype}: - `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) + `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`(`%`([]), `%`([]))) -- if (x.`%`.0 < |C.ELEM_context|) -- if (C.ELEM_context[x.`%`.0] = rt) ;; 6-typing.watsup:985.1-987.22 rule memory.size{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) + `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`(`%`([]), `%`([I32_valtype]))) -- if (x.`%`.0 < |C.MEM_context|) -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup:989.1-991.22 rule memory.grow{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) + `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`(`%`([I32_valtype]), `%`([I32_valtype]))) -- if (x.`%`.0 < |C.MEM_context|) -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup:993.1-995.22 rule memory.fill{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (x.`%`.0 < |C.MEM_context|) -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup:997.1-1000.26 rule memory.copy{C : context, x_1 : idx, x_2 : idx, mt_1 : memtype, mt_2 : memtype}: - `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (x_1.`%`.0 < |C.MEM_context|) -- if (x_2.`%`.0 < |C.MEM_context|) -- if (C.MEM_context[x_1.`%`.0] = mt_1) @@ -25326,7 +25357,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1002.1-1005.23 rule memory.init{C : context, x : idx, y : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (x.`%`.0 < |C.MEM_context|) -- if (y.`%`.0 < |C.DATA_context|) -- if (C.MEM_context[x.`%`.0] = mt) @@ -25334,13 +25365,13 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1007.1-1009.23 rule data.drop{C : context, x : idx}: - `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) + `%|-%:%`(C, DATA.DROP_instr(x), `%->%`(`%`([]), `%`([]))) -- if (x.`%`.0 < |C.DATA_context|) -- if (C.DATA_context[x.`%`.0] = OK) ;; 6-typing.watsup:1011.1-1016.29 rule load{C : context, nt : numtype, n? : n?, sx? : sx?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([(nt : numtype <: valtype)]))) -- if (x.`%`.0 < |C.MEM_context|) -- if ((n?{n : n} = ?()) <=> (sx?{sx : sx} = ?())) -- if (C.MEM_context[x.`%`.0] = mt) @@ -25350,7 +25381,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1018.1-1023.29 rule store{C : context, nt : numtype, n? : n?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) + `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype (nt : numtype <: valtype)]), `%`([]))) -- if (x.`%`.0 < |C.MEM_context|) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($size(nt) / 8)) @@ -25359,28 +25390,28 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1025.1-1028.30 rule vload{C : context, M : M, N : N, sx : sx, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (x.`%`.0 < |C.MEM_context|) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ((M / 8) * N)) ;; 6-typing.watsup:1030.1-1033.26 rule vload-splat{C : context, n : n, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(SPLAT_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(SPLAT_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (x.`%`.0 < |C.MEM_context|) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= (n / 8)) ;; 6-typing.watsup:1035.1-1038.25 rule vload-zero{C : context, n : n, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(ZERO_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(ZERO_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (x.`%`.0 < |C.MEM_context|) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) < (n / 8)) ;; 6-typing.watsup:1040.1-1044.29 rule vload_lane{C : context, n : n, x : idx, n_A : n, n_O : n, laneidx : laneidx, mt : memtype}: - `%|-%:%`(C, VLOAD_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`([I32_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`(`%`([I32_valtype V128_valtype]), `%`([V128_valtype]))) -- if (x.`%`.0 < |C.MEM_context|) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) < (n / 8)) @@ -25388,14 +25419,14 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1046.1-1049.37 rule vstore{C : context, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VSTORE_instr(x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype V128_valtype], [])) + `%|-%:%`(C, VSTORE_instr(x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype V128_valtype]), `%`([]))) -- if (x.`%`.0 < |C.MEM_context|) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) <= ($vsize(V128_vectype) / 8)) ;; 6-typing.watsup:1051.1-1055.29 rule vstore_lane{C : context, n : n, x : idx, n_A : n, n_O : n, laneidx : laneidx, mt : memtype}: - `%|-%:%`(C, VSTORE_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`([I32_valtype V128_valtype], [])) + `%|-%:%`(C, VSTORE_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`(`%`([I32_valtype V128_valtype]), `%`([]))) -- if (x.`%`.0 < |C.MEM_context|) -- if (C.MEM_context[x.`%`.0] = mt) -- if ((2 ^ n_A) < (n / 8)) @@ -25405,56 +25436,56 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) relation Instrf_ok: `%|-%:%`(context, instr, instrtype) ;; 6-typing.watsup:518.1-520.41 rule instr{C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1 : valtype}, [], t_2*{t_2 : valtype})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, instr, `%->%%`(`%`(t_1*{t_1 : valtype}), [], `%`(t_2*{t_2 : valtype}))) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:924.1-926.28 rule local.set{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) + `%|-%:%`(C, LOCAL.SET_instr(x), `%->%%`(`%`([t]), [x], `%`([]))) -- if (x.`%`.0 < |C.LOCAL_context|) -- if (C.LOCAL_context[x.`%`.0] = `%%`(init, t)) ;; 6-typing.watsup:928.1-930.28 rule local.tee{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) + `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%%`(`%`([t]), [x], `%`([t]))) -- if (x.`%`.0 < |C.LOCAL_context|) -- if (C.LOCAL_context[x.`%`.0] = `%%`(init, t)) ;; 6-typing.watsup:505.1-505.74 -relation Instrs_ok: `%|-%*_:%`(context, instr*, instrtype) +relation Instrs_ok: `%|-%:%`(context, instr*, instrtype) ;; 6-typing.watsup:522.1-523.29 rule empty{C : context}: - `%|-%*_:%`(C, [], `%->%*%`([], [], [])) + `%|-%:%`(C, [], `%->%%`(`%`([]), [], `%`([]))) ;; 6-typing.watsup:525.1-530.52 rule seq{C : context, instr_1 : instr, instr_2* : instr*, t_1* : valtype*, x_1* : idx*, x_2* : idx*, t_3* : valtype*, init* : init*, t* : valtype*, C' : context, t_2* : valtype*}: - `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + `%|-%:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, `%`(t_3*{t_3 : valtype}))) -- if (|init*{init : init}| = |t*{t : valtype}|) -- if (|init*{init : init}| = |x_1*{x_1 : idx}|) -- (if (x_1.`%`.0 < |C.LOCAL_context|))*{init : init t : valtype x_1 : idx} -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init : init t : valtype x_1 : idx} -- if (C' = $with_locals(C, x_1*{x_1 : localidx}, `%%`(SET_init, t)*{t : valtype})) - -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2 : instr}, `%->%*%`(t_2*{t_2 : valtype}, x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C', instr_2*{instr_2 : instr}, `%->%%`(`%`(t_2*{t_2 : valtype}), x_2*{x_2 : localidx}, `%`(t_3*{t_3 : valtype}))) ;; 6-typing.watsup:532.1-535.35 rule sub{C : context, instr* : instr*, it' : instrtype, it : instrtype}: - `%|-%*_:%`(C, instr*{instr : instr}, it') - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, it) + `%|-%:%`(C, instr*{instr : instr}, it') + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, it) -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:537.1-539.47 rule frame{C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, x* : idx*, t_2* : valtype*}: - `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t*{t : valtype} :: t_1*{t_1 : valtype}, x*{x : localidx}, t*{t : valtype} :: t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`(t*{t : valtype} :: t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t*{t : valtype} :: t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) } ;; 6-typing.watsup relation Expr_ok: `%|-%:%`(context, expr, resulttype) ;; 6-typing.watsup rule _{C : context, instr* : instr*, t* : valtype*}: - `%|-%:%`(C, instr*{instr : instr}, t*{t : valtype}) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`([], [], t*{t : valtype})) + `%|-%:%`(C, instr*{instr : instr}, `%`(t*{t : valtype})) + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`([]), [], `%`(t*{t : valtype}))) ;; 6-typing.watsup rec { @@ -25520,14 +25551,14 @@ relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) ;; 6-typing.watsup rule _{C : context, expr : expr, t : valtype}: `%|-%:%CONST`(C, expr, t) - -- Expr_ok: `%|-%:%`(C, expr, [t]) + -- Expr_ok: `%|-%:%`(C, expr, `%`([t])) -- Expr_const: `%|-%CONST`(C, expr) ;; 6-typing.watsup -relation Type_ok: `%|-%:%*`(context, type, deftype*) +relation Type_ok: `%|-%:%`(context, type, deftype*) ;; 6-typing.watsup rule _{C : context, rectype : rectype, dt* : deftype*, x : idx}: - `%|-%:%*`(C, TYPE(rectype), dt*{dt : deftype}) + `%|-%:%`(C, TYPE(rectype), dt*{dt : deftype}) -- if (x = `%`(|C.TYPE_context|)) -- if (dt*{dt : deftype} = $rolldt(x, rectype)) -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt : deftype}], rectype, OK_oktypeidx(x)) @@ -25548,12 +25579,12 @@ relation Local_ok: `%|-%:%`(context, local, localtype) relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup rule _{C : context, x : idx, local* : local*, expr : expr, t_1* : valtype*, t_2* : valtype*, lt* : localtype*}: - `%|-%:%`(C, `FUNC%%*%`(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) + `%|-%:%`(C, FUNC(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) -- if (x.`%`.0 < |C.TYPE_context|) -- if (|local*{local : local}| = |lt*{lt : localtype}|) - -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}))) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) -- (Local_ok: `%|-%:%`(C, local, lt))*{local : local lt : localtype} - -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2 : valtype})}, expr, t_2*{t_2 : valtype}) + -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(`%`(t_2*{t_2 : valtype}))}, expr, `%`(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -25601,7 +25632,7 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup rule _{C : context, rt : reftype, expr* : expr*, elemmode : elemmode}: - `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr : expr}, elemmode), rt) + `%|-%:%`(C, ELEM(rt, expr*{expr : expr}, elemmode), rt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr : expr} -- Elemmode_ok: `%|-%:%`(C, elemmode, rt) @@ -25622,7 +25653,7 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) relation Data_ok: `%|-%:_OK`(context, data) ;; 6-typing.watsup rule _{C : context, b* : byte*, datamode : datamode}: - `%|-%:_OK`(C, `DATA%*%`(b*{b : byte}, datamode)) + `%|-%:_OK`(C, DATA(b*{b : byte}, datamode)) -- Datamode_ok: `%|-%:_OK`(C, datamode) ;; 6-typing.watsup @@ -25631,7 +25662,7 @@ relation Start_ok: `%|-%:_OK`(context, start) rule _{C : context, x : idx}: `%|-%:_OK`(C, START(x)) -- if (x.`%`.0 < |C.FUNC_context|) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`([], []))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`([]), `%`([])))) ;; 6-typing.watsup relation Import_ok: `%|-%:%`(context, import, externtype) @@ -25677,48 +25708,48 @@ relation Export_ok: `%|-%:%`(context, export, externtype) rec { ;; 6-typing.watsup:1229.1-1229.77 -relation Globals_ok: `%|-%*_:%*`(context, global*, globaltype*) +relation Globals_ok: `%|-%:%`(context, global*, globaltype*) ;; 6-typing.watsup:1272.1-1273.17 rule empty{C : context}: - `%|-%*_:%*`(C, [], []) + `%|-%:%`(C, [], []) ;; 6-typing.watsup:1275.1-1278.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: - `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) + `%|-%:%`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) - -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) + -- Globals_ok: `%|-%:%`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) } ;; 6-typing.watsup rec { ;; 6-typing.watsup:1228.1-1228.75 -relation Types_ok: `%|-%*_:%*`(context, type*, deftype*) +relation Types_ok: `%|-%:%`(context, type*, deftype*) ;; 6-typing.watsup:1264.1-1265.17 rule empty{C : context}: - `%|-%*_:%*`(C, [], []) + `%|-%:%`(C, [], []) ;; 6-typing.watsup:1267.1-1270.49 rule cons{C : context, type_1 : type, type* : type*, dt_1 : deftype, dt* : deftype*}: - `%|-%*_:%*`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) - -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) + `%|-%:%`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) + -- Type_ok: `%|-%:%`(C, type_1, [dt_1]) + -- Types_ok: `%|-%:%`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) } ;; 6-typing.watsup relation Module_ok: `|-%:_OK`(module) ;; 6-typing.watsup rule _{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data^n : data^n, n : n, start? : start?, export* : export*, dt'* : deftype*, ixt* : externtype*, C' : context, gt* : globaltype*, tt* : tabletype*, mt* : memtype*, C : context, dt* : deftype*, rt* : reftype*, et* : externtype*, idt* : deftype*, igt* : globaltype*, itt* : tabletype*, imt* : memtype*}: - `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) + `|-%:_OK`(MODULE(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) -- if (|import*{import : import}| = |ixt*{ixt : externtype}|) -- if (|table*{table : table}| = |tt*{tt : tabletype}|) -- if (|mem*{mem : mem}| = |mt*{mt : memtype}|) -- if (|dt*{dt : deftype}| = |func*{func : func}|) -- if (|elem*{elem : elem}| = |rt*{rt : reftype}|) -- if (|et*{et : externtype}| = |export*{export : export}|) - -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) + -- Types_ok: `%|-%:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) -- (Import_ok: `%|-%:%`({TYPE dt'*{dt' : deftype}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import : import ixt : externtype} - -- Globals_ok: `%|-%*_:%*`(C', global*{global : global}, gt*{gt : globaltype}) + -- Globals_ok: `%|-%:%`(C', global*{global : global}, gt*{gt : globaltype}) -- (Table_ok: `%|-%:%`(C', table, tt))*{table : table tt : tabletype} -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem : mem mt : memtype} -- (Func_ok: `%|-%:%`(C, func, dt))*{dt : deftype func : func} @@ -25770,238 +25801,238 @@ relation Ref_ok: `%|-%:%`(store, ref, reftype) `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) ;; 8-reduction.watsup -relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) +relation Step_pure: `%~>%`(admininstr*, admininstr*) ;; 8-reduction.watsup rule unreachable: - `%*_~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) + `%~>%`([UNREACHABLE_admininstr], [TRAP_admininstr]) ;; 8-reduction.watsup rule nop: - `%*_~>%*`([NOP_admininstr], []) + `%~>%`([NOP_admininstr], []) ;; 8-reduction.watsup rule drop{val : val}: - `%*_~>%*`([(val : val <: admininstr) DROP_admininstr], []) + `%~>%`([(val : val <: admininstr) DROP_admininstr], []) ;; 8-reduction.watsup rule select-true{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) + `%~>%`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule select-false{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) + `%~>%`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule if-true{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) + `%~>%`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule if-false{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) + `%~>%`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule label-vals{n : n, instr* : instr*, val* : val*}: - `%*_~>%*`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) + `%~>%`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) ;; 8-reduction.watsup rule br-zero{n : n, instr'* : instr*, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule br-succ{n : n, instr'* : instr*, val* : val*, l : labelidx, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) + `%~>%`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) ;; 8-reduction.watsup rule br_if-true{c : num_(I32_numtype), l : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) + `%~>%`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule br_if-false{c : num_(I32_numtype), l : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) + `%~>%`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) -- if (c = `%`(0)) ;; 8-reduction.watsup rule br_table-lt{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) -- if (i < |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_table-ge{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) -- if (i >= |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_on_null-null{val : val, l : labelidx, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) + `%~>%`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) -- if (val = REF.NULL_val(ht)) ;; 8-reduction.watsup rule br_on_null-addr{val : val, l : labelidx}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [(val : val <: admininstr)]) + `%~>%`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [(val : val <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule br_on_non_null-null{val : val, l : labelidx, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], []) + `%~>%`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], []) -- if (val = REF.NULL_val(ht)) ;; 8-reduction.watsup rule br_on_non_null-addr{val : val, l : labelidx}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], [(val : val <: admininstr) BR_admininstr(l)]) + `%~>%`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], [(val : val <: admininstr) BR_admininstr(l)]) -- otherwise ;; 8-reduction.watsup rule call_indirect-call{x : idx, y : idx}: - `%*_~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) CALL_REF_admininstr(?(y))]) + `%~>%`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) CALL_REF_admininstr(?(y))]) ;; 8-reduction.watsup rule return_call_indirect{x : idx, y : idx}: - `%*_~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) RETURN_CALL_REF_admininstr(?(y))]) + `%~>%`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) RETURN_CALL_REF_admininstr(?(y))]) ;; 8-reduction.watsup rule frame-vals{n : n, f : frame, val^n : val^n}: - `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) + `%~>%`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-frame{n : n, f : frame, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) + `%~>%`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-label{k : nat, instr'* : instr*, val* : val*, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) + `%~>%`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) ;; 8-reduction.watsup rule unop-val{nt : numtype, c_1 : num_(nt), unop : unop_(nt), c : num_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) + `%~>%`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) -- if ($unop(nt, unop, c_1) = [c]) ;; 8-reduction.watsup rule unop-trap{nt : numtype, c_1 : num_(nt), unop : unop_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) -- if ($unop(nt, unop, c_1) = []) ;; 8-reduction.watsup rule binop-val{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), binop : binop_(nt), c : num_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- if ($binop(nt, binop, c_1, c_2) = [c]) ;; 8-reduction.watsup rule binop-trap{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), binop : binop_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) -- if ($binop(nt, binop, c_1, c_2) = []) ;; 8-reduction.watsup rule testop{nt : numtype, c_1 : num_(nt), testop : testop_(nt), c : num_(I32_numtype)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $testop(nt, testop, c_1)) ;; 8-reduction.watsup rule relop{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), relop : relop_(nt), c : num_(I32_numtype)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $relop(nt, relop, c_1, c_2)) ;; 8-reduction.watsup rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?, c : num_(nt_2)}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) + `%~>%`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = [c]) ;; 8-reduction.watsup rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, `%`(i)))]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, `%`(i)))]) ;; 8-reduction.watsup rule ref.is_null-true{val : val, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- if (val = REF.NULL_val(ht)) ;; 8-reduction.watsup rule ref.is_null-false{val : val}: - `%*_~>%*`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule ref.as_non_null-null{ref : ref, ht : heaptype}: - `%*_~>%*`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) + `%~>%`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) -- if (ref = REF.NULL_ref(ht)) ;; 8-reduction.watsup rule ref.as_non_null-addr{ref : ref}: - `%*_~>%*`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [(ref : ref <: admininstr)]) + `%~>%`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [(ref : ref <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule ref.eq-null{ref_1 : ref, ref_2 : ref, ht_1 : heaptype, ht_2 : heaptype}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) ;; 8-reduction.watsup rule ref.eq-true{ref_1 : ref, ref_2 : ref}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- otherwise -- if (ref_1 = ref_2) ;; 8-reduction.watsup rule ref.eq-false{ref_1 : ref, ref_2 : ref}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule i31.get-null{ht : heaptype, sx : sx}: - `%*_~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) + `%~>%`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) ;; 8-reduction.watsup rule i31.get-num{i : nat, sx : sx}: - `%*_~>%*`([REF.I31_NUM_admininstr(`%`(i)) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, `%`(i)))]) + `%~>%`([REF.I31_NUM_admininstr(`%`(i)) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, `%`(i)))]) ;; 8-reduction.watsup rule extern.convert_any-null{ht : heaptype}: - `%*_~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) + `%~>%`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) ;; 8-reduction.watsup rule extern.convert_any-addr{addrref : addrref}: - `%*_~>%*`([(addrref : addrref <: admininstr) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) + `%~>%`([(addrref : addrref <: admininstr) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) ;; 8-reduction.watsup rule any.convert_extern-null{ht : heaptype}: - `%*_~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) + `%~>%`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) ;; 8-reduction.watsup rule any.convert_extern-addr{addrref : addrref}: - `%*_~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [(addrref : addrref <: admininstr)]) + `%~>%`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [(addrref : addrref <: admininstr)]) ;; 8-reduction.watsup rule vvunop{c_1 : vec_(V128_vnn), vvunop : vvunop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VVUNOP_admininstr(V128_vectype, vvunop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VVUNOP_admininstr(V128_vectype, vvunop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vvunop(V128_vectype, vvunop, c_1) = c) ;; 8-reduction.watsup rule vvbinop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), vvbinop : vvbinop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VVBINOP_admininstr(V128_vectype, vvbinop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VVBINOP_admininstr(V128_vectype, vvbinop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vvbinop(V128_vectype, vvbinop, c_1, c_2) = c) ;; 8-reduction.watsup rule vvternop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), c_3 : vec_(V128_vnn), vvternop : vvternop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VCONST_admininstr(V128_vectype, c_3) VVTERNOP_admininstr(V128_vectype, vvternop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VCONST_admininstr(V128_vectype, c_3) VVTERNOP_admininstr(V128_vectype, vvternop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vvternop(V128_vectype, vvternop, c_1, c_2, c_3) = c) ;; 8-reduction.watsup rule vvtestop{c_1 : vec_(V128_vnn), c : num_(I32_numtype)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VVTESTOP_admininstr(V128_vectype, ANY_TRUE_vvtestop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VVTESTOP_admininstr(V128_vectype, ANY_TRUE_vvtestop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $ine($vsize(V128_vectype), c_1, `%`(0))) ;; 8-reduction.watsup rule vswizzle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn : inn, N : N, c' : vec_(V128_vnn), c : iN($size((inn : inn <: numtype))), ci* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*, k^N : nat^N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) -- (if (ci*{ci : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))}[k].`%`.0 < |c*{}|))^(k%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vshuffle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn : inn, N : N, i* : nat*, c : vec_(V128_vnn), c' : iN($size((inn : inn <: numtype))), k^N : nat^N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) -- (if (i*{i : nat}[k] < |c'*{}|))^(k%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vsplat{lnn : lnn, c_1 : num_($lunpack(lnn)), N : N, c : vec_(V128_vnn)}: - `%*_~>%*`([CONST_admininstr($lunpack(lnn), c_1) VSPLAT_admininstr(`%X%`(lnn, `%`(N)))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([CONST_admininstr($lunpack(lnn), c_1) VSPLAT_admininstr(`%X%`(lnn, `%`(N)))], [VCONST_admininstr(V128_vectype, c)]) -- if (c = $invlanes_(`%X%`(lnn, `%`(N)), $packnum(lnn, c_1)^N{})) ;; 8-reduction.watsup rule vextract_lane-num{c_1 : vec_(V128_vnn), nt : numtype, N : N, i : nat, c_2 : num_(nt)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((nt : numtype <: lanetype), `%`(N)), ?(), `%`(i))], [CONST_admininstr(nt, c_2)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((nt : numtype <: lanetype), `%`(N)), ?(), `%`(i))], [CONST_admininstr(nt, c_2)]) -- if (i < |$lanes_(`%X%`((nt : numtype <: lanetype), `%`(N)), c_1)|) -- if (c_2 = $lanes_(`%X%`((nt : numtype <: lanetype), `%`(N)), c_1)[i]) ;; 8-reduction.watsup rule vextract_lane-pack{c_1 : vec_(V128_vnn), pt : packtype, N : N, sx : sx, i : nat, c_2 : num_(I32_numtype)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((pt : packtype <: lanetype), `%`(N)), ?(sx), `%`(i))], [CONST_admininstr(I32_numtype, c_2)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((pt : packtype <: lanetype), `%`(N)), ?(sx), `%`(i))], [CONST_admininstr(I32_numtype, c_2)]) -- if (i < |$lanes_(`%X%`((pt : packtype <: lanetype), `%`(N)), c_1)|) -- if (c_2 = $ext($psize(pt), 32, sx, $lanes_(`%X%`((pt : packtype <: lanetype), `%`(N)), c_1)[i])) ;; 8-reduction.watsup rule vreplace_lane{c_1 : vec_(V128_vnn), lnn : lnn, c_2 : num_($lunpack(lnn)), N : N, i : nat, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr($lunpack(lnn), c_2) VREPLACE_LANE_admininstr(`%X%`(lnn, `%`(N)), `%`(i))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr($lunpack(lnn), c_2) VREPLACE_LANE_admininstr(`%X%`(lnn, `%`(N)), `%`(i))], [VCONST_admininstr(V128_vectype, c)]) -- if (c = $invlanes_(`%X%`(lnn, `%`(N)), $lanes_(`%X%`(lnn, `%`(N)), c_1)[[i] = $packnum(lnn, c_2)])) ;; 8-reduction.watsup rule vunop{c_1 : vec_(V128_vnn), sh : shape, vunop : vunop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VUNOP_admininstr(sh, vunop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VUNOP_admininstr(sh, vunop)], [VCONST_admininstr(V128_vectype, c)]) -- if (c = $vunop(sh, vunop, c_1)) ;; 8-reduction.watsup rule vbinop-val{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vbinop : vbinop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vbinop(sh, vbinop, c_1, c_2) = [c]) ;; 8-reduction.watsup rule vbinop-trap{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vbinop : vbinop_(sh)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [TRAP_admininstr]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [TRAP_admininstr]) -- if ($vbinop(sh, vbinop, c_1, c_2) = []) ;; 8-reduction.watsup rule vrelop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vrelop : vrelop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VRELOP_admininstr(sh, vrelop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VRELOP_admininstr(sh, vrelop)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vrelop(sh, vrelop, c_1, c_2) = c) ;; 8-reduction.watsup rule vshiftop{c_1 : vec_(V128_vnn), n : n, imm : imm, N : N, vshiftop : vshiftop_(`%X%`(imm, `%`(N))), c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1)) -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))})) ;; 8-reduction.watsup rule vtestop-true{c : vec_(V128_vnn), inn : inn, N : N, ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), inn : inn, N : N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule vbitmask{c : vec_(V128_vnn), inn : inn, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c)) -- if ($ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($size((inn : inn <: numtype)))}) ;; 8-reduction.watsup rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn_1 : inn, N_1 : N, inn_2 : inn, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, cj_1* : iN($size((inn_2 : inn <: numtype)))*, cj_2* : iN($size((inn_2 : inn <: numtype)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) -- if (ci_2*{ci_2 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2)) -- if (cj_1*{cj_1 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1 : iN($size((inn_1 : inn <: numtype)))}) @@ -26092,195 +26123,195 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vcvtop-normal{c_1 : vec_(V128_vnn), lnn_2 : lnn, N_2 : N, vcvtop : vcvtop, lnn_1 : lnn, N_1 : N, sx : sx, c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) -- if (c'*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1)) -- if (c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-half{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, hf : half, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))})) ;; 8-reduction.watsup rule vcvtop-zero{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) -- if (ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)) -- if (c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} :: `%`(0)^N_1{})) ;; 8-reduction.watsup rule vextunop{c_1 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTUNOP_admininstr(sh_1, sh_2, vextunop, sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTUNOP_admininstr(sh_1, sh_2, vextunop, sx)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vextunop(sh_1, sh_2, vextunop, sx, c_1) = c) ;; 8-reduction.watsup rule vextbinop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextbinop : vextbinop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VEXTBINOP_admininstr(sh_1, sh_2, vextbinop, sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VEXTBINOP_admininstr(sh_1, sh_2, vextbinop, sx)], [VCONST_admininstr(V128_vectype, c)]) -- if ($vextbinop(sh_1, sh_2, vextbinop, sx, c_1, c_2) = c) ;; 8-reduction.watsup rule local.tee{val : val, x : idx}: - `%*_~>%*`([(val : val <: admininstr) LOCAL.TEE_admininstr(x)], [(val : val <: admininstr) (val : val <: admininstr) LOCAL.SET_admininstr(x)]) + `%~>%`([(val : val <: admininstr) LOCAL.TEE_admininstr(x)], [(val : val <: admininstr) (val : val <: admininstr) LOCAL.SET_admininstr(x)]) ;; 8-reduction.watsup def $blocktype(state : state, blocktype : blocktype) : functype ;; 8-reduction.watsup - def $blocktype{z : state}(z, _RESULT_blocktype(?())) = `%->%`([], []) + def $blocktype{z : state}(z, _RESULT_blocktype(?())) = `%->%`(`%`([]), `%`([])) ;; 8-reduction.watsup - def $blocktype{z : state, t : valtype}(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) + def $blocktype{z : state, t : valtype}(z, _RESULT_blocktype(?(t))) = `%->%`(`%`([]), `%`([t])) ;; 8-reduction.watsup def $blocktype{z : state, x : idx, ft : functype}(z, _IDX_blocktype(x)) = ft -- Expand: `%~~%`($type(z, x), FUNC_comptype(ft)) ;; 8-reduction.watsup -relation Step_read: `%~>%*`(config, admininstr*) +relation Step_read: `%~>%`(config, admininstr*) ;; 8-reduction.watsup rule block{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, n : n, t_1^k : valtype^k, t_2^n : valtype^n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) + `%~>%`(`%;%`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(`%`(t_1^k{t_1 : valtype}), `%`(t_2^n{t_2 : valtype}))) ;; 8-reduction.watsup rule loop{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, t_1^k : valtype^k, t_2^n : valtype^n, n : n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype})) + `%~>%`(`%;%`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- if ($blocktype(z, bt) = `%->%`(`%`(t_1^k{t_1 : valtype}), `%`(t_2^n{t_2 : valtype}))) ;; 8-reduction.watsup rule br_on_cast-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt) -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) ;; 8-reduction.watsup rule br_on_cast-fail{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule br_on_cast_fail-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt) -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) ;; 8-reduction.watsup rule br_on_cast_fail-fail{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) -- otherwise ;; 8-reduction.watsup rule call{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) CALL_REF_admininstr(?())]) + `%~>%`(`%;%`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) CALL_REF_admininstr(?())]) -- if (x.`%`.0 < |$funcaddr(z)|) ;; 8-reduction.watsup rule call_ref-null{z : state, ht : heaptype, x? : idx?}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule call_ref-func{z : state, val^n : val^n, n : n, a : addr, x? : idx?, m : m, f : frame, instr* : instr*, fi : funcinst, t_1^n : valtype^n, t_2^m : valtype^m, y : idx, t* : valtype*}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) -- if (a < |$funcinst(z)|) -- if ($funcinst(z)[a] = fi) - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) - -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t : valtype}, instr*{instr : instr})) + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2^m{t_2 : valtype})))) + -- if (fi.CODE_funcinst = FUNC(y, LOCAL(t)*{t : valtype}, instr*{instr : instr})) -- if (f = {LOCAL ?(val)^n{val : val} :: $default(t)*{t : valtype}, MODULE fi.MODULE_funcinst}) ;; 8-reduction.watsup rule return_call{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) RETURN_CALL_REF_admininstr(?())]) + `%~>%`(`%;%`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) RETURN_CALL_REF_admininstr(?())]) -- if (x.`%`.0 < |$funcaddr(z)|) ;; 8-reduction.watsup rule return_call_ref-label{z : state, k : nat, instr'* : instr*, val* : val*, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) + `%~>%`(`%;%`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) ;; 8-reduction.watsup rule return_call_ref-frame-addr{z : state, k : nat, f : frame, val'* : val*, val^n : val^n, n : n, a : addr, x? : idx?, instr* : instr*, t_1^n : valtype^n, t_2^m : valtype^m, m : m}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) + `%~>%`(`%;%`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) -- if (a < |$funcinst(z)|) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype}))) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2^m{t_2 : valtype})))) ;; 8-reduction.watsup rule return_call_ref-frame-null{z : state, k : nat, f : frame, val* : val*, ht : heaptype, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule ref.func{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0])]) + `%~>%`(`%;%`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0])]) -- if (x.`%`.0 < |$funcaddr(z)|) ;; 8-reduction.watsup rule ref.test-true{z : state, ref : ref, rt : reftype, rt' : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(1))]) -- Ref_ok: `%|-%:%`($store(z), ref, rt') -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) ;; 8-reduction.watsup rule ref.test-false{z : state, ref : ref, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule ref.cast-succeed{z : state, ref : ref, rt : reftype, rt' : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [(ref : ref <: admininstr)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt') -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) ;; 8-reduction.watsup rule ref.cast-fail{z : state, ref : ref, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) -- otherwise ;; 8-reduction.watsup rule struct.new_default{z : state, x : idx, val* : val*, mut* : mut*, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) + `%~>%`(`%;%`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) -- if (|val*{val : val}| = |zt*{zt : storagetype}|) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) -- (if ($default($unpack(zt)) = ?(val)))*{val : val zt : storagetype} ;; 8-reduction.watsup rule struct.get-null{z : state, ht : heaptype, sx? : sx?, x : idx, i : nat}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) ;; 8-reduction.watsup rule struct.get-struct{z : state, a : addr, sx? : sx?, x : idx, i : nat, zt* : storagetype*, si : structinst, mut* : mut*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) + `%~>%`(`%;%`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) -- if (a < |$structinst(z)|) -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) -- if (i < |zt*{zt : storagetype}|) -- if (i < |si.FIELD_structinst|) -- if ($structinst(z)[a] = si) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) ;; 8-reduction.watsup rule array.new{z : state, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [(val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [(val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) ;; 8-reduction.watsup rule array.new_default{z : state, n : n, x : idx, val : val, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if ($default($unpack(zt)) = ?(val)) ;; 8-reduction.watsup rule array.new_elem-oob{z : state, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) ;; 8-reduction.watsup rule array.new_elem-alloc{z : state, i : nat, n : n, x : idx, y : idx, ref^n : ref^n}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- if (ref^n{ref : ref} = $elem(z, y).ELEM_eleminst[i : n]) ;; 8-reduction.watsup rule array.new_data-oob{z : state, i : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if ((i + ((n * $zsize(zt)) / 8)) > |$data(z, y).DATA_datainst|) ;; 8-reduction.watsup rule array.new_data-num{z : state, i : nat, n : n, x : idx, y : idx, nt : numtype, c^n : num_(nt)^n, mut : mut, zt : storagetype, o0 : numtype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- if ($nunpack(zt) = ?(o0)) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (nt = o0) @@ -26288,7 +26319,7 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.new_data-vec{z : state, i : nat, n : n, x : idx, y : idx, vt : vectype, c^n : vec_(vt)^n, mut : mut, zt : storagetype, o0 : vectype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- if ($vunpack(zt) = ?(o0)) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (vt = o0) @@ -26296,17 +26327,17 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.get-null{z : state, ht : heaptype, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.get-oob{z : state, a : addr, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) -- if (a < |$arrayinst(z)|) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.get-array{z : state, a : addr, i : nat, sx? : sx?, x : idx, zt : storagetype, fv : fieldval, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) -- if (i < |$arrayinst(z)[a].FIELD_arrayinst|) -- if (a < |$arrayinst(z)|) -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) @@ -26314,64 +26345,64 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.len-null{z : state, ht : heaptype}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.len-array{z : state, a : addr, n : n}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, `%`(n))]) -- if (a < |$arrayinst(z)|) -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.fill-null{z : state, ht : heaptype, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.fill-oob{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) -- if (a < |$arrayinst(z)|) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.fill-zero{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.fill-succ{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule array.copy-null1{z : state, ht_1 : heaptype, i_1 : nat, ref : ref, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, `%`(i_1)) (ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, `%`(i_1)) (ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.copy-null2{z : state, ref : ref, i_1 : nat, ht_2 : heaptype, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_1)) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_1)) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.copy-oob1{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if (a_1 < |$arrayinst(z)|) -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.copy-oob2{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if (a_2 < |$arrayinst(z)|) -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.copy-zero{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.copy-le{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) -- if (sx?{sx : sx} = $sxfield(zt_2)) @@ -26379,64 +26410,64 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.copy-gt{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) -- if (sx?{sx : sx} = $sxfield(zt_2)) ;; 8-reduction.watsup rule array.init_elem-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.init_elem-oob1{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if (a < |$arrayinst(z)|) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.init_elem-oob2{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) ;; 8-reduction.watsup rule array.init_elem-zero{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.init_elem-succ{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, ref : ref}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_ELEM_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_ELEM_admininstr(x, y)]) -- if (j < |$elem(z, y).ELEM_eleminst|) -- otherwise -- if (ref = $elem(z, y).ELEM_eleminst[j]) ;; 8-reduction.watsup rule array.init_data-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.init_data-oob1{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- if (a < |$arrayinst(z)|) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.init_data-oob2{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if ((j + ((n * $zsize(zt)) / 8)) > |$data(z, y).DATA_datainst|) ;; 8-reduction.watsup rule array.init_data-zero{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.init_data-num{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, nt : numtype, c : num_(nt), zt : storagetype, mut : mut, o0 : numtype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) -- if ($nunpack(zt) = ?(o0)) -- otherwise -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) @@ -26445,7 +26476,7 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.init_data-num{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, vt : vectype, c : vec_(vt), zt : storagetype, mut : mut, o0 : vectype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) -- if ($vunpack((vt : vectype <: storagetype)) = ?(o0)) -- otherwise -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) @@ -26454,133 +26485,133 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule local.get{z : state, x : idx, val : val}: - `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [(val : val <: admininstr)]) + `%~>%`(`%;%`(z, [LOCAL.GET_admininstr(x)]), [(val : val <: admininstr)]) -- if ($local(z, x) = ?(val)) ;; 8-reduction.watsup rule global.get{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst : val <: admininstr)]) + `%~>%`(`%;%`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst : val <: admininstr)]) ;; 8-reduction.watsup rule table.get-oob{z : state, i : nat, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) -- if (i >= |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.get-val{z : state, i : nat, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] : ref <: admininstr)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] : ref <: admininstr)]) -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.size{z : state, x : idx, n : n}: - `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) -- if (|$table(z, x).ELEM_tableinst| = n) ;; 8-reduction.watsup rule table.fill-oob{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.fill-zero{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.fill-succ{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule table.copy-oob{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) ;; 8-reduction.watsup rule table.copy-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.copy-le{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) -- otherwise -- if (j <= i) ;; 8-reduction.watsup rule table.copy-gt{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(((j + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i + n) - 1))) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(((j + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i + n) - 1))) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) -- otherwise ;; 8-reduction.watsup rule table.init-oob{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) ;; 8-reduction.watsup rule table.init-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.init-succ{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) ($elem(z, y).ELEM_eleminst[i] : ref <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.INIT_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) ($elem(z, y).ELEM_eleminst[i] : ref <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.INIT_admininstr(x, y)]) -- if (i < |$elem(z, y).ELEM_eleminst|) -- otherwise ;; 8-reduction.watsup rule load-num-oob{z : state, i : nat, nt : numtype, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ($size(nt) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule load-num-val{z : state, i : nat, nt : numtype, x : idx, mo : memop, c : num_(nt)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) -- if ($nbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : ($size(nt) / 8)]) ;; 8-reduction.watsup rule load-pack-oob{z : state, i : nat, inn : inn, n : n, sx : sx, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (n / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule load-pack-val{z : state, i : nat, inn : inn, n : n, sx : sx, x : idx, mo : memop, c : iN(n)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [CONST_admininstr((inn : inn <: numtype), $ext(n, $size((inn : inn <: numtype)), sx, c))]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [CONST_admininstr((inn : inn <: numtype), $ext(n, $size((inn : inn <: numtype)), sx, c))]) -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (n / 8)]) ;; 8-reduction.watsup rule vload-oob{z : state, i : nat, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ($vsize(V128_vectype) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-val{z : state, i : nat, x : idx, mo : memop, c : vec_(V128_vnn)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- if ($vbytes(V128_vectype, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : ($vsize(V128_vectype) / 8)]) ;; 8-reduction.watsup rule vload-shape-oob{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ((M * N) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-shape-val{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop, c : vec_(V128_vnn), j^N : nat^N, k^N : nat^N, inn : inn}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- (if ($ibytes(M, `%`(j)) = $mem(z, x).DATA_meminst[((i + mo.OFFSET_memop.`%`.0) + ((k * M) / 8)) : (M / 8)]))^(k%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-splat-val{z : state, i : nat, N : N, x : idx, mo : memop, c : vec_(V128_vnn), j : nat, imm : imm, M : M}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- if ($ibytes(N, `%`(j)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)]) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = (128 / N)) @@ -26588,23 +26619,23 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule vload-zero-oob{z : state, i : nat, N : N, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-zero-val{z : state, i : nat, N : N, x : idx, mo : memop, c : vec_(V128_vnn), j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- if ($ibytes(N, `%`(j)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)]) -- if (c = $ext(N, 128, U_sx, `%`(j))) ;; 8-reduction.watsup rule vload_lane-oob{z : state, i : nat, vt : vectype, c_1 : vec_(vt), N : N, x : idx, mo : memop, j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload_lane-val{z : state, i : nat, vt : vectype, c_1 : vec_(vt), N : N, x : idx, mo : memop, j : nat, c : vec_(vt), k : nat, imm : imm, M : M}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(vt, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(vt, c)]) -- if ($ibytes(N, `%`(k)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)]) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = ($vsize(vt) / N)) @@ -26612,61 +26643,61 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule memory.size{z : state, x : idx, n : n}: - `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule memory.fill-oob{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule memory.fill-zero{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.fill-succ{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule memory.copy-oob{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) ;; 8-reduction.watsup rule memory.copy-zero{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.copy-le{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise -- if (i_1 <= i_2) ;; 8-reduction.watsup rule memory.copy-gt{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise ;; 8-reduction.watsup rule memory.init-oob{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) ;; 8-reduction.watsup rule memory.init-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.init-succ{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`($data(z, y).DATA_datainst[i].`%`.0)) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.INIT_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`($data(z, y).DATA_datainst[i].`%`.0)) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.INIT_admininstr(x, y)]) -- if (i < |$data(z, y).DATA_datainst|) -- otherwise @@ -26674,126 +26705,126 @@ relation Step_read: `%~>%*`(config, admininstr*) relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule pure{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) - -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_pure: `%~>%`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule read{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) - -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_read: `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule struct.new{z : state, val^n : val^n, n : n, x : idx, si : structinst, mut^n : mut^n, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut : mut zt : storagetype})) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%`(`%%`(mut, zt)^n{mut : mut zt : storagetype}))) -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val zt : storagetype}}) ;; 8-reduction.watsup rule struct.set-null{z : state, ht : heaptype, val : val, x : idx, i : nat}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%`(z, [TRAP_admininstr])) ;; 8-reduction.watsup rule struct.set-struct{z : state, a : addr, val : val, x : idx, i : nat, fv : fieldval, mut* : mut*, zt* : storagetype*}: - `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`($with_struct(z, a, i, fv), [])) + `%~>%`(`%;%`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%`($with_struct(z, a, i, fv), [])) -- if (a < |$structinst(z)|) -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) -- if (i < |zt*{zt : storagetype}|) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype})) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype}))) -- if (fv = $packval(zt*{zt : storagetype}[i], val)) ;; 8-reduction.watsup rule array.new_fixed{z : state, val^n : val^n, n : n, x : idx, ai : arrayinst, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val}}) ;; 8-reduction.watsup rule array.set-null{z : state, ht : heaptype, i : nat, val : val, x : idx}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) ;; 8-reduction.watsup rule array.set-oob{z : state, a : addr, i : nat, val : val, x : idx}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) -- if (a < |$arrayinst(z)|) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.set-array{z : state, a : addr, i : nat, val : val, x : idx, fv : fieldval, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`($with_array(z, a, i, fv), [])) -- if (a < |$arrayinst(z)|) -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) -- if (fv = $packval(zt, val)) ;; 8-reduction.watsup rule local.set{z : state, val : val, x : idx}: - `%~>%`(`%;%*`(z, [(val : val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) + `%~>%`(`%;%`(z, [(val : val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%`($with_local(z, x, val), [])) ;; 8-reduction.watsup rule global.set{z : state, val : val, x : idx}: - `%~>%`(`%;%*`(z, [(val : val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) + `%~>%`(`%;%`(z, [(val : val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%`($with_global(z, x, val), [])) ;; 8-reduction.watsup rule table.set-oob{z : state, i : nat, ref : ref, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.set-val{z : state, i : nat, ref : ref, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%`($with_table(z, x, i, ref), [])) -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.grow-succeed{z : state, ref : ref, n : n, x : idx, ti : tableinst, o0 : tableinst}: - `%~>%`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, `%`(|$table(z, x).ELEM_tableinst|))])) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, `%`(|$table(z, x).ELEM_tableinst|))])) -- if ($growtable($table(z, x), n, ref) = ?(o0)) -- if (ti = o0) ;; 8-reduction.watsup rule table.grow-fail{z : state, ref : ref, n : n, x : idx}: - `%~>%`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) ;; 8-reduction.watsup rule elem.drop{z : state, x : idx}: - `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) + `%~>%`(`%;%`(z, [ELEM.DROP_admininstr(x)]), `%;%`($with_elem(z, x, []), [])) ;; 8-reduction.watsup rule store-num-oob{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + ($size(nt) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule store-num-val{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) -- if (b*{b : byte} = $nbytes(nt, c)) ;; 8-reduction.watsup rule store-pack-oob{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + (n / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule store-pack-val{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) -- if (b*{b : byte} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c))) ;; 8-reduction.watsup rule vstore-oob{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + ($vsize(V128_vectype) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vstore-val{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) -- if (b*{b : byte} = $vbytes(V128_vectype, c)) ;; 8-reduction.watsup rule vstore_lane-oob{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + N) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vstore_lane-val{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, b* : byte*, imm : imm, M : M}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) -- if (j < |$lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)|) -- if (N = $lsize((imm : imm <: lanetype))) -- if (M = (128 / N)) @@ -26801,17 +26832,17 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule memory.grow-succeed{z : state, n : n, x : idx, mi : meminst, o0 : meminst}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, `%`((|$mem(z, x).DATA_meminst| / (64 * $Ki))))])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, `%`((|$mem(z, x).DATA_meminst| / (64 * $Ki))))])) -- if ($growmemory($mem(z, x), n) = ?(o0)) -- if (mi = o0) ;; 8-reduction.watsup rule memory.grow-fail{z : state, n : n, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) ;; 8-reduction.watsup rule data.drop{z : state, x : idx}: - `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) + `%~>%`(`%;%`(z, [DATA.DROP_admininstr(x)]), `%;%`($with_data(z, x, []), [])) ;; 8-reduction.watsup rec { @@ -26820,21 +26851,21 @@ rec { relation Steps: `%~>*%`(config, config) ;; 8-reduction.watsup:18.1-19.36 rule refl{z : state, admininstr* : admininstr*}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z, admininstr*{admininstr : admininstr})) + `%~>*%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z, admininstr*{admininstr : admininstr})) ;; 8-reduction.watsup:21.1-24.53 rule trans{z : state, admininstr* : admininstr*, z'' : state, admininstr''* : admininstr*, z' : state, admininstr' : admininstr}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) - -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z', admininstr'*{})) - -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) + `%~>*%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z'', admininstr''*{admininstr'' : admininstr})) + -- Step: `%~>%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z', admininstr'*{})) + -- Steps: `%~>*%`(`%;%`(z', [admininstr']), `%;%`(z'', admininstr''*{admininstr'' : admininstr})) } ;; 8-reduction.watsup -relation Eval_expr: `%;%~>*%;%*`(state, expr, state, val*) +relation Eval_expr: `%;%~>*%;%`(state, expr, state, val*) ;; 8-reduction.watsup rule _{z : state, instr* : instr*, z' : state, val* : val*}: - `%;%~>*%;%*`(z, instr*{instr : instr}, z', val*{val : val}) - -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z', (val : val <: admininstr)*{val : val})) + `%;%~>*%;%`(z, instr*{instr : instr}, z', val*{val : val}) + -- Steps: `%~>*%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z', (val : val <: admininstr)*{val : val})) ;; 9-module.watsup rec { @@ -26855,7 +26886,7 @@ def $alloctypes(type*) : deftype* def $allocfunc(store : store, moduleinst : moduleinst, func : func) : (store, funcaddr) ;; 9-module.watsup def $allocfunc{s : store, mm : moduleinst, func : func, fi : funcinst, x : idx, local* : local*, expr : expr}(s, mm, func) = (s[FUNC_store =.. [fi]], |s.FUNC_store|) - -- if (func = `FUNC%%*%`(x, local*{local : local}, expr)) + -- if (func = FUNC(x, local*{local : local}, expr)) -- if (fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func}) ;; 9-module.watsup @@ -26981,7 +27012,7 @@ def $instexport(funcaddr*, globaladdr*, tableaddr*, memaddr*, export : export) : def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) : (store, moduleinst) ;; 9-module.watsup def $allocmodule{s : store, module : module, externval* : externval*, val_g* : val*, ref_t* : ref*, ref_e** : ref**, s_6 : store, mm : moduleinst, type* : type*, import* : import*, func^n_f : func^n_f, n_f : n, globaltype^n_g : globaltype^n_g, expr_g^n_g : expr^n_g, n_g : n, tabletype^n_t : tabletype^n_t, expr_t^n_t : expr^n_t, n_t : n, memtype^n_m : memtype^n_m, n_m : n, reftype^n_e : reftype^n_e, expr_e*^n_e : expr*^n_e, elemmode^n_e : elemmode^n_e, n_e : n, byte*^n_d : byte*^n_d, datamode^n_d : datamode^n_d, n_d : n, start? : start?, export* : export*, fa_ex* : funcaddr*, ga_ex* : globaladdr*, ta_ex* : tableaddr*, ma_ex* : memaddr*, fa* : funcaddr*, i_f^n_f : nat^n_f, ga* : globaladdr*, i_g^n_g : nat^n_g, ta* : tableaddr*, i_t^n_t : nat^n_t, ma* : memaddr*, i_m^n_m : nat^n_m, ea* : elemaddr*, i_e^n_e : nat^n_e, da* : dataaddr*, i_d^n_d : nat^n_d, xi* : exportinst*, dt* : deftype*, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store}(s, module, externval*{externval : externval}, val_g*{val_g : val}, ref_t*{ref_t : ref}, ref_e*{ref_e : ref}*{ref_e : ref}) = (s_6, mm) - -- if (module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func^n_f{func : func}, GLOBAL(globaltype, expr_g)^n_g{expr_g : expr globaltype : globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t : expr tabletype : tabletype}, MEMORY(memtype)^n_m{memtype : memtype}, `ELEM%%*%`(reftype, expr_e*{expr_e : expr}, elemmode)^n_e{elemmode : elemmode expr_e : expr reftype : reftype}, `DATA%*%`(byte*{byte : byte}, datamode)^n_d{byte : byte datamode : datamode}, start?{start : start}, export*{export : export})) + -- if (module = MODULE(type*{type : type}, import*{import : import}, func^n_f{func : func}, GLOBAL(globaltype, expr_g)^n_g{expr_g : expr globaltype : globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t : expr tabletype : tabletype}, MEMORY(memtype)^n_m{memtype : memtype}, ELEM(reftype, expr_e*{expr_e : expr}, elemmode)^n_e{elemmode : elemmode expr_e : expr reftype : reftype}, DATA(byte*{byte : byte}, datamode)^n_d{byte : byte datamode : datamode}, start?{start : start}, export*{export : export})) -- if (fa_ex*{fa_ex : funcaddr} = $funcsxv(externval*{externval : externval})) -- if (ga_ex*{ga_ex : globaladdr} = $globalsxv(externval*{externval : externval})) -- if (ta_ex*{ta_ex : tableaddr} = $tablesxv(externval*{externval : externval})) @@ -27005,36 +27036,36 @@ def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) ;; 9-module.watsup def $runelem(elem : elem, idx : idx) : instr* ;; 9-module.watsup - def $runelem{reftype : reftype, expr* : expr*, y : idx}(`ELEM%%*%`(reftype, expr*{expr : expr}, PASSIVE_elemmode), y) = [] + def $runelem{reftype : reftype, expr* : expr*, y : idx}(ELEM(reftype, expr*{expr : expr}, PASSIVE_elemmode), y) = [] ;; 9-module.watsup - def $runelem{reftype : reftype, expr* : expr*, y : idx}(`ELEM%%*%`(reftype, expr*{expr : expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] + def $runelem{reftype : reftype, expr* : expr*, y : idx}(ELEM(reftype, expr*{expr : expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] ;; 9-module.watsup - def $runelem{reftype : reftype, expr* : expr*, x : idx, instr* : instr*, y : idx}(`ELEM%%*%`(reftype, expr*{expr : expr}, ACTIVE_elemmode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|expr*{expr : expr}|)) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] + def $runelem{reftype : reftype, expr* : expr*, x : idx, instr* : instr*, y : idx}(ELEM(reftype, expr*{expr : expr}, ACTIVE_elemmode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|expr*{expr : expr}|)) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] ;; 9-module.watsup def $rundata(data : data, idx : idx) : instr* ;; 9-module.watsup - def $rundata{byte* : byte*, y : idx}(`DATA%*%`(byte*{byte : byte}, PASSIVE_datamode), y) = [] + def $rundata{byte* : byte*, y : idx}(DATA(byte*{byte : byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup - def $rundata{byte* : byte*, x : idx, instr* : instr*, y : idx}(`DATA%*%`(byte*{byte : byte}, ACTIVE_datamode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|byte*{byte : byte}|)) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] + def $rundata{byte* : byte*, x : idx, instr* : instr*, y : idx}(DATA(byte*{byte : byte}, ACTIVE_datamode(x, instr*{instr : instr})), y) = instr*{instr : instr} :: [CONST_instr(I32_numtype, `%`(0)) CONST_instr(I32_numtype, `%`(|byte*{byte : byte}|)) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] ;; 9-module.watsup def $instantiate(store : store, module : module, externval*) : config ;; 9-module.watsup - def $instantiate{s : store, module : module, externval* : externval*, s' : store, f : frame, instr_E* : instr*, instr_D* : instr*, x? : idx?, type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start? : start?, export* : export*, globaltype* : globaltype*, expr_G* : expr*, tabletype* : tabletype*, expr_T* : expr*, reftype* : reftype*, expr_E** : expr**, elemmode* : elemmode*, n_F : n, n_E : n, n_D : n, mm_init : moduleinst, i_F^n_F : nat^n_F, z : state, val_G* : val*, ref_T* : ref*, ref_E** : ref**, mm : moduleinst, i^n_E : nat^n_E, j^n_D : nat^n_D}(s, module, externval*{externval : externval}) = `%;%*`(`%;%`(s', f), (instr_E : instr <: admininstr)*{instr_E : instr} :: (instr_D : instr <: admininstr)*{instr_D : instr} :: CALL_admininstr(x)?{x : funcidx}) - -- if (module = `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data*{data : data}, start?{start : start}, export*{export : export})) + def $instantiate{s : store, module : module, externval* : externval*, s' : store, f : frame, instr_E* : instr*, instr_D* : instr*, x? : idx?, type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start? : start?, export* : export*, globaltype* : globaltype*, expr_G* : expr*, tabletype* : tabletype*, expr_T* : expr*, reftype* : reftype*, expr_E** : expr**, elemmode* : elemmode*, n_F : n, n_E : n, n_D : n, mm_init : moduleinst, i_F^n_F : nat^n_F, z : state, val_G* : val*, ref_T* : ref*, ref_E** : ref**, mm : moduleinst, i^n_E : nat^n_E, j^n_D : nat^n_D}(s, module, externval*{externval : externval}) = `%;%`(`%;%`(s', f), (instr_E : instr <: admininstr)*{instr_E : instr} :: (instr_D : instr <: admininstr)*{instr_D : instr} :: CALL_admininstr(x)?{x : funcidx}) + -- if (module = MODULE(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data*{data : data}, start?{start : start}, export*{export : export})) -- if (global*{global : global} = GLOBAL(globaltype, expr_G)*{expr_G : expr globaltype : globaltype}) -- if (table*{table : table} = TABLE(tabletype, expr_T)*{expr_T : expr tabletype : tabletype}) - -- if (elem*{elem : elem} = `ELEM%%*%`(reftype, expr_E*{expr_E : expr}, elemmode)*{elemmode : elemmode expr_E : expr reftype : reftype}) + -- if (elem*{elem : elem} = ELEM(reftype, expr_E*{expr_E : expr}, elemmode)*{elemmode : elemmode expr_E : expr reftype : reftype}) -- if (start?{start : start} = START(x)?{x : funcidx}) -- if (n_F = |func*{func : func}|) -- if (n_E = |elem*{elem : elem}|) -- if (n_D = |data*{data : data}|) -- if (mm_init = {TYPE $alloctypes(type*{type : type}), FUNC $funcsxv(externval*{externval : externval}) :: (|s.FUNC_store| + i_F)^(i_F*%;%*`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} + -- (Eval_expr: `%;%~>*%;%`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} + -- (Eval_expr: `%;%~>*%;%`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} + -- (Eval_expr: `%;%~>*%;%`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} -- if ((s', mm) = $allocmodule(s, module, externval*{externval : externval}, val_G*{val_G : val}, ref_T*{ref_T : ref}, ref_E*{ref_E : ref}*{ref_E : ref})) -- if (f = {LOCAL [], MODULE mm}) -- if (instr_E*{instr_E : instr} = $concat_(syntax instr, $runelem(elem*{elem : elem}[i], `%`(i))^(i%`(t_1^n{t_1 : valtype}, t_2*{t_2 : valtype}))) - -;; A-binary.watsup -rec { - -;; A-binary.watsup:49.1-49.24 -def $utf8(name : name) : byte* - ;; A-binary.watsup:50.1-50.47 - def $utf8{ch : nat, b : byte}([`%`(ch)]) = [b] - -- if ((ch < 128) /\ (ch = b.`%`.0)) - ;; A-binary.watsup:51.1-51.96 - def $utf8{ch : nat, b_1 : byte, b_2 : byte}([`%`(ch)]) = [b_1 b_2] - -- if (((128 <= ch) /\ (ch < 2048)) /\ (ch = (((2 ^ 6) * (b_1.`%`.0 - 192)) + (b_2.`%`.0 - 128)))) - ;; A-binary.watsup:52.1-52.148 - def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte}([`%`(ch)]) = [b_1 b_2 b_3] - -- if ((((2048 <= ch) /\ (ch < 55296)) \/ ((57344 <= ch) /\ (ch < 65536))) /\ (ch = ((((2 ^ 12) * (b_1.`%`.0 - 224)) + ((2 ^ 6) * (b_2.`%`.0 - 128))) + (b_3.`%`.0 - 128)))) - ;; A-binary.watsup:53.1-53.148 - def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([`%`(ch)]) = [b_1 b_2 b_3 b_4] - -- if (((65536 <= ch) /\ (ch < 69632)) /\ (ch = (((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128)))) - ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(`%`(ch)*{ch : nat}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch : nat}) -} + -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = FUNC(x, local*{local : local}, expr)) + -- Expand: `%~~%`(s.FUNC_store[fa].TYPE_funcinst, FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2*{t_2 : valtype})))) ;; A-binary.watsup syntax castop = (nul, nul) @@ -27186,14 +27196,8 @@ def $concat_(syntax X, X**) : X* } ;; 1-syntax.watsup -syntax list{syntax X}(syntax X) = X* - -;; 1-syntax.watsup -syntax char = `%`{i : nat}(i : nat) - -- if (((i >= 0) /\ (i <= 55295)) \/ ((i >= 57344) /\ (i <= 1114111))) - -;; 1-syntax.watsup -syntax name = char* +syntax list{syntax X}(syntax X) = `%`{X* : X*}(X*{X : X} : X*) + -- if (|X*{X : X}| < (2 ^ 32)) ;; 1-syntax.watsup syntax bit = `%`{i : nat}(i : nat) @@ -27298,6 +27302,41 @@ def $canon_(N : N) : nat ;; 1-syntax.watsup syntax vN{N : N}(N) = iN(N) +;; 1-syntax.watsup +syntax char = `%`{i : nat}(i : nat) + -- if (((i >= 0) /\ (i <= 55295)) \/ ((i >= 57344) /\ (i <= 1114111))) + +;; 1-syntax.watsup +rec { + +;; 1-syntax.watsup:87.1-87.25 +def $utf8(char*) : byte* + ;; A-binary.watsup:50.1-50.47 + def $utf8{ch : char, b : byte}([ch]) = [b] + -- if (ch.`%`.0 < 128) + -- where `%`(b.`%`.0) = ch + ;; A-binary.watsup:51.1-51.96 + def $utf8{ch : char, b_1 : byte, b_2 : byte}([ch]) = [b_1 b_2] + -- if (128 <= ch.`%`.0) + -- if (ch.`%`.0 < 2048) + -- where `%`((((2 ^ 6) * (b_1.`%`.0 - 192)) + (b_2.`%`.0 - 128))) = ch + ;; A-binary.watsup:52.1-52.148 + def $utf8{ch : char, b_1 : byte, b_2 : byte, b_3 : byte}([ch]) = [b_1 b_2 b_3] + -- if (((2048 <= ch.`%`.0) /\ (ch.`%`.0 < 55296)) \/ ((57344 <= ch.`%`.0) /\ (ch.`%`.0 < 65536))) + -- where `%`(((((2 ^ 12) * (b_1.`%`.0 - 224)) + ((2 ^ 6) * (b_2.`%`.0 - 128))) + (b_3.`%`.0 - 128))) = ch + ;; A-binary.watsup:53.1-53.148 + def $utf8{ch : char, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([ch]) = [b_1 b_2 b_3 b_4] + -- if (65536 <= ch.`%`.0) + -- if (ch.`%`.0 < 69632) + -- where `%`((((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128))) = ch + ;; A-binary.watsup:54.1-54.44 + def $utf8{ch* : char*}(ch*{ch : char}) = $concat_(syntax byte, $utf8([ch])*{ch : char}) +} + +;; 1-syntax.watsup +syntax name = `%`{char* : char*}(char*{char : char} : char*) + -- if (|$utf8(char*{char : char})| < (2 ^ 32)) + ;; 1-syntax.watsup syntax idx = u32 @@ -27368,7 +27407,7 @@ syntax fin = `FINAL%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:146.1-147.14 +;; 1-syntax.watsup:147.1-148.14 syntax valtype = | I32 | I64 @@ -27378,10 +27417,10 @@ syntax valtype = | REF{nul : nul, heaptype : heaptype}(nul : nul, heaptype : heaptype) | BOT -;; 1-syntax.watsup:154.1-155.16 +;; 1-syntax.watsup:155.1-156.16 syntax resulttype = list(syntax valtype) -;; 1-syntax.watsup:162.1-162.68 +;; 1-syntax.watsup:163.1-163.68 syntax storagetype = | BOT | I32 @@ -27393,34 +27432,34 @@ syntax storagetype = | I8 | I16 -;; 1-syntax.watsup:175.1-176.18 +;; 1-syntax.watsup:176.1-177.18 syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) -;; 1-syntax.watsup:178.1-178.70 +;; 1-syntax.watsup:179.1-179.70 syntax functype = `%->%`{resulttype : resulttype}(resulttype : resulttype, resulttype) -;; 1-syntax.watsup:179.1-179.64 +;; 1-syntax.watsup:180.1-180.64 syntax structtype = list(syntax fieldtype) -;; 1-syntax.watsup:180.1-180.53 +;; 1-syntax.watsup:181.1-181.53 syntax arraytype = fieldtype -;; 1-syntax.watsup:182.1-185.18 +;; 1-syntax.watsup:183.1-186.18 syntax comptype = | STRUCT{structtype : structtype}(structtype : structtype) | ARRAY{arraytype : arraytype}(arraytype : arraytype) | FUNC{functype : functype}(functype : functype) -;; 1-syntax.watsup:189.1-190.60 +;; 1-syntax.watsup:190.1-191.60 syntax subtype = | SUB{fin : fin, typeidx* : typeidx*, comptype : comptype}(fin : fin, typeidx*{typeidx : typeidx} : typeidx*, comptype : comptype) | SUBD{fin : fin, heaptype* : heaptype*, comptype : comptype}(fin : fin, heaptype*{heaptype : heaptype} : heaptype*, comptype : comptype) -;; 1-syntax.watsup:192.1-193.22 +;; 1-syntax.watsup:193.1-194.22 syntax rectype = | REC{list : list(syntax subtype)}(list : list(syntax subtype)) -;; 1-syntax.watsup:198.1-199.26 +;; 1-syntax.watsup:199.1-200.26 syntax heaptype = | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY @@ -27879,7 +27918,7 @@ syntax zero = `ZERO%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:522.1-534.78 +;; 1-syntax.watsup:523.1-535.78 syntax instr = | UNREACHABLE | NOP @@ -28009,7 +28048,7 @@ syntax type = TYPE{rectype : rectype}(rectype : rectype) syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) +syntax func = FUNC{typeidx : typeidx, local* : local*, expr : expr}(typeidx : typeidx, local*{local : local} : local*, expr : expr) ;; 1-syntax.watsup syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) @@ -28021,10 +28060,10 @@ syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) +syntax elem = ELEM{reftype : reftype, expr* : expr*, elemmode : elemmode}(reftype : reftype, expr*{expr : expr} : expr*, elemmode : elemmode) ;; 1-syntax.watsup -syntax data = `DATA%*%`{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) +syntax data = DATA{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup syntax start = START{funcidx : funcidx}(funcidx : funcidx) @@ -28043,7 +28082,7 @@ syntax export = EXPORT{name : name, externidx : externidx}(name : name, externid syntax import = IMPORT{name : name, externtype : externtype}(name : name, name, externtype : externtype) ;; 1-syntax.watsup -syntax module = `MODULE%*%*%*%*%*%*%*%*%*%*`{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) +syntax module = MODULE{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data* : data*, start* : start*, export* : export*}(type*{type : type} : type*, import*{import : import} : import*, func*{func : func} : func*, global*{global : global} : global*, table*{table : table} : table*, mem*{mem : mem} : mem*, elem*{elem : elem} : elem*, data*{data : data} : data*, start*{start : start} : start*, export*{export : export} : export*) ;; 2-syntax-aux.watsup rec { @@ -28099,7 +28138,7 @@ def $free_dataidx_expr(expr : expr) : dataidx* ;; 2-syntax-aux.watsup def $free_dataidx_func(func : func) : dataidx* ;; 2-syntax-aux.watsup - def $free_dataidx_func{x : idx, loc* : local*, e : expr}(`FUNC%%*%`(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) + def $free_dataidx_func{x : idx, loc* : local*, e : expr}(FUNC(x, loc*{loc : local}, e)) = $free_dataidx_expr(e) ;; 2-syntax-aux.watsup rec { @@ -28238,7 +28277,7 @@ def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype ;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype ;; 2-syntax-aux.watsup:175.1-175.85 - def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(yt*{yt : fieldtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype}) + def $subst_comptype{yt* : fieldtype*, xx* : typevar*, ht* : heaptype*}(STRUCT_comptype(`%`(yt*{yt : fieldtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = STRUCT_comptype(`%`($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})*{yt : fieldtype})) ;; 2-syntax-aux.watsup:176.1-176.81 def $subst_comptype{yt : fieldtype, xx* : typevar*, ht* : heaptype*}(ARRAY_comptype(yt), xx*{xx : typevar}, ht*{ht : heaptype}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx : typevar}, ht*{ht : heaptype})) ;; 2-syntax-aux.watsup:177.1-177.78 @@ -28254,7 +28293,7 @@ def $subst_subtype(subtype : subtype, typevar*, heaptype*) : subtype ;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype ;; 2-syntax-aux.watsup:184.1-184.76 - def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(st*{st : subtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype}) + def $subst_rectype{st* : subtype*, xx* : typevar*, ht* : heaptype*}(REC_rectype(`%`(st*{st : subtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = REC_rectype(`%`($subst_subtype(st, xx*{xx : typevar}, ht*{ht : heaptype})*{st : subtype})) ;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype @@ -28264,7 +28303,7 @@ def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype ;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype ;; 2-syntax-aux.watsup:189.1-189.113 - def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype}), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}, $subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype}) + def $subst_functype{t_1* : valtype*, t_2* : valtype*, xx* : typevar*, ht* : heaptype*}(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype})), xx*{xx : typevar}, ht*{ht : heaptype}) = `%->%`(`%`($subst_valtype(t_1, xx*{xx : typevar}, ht*{ht : heaptype})*{t_1 : valtype}), `%`($subst_valtype(t_2, xx*{xx : typevar}, ht*{ht : heaptype})*{t_2 : valtype})) } ;; 2-syntax-aux.watsup @@ -28317,25 +28356,25 @@ def $subst_all_deftypes(deftype*, heaptype*) : deftype* ;; 2-syntax-aux.watsup def $rollrt(typeidx : typeidx, rectype : rectype) : rectype ;; 2-syntax-aux.watsup - def $rollrt{x : idx, st^n : subtype^n, n : n, i^n : nat^n}(x, REC_rectype(st^n{st : subtype})) = REC_rectype($subst_subtype(st, $idx(`%`((x.`%`.0 + i)))^(i%*%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) +syntax instrtype = `%->%%`{resulttype : resulttype, localidx* : localidx*}(resulttype : resulttype, localidx*{localidx : localidx} : localidx*, resulttype) ;; 6-typing.watsup syntax context = @@ -29811,18 +29850,18 @@ relation Valtype_ok: `%|-%:_OK`(context, valtype) relation Resulttype_ok: `%|-%:_OK`(context, resulttype) ;; 6-typing.watsup rule _{C : context, t* : valtype*}: - `%|-%:_OK`(C, t*{t : valtype}) + `%|-%:_OK`(C, `%`(t*{t : valtype})) -- (Valtype_ok: `%|-%:_OK`(C, t))*{t : valtype} ;; 6-typing.watsup relation Instrtype_ok: `%|-%:_OK`(context, instrtype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, x* : idx*, t_2* : valtype*, lt* : localtype*}: - `%|-%:_OK`(C, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:_OK`(C, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) -- if (|lt*{lt : localtype}| = |x*{x : idx}|) -- (if (x.`%`.0 < |C.LOCAL_context|))*{lt : localtype x : idx} - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_1*{t_1 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_2*{t_2 : valtype})) -- (if (C.LOCAL_context[x.`%`.0] = lt))*{lt : localtype x : idx} ;; 6-typing.watsup @@ -29862,15 +29901,15 @@ relation Fieldtype_ok: `%|-%:_OK`(context, fieldtype) relation Functype_ok: `%|-%:_OK`(context, functype) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:_OK`(C, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Resulttype_ok: `%|-%:_OK`(C, t_1*{t_1 : valtype}) - -- Resulttype_ok: `%|-%:_OK`(C, t_2*{t_2 : valtype}) + `%|-%:_OK`(C, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_1*{t_1 : valtype})) + -- Resulttype_ok: `%|-%:_OK`(C, `%`(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Comptype_ok: `%|-%:_OK`(context, comptype) ;; 6-typing.watsup rule struct{C : context, yt* : fieldtype*}: - `%|-%:_OK`(C, STRUCT_comptype(yt*{yt : fieldtype})) + `%|-%:_OK`(C, STRUCT_comptype(`%`(yt*{yt : fieldtype}))) -- (Fieldtype_ok: `%|-%:_OK`(C, yt))*{yt : fieldtype} ;; 6-typing.watsup @@ -29943,7 +29982,7 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:303.1-305.35 rule struct{C : context, deftype : deftype, yt* : fieldtype*}: `%|-%<:%`(C, (deftype : deftype <: heaptype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt : fieldtype})) + -- Expand: `%~~%`(deftype, STRUCT_comptype(`%`(yt*{yt : fieldtype}))) ;; 6-typing.watsup:307.1-309.33 rule array{C : context, deftype : deftype, yt : fieldtype}: @@ -30072,7 +30111,7 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) ;; 6-typing.watsup rule struct{C : context, yt_1* : fieldtype*, yt'_1 : fieldtype, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1 : fieldtype} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2 : fieldtype})) + `%|-%<:%`(C, STRUCT_comptype(`%`(yt_1*{yt_1 : fieldtype} :: [yt'_1])), STRUCT_comptype(`%`(yt_2*{yt_2 : fieldtype}))) -- if (|yt_1*{yt_1 : fieldtype}| = |yt_2*{yt_2 : fieldtype}|) -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 : fieldtype yt_2 : fieldtype} @@ -30138,12 +30177,12 @@ rec { relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) ;; 6-typing.watsup:196.1-197.24 rule empty{C : context, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) + `%|-%:%`(C, REC_rectype(`%`([])), OK_oktypeidxnat(x, i)) ;; 6-typing.watsup:199.1-202.50 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx, i : nat}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidxnat(x, i)) - -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) + `%|-%:%`(C, REC_rectype(`%`([st_1] :: st*{st : subtype})), OK_oktypeidxnat(x, i)) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) } @@ -30154,18 +30193,18 @@ rec { relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) ;; 6-typing.watsup:184.1-185.23 rule empty{C : context, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) + `%|-%:%`(C, REC_rectype(`%`([])), OK_oktypeidx(x)) ;; 6-typing.watsup:187.1-190.43 rule cons{C : context, st_1 : subtype, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype([st_1] :: st*{st : subtype}), OK_oktypeidx(x)) - -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(`%`((x.`%`.0 + 1)))) + `%|-%:%`(C, REC_rectype(`%`([st_1] :: st*{st : subtype})), OK_oktypeidx(x)) + -- Rectype_ok: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidx(`%`((x.`%`.0 + 1)))) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) ;; 6-typing.watsup:192.1-194.49 rule rec2{C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st : subtype}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st : subtype}), OK_oktypeidxnat(x, 0)) + `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st : subtype}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(x, 0)) } ;; 6-typing.watsup @@ -30174,7 +30213,7 @@ relation Deftype_ok: `%|-%:_OK`(context, deftype) rule _{C : context, qt : rectype, i : nat, x : idx, st^n : subtype^n, n : n}: `%|-%:_OK`(C, DEF_deftype(qt, i)) -- Rectype_ok: `%|-%:%`(C, qt, OK_oktypeidx(x)) - -- if (qt = REC_rectype(st^n{st : subtype})) + -- if (qt = REC_rectype(`%`(st^n{st : subtype}))) -- if (i < n) ;; 6-typing.watsup @@ -30231,10 +30270,10 @@ relation Externtype_ok: `%|-%:_OK`(context, externtype) -- Memtype_ok: `%|-%:_OK`(C, mt) ;; 6-typing.watsup -relation Resulttype_sub: `%|-%*_<:%*`(context, valtype*, valtype*) +relation Resulttype_sub: `%|-%<:%`(context, valtype*, valtype*) ;; 6-typing.watsup rule _{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%*_<:%*`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) + `%|-%<:%`(C, t_1*{t_1 : valtype}, t_2*{t_2 : valtype}) -- if (|t_1*{t_1 : valtype}| = |t_2*{t_2 : valtype}|) -- (Valtype_sub: `%|-%<:%`(C, t_1, t_2))*{t_1 : valtype t_2 : valtype} @@ -30242,11 +30281,11 @@ relation Resulttype_sub: `%|-%*_<:%*`(context, valtype*, valtype*) relation Instrtype_sub: `%|-%<:%`(context, instrtype, instrtype) ;; 6-typing.watsup rule _{C : context, t_11* : valtype*, x_1* : idx*, t_12* : valtype*, t_21* : valtype*, x_2* : idx*, t_22* : valtype*, x* : idx*, t* : valtype*}: - `%|-%<:%`(C, `%->%*%`(t_11*{t_11 : valtype}, x_1*{x_1 : localidx}, t_12*{t_12 : valtype}), `%->%*%`(t_21*{t_21 : valtype}, x_2*{x_2 : localidx}, t_22*{t_22 : valtype})) + `%|-%<:%`(C, `%->%%`(`%`(t_11*{t_11 : valtype}), x_1*{x_1 : localidx}, `%`(t_12*{t_12 : valtype})), `%->%%`(`%`(t_21*{t_21 : valtype}), x_2*{x_2 : localidx}, `%`(t_22*{t_22 : valtype}))) -- if (|t*{t : valtype}| = |x*{x : idx}|) -- (if (x.`%`.0 < |C.LOCAL_context|))*{t : valtype x : idx} - -- Resulttype_sub: `%|-%*_<:%*`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) + -- Resulttype_sub: `%|-%<:%`(C, t_21*{t_21 : valtype}, t_11*{t_11 : valtype}) + -- Resulttype_sub: `%|-%<:%`(C, t_12*{t_12 : valtype}, t_22*{t_22 : valtype}) -- if (x*{x : idx} = $setminus(x_2*{x_2 : idx}, x_1*{x_1 : idx})) -- (if (C.LOCAL_context[x.`%`.0] = `%%`(SET_init, t)))*{t : valtype x : idx} @@ -30313,11 +30352,11 @@ relation Externtype_sub: `%|-%<:%`(context, externtype, externtype) relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) ;; 6-typing.watsup rule void{C : context}: - `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) + `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`(`%`([]), `%`([]))) ;; 6-typing.watsup rule result{C : context, t : valtype}: - `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`([], [t])) + `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`(`%`([]), `%`([t]))) ;; 6-typing.watsup rule typeidx{C : context, x : idx, ft : functype}: @@ -30332,296 +30371,296 @@ rec { relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:544.1-545.34 rule unreachable{C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:547.1-548.24 rule nop{C : context}: - `%|-%:%`(C, NOP_instr, `%->%`([], [])) + `%|-%:%`(C, NOP_instr, `%->%`(`%`([]), `%`([]))) ;; 6-typing.watsup:550.1-551.23 rule drop{C : context, t : valtype}: - `%|-%:%`(C, DROP_instr, `%->%`([t], [])) + `%|-%:%`(C, DROP_instr, `%->%`(`%`([t]), `%`([]))) ;; 6-typing.watsup:554.1-555.31 rule select-expl{C : context, t : valtype}: - `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) + `%|-%:%`(C, SELECT_instr(?([t])), `%->%`(`%`([t t I32_valtype]), `%`([t]))) ;; 6-typing.watsup:557.1-560.37 rule select-impl-0{C : context, t : valtype, t' : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) + `%|-%:%`(C, SELECT_instr(?()), `%->%`(`%`([t t I32_valtype]), `%`([t]))) -- Valtype_sub: `%|-%<:%`(C, t, t') -- if (t' = (numtype : numtype <: valtype)) ;; 6-typing.watsup:557.1-560.37 rule select-impl-1{C : context, t : valtype, t' : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) + `%|-%:%`(C, SELECT_instr(?()), `%->%`(`%`([t t I32_valtype]), `%`([t]))) -- Valtype_sub: `%|-%<:%`(C, t, t') -- if (t' = (vectype : vectype <: valtype)) ;; 6-typing.watsup:578.1-581.61 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:583.1-586.61 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1 : valtype}], RETURN ?()}, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_1*{t_1 : valtype})], RETURN ?()}, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:588.1-592.65 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_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_2*{x_2 : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->%`(`%`(t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr_1*{instr_1 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx}, `%`(t_2*{t_2 : valtype}))) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()}, instr_2*{instr_2 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_2*{x_2 : localidx}, `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:597.1-599.24 rule br{C : context, l : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, BR_instr(l), `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) -- if (l.`%`.0 < |C.LABEL_context|) - -- where t*{t : valtype} = C.LABEL_context[l.`%`.0] + -- where `%`(t*{t : valtype}) = C.LABEL_context[l.`%`.0] ;; 6-typing.watsup:601.1-603.24 rule br_if{C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t : valtype} :: [I32_valtype], t*{t : valtype})) + `%|-%:%`(C, BR_IF_instr(l), `%->%`(`%`(t*{t : valtype} :: [I32_valtype]), `%`(t*{t : valtype}))) -- if (l.`%`.0 < |C.LABEL_context|) - -- where t*{t : valtype} = C.LABEL_context[l.`%`.0] + -- where `%`(t*{t : valtype}) = C.LABEL_context[l.`%`.0] ;; 6-typing.watsup:605.1-608.44 rule br_table{C : context, l* : labelidx*, l' : labelidx, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, BR_TABLE_instr(l*{l : labelidx}, l'), `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) -- (if (l.`%`.0 < |C.LABEL_context|))*{l : labelidx} -- if (l'.`%`.0 < |C.LABEL_context|) - -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0]))*{l : labelidx} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0]) + -- (Resulttype_sub: `%|-%<:%`(C, t*{t : valtype}, C.LABEL_context[l.`%`.0].`%`.0))*{l : labelidx} + -- Resulttype_sub: `%|-%<:%`(C, t*{t : valtype}, C.LABEL_context[l'.`%`.0].`%`.0) ;; 6-typing.watsup:610.1-613.31 rule br_on_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)])) + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(`%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)]), `%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]))) -- if (l.`%`.0 < |C.LABEL_context|) -- Heaptype_ok: `%|-%:_OK`(C, ht) - -- where t*{t : valtype} = C.LABEL_context[l.`%`.0] + -- where `%`(t*{t : valtype}) = C.LABEL_context[l.`%`.0] ;; 6-typing.watsup:615.1-618.31 rule br_on_non_null{C : context, l : labelidx, t* : valtype*, ht : heaptype}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t : valtype})) + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(`%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?(())), ht)]), `%`(t*{t : valtype}))) -- if (l.`%`.0 < |C.LABEL_context|) - -- where t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)] = C.LABEL_context[l.`%`.0] + -- where `%`(t*{t : valtype} :: [REF_valtype(`NULL%?`(?()), ht)]) = C.LABEL_context[l.`%`.0] -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:620.1-626.34 rule br_on_cast{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)])) + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(`%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)]), `%`(t*{t : valtype} :: [($diffrt(rt_1, rt_2) : reftype <: valtype)]))) -- if (l.`%`.0 < |C.LABEL_context|) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- where t*{t : valtype} :: [(rt : reftype <: valtype)] = C.LABEL_context[l.`%`.0] + -- where `%`(t*{t : valtype} :: [(rt : reftype <: valtype)]) = C.LABEL_context[l.`%`.0] -- Reftype_sub: `%|-%<:%`(C, rt_2, rt) ;; 6-typing.watsup:628.1-634.49 rule br_on_cast_fail{C : context, l : labelidx, rt_1 : reftype, rt_2 : reftype, t* : valtype*, rt : reftype}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)], t*{t : valtype} :: [(rt_2 : reftype <: valtype)])) + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(`%`(t*{t : valtype} :: [(rt_1 : reftype <: valtype)]), `%`(t*{t : valtype} :: [(rt_2 : reftype <: valtype)]))) -- if (l.`%`.0 < |C.LABEL_context|) -- Reftype_ok: `%|-%:_OK`(C, rt_1) -- Reftype_ok: `%|-%:_OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- where t*{t : valtype} :: [(rt : reftype <: valtype)] = C.LABEL_context[l.`%`.0] + -- where `%`(t*{t : valtype} :: [(rt : reftype <: valtype)]) = C.LABEL_context[l.`%`.0] -- Reftype_sub: `%|-%<:%`(C, $diffrt(rt_1, rt_2), rt) ;; 6-typing.watsup:639.1-641.24 rule return{C : context, t_1* : valtype*, t* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1 : valtype} :: t*{t : valtype}, t_2*{t_2 : valtype})) - -- where ?(t*{t : valtype}) = C.RETURN_context + `%|-%:%`(C, RETURN_instr, `%->%`(`%`(t_1*{t_1 : valtype} :: t*{t : valtype}), `%`(t_2*{t_2 : valtype}))) + -- where ?(`%`(t*{t : valtype})) = C.RETURN_context ;; 6-typing.watsup:643.1-645.46 rule call{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, CALL_instr(x), `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) -- if (x.`%`.0 < |C.FUNC_context|) - -- where FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) = $expanddt(C.FUNC_context[x.`%`.0]) + -- where FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) = $expanddt(C.FUNC_context[x.`%`.0]) ;; 6-typing.watsup:647.1-649.46 rule call_ref{C : context, x : idx, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_2*{t_2 : valtype})) + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(`%`(t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`(t_2*{t_2 : valtype}))) -- if (x.`%`.0 < |C.TYPE_context|) - -- where FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) = $expanddt(C.TYPE_context[x.`%`.0]) + -- where FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) = $expanddt(C.TYPE_context[x.`%`.0]) ;; 6-typing.watsup:651.1-655.46 rule call_indirect{C : context, x : idx, y : idx, t_1* : valtype*, t_2* : valtype*, lim : limits, rt : reftype}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1 : valtype} :: [I32_valtype], t_2*{t_2 : valtype})) + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(`%`(t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_2*{t_2 : valtype}))) -- if (x.`%`.0 < |C.TABLE_context|) -- if (y.`%`.0 < |C.TYPE_context|) -- where `%%`(lim, rt) = C.TABLE_context[x.`%`.0] - -- where FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) = $expanddt(C.TYPE_context[y.`%`.0]) + -- where FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) = $expanddt(C.TYPE_context[y.`%`.0]) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) ;; 6-typing.watsup:657.1-661.40 rule return_call{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}, t_4*{t_4 : valtype})) + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype}), `%`(t_4*{t_4 : valtype}))) -- if (x.`%`.0 < |C.FUNC_context|) - -- where FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) = $expanddt(C.FUNC_context[x.`%`.0]) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- where FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) = $expanddt(C.FUNC_context[x.`%`.0]) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) ;; 6-typing.watsup:663.1-667.40 rule return_call_ref{C : context, x : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], t_4*{t_4 : valtype})) + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`(t_4*{t_4 : valtype}))) -- if (x.`%`.0 < |C.TYPE_context|) - -- where FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) = $expanddt(C.TYPE_context[x.`%`.0]) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- where FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) = $expanddt(C.TYPE_context[x.`%`.0]) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) ;; 6-typing.watsup:669.1-675.40 rule return_call_indirect{C : context, x : idx, y : idx, t_3* : valtype*, t_1* : valtype*, t_4* : valtype*, lim : limits, rt : reftype, t_2* : valtype*, t'_2* : valtype*}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype], t_4*{t_4 : valtype})) + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(`%`(t_3*{t_3 : valtype} :: t_1*{t_1 : valtype} :: [I32_valtype]), `%`(t_4*{t_4 : valtype}))) -- if (x.`%`.0 < |C.TABLE_context|) -- if (y.`%`.0 < |C.TYPE_context|) -- where `%%`(lim, rt) = C.TABLE_context[x.`%`.0] - -- where FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) = $expanddt(C.TYPE_context[y.`%`.0]) + -- where FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) = $expanddt(C.TYPE_context[y.`%`.0]) -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) - -- if (C.RETURN_context = ?(t'_2*{t'_2 : valtype})) + -- Resulttype_sub: `%|-%<:%`(C, t_2*{t_2 : valtype}, t'_2*{t'_2 : valtype}) + -- if (C.RETURN_context = ?(`%`(t'_2*{t'_2 : valtype}))) ;; 6-typing.watsup:680.1-681.33 rule const{C : context, nt : numtype, c_nt : num_(nt)}: - `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [(nt : numtype <: valtype)])) + `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`(`%`([]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:683.1-684.34 rule unop{C : context, nt : numtype, unop_nt : unop_(nt)}: - `%|-%:%`(C, UNOP_instr(nt, unop_nt), `%->%`([(nt : numtype <: valtype)], [(nt : numtype <: valtype)])) + `%|-%:%`(C, UNOP_instr(nt, unop_nt), `%->%`(`%`([(nt : numtype <: valtype)]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:686.1-687.39 rule binop{C : context, nt : numtype, binop_nt : binop_(nt)}: - `%|-%:%`(C, BINOP_instr(nt, binop_nt), `%->%`([(nt : numtype <: valtype) (nt : numtype <: valtype)], [(nt : numtype <: valtype)])) + `%|-%:%`(C, BINOP_instr(nt, binop_nt), `%->%`(`%`([(nt : numtype <: valtype) (nt : numtype <: valtype)]), `%`([(nt : numtype <: valtype)]))) ;; 6-typing.watsup:689.1-690.39 rule testop{C : context, nt : numtype, testop_nt : testop_(nt)}: - `%|-%:%`(C, TESTOP_instr(nt, testop_nt), `%->%`([(nt : numtype <: valtype)], [I32_valtype])) + `%|-%:%`(C, TESTOP_instr(nt, testop_nt), `%->%`(`%`([(nt : numtype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:692.1-693.40 rule relop{C : context, nt : numtype, relop_nt : relop_(nt)}: - `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->%`([(nt : numtype <: valtype) (nt : numtype <: valtype)], [I32_valtype])) + `%|-%:%`(C, RELOP_instr(nt, relop_nt), `%->%`(`%`([(nt : numtype <: valtype) (nt : numtype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:696.1-699.34 rule reinterpret{C : context, nt_1 : numtype, nt_2 : numtype}: - `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([(nt_2 : numtype <: valtype)], [(nt_1 : numtype <: valtype)])) + `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`(`%`([(nt_2 : numtype <: valtype)]), `%`([(nt_1 : numtype <: valtype)]))) -- if (nt_1 =/= nt_2) -- if ($size(nt_1) = $size(nt_2)) ;; 6-typing.watsup:701.1-704.50 rule convert-i{C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: - `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx : sx}), `%->%`(`%`([(inn_2 : inn <: valtype)]), `%`([(inn_1 : inn <: valtype)]))) -- if (inn_1 =/= inn_2) -- if ((sx?{sx : sx} = ?()) <=> ($size((inn_1 : inn <: numtype)) > $size((inn_2 : inn <: numtype)))) ;; 6-typing.watsup:706.1-708.24 rule convert-f{C : context, fnn_1 : fnn, fnn_2 : fnn}: - `%|-%:%`(C, CVTOP_instr((fnn_1 : fnn <: numtype), CONVERT_cvtop, (fnn_2 : fnn <: numtype), ?()), `%->%`([(fnn_2 : fnn <: valtype)], [(fnn_1 : fnn <: valtype)])) + `%|-%:%`(C, CVTOP_instr((fnn_1 : fnn <: numtype), CONVERT_cvtop, (fnn_2 : fnn <: numtype), ?()), `%->%`(`%`([(fnn_2 : fnn <: valtype)]), `%`([(fnn_1 : fnn <: valtype)]))) -- if (fnn_1 =/= fnn_2) ;; 6-typing.watsup:713.1-715.31 rule ref.null{C : context, ht : heaptype}: - `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) + `%|-%:%`(C, REF.NULL_instr(ht), `%->%`(`%`([]), `%`([REF_valtype(`NULL%?`(?(())), ht)]))) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:718.1-720.23 rule ref.func{C : context, x : idx, epsilon : resulttype, dt : deftype}: - `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), (dt : deftype <: heaptype))])) + `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, `%`([REF_valtype(`NULL%?`(?()), (dt : deftype <: heaptype))]))) -- if (x.`%`.0 < |C.FUNC_context|) -- where dt = C.FUNC_context[x.`%`.0] ;; 6-typing.watsup:722.1-723.34 rule ref.i31{C : context}: - `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) + `%|-%:%`(C, REF.I31_instr, `%->%`(`%`([I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), I31_heaptype)]))) ;; 6-typing.watsup:725.1-726.31 rule ref.is_null{C : context, rt : reftype}: - `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([(rt : reftype <: valtype)], [I32_valtype])) + `%|-%:%`(C, REF.IS_NULL_instr, `%->%`(`%`([(rt : reftype <: valtype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:728.1-730.31 rule ref.as_non_null{C : context, ht : heaptype}: - `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) + `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ht)]), `%`([REF_valtype(`NULL%?`(?()), ht)]))) -- Heaptype_ok: `%|-%:_OK`(C, ht) ;; 6-typing.watsup:732.1-733.51 rule ref.eq{C : context}: - `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) + `%|-%:%`(C, REF.EQ_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:735.1-739.33 rule ref.test{C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([(rt' : reftype <: valtype)], [I32_valtype])) + `%|-%:%`(C, REF.TEST_instr(rt), `%->%`(`%`([(rt' : reftype <: valtype)]), `%`([I32_valtype]))) -- Reftype_ok: `%|-%:_OK`(C, rt) -- Reftype_sub: `%|-%<:%`(C, rt, rt') -- Reftype_ok: `%|-%:_OK`(C, rt') ;; 6-typing.watsup:741.1-745.33 rule ref.cast{C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.CAST_instr(rt), `%->%`([(rt' : reftype <: valtype)], [(rt : reftype <: valtype)])) + `%|-%:%`(C, REF.CAST_instr(rt), `%->%`(`%`([(rt' : reftype <: valtype)]), `%`([(rt : reftype <: valtype)]))) -- Reftype_ok: `%|-%:_OK`(C, rt) -- Reftype_sub: `%|-%<:%`(C, rt, rt') -- Reftype_ok: `%|-%:_OK`(C, rt') ;; 6-typing.watsup:750.1-751.42 rule i31.get{C : context, sx : sx}: - `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) + `%|-%:%`(C, I31.GET_instr(sx), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)]), `%`([I32_valtype]))) ;; 6-typing.watsup:756.1-758.43 rule struct.new{C : context, x : idx, zt* : storagetype*, mut* : mut*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`(`%`($unpack(zt)*{zt : storagetype}), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x.`%`.0 < |C.TYPE_context|) - -- where STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype}) = $expanddt(C.TYPE_context[x.`%`.0]) + -- where STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype})) = $expanddt(C.TYPE_context[x.`%`.0]) -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) ;; 6-typing.watsup:760.1-763.39 rule struct.new_default{C : context, x : idx, zt* : storagetype*, mut* : mut*, val* : val*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpack(zt)*{zt : storagetype}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`(`%`($unpack(zt)*{zt : storagetype}), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x.`%`.0 < |C.TYPE_context|) - -- where STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype}) = $expanddt(C.TYPE_context[x.`%`.0]) + -- where STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype})) = $expanddt(C.TYPE_context[x.`%`.0]) -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) -- (where ?(val) = $default($unpack(zt)))*{val : val zt : storagetype} -- if (|val*{val : val}| = |zt*{zt : storagetype}|) ;; 6-typing.watsup:765.1-769.39 rule struct.get{C : context, sx? : sx?, x : idx, i : nat, zt : storagetype, yt* : fieldtype*, mut : mut}: - `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))], [$unpack(zt)])) + `%|-%:%`(C, STRUCT.GET_instr(sx?{sx : sx}, x, `%`(i)), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype))]), `%`([$unpack(zt)]))) -- if (x.`%`.0 < |C.TYPE_context|) - -- where STRUCT_comptype(yt*{yt : fieldtype}) = $expanddt(C.TYPE_context[x.`%`.0]) + -- where STRUCT_comptype(`%`(yt*{yt : fieldtype})) = $expanddt(C.TYPE_context[x.`%`.0]) -- if (i < |yt*{yt : fieldtype}|) -- where `%%`(mut, zt) = yt*{yt : fieldtype}[i] -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:771.1-774.24 rule struct.set{C : context, x : idx, i : nat, zt : storagetype, yt* : fieldtype*}: - `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)], [])) + `%|-%:%`(C, STRUCT.SET_instr(x, `%`(i)), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) $unpack(zt)]), `%`([]))) -- if (x.`%`.0 < |C.TYPE_context|) - -- where STRUCT_comptype(yt*{yt : fieldtype}) = $expanddt(C.TYPE_context[x.`%`.0]) + -- where STRUCT_comptype(`%`(yt*{yt : fieldtype})) = $expanddt(C.TYPE_context[x.`%`.0]) -- if (i < |yt*{yt : fieldtype}|) -- where `%%`(`MUT%?`(?(())), zt) = yt*{yt : fieldtype}[i] ;; 6-typing.watsup:779.1-781.41 rule array.new{C : context, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpack(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`(`%`([$unpack(zt) I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x.`%`.0 < |C.TYPE_context|) -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt(C.TYPE_context[x.`%`.0]) ;; 6-typing.watsup:783.1-786.36 rule array.new_default{C : context, x : idx, mut : mut, zt : storagetype, val : val}: - `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`(`%`([I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x.`%`.0 < |C.TYPE_context|) -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt(C.TYPE_context[x.`%`.0]) -- where ?(val) = $default($unpack(zt)) ;; 6-typing.watsup:788.1-790.41 rule array.new_fixed{C : context, x : idx, n : n, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpack(zt)], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`(`%`([$unpack(zt)]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x.`%`.0 < |C.TYPE_context|) -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt(C.TYPE_context[x.`%`.0]) ;; 6-typing.watsup:792.1-795.39 rule array.new_elem{C : context, x : idx, y : idx, mut : mut, rt : reftype}: - `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x.`%`.0 < |C.TYPE_context|) -- if (y.`%`.0 < |C.ELEM_context|) -- where ARRAY_comptype(`%%`(mut, (rt : reftype <: storagetype))) = $expanddt(C.TYPE_context[x.`%`.0]) @@ -30629,7 +30668,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:797.1-801.23 rule array.new_data-0{C : context, x : idx, y : idx, mut : mut, t : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x.`%`.0 < |C.TYPE_context|) -- if (y.`%`.0 < |C.DATA_context|) -- if (C.DATA_context[y.`%`.0] = OK) @@ -30638,7 +30677,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:797.1-801.23 rule array.new_data-1{C : context, x : idx, y : idx, mut : mut, t : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) + `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype]), `%`([REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))]))) -- if (x.`%`.0 < |C.TYPE_context|) -- if (y.`%`.0 < |C.DATA_context|) -- if (C.DATA_context[y.`%`.0] = OK) @@ -30647,32 +30686,32 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:803.1-806.39 rule array.get{C : context, sx? : sx?, x : idx, zt : storagetype, mut : mut}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx : sx}, x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype]), `%`([$unpack(zt)]))) -- if (x.`%`.0 < |C.TYPE_context|) -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt(C.TYPE_context[x.`%`.0]) -- if ((sx?{sx : sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) ;; 6-typing.watsup:808.1-810.41 rule array.set{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)], [])) + `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt)]), `%`([]))) -- if (x.`%`.0 < |C.TYPE_context|) -- where ARRAY_comptype(`%%`(`MUT%?`(?(())), zt)) = $expanddt(C.TYPE_context[x.`%`.0]) ;; 6-typing.watsup:812.1-814.41 rule array.len{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) + `%|-%:%`(C, ARRAY.LEN_instr, `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)]), `%`([I32_valtype]))) -- where $expanddt(C.TYPE_context[x.`%`.0]) = ARRAY_comptype(`%%`(`MUT%?`(?(())), zt)) -- if (x.`%`.0 < |C.TYPE_context|) ;; 6-typing.watsup:816.1-818.41 rule array.fill{C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype], [])) + `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype $unpack(zt) I32_valtype]), `%`([]))) -- if (x.`%`.0 < |C.TYPE_context|) -- where ARRAY_comptype(`%%`(`MUT%?`(?(())), zt)) = $expanddt(C.TYPE_context[x.`%`.0]) ;; 6-typing.watsup:820.1-824.40 rule array.copy{C : context, x_1 : idx, x_2 : idx, zt_1 : storagetype, mut : mut, zt_2 : storagetype}: - `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x_1) : typevar <: heaptype)) I32_valtype REF_valtype(`NULL%?`(?(())), ($idx(x_2) : typevar <: heaptype)) I32_valtype I32_valtype]), `%`([]))) -- if (x_1.`%`.0 < |C.TYPE_context|) -- if (x_2.`%`.0 < |C.TYPE_context|) -- where ARRAY_comptype(`%%`(mut, zt_2)) = $expanddt(C.TYPE_context[x_2.`%`.0]) @@ -30681,7 +30720,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:826.1-829.43 rule array.init_elem{C : context, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (x.`%`.0 < |C.TYPE_context|) -- if (y.`%`.0 < |C.ELEM_context|) -- Storagetype_sub: `%|-%<:%`(C, (C.ELEM_context[y.`%`.0] : reftype <: storagetype), zt) @@ -30689,7 +30728,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:831.1-835.23 rule array.init_data-0{C : context, x : idx, y : idx, zt : storagetype, t : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (y.`%`.0 < |C.DATA_context|) -- if (x.`%`.0 < |C.TYPE_context|) -- if (C.DATA_context[y.`%`.0] = OK) @@ -30698,7 +30737,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:831.1-835.23 rule array.init_data-1{C : context, x : idx, y : idx, zt : storagetype, t : valtype, numtype : numtype, vectype : vectype}: - `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`(`%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (y.`%`.0 < |C.DATA_context|) -- if (x.`%`.0 < |C.TYPE_context|) -- if (C.DATA_context[y.`%`.0] = OK) @@ -30707,150 +30746,150 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:840.1-841.62 rule extern.convert_any{C : context, nul : nul}: - `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) + `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`(`%`([REF_valtype(nul, ANY_heaptype)]), `%`([REF_valtype(nul, EXTERN_heaptype)]))) ;; 6-typing.watsup:843.1-844.62 rule any.convert_extern{C : context, nul : nul}: - `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) + `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`(`%`([REF_valtype(nul, EXTERN_heaptype)]), `%`([REF_valtype(nul, ANY_heaptype)]))) ;; 6-typing.watsup:849.1-850.35 rule vconst{C : context, c : vec_(V128_vnn)}: - `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->%`([], [V128_valtype])) + `%|-%:%`(C, VCONST_instr(V128_vectype, c), `%->%`(`%`([]), `%`([V128_valtype]))) ;; 6-typing.watsup:852.1-853.41 rule vvunop{C : context, vvunop : vvunop}: - `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVUNOP_instr(V128_vectype, vvunop), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:855.1-856.48 rule vvbinop{C : context, vvbinop : vvbinop}: - `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVBINOP_instr(V128_vectype, vvbinop), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:858.1-859.55 rule vvternop{C : context, vvternop : vvternop}: - `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->%`([V128_valtype V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VVTERNOP_instr(V128_vectype, vvternop), `%->%`(`%`([V128_valtype V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:861.1-862.44 rule vvtestop{C : context, vvtestop : vvtestop}: - `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VVTESTOP_instr(V128_vectype, vvtestop), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:864.1-865.33 rule vbitmask{C : context, sh : ishape}: - `%|-%:%`(C, VBITMASK_instr(sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VBITMASK_instr(sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:867.1-868.39 rule vswizzle{C : context, sh : ishape}: - `%|-%:%`(C, VSWIZZLE_instr(sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VSWIZZLE_instr(sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:870.1-872.22 rule vshuffle{C : context, imm : imm, N : N, i* : nat*}: - `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VSHUFFLE_instr(`%X%`(imm, `%`(N)), `%`(i)*{i : nat}), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) -- (if (i < (N * 2)))*{i : nat} ;; 6-typing.watsup:874.1-875.48 rule vsplat{C : context, lnn : lnn, N : N}: - `%|-%:%`(C, VSPLAT_instr(`%X%`(lnn, `%`(N))), `%->%`([($lunpack(lnn) : numtype <: valtype)], [V128_valtype])) + `%|-%:%`(C, VSPLAT_instr(`%X%`(lnn, `%`(N))), `%->%`(`%`([($lunpack(lnn) : numtype <: valtype)]), `%`([V128_valtype]))) ;; 6-typing.watsup:878.1-880.14 rule vextract_lane{C : context, lnn : lnn, N : N, sx? : sx?, i : nat}: - `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`([V128_valtype], [($lunpack(lnn) : numtype <: valtype)])) + `%|-%:%`(C, VEXTRACT_LANE_instr(`%X%`(lnn, `%`(N)), sx?{sx : sx}, `%`(i)), `%->%`(`%`([V128_valtype]), `%`([($lunpack(lnn) : numtype <: valtype)]))) -- if (i < N) ;; 6-typing.watsup:882.1-884.14 rule vreplace_lane{C : context, lnn : lnn, N : N, i : nat}: - `%|-%:%`(C, VREPLACE_LANE_instr(`%X%`(lnn, `%`(N)), `%`(i)), `%->%`([V128_valtype ($lunpack(lnn) : numtype <: valtype)], [V128_valtype])) + `%|-%:%`(C, VREPLACE_LANE_instr(`%X%`(lnn, `%`(N)), `%`(i)), `%->%`(`%`([V128_valtype ($lunpack(lnn) : numtype <: valtype)]), `%`([V128_valtype]))) -- if (i < N) ;; 6-typing.watsup:886.1-887.40 rule vunop{C : context, sh : shape, vunop_sh : vunop_(sh)}: - `%|-%:%`(C, VUNOP_instr(sh, vunop_sh), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VUNOP_instr(sh, vunop_sh), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:889.1-890.47 rule vbinop{C : context, sh : shape, vbinop_sh : vbinop_(sh)}: - `%|-%:%`(C, VBINOP_instr(sh, vbinop_sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VBINOP_instr(sh, vbinop_sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:892.1-893.43 rule vtestop{C : context, sh : shape, vtestop_sh : vtestop_(sh)}: - `%|-%:%`(C, VTESTOP_instr(sh, vtestop_sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VTESTOP_instr(sh, vtestop_sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:895.1-896.47 rule vrelop{C : context, sh : shape, vrelop_sh : vrelop_(sh)}: - `%|-%:%`(C, VRELOP_instr(sh, vrelop_sh), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VRELOP_instr(sh, vrelop_sh), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:898.1-899.50 rule vshiftop{C : context, sh : ishape, vshiftop_sh : vshiftop_(sh)}: - `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop_sh), `%->%`([V128_valtype I32_valtype], [V128_valtype])) + `%|-%:%`(C, VSHIFTOP_instr(sh, vshiftop_sh), `%->%`(`%`([V128_valtype I32_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:902.1-903.55 rule vcvtop{C : context, sh : shape, vcvtop : vcvtop, hf? : half?, sx? : sx?, zero : zero}: - `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VCVTOP_instr(sh, vcvtop, hf?{hf : half}, sh, sx?{sx : sx}, zero), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:905.1-906.44 rule vnarrow{C : context, sh : ishape, sx : sx}: - `%|-%:%`(C, VNARROW_instr(sh, sh, sx), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VNARROW_instr(sh, sh, sx), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:908.1-909.49 rule vextunop{C : context, sh : ishape, vextunop : vextunop_(sh, sh), sx : sx}: - `%|-%:%`(C, VEXTUNOP_instr(sh, sh, vextunop, sx), `%->%`([V128_valtype], [V128_valtype])) + `%|-%:%`(C, VEXTUNOP_instr(sh, sh, vextunop, sx), `%->%`(`%`([V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:911.1-912.56 rule vextbinop{C : context, sh : ishape, vextbinop : vextbinop_(sh, sh), sx : sx}: - `%|-%:%`(C, VEXTBINOP_instr(sh, sh, vextbinop, sx), `%->%`([V128_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VEXTBINOP_instr(sh, sh, vextbinop, sx), `%->%`(`%`([V128_valtype V128_valtype]), `%`([V128_valtype]))) ;; 6-typing.watsup:914.1-915.33 rule vbitmask{C : context, sh : ishape}: - `%|-%:%`(C, VBITMASK_instr(sh), `%->%`([V128_valtype], [I32_valtype])) + `%|-%:%`(C, VBITMASK_instr(sh), `%->%`(`%`([V128_valtype]), `%`([I32_valtype]))) ;; 6-typing.watsup:920.1-922.28 rule local.get{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) + `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`(`%`([]), `%`([t]))) -- if (x.`%`.0 < |C.LOCAL_context|) -- where `%%`(init, t) = C.LOCAL_context[x.`%`.0] ;; 6-typing.watsup:935.1-937.28 rule global.get{C : context, x : idx, t : valtype, mut : mut}: - `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) + `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`(`%`([]), `%`([t]))) -- if (x.`%`.0 < |C.GLOBAL_context|) -- where `%%`(mut, t) = C.GLOBAL_context[x.`%`.0] ;; 6-typing.watsup:939.1-941.28 rule global.set{C : context, x : idx, t : valtype}: - `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) + `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`(`%`([t]), `%`([]))) -- if (x.`%`.0 < |C.GLOBAL_context|) -- where `%%`(`MUT%?`(?(())), t) = C.GLOBAL_context[x.`%`.0] ;; 6-typing.watsup:946.1-948.28 rule table.get{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [(rt : reftype <: valtype)])) + `%|-%:%`(C, TABLE.GET_instr(x), `%->%`(`%`([I32_valtype]), `%`([(rt : reftype <: valtype)]))) -- if (x.`%`.0 < |C.TABLE_context|) -- where `%%`(lim, rt) = C.TABLE_context[x.`%`.0] ;; 6-typing.watsup:950.1-952.28 rule table.set{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype (rt : reftype <: valtype)], [])) + `%|-%:%`(C, TABLE.SET_instr(x), `%->%`(`%`([I32_valtype (rt : reftype <: valtype)]), `%`([]))) -- if (x.`%`.0 < |C.TABLE_context|) -- where `%%`(lim, rt) = C.TABLE_context[x.`%`.0] ;; 6-typing.watsup:954.1-956.24 rule table.size{C : context, x : idx, tt : tabletype}: - `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) + `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`(`%`([]), `%`([I32_valtype]))) -- if (x.`%`.0 < |C.TABLE_context|) -- where tt = C.TABLE_context[x.`%`.0] ;; 6-typing.watsup:958.1-960.28 rule table.grow{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([(rt : reftype <: valtype) I32_valtype], [I32_valtype])) + `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`(`%`([(rt : reftype <: valtype) I32_valtype]), `%`([I32_valtype]))) -- if (x.`%`.0 < |C.TABLE_context|) -- where `%%`(lim, rt) = C.TABLE_context[x.`%`.0] ;; 6-typing.watsup:962.1-964.28 rule table.fill{C : context, x : idx, rt : reftype, lim : limits}: - `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype (rt : reftype <: valtype) I32_valtype], [])) + `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`(`%`([I32_valtype (rt : reftype <: valtype) I32_valtype]), `%`([]))) -- if (x.`%`.0 < |C.TABLE_context|) -- where `%%`(lim, rt) = C.TABLE_context[x.`%`.0] ;; 6-typing.watsup:966.1-970.36 rule table.copy{C : context, x_1 : idx, x_2 : idx, lim_1 : limits, rt_1 : reftype, lim_2 : limits, rt_2 : reftype}: - `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (x_1.`%`.0 < |C.TABLE_context|) -- if (x_2.`%`.0 < |C.TABLE_context|) -- where `%%`(lim_1, rt_1) = C.TABLE_context[x_1.`%`.0] @@ -30859,7 +30898,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:972.1-976.36 rule table.init{C : context, x : idx, y : idx, lim : limits, rt_1 : reftype, rt_2 : reftype}: - `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (x.`%`.0 < |C.TABLE_context|) -- if (y.`%`.0 < |C.ELEM_context|) -- where rt_2 = C.ELEM_context[y.`%`.0] @@ -30868,31 +30907,31 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:978.1-980.23 rule elem.drop{C : context, x : idx, rt : reftype}: - `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) + `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`(`%`([]), `%`([]))) -- if (x.`%`.0 < |C.ELEM_context|) -- where rt = C.ELEM_context[x.`%`.0] ;; 6-typing.watsup:985.1-987.22 rule memory.size{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) + `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`(`%`([]), `%`([I32_valtype]))) -- if (x.`%`.0 < |C.MEM_context|) -- where mt = C.MEM_context[x.`%`.0] ;; 6-typing.watsup:989.1-991.22 rule memory.grow{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) + `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`(`%`([I32_valtype]), `%`([I32_valtype]))) -- if (x.`%`.0 < |C.MEM_context|) -- where mt = C.MEM_context[x.`%`.0] ;; 6-typing.watsup:993.1-995.22 rule memory.fill{C : context, x : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (x.`%`.0 < |C.MEM_context|) -- where mt = C.MEM_context[x.`%`.0] ;; 6-typing.watsup:997.1-1000.26 rule memory.copy{C : context, x_1 : idx, x_2 : idx, mt_1 : memtype, mt_2 : memtype}: - `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (x_1.`%`.0 < |C.MEM_context|) -- if (x_2.`%`.0 < |C.MEM_context|) -- where mt_1 = C.MEM_context[x_1.`%`.0] @@ -30900,7 +30939,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1002.1-1005.23 rule memory.init{C : context, x : idx, y : idx, mt : memtype}: - `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`(`%`([I32_valtype I32_valtype I32_valtype]), `%`([]))) -- if (x.`%`.0 < |C.MEM_context|) -- if (y.`%`.0 < |C.DATA_context|) -- if (C.DATA_context[y.`%`.0] = OK) @@ -30908,13 +30947,13 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1007.1-1009.23 rule data.drop{C : context, x : idx}: - `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) + `%|-%:%`(C, DATA.DROP_instr(x), `%->%`(`%`([]), `%`([]))) -- if (x.`%`.0 < |C.DATA_context|) -- if (C.DATA_context[x.`%`.0] = OK) ;; 6-typing.watsup:1011.1-1016.29 rule load-0{C : context, nt : numtype, n? : n?, sx? : sx?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([(nt : numtype <: valtype)]))) -- if (x.`%`.0 < |C.MEM_context|) -- if ((n?{n : n} = ?()) <=> (sx?{sx : sx} = ?())) -- if ((2 ^ n_A) <= ($size(nt) / 8)) @@ -30924,7 +30963,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1011.1-1016.29 rule load-1{C : context, nt : numtype, n? : n?, sx? : sx?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n : n sx : sx}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([(nt : numtype <: valtype)]))) -- if (x.`%`.0 < |C.MEM_context|) -- if ((n?{n : n} = ?()) <=> (sx?{sx : sx} = ?())) -- if ((2 ^ n_A) <= ($size(nt) / 8)) @@ -30934,7 +30973,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1018.1-1023.29 rule store-0{C : context, nt : numtype, n? : n?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) + `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype (nt : numtype <: valtype)]), `%`([]))) -- if (x.`%`.0 < |C.MEM_context|) -- if ((2 ^ n_A) <= ($size(nt) / 8)) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} @@ -30943,7 +30982,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1018.1-1023.29 rule store-1{C : context, nt : numtype, n? : n?, x : idx, n_A : n, n_O : n, mt : memtype, inn : inn}: - `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) + `%|-%:%`(C, STORE_instr(nt, n?{n : n}, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype (nt : numtype <: valtype)]), `%`([]))) -- if (x.`%`.0 < |C.MEM_context|) -- if ((2 ^ n_A) <= ($size(nt) / 8)) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt) / 8))))?{n : nat} @@ -30952,28 +30991,28 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1025.1-1028.30 rule vload{C : context, M : M, N : N, sx : sx, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (x.`%`.0 < |C.MEM_context|) -- if ((2 ^ n_A) <= ((M / 8) * N)) -- where mt = C.MEM_context[x.`%`.0] ;; 6-typing.watsup:1030.1-1033.26 rule vload-splat{C : context, n : n, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(SPLAT_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(SPLAT_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (x.`%`.0 < |C.MEM_context|) -- if ((2 ^ n_A) <= (n / 8)) -- where mt = C.MEM_context[x.`%`.0] ;; 6-typing.watsup:1035.1-1038.25 rule vload-zero{C : context, n : n, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VLOAD_instr(?(ZERO_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_instr(?(ZERO_vloadop(n)), x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype]), `%`([V128_valtype]))) -- if (x.`%`.0 < |C.MEM_context|) -- if ((2 ^ n_A) < (n / 8)) -- where mt = C.MEM_context[x.`%`.0] ;; 6-typing.watsup:1040.1-1044.29 rule vload_lane{C : context, n : n, x : idx, n_A : n, n_O : n, laneidx : laneidx, mt : memtype}: - `%|-%:%`(C, VLOAD_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`([I32_valtype V128_valtype], [V128_valtype])) + `%|-%:%`(C, VLOAD_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`(`%`([I32_valtype V128_valtype]), `%`([V128_valtype]))) -- if (x.`%`.0 < |C.MEM_context|) -- if ((2 ^ n_A) < (n / 8)) -- if (laneidx.`%`.0 < (128 / n)) @@ -30981,14 +31020,14 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) ;; 6-typing.watsup:1046.1-1049.37 rule vstore{C : context, x : idx, n_A : n, n_O : n, mt : memtype}: - `%|-%:%`(C, VSTORE_instr(x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`([I32_valtype V128_valtype], [])) + `%|-%:%`(C, VSTORE_instr(x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}), `%->%`(`%`([I32_valtype V128_valtype]), `%`([]))) -- if (x.`%`.0 < |C.MEM_context|) -- if ((2 ^ n_A) <= ($vsize(V128_vectype) / 8)) -- where mt = C.MEM_context[x.`%`.0] ;; 6-typing.watsup:1051.1-1055.29 rule vstore_lane{C : context, n : n, x : idx, n_A : n, n_O : n, laneidx : laneidx, mt : memtype}: - `%|-%:%`(C, VSTORE_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`([I32_valtype V128_valtype], [])) + `%|-%:%`(C, VSTORE_LANE_instr(n, x, {ALIGN `%`(n_A), OFFSET `%`(n_O)}, laneidx), `%->%`(`%`([I32_valtype V128_valtype]), `%`([]))) -- if (x.`%`.0 < |C.MEM_context|) -- if ((2 ^ n_A) < (n / 8)) -- if (laneidx.`%`.0 < (128 / n)) @@ -30998,56 +31037,56 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) relation Instrf_ok: `%|-%:%`(context, instr, instrtype) ;; 6-typing.watsup:518.1-520.41 rule instr{C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1 : valtype}, [], t_2*{t_2 : valtype})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) + `%|-%:%`(C, instr, `%->%%`(`%`(t_1*{t_1 : valtype}), [], `%`(t_2*{t_2 : valtype}))) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) ;; 6-typing.watsup:924.1-926.28 rule local.set{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) + `%|-%:%`(C, LOCAL.SET_instr(x), `%->%%`(`%`([t]), [x], `%`([]))) -- if (x.`%`.0 < |C.LOCAL_context|) -- where `%%`(init, t) = C.LOCAL_context[x.`%`.0] ;; 6-typing.watsup:928.1-930.28 rule local.tee{C : context, x : idx, t : valtype, init : init}: - `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) + `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%%`(`%`([t]), [x], `%`([t]))) -- if (x.`%`.0 < |C.LOCAL_context|) -- where `%%`(init, t) = C.LOCAL_context[x.`%`.0] ;; 6-typing.watsup:505.1-505.74 -relation Instrs_ok: `%|-%*_:%`(context, instr*, instrtype) +relation Instrs_ok: `%|-%:%`(context, instr*, instrtype) ;; 6-typing.watsup:522.1-523.29 rule empty{C : context}: - `%|-%*_:%`(C, [], `%->%*%`([], [], [])) + `%|-%:%`(C, [], `%->%%`(`%`([]), [], `%`([]))) ;; 6-typing.watsup:525.1-530.52 rule seq{C : context, instr_1 : instr, instr_2* : instr*, t_1* : valtype*, x_1* : idx*, x_2* : idx*, t_3* : valtype*, init* : init*, t* : valtype*, C' : context, t_2* : valtype*}: - `%|-%*_:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) - -- if (|init*{init : init}| = |t*{t : valtype}|) - -- if (|init*{init : init}| = |x_1*{x_1 : idx}|) + `%|-%:%`(C, [instr_1] :: instr_2*{instr_2 : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx} :: x_2*{x_2 : localidx}, `%`(t_3*{t_3 : valtype}))) + -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%%`(`%`(t_1*{t_1 : valtype}), x_1*{x_1 : localidx}, `%`(t_2*{t_2 : valtype}))) -- (if (x_1.`%`.0 < |C.LOCAL_context|))*{init : init t : valtype x_1 : idx} + -- where C' = $with_locals(C, x_1*{x_1 : localidx}, `%%`(SET_init, t)*{t : valtype}) + -- if (|init*{init : init}| = |x_1*{x_1 : idx}|) + -- if (|init*{init : init}| = |t*{t : valtype}|) -- (if (C.LOCAL_context[x_1.`%`.0] = `%%`(init, t)))*{init : init t : valtype x_1 : idx} - -- if (C' = $with_locals(C, x_1*{x_1 : localidx}, `%%`(SET_init, t)*{t : valtype})) - -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1 : valtype}, x_1*{x_1 : localidx}, t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C', instr_2*{instr_2 : instr}, `%->%*%`(t_2*{t_2 : valtype}, x_2*{x_2 : localidx}, t_3*{t_3 : valtype})) + -- Instrs_ok: `%|-%:%`(C', instr_2*{instr_2 : instr}, `%->%%`(`%`(t_2*{t_2 : valtype}), x_2*{x_2 : localidx}, `%`(t_3*{t_3 : valtype}))) ;; 6-typing.watsup:532.1-535.35 rule sub{C : context, instr* : instr*, it' : instrtype, it : instrtype}: - `%|-%*_:%`(C, instr*{instr : instr}, it') - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, it) + `%|-%:%`(C, instr*{instr : instr}, it') + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, it) -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:537.1-539.47 rule frame{C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, x* : idx*, t_2* : valtype*}: - `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t*{t : valtype} :: t_1*{t_1 : valtype}, x*{x : localidx}, t*{t : valtype} :: t_2*{t_2 : valtype})) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`(t_1*{t_1 : valtype}, x*{x : localidx}, t_2*{t_2 : valtype})) + `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`(t*{t : valtype} :: t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t*{t : valtype} :: t_2*{t_2 : valtype}))) + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`(t_1*{t_1 : valtype}), x*{x : localidx}, `%`(t_2*{t_2 : valtype}))) } ;; 6-typing.watsup relation Expr_ok: `%|-%:%`(context, expr, resulttype) ;; 6-typing.watsup rule _{C : context, instr* : instr*, t* : valtype*}: - `%|-%:%`(C, instr*{instr : instr}, t*{t : valtype}) - -- Instrs_ok: `%|-%*_:%`(C, instr*{instr : instr}, `%->%*%`([], [], t*{t : valtype})) + `%|-%:%`(C, instr*{instr : instr}, `%`(t*{t : valtype})) + -- Instrs_ok: `%|-%:%`(C, instr*{instr : instr}, `%->%%`(`%`([]), [], `%`(t*{t : valtype}))) ;; 6-typing.watsup rec { @@ -31113,16 +31152,16 @@ relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) ;; 6-typing.watsup rule _{C : context, expr : expr, t : valtype}: `%|-%:%CONST`(C, expr, t) - -- Expr_ok: `%|-%:%`(C, expr, [t]) + -- Expr_ok: `%|-%:%`(C, expr, `%`([t])) -- Expr_const: `%|-%CONST`(C, expr) ;; 6-typing.watsup -relation Type_ok: `%|-%:%*`(context, type, deftype*) +relation Type_ok: `%|-%:%`(context, type, deftype*) ;; 6-typing.watsup rule _{C : context, rectype : rectype, dt* : deftype*, x : idx}: - `%|-%:%*`(C, TYPE(rectype), dt*{dt : deftype}) - -- if (x = `%`(|C.TYPE_context|)) - -- if (dt*{dt : deftype} = $rolldt(x, rectype)) + `%|-%:%`(C, TYPE(rectype), dt*{dt : deftype}) + -- where x = `%`(|C.TYPE_context|) + -- where dt*{dt : deftype} = $rolldt(x, rectype) -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt : deftype}], rectype, OK_oktypeidx(x)) ;; 6-typing.watsup @@ -31141,12 +31180,12 @@ relation Local_ok: `%|-%:%`(context, local, localtype) relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup rule _{C : context, x : idx, local* : local*, expr : expr, t_1* : valtype*, t_2* : valtype*, lt* : localtype*}: - `%|-%:%`(C, `FUNC%%*%`(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) + `%|-%:%`(C, FUNC(x, local*{local : local}, expr), C.TYPE_context[x.`%`.0]) -- if (x.`%`.0 < |C.TYPE_context|) -- (Local_ok: `%|-%:%`(C, local, lt))*{local : local lt : localtype} - -- where FUNC_comptype(`%->%`(t_1*{t_1 : valtype}, t_2*{t_2 : valtype})) = $expanddt(C.TYPE_context[x.`%`.0]) + -- where FUNC_comptype(`%->%`(`%`(t_1*{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) = $expanddt(C.TYPE_context[x.`%`.0]) -- if (|local*{local : local}| = |lt*{lt : localtype}|) - -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2 : valtype}], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2 : valtype})}, expr, t_2*{t_2 : valtype}) + -- Expr_ok: `%|-%:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL `%%`(SET_init, t_1)*{t_1 : valtype} :: lt*{lt : localtype}, LABEL [], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [`%`(t_2*{t_2 : valtype})], RETURN ?()} ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(`%`(t_2*{t_2 : valtype}))}, expr, `%`(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -31194,7 +31233,7 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup rule _{C : context, rt : reftype, expr* : expr*, elemmode : elemmode}: - `%|-%:%`(C, `ELEM%%*%`(rt, expr*{expr : expr}, elemmode), rt) + `%|-%:%`(C, ELEM(rt, expr*{expr : expr}, elemmode), rt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, (rt : reftype <: valtype)))*{expr : expr} -- Elemmode_ok: `%|-%:%`(C, elemmode, rt) @@ -31215,7 +31254,7 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) relation Data_ok: `%|-%:_OK`(context, data) ;; 6-typing.watsup rule _{C : context, b* : byte*, datamode : datamode}: - `%|-%:_OK`(C, `DATA%*%`(b*{b : byte}, datamode)) + `%|-%:_OK`(C, DATA(b*{b : byte}, datamode)) -- Datamode_ok: `%|-%:_OK`(C, datamode) ;; 6-typing.watsup @@ -31224,7 +31263,7 @@ relation Start_ok: `%|-%:_OK`(context, start) rule _{C : context, x : idx}: `%|-%:_OK`(C, START(x)) -- if (x.`%`.0 < |C.FUNC_context|) - -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`([], []))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`([]), `%`([])))) ;; 6-typing.watsup relation Import_ok: `%|-%:%`(context, import, externtype) @@ -31270,48 +31309,48 @@ relation Export_ok: `%|-%:%`(context, export, externtype) rec { ;; 6-typing.watsup:1229.1-1229.77 -relation Globals_ok: `%|-%*_:%*`(context, global*, globaltype*) +relation Globals_ok: `%|-%:%`(context, global*, globaltype*) ;; 6-typing.watsup:1272.1-1273.17 rule empty{C : context}: - `%|-%*_:%*`(C, [], []) + `%|-%:%`(C, [], []) ;; 6-typing.watsup:1275.1-1278.54 rule cons{C : context, global_1 : global, global : global, gt_1 : globaltype, gt* : globaltype*}: - `%|-%*_:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) + `%|-%:%`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt : globaltype}) -- Global_ok: `%|-%:%`(C, global, gt_1) - -- Globals_ok: `%|-%*_:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) + -- Globals_ok: `%|-%:%`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt : globaltype}) } ;; 6-typing.watsup rec { ;; 6-typing.watsup:1228.1-1228.75 -relation Types_ok: `%|-%*_:%*`(context, type*, deftype*) +relation Types_ok: `%|-%:%`(context, type*, deftype*) ;; 6-typing.watsup:1264.1-1265.17 rule empty{C : context}: - `%|-%*_:%*`(C, [], []) + `%|-%:%`(C, [], []) ;; 6-typing.watsup:1267.1-1270.49 rule cons{C : context, type_1 : type, type* : type*, dt_1 : deftype, dt* : deftype*}: - `%|-%*_:%*`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) - -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) + `%|-%:%`(C, [type_1] :: type*{type : type}, dt_1*{} :: dt*{dt : deftype}) + -- Type_ok: `%|-%:%`(C, type_1, [dt_1]) + -- Types_ok: `%|-%:%`(C[TYPE_context =.. dt_1*{}], type*{type : type}, dt*{dt : deftype}) } ;; 6-typing.watsup relation Module_ok: `|-%:_OK`(module) ;; 6-typing.watsup rule _{type* : type*, import* : import*, func* : func*, global* : global*, table* : table*, mem* : mem*, elem* : elem*, data^n : data^n, n : n, start? : start?, export* : export*, dt'* : deftype*, ixt* : externtype*, C' : context, gt* : globaltype*, tt* : tabletype*, mt* : memtype*, C : context, dt* : deftype*, rt* : reftype*, et* : externtype*, idt* : deftype*, igt* : globaltype*, itt* : tabletype*, imt* : memtype*}: - `|-%:_OK`(`MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) + `|-%:_OK`(MODULE(type*{type : type}, import*{import : import}, func*{func : func}, global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data^n{data : data}, start?{start : start}, export*{export : export})) -- if (|import*{import : import}| = |ixt*{ixt : externtype}|) -- if (|table*{table : table}| = |tt*{tt : tabletype}|) -- if (|mem*{mem : mem}| = |mt*{mt : memtype}|) -- if (|dt*{dt : deftype}| = |func*{func : func}|) -- if (|elem*{elem : elem}| = |rt*{rt : reftype}|) -- if (|et*{et : externtype}| = |export*{export : export}|) - -- Types_ok: `%|-%*_:%*`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) + -- Types_ok: `%|-%:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, type*{type : type}, dt'*{dt' : deftype}) -- (Import_ok: `%|-%:%`({TYPE dt'*{dt' : deftype}, REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, import, ixt))*{import : import ixt : externtype} - -- Globals_ok: `%|-%*_:%*`(C', global*{global : global}, gt*{gt : globaltype}) + -- Globals_ok: `%|-%:%`(C', global*{global : global}, gt*{gt : globaltype}) -- (Table_ok: `%|-%:%`(C', table, tt))*{table : table tt : tabletype} -- (Mem_ok: `%|-%:%`(C', mem, mt))*{mem : mem mt : memtype} -- (Func_ok: `%|-%:%`(C, func, dt))*{dt : deftype func : func} @@ -31363,239 +31402,239 @@ relation Ref_ok: `%|-%:%`(store, ref, reftype) `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) ;; 8-reduction.watsup -relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) +relation Step_pure: `%~>%`(admininstr*, admininstr*) ;; 8-reduction.watsup rule unreachable: - `%*_~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) + `%~>%`([UNREACHABLE_admininstr], [TRAP_admininstr]) ;; 8-reduction.watsup rule nop: - `%*_~>%*`([NOP_admininstr], []) + `%~>%`([NOP_admininstr], []) ;; 8-reduction.watsup rule drop{val : val}: - `%*_~>%*`([(val : val <: admininstr) DROP_admininstr], []) + `%~>%`([(val : val <: admininstr) DROP_admininstr], []) ;; 8-reduction.watsup rule select-true{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) + `%~>%`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_1 : val <: admininstr)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule select-false{val_1 : val, val_2 : val, c : num_(I32_numtype), t*? : valtype*?}: - `%*_~>%*`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) + `%~>%`([(val_1 : val <: admininstr) (val_2 : val <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t : valtype}?{t : valtype})], [(val_2 : val <: admininstr)]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule if-true{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) + `%~>%`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_1*{instr_1 : instr})]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule if-false{c : num_(I32_numtype), bt : blocktype, instr_1* : instr*, instr_2* : instr*}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) + `%~>%`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr})], [BLOCK_admininstr(bt, instr_2*{instr_2 : instr})]) -- if (c = `%`(0)) ;; 8-reduction.watsup rule label-vals{n : n, instr* : instr*, val* : val*}: - `%*_~>%*`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) + `%~>%`([LABEL__admininstr(n, instr*{instr : instr}, (val : val <: admininstr)*{val : val})], (val : val <: admininstr)*{val : val}) ;; 8-reduction.watsup rule br-zero{n : n, instr'* : instr*, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`([LABEL__admininstr(n, instr'*{instr' : instr}, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [BR_admininstr(`%`(0))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val} :: (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule br-succ{n : n, instr'* : instr*, val* : val*, l : labelidx, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) + `%~>%`([LABEL__admininstr(n, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [BR_admininstr(`%`((l.`%`.0 + 1)))] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [BR_admininstr(l)]) ;; 8-reduction.watsup rule br_if-true{c : num_(I32_numtype), l : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) + `%~>%`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) -- if (c =/= `%`(0)) ;; 8-reduction.watsup rule br_if-false{c : num_(I32_numtype), l : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) + `%~>%`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) -- if (c = `%`(0)) ;; 8-reduction.watsup rule br_table-lt{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l*{l : labelidx}[i])]) -- if (i < |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_table-ge{i : nat, l* : labelidx*, l' : labelidx}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) BR_TABLE_admininstr(l*{l : labelidx}, l')], [BR_admininstr(l')]) -- if (i >= |l*{l : labelidx}|) ;; 8-reduction.watsup rule br_on_null-null{val : val, l : labelidx, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) + `%~>%`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) -- where REF.NULL_val(ht) = val ;; 8-reduction.watsup rule br_on_null-addr{val : val, l : labelidx}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [(val : val <: admininstr)]) + `%~>%`([(val : val <: admininstr) BR_ON_NULL_admininstr(l)], [(val : val <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule br_on_non_null-null{val : val, l : labelidx, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], []) + `%~>%`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], []) -- where REF.NULL_val(ht) = val ;; 8-reduction.watsup rule br_on_non_null-addr{val : val, l : labelidx}: - `%*_~>%*`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], [(val : val <: admininstr) BR_admininstr(l)]) + `%~>%`([(val : val <: admininstr) BR_ON_NON_NULL_admininstr(l)], [(val : val <: admininstr) BR_admininstr(l)]) -- otherwise ;; 8-reduction.watsup rule call_indirect-call{x : idx, y : idx}: - `%*_~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) CALL_REF_admininstr(?(y))]) + `%~>%`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) CALL_REF_admininstr(?(y))]) ;; 8-reduction.watsup rule return_call_indirect{x : idx, y : idx}: - `%*_~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) RETURN_CALL_REF_admininstr(?(y))]) + `%~>%`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) : typevar <: heaptype))) RETURN_CALL_REF_admininstr(?(y))]) ;; 8-reduction.watsup rule frame-vals{n : n, f : frame, val^n : val^n}: - `%*_~>%*`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) + `%~>%`([FRAME__admininstr(n, f, (val : val <: admininstr)^n{val : val})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-frame{n : n, f : frame, val'* : val*, val^n : val^n, instr* : instr*}: - `%*_~>%*`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) + `%~>%`([FRAME__admininstr(n, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)^n{val : val}) ;; 8-reduction.watsup rule return-label{k : nat, instr'* : instr*, val* : val*, instr* : instr*}: - `%*_~>%*`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) + `%~>%`([LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_admininstr] :: (instr : instr <: admininstr)*{instr : instr})], (val : val <: admininstr)*{val : val} :: [RETURN_admininstr]) ;; 8-reduction.watsup rule unop-val{nt : numtype, c_1 : num_(nt), unop : unop_(nt), c : num_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) + `%~>%`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) -- where [c] = $unop(nt, unop, c_1) ;; 8-reduction.watsup rule unop-trap{nt : numtype, c_1 : num_(nt), unop : unop_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) -- if ($unop(nt, unop, c_1) = []) ;; 8-reduction.watsup rule binop-val{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), binop : binop_(nt), c : num_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- where [c] = $binop(nt, binop, c_1, c_2) ;; 8-reduction.watsup rule binop-trap{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), binop : binop_(nt)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) -- if ($binop(nt, binop, c_1, c_2) = []) ;; 8-reduction.watsup rule testop{nt : numtype, c_1 : num_(nt), testop : testop_(nt), c : num_(I32_numtype)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) -- where c = $testop(nt, testop, c_1) ;; 8-reduction.watsup rule relop{nt : numtype, c_1 : num_(nt), c_2 : num_(nt), relop : relop_(nt), c : num_(I32_numtype)}: - `%*_~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) -- where c = $relop(nt, relop, c_1, c_2) ;; 8-reduction.watsup rule cvtop-val{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?, c : num_(nt_2)}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) + `%~>%`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [CONST_admininstr(nt_2, c)]) -- where [c] = $cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) ;; 8-reduction.watsup rule cvtop-trap{nt_1 : numtype, c_1 : num_(nt_1), nt_2 : numtype, cvtop : cvtop, sx? : sx?}: - `%*_~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) + `%~>%`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx : sx})], [TRAP_admininstr]) -- if ($cvtop(nt_1, nt_2, cvtop, sx?{sx : sx}, c_1) = []) ;; 8-reduction.watsup rule ref.i31{i : nat}: - `%*_~>%*`([CONST_admininstr(I32_numtype, `%`(i)) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, `%`(i)))]) + `%~>%`([CONST_admininstr(I32_numtype, `%`(i)) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, `%`(i)))]) ;; 8-reduction.watsup rule ref.is_null-true{val : val, ht : heaptype}: - `%*_~>%*`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- where REF.NULL_val(ht) = val ;; 8-reduction.watsup rule ref.is_null-false{val : val}: - `%*_~>%*`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([(val : val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule ref.as_non_null-null{ref : ref, ht : heaptype}: - `%*_~>%*`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) + `%~>%`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) -- where REF.NULL_ref(ht) = ref ;; 8-reduction.watsup rule ref.as_non_null-addr{ref : ref}: - `%*_~>%*`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [(ref : ref <: admininstr)]) + `%~>%`([(ref : ref <: admininstr) REF.AS_NON_NULL_admininstr], [(ref : ref <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule ref.eq-null{ref_1 : ref, ref_2 : ref, ht_1 : heaptype, ht_2 : heaptype}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- where REF.NULL_ref(ht_1) = ref_1 -- where REF.NULL_ref(ht_2) = ref_2 ;; 8-reduction.watsup rule ref.eq-true{ref_1 : ref, ref_2 : ref}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(1))]) -- otherwise -- if (ref_1 = ref_2) ;; 8-reduction.watsup rule ref.eq-false{ref_1 : ref, ref_2 : ref}: - `%*_~>%*`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([(ref_1 : ref <: admininstr) (ref_2 : ref <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule i31.get-null{ht : heaptype, sx : sx}: - `%*_~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) + `%~>%`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) ;; 8-reduction.watsup rule i31.get-num{i : nat, sx : sx}: - `%*_~>%*`([REF.I31_NUM_admininstr(`%`(i)) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, `%`(i)))]) + `%~>%`([REF.I31_NUM_admininstr(`%`(i)) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, `%`(i)))]) ;; 8-reduction.watsup rule extern.convert_any-null{ht : heaptype}: - `%*_~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) + `%~>%`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) ;; 8-reduction.watsup rule extern.convert_any-addr{addrref : addrref}: - `%*_~>%*`([(addrref : addrref <: admininstr) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) + `%~>%`([(addrref : addrref <: admininstr) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) ;; 8-reduction.watsup rule any.convert_extern-null{ht : heaptype}: - `%*_~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) + `%~>%`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) ;; 8-reduction.watsup rule any.convert_extern-addr{addrref : addrref}: - `%*_~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [(addrref : addrref <: admininstr)]) + `%~>%`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [(addrref : addrref <: admininstr)]) ;; 8-reduction.watsup rule vvunop{c_1 : vec_(V128_vnn), vvunop : vvunop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VVUNOP_admininstr(V128_vectype, vvunop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VVUNOP_admininstr(V128_vectype, vvunop)], [VCONST_admininstr(V128_vectype, c)]) -- where c = $vvunop(V128_vectype, vvunop, c_1) ;; 8-reduction.watsup rule vvbinop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), vvbinop : vvbinop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VVBINOP_admininstr(V128_vectype, vvbinop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VVBINOP_admininstr(V128_vectype, vvbinop)], [VCONST_admininstr(V128_vectype, c)]) -- where c = $vvbinop(V128_vectype, vvbinop, c_1, c_2) ;; 8-reduction.watsup rule vvternop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), c_3 : vec_(V128_vnn), vvternop : vvternop, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VCONST_admininstr(V128_vectype, c_3) VVTERNOP_admininstr(V128_vectype, vvternop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VCONST_admininstr(V128_vectype, c_3) VVTERNOP_admininstr(V128_vectype, vvternop)], [VCONST_admininstr(V128_vectype, c)]) -- where c = $vvternop(V128_vectype, vvternop, c_1, c_2, c_3) ;; 8-reduction.watsup rule vvtestop{c_1 : vec_(V128_vnn), c : num_(I32_numtype)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VVTESTOP_admininstr(V128_vectype, ANY_TRUE_vvtestop)], [CONST_admininstr(I32_numtype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VVTESTOP_admininstr(V128_vectype, ANY_TRUE_vvtestop)], [CONST_admininstr(I32_numtype, c)]) -- where c = $ine($vsize(V128_vectype), c_1, `%`(0)) ;; 8-reduction.watsup rule vswizzle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn : inn, N : N, c' : vec_(V128_vnn), c : iN($size((inn : inn <: numtype))), ci* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*, k^N : nat^N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) -- where c*{} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_1) :: `%`(0)^(256 - N){} -- where ci*{ci : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c_2) -- (if (ci*{ci : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))}[k].`%`.0 < |c*{}|))^(k%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vshuffle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn : inn, N : N, i* : nat*, c : vec_(V128_vnn), c' : iN($size((inn : inn <: numtype))), k^N : nat^N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((inn : inn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) -- (if (k < |i*{i : nat}|))^(k%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vsplat{lnn : lnn, c_1 : num_($lunpack(lnn)), N : N, c : vec_(V128_vnn)}: - `%*_~>%*`([CONST_admininstr($lunpack(lnn), c_1) VSPLAT_admininstr(`%X%`(lnn, `%`(N)))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([CONST_admininstr($lunpack(lnn), c_1) VSPLAT_admininstr(`%X%`(lnn, `%`(N)))], [VCONST_admininstr(V128_vectype, c)]) -- where c = $invlanes_(`%X%`(lnn, `%`(N)), $packnum(lnn, c_1)^N{}) ;; 8-reduction.watsup rule vextract_lane-num{c_1 : vec_(V128_vnn), nt : numtype, N : N, i : nat, c_2 : num_(nt)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((nt : numtype <: lanetype), `%`(N)), ?(), `%`(i))], [CONST_admininstr(nt, c_2)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((nt : numtype <: lanetype), `%`(N)), ?(), `%`(i))], [CONST_admininstr(nt, c_2)]) -- if (i < |$lanes_(`%X%`((nt : numtype <: lanetype), `%`(N)), c_1)|) -- where c_2 = $lanes_(`%X%`((nt : numtype <: lanetype), `%`(N)), c_1)[i] ;; 8-reduction.watsup rule vextract_lane-pack{c_1 : vec_(V128_vnn), pt : packtype, N : N, sx : sx, i : nat, c_2 : num_(I32_numtype)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((pt : packtype <: lanetype), `%`(N)), ?(sx), `%`(i))], [CONST_admininstr(I32_numtype, c_2)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTRACT_LANE_admininstr(`%X%`((pt : packtype <: lanetype), `%`(N)), ?(sx), `%`(i))], [CONST_admininstr(I32_numtype, c_2)]) -- if (i < |$lanes_(`%X%`((pt : packtype <: lanetype), `%`(N)), c_1)|) -- where c_2 = $ext($psize(pt), 32, sx, $lanes_(`%X%`((pt : packtype <: lanetype), `%`(N)), c_1)[i]) ;; 8-reduction.watsup rule vreplace_lane{c_1 : vec_(V128_vnn), lnn : lnn, c_2 : num_($lunpack(lnn)), N : N, i : nat, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr($lunpack(lnn), c_2) VREPLACE_LANE_admininstr(`%X%`(lnn, `%`(N)), `%`(i))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr($lunpack(lnn), c_2) VREPLACE_LANE_admininstr(`%X%`(lnn, `%`(N)), `%`(i))], [VCONST_admininstr(V128_vectype, c)]) -- where c = $invlanes_(`%X%`(lnn, `%`(N)), $lanes_(`%X%`(lnn, `%`(N)), c_1)[[i] = $packnum(lnn, c_2)]) ;; 8-reduction.watsup rule vunop{c_1 : vec_(V128_vnn), sh : shape, vunop : vunop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VUNOP_admininstr(sh, vunop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VUNOP_admininstr(sh, vunop)], [VCONST_admininstr(V128_vectype, c)]) -- where c = $vunop(sh, vunop, c_1) ;; 8-reduction.watsup rule vbinop-val{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vbinop : vbinop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [VCONST_admininstr(V128_vectype, c)]) -- where [c] = $vbinop(sh, vbinop, c_1, c_2) ;; 8-reduction.watsup rule vbinop-trap{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vbinop : vbinop_(sh)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [TRAP_admininstr]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VBINOP_admininstr(sh, vbinop)], [TRAP_admininstr]) -- if ($vbinop(sh, vbinop, c_1, c_2) = []) ;; 8-reduction.watsup rule vrelop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh : shape, vrelop : vrelop_(sh), c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VRELOP_admininstr(sh, vrelop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VRELOP_admininstr(sh, vrelop)], [VCONST_admininstr(V128_vectype, c)]) -- where c = $vrelop(sh, vrelop, c_1, c_2) ;; 8-reduction.watsup rule vshiftop{c_1 : vec_(V128_vnn), n : n, imm : imm, N : N, vshiftop : vshiftop_(`%X%`(imm, `%`(N))), c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) CONST_admininstr(I32_numtype, `%`(n)) VSHIFTOP_admininstr(`%X%`(imm, `%`(N)), vshiftop)], [VCONST_admininstr(V128_vectype, c)]) -- where c'*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c_1) -- where c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(N)), $vishiftop(`%X%`(imm, `%`(N)), vshiftop, c', `%`(n))*{c' : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))}) ;; 8-reduction.watsup rule vtestop-true{c : vec_(V128_vnn), inn : inn, N : N, ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) -- where ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c) -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), inn : inn, N : N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((inn : inn <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((inn : inn <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule vbitmask{c : vec_(V128_vnn), inn : inn, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`((inn : inn <: imm), `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) -- where ci_1*{ci_1 : lane_($lanetype(`%X%`((inn : inn <: lanetype), `%`(N))))} = $lanes_(`%X%`((inn : inn <: lanetype), `%`(N)), c) -- where $ibits(32, ci) = `%`($ilt($size((inn : inn <: numtype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($size((inn : inn <: numtype)))} ;; 8-reduction.watsup rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), inn_1 : inn, N_1 : N, inn_2 : inn, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*, cj_1* : iN($size((inn_2 : inn <: numtype)))*, cj_2* : iN($size((inn_2 : inn <: numtype)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) -- where ci_1*{ci_1 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1) -- where ci_2*{ci_2 : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_2) -- where cj_1*{cj_1 : iN($size((inn_2 : inn <: numtype)))} = $narrow($size((inn_1 : inn <: numtype)), $size((inn_2 : inn <: numtype)), sx, ci_1)*{ci_1 : iN($size((inn_1 : inn <: numtype)))} @@ -31686,195 +31725,195 @@ relation Step_pure: `%*_~>%*`(admininstr*, admininstr*) ;; 8-reduction.watsup rule vcvtop-normal{c_1 : vec_(V128_vnn), lnn_2 : lnn, N_2 : N, vcvtop : vcvtop, lnn_1 : lnn, N_1 : N, sx : sx, c : vec_(V128_vnn), c'* : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`(lnn_2, `%`(N_2)), vcvtop, ?(), `%X%`(lnn_1, `%`(N_1)), ?(sx), `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) -- where c'*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))} = $lanes_(`%X%`(lnn_1, `%`(N_1)), c_1) -- where c = $invlanes_(`%X%`(lnn_2, `%`(N_2)), $vcvtop(`%X%`(lnn_1, `%`(N_1)), `%X%`(lnn_2, `%`(N_2)), vcvtop, ?(sx), c')*{c' : lane_($lanetype(`%X%`(lnn_1, `%`(N_1))))}) ;; 8-reduction.watsup rule vcvtop-half{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, hf : half, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) -- where ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2] -- where c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))}) ;; 8-reduction.watsup rule vcvtop-zero{c_1 : vec_(V128_vnn), inn_2 : inn, N_2 : N, vcvtop : vcvtop, inn_1 : inn, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, ?(), `%X%`((inn_1 : inn <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?(())))], [VCONST_admininstr(V128_vectype, c)]) -- where ci*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), c_1) -- where c = $invlanes_(`%X%`((inn_2 : inn <: lanetype), `%`(N_2)), $vcvtop(`%X%`((inn_1 : inn <: lanetype), `%`(N_1)), `%X%`((inn_2 : inn <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((inn_1 : inn <: lanetype), `%`(N_1))))} :: `%`(0)^N_1{}) ;; 8-reduction.watsup rule vextunop{c_1 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextunop : vextunop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VEXTUNOP_admininstr(sh_1, sh_2, vextunop, sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VEXTUNOP_admininstr(sh_1, sh_2, vextunop, sx)], [VCONST_admininstr(V128_vectype, c)]) -- where c = $vextunop(sh_1, sh_2, vextunop, sx, c_1) ;; 8-reduction.watsup rule vextbinop{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), sh_1 : ishape, sh_2 : ishape, vextbinop : vextbinop_(sh_1, sh_2), sx : sx, c : vec_(V128_vnn)}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VEXTBINOP_admininstr(sh_1, sh_2, vextbinop, sx)], [VCONST_admininstr(V128_vectype, c)]) + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VEXTBINOP_admininstr(sh_1, sh_2, vextbinop, sx)], [VCONST_admininstr(V128_vectype, c)]) -- where c = $vextbinop(sh_1, sh_2, vextbinop, sx, c_1, c_2) ;; 8-reduction.watsup rule local.tee{val : val, x : idx}: - `%*_~>%*`([(val : val <: admininstr) LOCAL.TEE_admininstr(x)], [(val : val <: admininstr) (val : val <: admininstr) LOCAL.SET_admininstr(x)]) + `%~>%`([(val : val <: admininstr) LOCAL.TEE_admininstr(x)], [(val : val <: admininstr) (val : val <: admininstr) LOCAL.SET_admininstr(x)]) ;; 8-reduction.watsup def $blocktype(state : state, blocktype : blocktype) : functype ;; 8-reduction.watsup - def $blocktype{z : state}(z, _RESULT_blocktype(?())) = `%->%`([], []) + def $blocktype{z : state}(z, _RESULT_blocktype(?())) = `%->%`(`%`([]), `%`([])) ;; 8-reduction.watsup - def $blocktype{z : state, t : valtype}(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) + def $blocktype{z : state, t : valtype}(z, _RESULT_blocktype(?(t))) = `%->%`(`%`([]), `%`([t])) ;; 8-reduction.watsup def $blocktype{z : state, x : idx, ft : functype}(z, _IDX_blocktype(x)) = ft -- where FUNC_comptype(ft) = $expanddt($type(z, x)) ;; 8-reduction.watsup -relation Step_read: `%~>%*`(config, admininstr*) +relation Step_read: `%~>%`(config, admininstr*) ;; 8-reduction.watsup rule block{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, n : n, t_1^k : valtype^k, t_2^n : valtype^n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) - -- where `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype}) = $blocktype(z, bt) + `%~>%`(`%;%`(z, (val : val <: admininstr)^k{val : val} :: [BLOCK_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(n, [], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- where `%->%`(`%`(t_1^k{t_1 : valtype}), `%`(t_2^n{t_2 : valtype})) = $blocktype(z, bt) ;; 8-reduction.watsup rule loop{z : state, val^k : val^k, k : nat, bt : blocktype, instr* : instr*, t_1^k : valtype^k, t_2^n : valtype^n, n : n}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) - -- where `%->%`(t_1^k{t_1 : valtype}, t_2^n{t_2 : valtype}) = $blocktype(z, bt) + `%~>%`(`%;%`(z, (val : val <: admininstr)^k{val : val} :: [LOOP_admininstr(bt, instr*{instr : instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr : instr})], (val : val <: admininstr)^k{val : val} :: (instr : instr <: admininstr)*{instr : instr})]) + -- where `%->%`(`%`(t_1^k{t_1 : valtype}), `%`(t_2^n{t_2 : valtype})) = $blocktype(z, bt) ;; 8-reduction.watsup rule br_on_cast-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt) -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) ;; 8-reduction.watsup rule br_on_cast-fail{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) -- otherwise ;; 8-reduction.watsup rule br_on_cast_fail-succeed{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt) -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) ;; 8-reduction.watsup rule br_on_cast_fail-fail{z : state, ref : ref, l : labelidx, rt_1 : reftype, rt_2 : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref : ref <: admininstr) BR_admininstr(l)]) -- otherwise ;; 8-reduction.watsup rule call{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) CALL_REF_admininstr(?())]) + `%~>%`(`%;%`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) CALL_REF_admininstr(?())]) -- if (x.`%`.0 < |$funcaddr(z)|) ;; 8-reduction.watsup rule call_ref-null{z : state, ht : heaptype, x? : idx?}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x : typeidx})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule call_ref-func{z : state, val^n : val^n, n : n, a : addr, x? : idx?, m : m, f : frame, instr* : instr*, fi : funcinst, t_1^n : valtype^n, t_2^m : valtype^m, y : idx, t* : valtype*}: - `%~>%*`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr : instr <: admininstr)*{instr : instr})])]) -- if (a < |$funcinst(z)|) -- where fi = $funcinst(z)[a] - -- where `FUNC%%*%`(y, LOCAL(t)*{t : valtype}, instr*{instr : instr}) = fi.CODE_funcinst - -- where FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype})) = $expanddt(fi.TYPE_funcinst) + -- where FUNC(y, LOCAL(t)*{t : valtype}, instr*{instr : instr}) = fi.CODE_funcinst + -- where FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2^m{t_2 : valtype}))) = $expanddt(fi.TYPE_funcinst) -- where f = {LOCAL ?(val)^n{val : val} :: $default(t)*{t : valtype}, MODULE fi.MODULE_funcinst} ;; 8-reduction.watsup rule return_call{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) RETURN_CALL_REF_admininstr(?())]) + `%~>%`(`%;%`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0]) RETURN_CALL_REF_admininstr(?())]) -- if (x.`%`.0 < |$funcaddr(z)|) ;; 8-reduction.watsup rule return_call_ref-label{z : state, k : nat, instr'* : instr*, val* : val*, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) + `%~>%`(`%;%`(z, [LABEL__admininstr(k, instr'*{instr' : instr}, (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)*{val : val} :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})]) ;; 8-reduction.watsup rule return_call_ref-frame-addr{z : state, k : nat, f : frame, val'* : val*, val^n : val^n, n : n, a : addr, x? : idx?, instr* : instr*, t_1^n : valtype^n, t_2^m : valtype^m, m : m}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) + `%~>%`(`%;%`(z, [FRAME__admininstr(k, f, (val' : val <: admininstr)*{val' : val} :: (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x : typeidx})]) -- if (a < |$funcinst(z)|) - -- where FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2^m{t_2 : valtype})) = $expanddt($funcinst(z)[a].TYPE_funcinst) + -- where FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2^m{t_2 : valtype}))) = $expanddt($funcinst(z)[a].TYPE_funcinst) ;; 8-reduction.watsup rule return_call_ref-frame-null{z : state, k : nat, f : frame, val* : val*, ht : heaptype, x? : idx?, instr* : instr*}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [FRAME__admininstr(k, f, (val : val <: admininstr)*{val : val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x : typeidx})] :: (instr : instr <: admininstr)*{instr : instr})]), [TRAP_admininstr]) ;; 8-reduction.watsup rule ref.func{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0])]) + `%~>%`(`%;%`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x.`%`.0])]) -- if (x.`%`.0 < |$funcaddr(z)|) ;; 8-reduction.watsup rule ref.test-true{z : state, ref : ref, rt : reftype, rt' : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(1))]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(1))]) -- Ref_ok: `%|-%:%`($store(z), ref, rt') -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) ;; 8-reduction.watsup rule ref.test-false{z : state, ref : ref, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(0))]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup rule ref.cast-succeed{z : state, ref : ref, rt : reftype, rt' : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [(ref : ref <: admininstr)]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [(ref : ref <: admininstr)]) -- Ref_ok: `%|-%:%`($store(z), ref, rt') -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) ;; 8-reduction.watsup rule ref.cast-fail{z : state, ref : ref, rt : reftype}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) -- otherwise ;; 8-reduction.watsup rule struct.new_default{z : state, x : idx, val* : val*, mut* : mut*, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) - -- where STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype}) = $expanddt($type(z, x)) + `%~>%`(`%;%`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)*{val : val} :: [STRUCT.NEW_admininstr(x)]) + -- where STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype})) = $expanddt($type(z, x)) -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) -- (where ?(val) = $default($unpack(zt)))*{val : val zt : storagetype} -- if (|val*{val : val}| = |zt*{zt : storagetype}|) ;; 8-reduction.watsup rule struct.get-null{z : state, ht : heaptype, sx? : sx?, x : idx, i : nat}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [TRAP_admininstr]) ;; 8-reduction.watsup rule struct.get-struct{z : state, a : addr, sx? : sx?, x : idx, i : nat, zt* : storagetype*, si : structinst, mut* : mut*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) + `%~>%`(`%;%`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx : sx}, x, `%`(i))]), [($unpackval(zt*{zt : storagetype}[i], sx?{sx : sx}, si.FIELD_structinst[i]) : val <: admininstr)]) -- if (a < |$structinst(z)|) -- where si = $structinst(z)[a] -- if (i < |si.FIELD_structinst|) - -- where STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype}) = $expanddt(si.TYPE_structinst) + -- where STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype})) = $expanddt(si.TYPE_structinst) -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) -- if (i < |zt*{zt : storagetype}|) ;; 8-reduction.watsup rule array.new{z : state, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [(val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [(val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) ;; 8-reduction.watsup rule array.new_default{z : state, n : n, x : idx, val : val, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DEFAULT_admininstr(x)]), (val : val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt($type(z, x)) -- where ?(val) = $default($unpack(zt)) ;; 8-reduction.watsup rule array.new_elem-oob{z : state, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) ;; 8-reduction.watsup rule array.new_elem-alloc{z : state, i : nat, n : n, x : idx, y : idx, ref^n : ref^n}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref : ref <: admininstr)^n{ref : ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- where ref^n{ref : ref} = $elem(z, y).ELEM_eleminst[i : n] ;; 8-reduction.watsup rule array.new_data-oob{z : state, i : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt($type(z, x)) -- if ((i + ((n * $zsize(zt)) / 8)) > |$data(z, y).DATA_datainst|) ;; 8-reduction.watsup rule array.new_data-num{z : state, i : nat, n : n, x : idx, y : idx, nt : numtype, c^n : num_(nt)^n, mut : mut, zt : storagetype, o0 : numtype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c : num_(nt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt($type(z, x)) -- where ?(o0) = $nunpack(zt) -- where nt = o0 @@ -31882,7 +31921,7 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.new_data-vec{z : state, i : nat, n : n, x : idx, y : idx, vt : vectype, c^n : vec_(vt)^n, mut : mut, zt : storagetype, o0 : vectype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.NEW_DATA_admininstr(x, y)]), VCONST_admininstr(vt, c)^n{c : vec_(vt)} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt($type(z, x)) -- where ?(o0) = $vunpack(zt) -- where vt = o0 @@ -31890,17 +31929,17 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.get-null{z : state, ht : heaptype, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.get-oob{z : state, a : addr, i : nat, sx? : sx?, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [TRAP_admininstr]) -- if (a < |$arrayinst(z)|) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.get-array{z : state, a : addr, i : nat, sx? : sx?, x : idx, zt : storagetype, fv : fieldval, mut : mut}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) ARRAY.GET_admininstr(sx?{sx : sx}, x)]), [($unpackval(zt, sx?{sx : sx}, fv) : val <: admininstr)]) -- if (i < |$arrayinst(z)[a].FIELD_arrayinst|) -- if (a < |$arrayinst(z)|) -- where fv = $arrayinst(z)[a].FIELD_arrayinst[i] @@ -31908,64 +31947,64 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.len-null{z : state, ht : heaptype}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.len-array{z : state, a : addr, n : n}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, `%`(n))]) -- if (a < |$arrayinst(z)|) -- where n = |$arrayinst(z)[a].FIELD_arrayinst| ;; 8-reduction.watsup rule array.fill-null{z : state, ht : heaptype, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.fill-oob{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) -- if (a < |$arrayinst(z)|) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.fill-zero{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.fill-succ{z : state, a : addr, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule array.copy-null1{z : state, ht_1 : heaptype, i_1 : nat, ref : ref, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, `%`(i_1)) (ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, `%`(i_1)) (ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.copy-null2{z : state, ref : ref, i_1 : nat, ht_2 : heaptype, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_1)) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(i_1)) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.copy-oob1{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if (a_1 < |$arrayinst(z)|) -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.copy-oob2{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if (a_2 < |$arrayinst(z)|) -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.copy-zero{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.copy-le{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- if (i_1 <= i_2) -- where ARRAY_comptype(`%%`(mut, zt_2)) = $expanddt($type(z, x_2)) @@ -31973,64 +32012,64 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.copy-gt{z : state, a_1 : addr, i_1 : nat, a_2 : addr, i_2 : nat, n : n, x_1 : idx, x_2 : idx, sx? : sx?, mut : mut, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) ARRAY.GET_admininstr(sx?{sx : sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, `%`(i_1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise -- where ARRAY_comptype(`%%`(mut, zt_2)) = $expanddt($type(z, x_2)) -- where sx?{sx : sx} = $sxfield(zt_2) ;; 8-reduction.watsup rule array.init_elem-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.init_elem-oob1{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if (a < |$arrayinst(z)|) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.init_elem-oob2{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) ;; 8-reduction.watsup rule array.init_elem-zero{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.init_elem-succ{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, ref : ref}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_ELEM_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_ELEM_admininstr(x, y)]) -- otherwise -- if (j < |$elem(z, y).ELEM_eleminst|) -- where ref = $elem(z, y).ELEM_eleminst[j] ;; 8-reduction.watsup rule array.init_data-null{z : state, ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) ;; 8-reduction.watsup rule array.init_data-oob1{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- if (a < |$arrayinst(z)|) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.init_data-oob2{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, mut : mut, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt($type(z, x)) -- if ((j + ((n * $zsize(zt)) / 8)) > |$data(z, y).DATA_datainst|) ;; 8-reduction.watsup rule array.init_data-zero{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule array.init_data-num{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, nt : numtype, c : num_(nt), zt : storagetype, mut : mut, o0 : numtype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) -- otherwise -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt($type(z, x)) -- where ?(o0) = $nunpack(zt) @@ -32039,7 +32078,7 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule array.init_data-num{z : state, a : addr, i : nat, j : nat, n : n, x : idx, y : idx, vt : vectype, c : vec_(vt), zt : storagetype, mut : mut, o0 : vectype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(n)) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((j + ($zsize(zt) / 8)))) CONST_admininstr(I32_numtype, `%`((n - 1))) ARRAY.INIT_DATA_admininstr(x, y)]) -- otherwise -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt($type(z, x)) -- where $vbytes(vt, c) = $data(z, y).DATA_datainst[j : ($zsize(zt) / 8)] @@ -32048,143 +32087,143 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule local.get{z : state, x : idx, val : val}: - `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [(val : val <: admininstr)]) + `%~>%`(`%;%`(z, [LOCAL.GET_admininstr(x)]), [(val : val <: admininstr)]) -- where ?(val) = $local(z, x) ;; 8-reduction.watsup rule global.get{z : state, x : idx}: - `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst : val <: admininstr)]) + `%~>%`(`%;%`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst : val <: admininstr)]) ;; 8-reduction.watsup rule table.get-oob{z : state, i : nat, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) -- if (i >= |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.get-val{z : state, i : nat, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] : ref <: admininstr)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] : ref <: admininstr)]) -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.size{z : state, x : idx, n : n}: - `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) -- where n = |$table(z, x).ELEM_tableinst| ;; 8-reduction.watsup rule table.fill-oob{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.fill-zero{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.fill-succ{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule table.copy-oob-0{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$table(z, y).ELEM_tableinst|) ;; 8-reduction.watsup rule table.copy-oob-1{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) -- if ((j + n) > |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.copy-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.copy-le{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) -- otherwise -- if (j <= i) ;; 8-reduction.watsup rule table.copy-gt{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(((j + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i + n) - 1))) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(((j + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i + n) - 1))) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.COPY_admininstr(x, y)]) -- otherwise ;; 8-reduction.watsup rule table.init-oob-0{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) ;; 8-reduction.watsup rule table.init-oob-1{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) -- if ((j + n) > |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.init-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule table.init-succ{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) ($elem(z, y).ELEM_eleminst[i] : ref <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.INIT_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) ($elem(z, y).ELEM_eleminst[i] : ref <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) TABLE.INIT_admininstr(x, y)]) -- otherwise -- if (i < |$elem(z, y).ELEM_eleminst|) ;; 8-reduction.watsup rule load-num-oob{z : state, i : nat, nt : numtype, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ($size(nt) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule load-num-val{z : state, i : nat, nt : numtype, x : idx, mo : memop, c : num_(nt)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) -- where $nbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : ($size(nt) / 8)] ;; 8-reduction.watsup rule load-pack-oob{z : state, i : nat, inn : inn, n : n, sx : sx, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (n / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule load-pack-val{z : state, i : nat, inn : inn, n : n, sx : sx, x : idx, mo : memop, c : iN(n)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [CONST_admininstr((inn : inn <: numtype), $ext(n, $size((inn : inn <: numtype)), sx, c))]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [CONST_admininstr((inn : inn <: numtype), $ext(n, $size((inn : inn <: numtype)), sx, c))]) -- where $ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (n / 8)] ;; 8-reduction.watsup rule vload-oob{z : state, i : nat, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ($vsize(V128_vectype) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-val{z : state, i : nat, x : idx, mo : memop, c : vec_(V128_vnn)}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- where $vbytes(V128_vectype, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : ($vsize(V128_vectype) / 8)] ;; 8-reduction.watsup rule vload-shape-oob{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + ((M * N) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-shape-val{z : state, i : nat, M : M, N : N, sx : sx, x : idx, mo : memop, c : vec_(V128_vnn), j^N : nat^N, k^N : nat^N, inn : inn}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- where $size((inn : inn <: numtype)) = (M * 2) -- (where $ibytes(M, `%`(j)) = $mem(z, x).DATA_meminst[((i + mo.OFFSET_memop.`%`.0) + ((k * M) / 8)) : (M / 8)])^(k%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-splat-val{z : state, i : nat, N : N, x : idx, mo : memop, c : vec_(V128_vnn), j : nat, imm : imm, M : M}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(SPLAT_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- where M = (128 / N) -- where $lsize((imm : imm <: lanetype)) = N -- where $ibytes(N, `%`(j)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)] @@ -32192,23 +32231,23 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule vload-zero-oob{z : state, i : nat, N : N, x : idx, mo : memop}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload-zero-val{z : state, i : nat, N : N, x : idx, mo : memop, c : vec_(V128_vnn), j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VLOAD_admininstr(?(ZERO_vloadop(N)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) -- where $ibytes(N, `%`(j)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)] -- where c = $ext(N, 128, U_sx, `%`(j)) ;; 8-reduction.watsup rule vload_lane-oob{z : state, i : nat, vt : vectype, c_1 : vec_(vt), N : N, x : idx, mo : memop, j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [TRAP_admininstr]) -- if (((i + mo.OFFSET_memop.`%`.0) + (N / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vload_lane-val{z : state, i : nat, vt : vectype, c_1 : vec_(vt), N : N, x : idx, mo : memop, j : nat, c : vec_(vt), k : nat, imm : imm, M : M}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(vt, c)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(vt, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(vt, c)]) -- where M = ($vsize(vt) / N) -- where $lsize((imm : imm <: lanetype)) = N -- where $ibytes(N, `%`(k)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)] @@ -32216,71 +32255,71 @@ relation Step_read: `%~>%*`(config, admininstr*) ;; 8-reduction.watsup rule memory.size{z : state, x : idx, n : n}: - `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) + `%~>%`(`%;%`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(n))]) -- where ((n * 64) * $Ki) = |$mem(z, x).DATA_meminst| ;; 8-reduction.watsup rule memory.fill-oob{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule memory.fill-zero{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.fill-succ{z : state, i : nat, val : val, n : n, x : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.FILL_admininstr(x)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((i + 1))) (val : val <: admininstr) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.FILL_admininstr(x)]) -- otherwise ;; 8-reduction.watsup rule memory.copy-oob-0{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if ((i_1 + n) > |$mem(z, x_1).DATA_meminst|) ;; 8-reduction.watsup rule memory.copy-oob-1{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) -- if ((i_2 + n) > |$mem(z, x_2).DATA_meminst|) ;; 8-reduction.watsup rule memory.copy-zero{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.copy-le{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`((i_1 + 1))) CONST_admininstr(I32_numtype, `%`((i_2 + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise -- if (i_1 <= i_2) ;; 8-reduction.watsup rule memory.copy-gt{z : state, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, `%`(((i_1 + n) - 1))) CONST_admininstr(I32_numtype, `%`(((i_2 + n) - 1))) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, `%`(i_1)) CONST_admininstr(I32_numtype, `%`(i_2)) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise ;; 8-reduction.watsup rule memory.init-oob-0{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$data(z, y).DATA_datainst|) ;; 8-reduction.watsup rule memory.init-oob-1{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) -- if ((j + n) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule memory.init-zero{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), []) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), []) -- otherwise -- if (n = 0) ;; 8-reduction.watsup rule memory.init-succ{z : state, j : nat, i : nat, n : n, x : idx, y : idx}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`($data(z, y).DATA_datainst[i].`%`.0)) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.INIT_admininstr(x, y)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(I32_numtype, `%`(n)) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, `%`(j)) CONST_admininstr(I32_numtype, `%`($data(z, y).DATA_datainst[i].`%`.0)) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, `%`((j + 1))) CONST_admininstr(I32_numtype, `%`((i + 1))) CONST_admininstr(I32_numtype, `%`((n - 1))) MEMORY.INIT_admininstr(x, y)]) -- otherwise -- if (i < |$data(z, y).DATA_datainst|) @@ -32288,126 +32327,126 @@ relation Step_read: `%~>%*`(config, admininstr*) relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule pure{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) - -- Step_pure: `%*_~>%*`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_pure: `%~>%`((instr : instr <: admininstr)*{instr : instr}, (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule read{z : state, instr* : instr*, instr'* : instr*}: - `%~>%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z, (instr' : instr <: admininstr)*{instr' : instr})) - -- Step_read: `%~>%*`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) + `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z, (instr' : instr <: admininstr)*{instr' : instr})) + -- Step_read: `%~>%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), (instr' : instr <: admininstr)*{instr' : instr}) ;; 8-reduction.watsup rule struct.new{z : state, val^n : val^n, n : n, x : idx, si : structinst, mut^n : mut^n, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- where STRUCT_comptype(`%%`(mut, zt)^n{mut : mut zt : storagetype}) = $expanddt($type(z, x)) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [STRUCT.NEW_admininstr(x)]), `%;%`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- where STRUCT_comptype(`%`(`%%`(mut, zt)^n{mut : mut zt : storagetype})) = $expanddt($type(z, x)) -- where si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val zt : storagetype}} ;; 8-reduction.watsup rule struct.set-null{z : state, ht : heaptype, val : val, x : idx, i : nat}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%`(z, [TRAP_admininstr])) ;; 8-reduction.watsup rule struct.set-struct{z : state, a : addr, val : val, x : idx, i : nat, fv : fieldval, mut* : mut*, zt* : storagetype*}: - `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%*`($with_struct(z, a, i, fv), [])) + `%~>%`(`%;%`(z, [REF.STRUCT_ADDR_admininstr(a) (val : val <: admininstr) STRUCT.SET_admininstr(x, `%`(i))]), `%;%`($with_struct(z, a, i, fv), [])) -- if (a < |$structinst(z)|) - -- where STRUCT_comptype(`%%`(mut, zt)*{mut : mut zt : storagetype}) = $expanddt($structinst(z)[a].TYPE_structinst) + -- where STRUCT_comptype(`%`(`%%`(mut, zt)*{mut : mut zt : storagetype})) = $expanddt($structinst(z)[a].TYPE_structinst) -- if (|mut*{mut : mut}| = |zt*{zt : storagetype}|) -- if (i < |zt*{zt : storagetype}|) -- where fv = $packval(zt*{zt : storagetype}[i], val) ;; 8-reduction.watsup rule array.new_fixed{z : state, val^n : val^n, n : n, x : idx, ai : arrayinst, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + `%~>%`(`%;%`(z, (val : val <: admininstr)^n{val : val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt($type(z, x)) -- where ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val : val}} ;; 8-reduction.watsup rule array.set-null{z : state, ht : heaptype, i : nat, val : val, x : idx}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) ;; 8-reduction.watsup rule array.set-oob{z : state, a : addr, i : nat, val : val, x : idx}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) -- if (a < |$arrayinst(z)|) -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) ;; 8-reduction.watsup rule array.set-array{z : state, a : addr, i : nat, val : val, x : idx, fv : fieldval, mut : mut, zt : storagetype}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) + `%~>%`(`%;%`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, `%`(i)) (val : val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%`($with_array(z, a, i, fv), [])) -- if (a < |$arrayinst(z)|) -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt($arrayinst(z)[a].TYPE_arrayinst) -- where fv = $packval(zt, val) ;; 8-reduction.watsup rule local.set{z : state, val : val, x : idx}: - `%~>%`(`%;%*`(z, [(val : val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) + `%~>%`(`%;%`(z, [(val : val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%`($with_local(z, x, val), [])) ;; 8-reduction.watsup rule global.set{z : state, val : val, x : idx}: - `%~>%`(`%;%*`(z, [(val : val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) + `%~>%`(`%;%`(z, [(val : val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%`($with_global(z, x, val), [])) ;; 8-reduction.watsup rule table.set-oob{z : state, i : nat, ref : ref, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.set-val{z : state, i : nat, ref : ref, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) (ref : ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%`($with_table(z, x, i, ref), [])) -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup rule table.grow-succeed{z : state, ref : ref, n : n, x : idx, ti : tableinst, o0 : tableinst}: - `%~>%`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, `%`(|$table(z, x).ELEM_tableinst|))])) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, `%`(|$table(z, x).ELEM_tableinst|))])) -- where ?(o0) = $growtable($table(z, x), n, ref) -- where ti = o0 ;; 8-reduction.watsup rule table.grow-fail{z : state, ref : ref, n : n, x : idx}: - `%~>%`(`%;%*`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) + `%~>%`(`%;%`(z, [(ref : ref <: admininstr) CONST_admininstr(I32_numtype, `%`(n)) TABLE.GROW_admininstr(x)]), `%;%`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) ;; 8-reduction.watsup rule elem.drop{z : state, x : idx}: - `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) + `%~>%`(`%;%`(z, [ELEM.DROP_admininstr(x)]), `%;%`($with_elem(z, x, []), [])) ;; 8-reduction.watsup rule store-num-oob{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + ($size(nt) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule store-num-val{z : state, i : nat, nt : numtype, c : num_(nt), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($size(nt) / 8), b*{b : byte}), [])) -- where b*{b : byte} = $nbytes(nt, c) ;; 8-reduction.watsup rule store-pack-oob{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + (n / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule store-pack-val{z : state, i : nat, inn : inn, c : num_((inn : inn <: numtype)), nt : numtype, n : n, x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) CONST_admininstr((inn : inn <: numtype), c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (n / 8), b*{b : byte}), [])) -- where b*{b : byte} = $ibytes(n, $wrap($size((inn : inn <: numtype)), n, c)) ;; 8-reduction.watsup rule vstore-oob{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + ($vsize(V128_vectype) / 8)) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vstore-val{z : state, i : nat, c : vec_(V128_vnn), x : idx, mo : memop, b* : byte*}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), ($vsize(V128_vectype) / 8), b*{b : byte}), [])) -- where b*{b : byte} = $vbytes(V128_vectype, c) ;; 8-reduction.watsup rule vstore_lane-oob{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`(z, [TRAP_admininstr])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%`(z, [TRAP_admininstr])) -- if (((i + mo.OFFSET_memop.`%`.0) + N) > |$mem(z, x).DATA_meminst|) ;; 8-reduction.watsup rule vstore_lane-val{z : state, i : nat, c : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, b* : byte*, imm : imm, M : M}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c) VSTORE_LANE_admininstr(N, x, mo, `%`(j))]), `%;%`($with_mem(z, x, (i + mo.OFFSET_memop.`%`.0), (N / 8), b*{b : byte}), [])) -- where M = (128 / N) -- where $lsize((imm : imm <: lanetype)) = N -- if (j < |$lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)|) @@ -32415,17 +32454,17 @@ relation Step: `%~>%`(config, config) ;; 8-reduction.watsup rule memory.grow-succeed{z : state, n : n, x : idx, mi : meminst, o0 : meminst}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, `%`((|$mem(z, x).DATA_meminst| / (64 * $Ki))))])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, `%`((|$mem(z, x).DATA_meminst| / (64 * $Ki))))])) -- where ?(o0) = $growmemory($mem(z, x), n) -- where mi = o0 ;; 8-reduction.watsup rule memory.grow-fail{z : state, n : n, x : idx}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(n)) MEMORY.GROW_admininstr(x)]), `%;%`(z, [CONST_admininstr(I32_numtype, `%`($invsigned(32, - (1 : nat <: int))))])) ;; 8-reduction.watsup rule data.drop{z : state, x : idx}: - `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) + `%~>%`(`%;%`(z, [DATA.DROP_admininstr(x)]), `%;%`($with_data(z, x, []), [])) ;; 8-reduction.watsup rec { @@ -32434,21 +32473,21 @@ rec { relation Steps: `%~>*%`(config, config) ;; 8-reduction.watsup:18.1-19.36 rule refl{z : state, admininstr* : admininstr*}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z, admininstr*{admininstr : admininstr})) + `%~>*%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z, admininstr*{admininstr : admininstr})) ;; 8-reduction.watsup:21.1-24.53 rule trans{z : state, admininstr* : admininstr*, z'' : state, admininstr''* : admininstr*, z' : state, admininstr' : admininstr}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) - -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr : admininstr}), `%;%*`(z', admininstr'*{})) - -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr'' : admininstr})) + `%~>*%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z'', admininstr''*{admininstr'' : admininstr})) + -- Step: `%~>%`(`%;%`(z, admininstr*{admininstr : admininstr}), `%;%`(z', admininstr'*{})) + -- Steps: `%~>*%`(`%;%`(z', [admininstr']), `%;%`(z'', admininstr''*{admininstr'' : admininstr})) } ;; 8-reduction.watsup -relation Eval_expr: `%;%~>*%;%*`(state, expr, state, val*) +relation Eval_expr: `%;%~>*%;%`(state, expr, state, val*) ;; 8-reduction.watsup rule _{z : state, instr* : instr*, z' : state, val* : val*}: - `%;%~>*%;%*`(z, instr*{instr : instr}, z', val*{val : val}) - -- Steps: `%~>*%`(`%;%*`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%*`(z', (val : val <: admininstr)*{val : val})) + `%;%~>*%;%`(z, instr*{instr : instr}, z', val*{val : val}) + -- Steps: `%~>*%`(`%;%`(z, (instr : instr <: admininstr)*{instr : instr}), `%;%`(z', (val : val <: admininstr)*{val : val})) ;; 9-module.watsup rec { @@ -32469,7 +32508,7 @@ def $alloctypes(type*) : deftype* def $allocfunc(store : store, moduleinst : moduleinst, func : func) : (store, funcaddr) ;; 9-module.watsup def $allocfunc{s : store, mm : moduleinst, func : func, fi : funcinst, x : idx, local* : local*, expr : expr}(s, mm, func) = (s[FUNC_store =.. [fi]], |s.FUNC_store|) - -- where `FUNC%%*%`(x, local*{local : local}, expr) = func + -- where FUNC(x, local*{local : local}, expr) = func -- where fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func} ;; 9-module.watsup @@ -32599,7 +32638,7 @@ def $allocmodule(store : store, module : module, externval*, val*, ref*, ref**) -- where ga_ex*{ga_ex : globaladdr} = $globalsxv(externval*{externval : externval}) -- where ma_ex*{ma_ex : memaddr} = $memsxv(externval*{externval : externval}) -- where ta_ex*{ta_ex : tableaddr} = $tablesxv(externval*{externval : externval}) - -- where `MODULE%*%*%*%*%*%*%*%*%*%*`(type*{type : type}, import*{import : import}, func^n_f{func : func}, GLOBAL(globaltype, expr_g)^n_g{expr_g : expr globaltype : globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t : expr tabletype : tabletype}, MEMORY(memtype)^n_m{memtype : memtype}, `ELEM%%*%`(reftype, expr_e*{expr_e : expr}, elemmode)^n_e{elemmode : elemmode expr_e : expr reftype : reftype}, `DATA%*%`(byte*{byte : byte}, datamode)^n_d{byte : byte datamode : datamode}, start?{start : start}, export*{export : export}) = module + -- where MODULE(type*{type : type}, import*{import : import}, func^n_f{func : func}, GLOBAL(globaltype, expr_g)^n_g{expr_g : expr globaltype : globaltype}, TABLE(tabletype, expr_t)^n_t{expr_t : expr tabletype : tabletype}, MEMORY(memtype)^n_m{memtype : memtype}, ELEM(reftype, expr_e*{expr_e : expr}, elemmode)^n_e{elemmode : elemmode expr_e : expr reftype : reftype}, DATA(byte*{byte : byte}, datamode)^n_d{byte : byte datamode : datamode}, start?{start : start}, export*{export : export}) = module -- where dt*{dt : deftype} = $alloctypes(type*{type : type}) -- where fa*{fa : funcaddr} = (|s.FUNC_store| + i_f)^(i_f*%;%*`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} - -- (Eval_expr: `%;%~>*%;%*`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} + -- (Eval_expr: `%;%~>*%;%`(z, expr_G, z, [val_G]))*{expr_G : expr val_G : val} + -- (Eval_expr: `%;%~>*%;%`(z, expr_T, z, [(ref_T : ref <: val)]))*{expr_T : expr ref_T : ref} + -- (Eval_expr: `%;%~>*%;%`(z, expr_E, z, [(ref_E : ref <: val)]))*{expr_E : expr ref_E : ref}*{expr_E : expr ref_E : ref} -- where (s', mm) = $allocmodule(s, module, externval*{externval : externval}, val_G*{val_G : val}, ref_T*{ref_T : ref}, ref_E*{ref_E : ref}*{ref_E : ref}) -- where f = {LOCAL [], MODULE mm} ;; 9-module.watsup def $invoke(store : store, funcaddr : funcaddr, val*) : config ;; 9-module.watsup - def $invoke{s : store, fa : funcaddr, val^n : val^n, n : n, f : frame, x : idx, local* : local*, expr : expr, t_1^n : valtype^n, t_2* : valtype*}(s, fa, val^n{val : val}) = `%;%*`(`%;%`(s, f), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(fa) CALL_REF_admininstr(?(`%`(0)))]) + def $invoke{s : store, fa : funcaddr, val^n : val^n, n : n, f : frame, x : idx, local* : local*, expr : expr, t_1^n : valtype^n, t_2* : valtype*}(s, fa, val^n{val : val}) = `%;%`(`%;%`(s, f), (val : val <: admininstr)^n{val : val} :: [REF.FUNC_ADDR_admininstr(fa) CALL_REF_admininstr(?(`%`(0)))]) -- where f = {LOCAL [], MODULE {TYPE [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], EXPORT []}} - -- where FUNC_comptype(`%->%`(t_1^n{t_1 : valtype}, t_2*{t_2 : valtype})) = $expanddt(s.FUNC_store[fa].TYPE_funcinst) - -- where `FUNC%%*%`(x, local*{local : local}, expr) = $funcinst(`%;%`(s, f))[fa].CODE_funcinst - -;; A-binary.watsup -rec { - -;; A-binary.watsup:49.1-49.24 -def $utf8(name : name) : byte* - ;; A-binary.watsup:50.1-50.47 - def $utf8{ch : nat, b : byte}([`%`(ch)]) = [b] - -- if (ch < 128) - -- where b.`%`.0 = ch - ;; A-binary.watsup:51.1-51.96 - def $utf8{ch : nat, b_1 : byte, b_2 : byte}([`%`(ch)]) = [b_1 b_2] - -- if (128 <= ch) - -- if (ch < 2048) - -- where (((2 ^ 6) * (b_1.`%`.0 - 192)) + (b_2.`%`.0 - 128)) = ch - ;; A-binary.watsup:52.1-52.148 - def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte}([`%`(ch)]) = [b_1 b_2 b_3] - -- if (((2048 <= ch) /\ (ch < 55296)) \/ ((57344 <= ch) /\ (ch < 65536))) - -- where ((((2 ^ 12) * (b_1.`%`.0 - 224)) + ((2 ^ 6) * (b_2.`%`.0 - 128))) + (b_3.`%`.0 - 128)) = ch - ;; A-binary.watsup:53.1-53.148 - def $utf8{ch : nat, b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte}([`%`(ch)]) = [b_1 b_2 b_3 b_4] - -- if (65536 <= ch) - -- if (ch < 69632) - -- where (((((2 ^ 18) * (b_1.`%`.0 - 240)) + ((2 ^ 12) * (b_2.`%`.0 - 128))) + ((2 ^ 6) * (b_3.`%`.0 - 128))) + (b_4.`%`.0 - 128)) = ch - ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(`%`(ch)*{ch : nat}) = $concat_(syntax byte, $utf8([`%`(ch)])*{ch : nat}) -} + -- where FUNC_comptype(`%->%`(`%`(t_1^n{t_1 : valtype}), `%`(t_2*{t_2 : valtype}))) = $expanddt(s.FUNC_store[fa].TYPE_funcinst) + -- where FUNC(x, local*{local : local}, expr) = $funcinst(`%;%`(s, f))[fa].CODE_funcinst ;; A-binary.watsup syntax castop = (nul, nul) @@ -32764,10 +32776,10 @@ $ (cd ../test-middlend; ../src/exe-watsup/main.exe test.watsup -l --print-all-il relation HasSize: `%|-%`(nat, nat) ;; test.watsup -relation TestNestedIter: `*_*%*_|-_*%*`(nat***, nat**) +relation TestNestedIter: `%|-%`(nat***, nat**) ;; test.watsup rule _{n**+ : nat**+, m*+ : nat*+}: - `*_*%*_|-_*%*`(n*{n : nat}*{n : nat}+{n : nat}, m*{m : nat}+{m : nat}) + `%|-%`(n*{n : nat}*{n : nat}+{n : nat}, m*{m : nat}+{m : nat}) -- (if (|n*{n : nat}| = m))*{m : nat n : nat}+{m : nat n : nat} == IL Validation... @@ -32777,10 +32789,10 @@ relation TestNestedIter: `*_*%*_|-_*%*`(nat***, nat**) relation HasSize: `%|-%`(nat, nat) ;; test.watsup -relation TestNestedIter: `*_*%*_|-_*%*`(nat***, nat**) +relation TestNestedIter: `%|-%`(nat***, nat**) ;; test.watsup rule _{n**+ : nat**+, m*+ : nat*+}: - `*_*%*_|-_*%*`(n*{n : nat}*{n : nat}+{n : nat}, m*{m : nat}+{m : nat}) + `%|-%`(n*{n : nat}*{n : nat}+{n : nat}, m*{m : nat}+{m : nat}) -- (if (|n*{n : nat}| = m))*{m : nat n : nat}+{m : nat n : nat} == IL Validation after pass totalize... @@ -32790,10 +32802,10 @@ relation TestNestedIter: `*_*%*_|-_*%*`(nat***, nat**) relation HasSize: `%|-%`(nat, nat) ;; test.watsup -relation TestNestedIter: `*_*%*_|-_*%*`(nat***, nat**) +relation TestNestedIter: `%|-%`(nat***, nat**) ;; test.watsup rule _{n**+ : nat**+, m*+ : nat*+}: - `*_*%*_|-_*%*`(n*{n : nat}*{n : nat}+{n : nat}, m*{m : nat}+{m : nat}) + `%|-%`(n*{n : nat}*{n : nat}+{n : nat}, m*{m : nat}+{m : nat}) -- (if (|n*{n : nat}| = m))*{m : nat n : nat}+{m : nat n : nat} == IL Validation after pass the-elimination... @@ -32803,10 +32815,10 @@ relation TestNestedIter: `*_*%*_|-_*%*`(nat***, nat**) relation HasSize: `%|-%`(nat, nat) ;; test.watsup -relation TestNestedIter: `*_*%*_|-_*%*`(nat***, nat**) +relation TestNestedIter: `%|-%`(nat***, nat**) ;; test.watsup rule _{n**+ : nat**+, m*+ : nat*+}: - `*_*%*_|-_*%*`(n*{n : nat}*{n : nat}+{n : nat}, m*{m : nat}+{m : nat}) + `%|-%`(n*{n : nat}*{n : nat}+{n : nat}, m*{m : nat}+{m : nat}) -- (if (|n*{n : nat}| = m))*{m : nat n : nat}+{m : nat n : nat} == IL Validation after pass wildcards... @@ -32816,10 +32828,10 @@ relation TestNestedIter: `*_*%*_|-_*%*`(nat***, nat**) relation HasSize: `%|-%`(nat, nat) ;; test.watsup -relation TestNestedIter: `*_*%*_|-_*%*`(nat***, nat**) +relation TestNestedIter: `%|-%`(nat***, nat**) ;; test.watsup rule _{n**+ : nat**+, m*+ : nat*+}: - `*_*%*_|-_*%*`(n*{n : nat}*{n : nat}+{n : nat}, m*{m : nat}+{m : nat}) + `%|-%`(n*{n : nat}*{n : nat}+{n : nat}, m*{m : nat}+{m : nat}) -- if (|m*{m : nat}+{m : nat}| = |n*{n : nat}*{n : nat}+{n : nat}|) -- (if (|m*{m : nat}| = |n*{n : nat}*{n : nat}|))+{m : nat n : nat} -- (if (|n*{n : nat}| = m))*{m : nat n : nat}+{m : nat n : nat} @@ -32831,10 +32843,10 @@ relation TestNestedIter: `*_*%*_|-_*%*`(nat***, nat**) relation HasSize: `%|-%`(nat, nat) ;; test.watsup -relation TestNestedIter: `*_*%*_|-_*%*`(nat***, nat**) +relation TestNestedIter: `%|-%`(nat***, nat**) ;; test.watsup rule _{n**+ : nat**+, m*+ : nat*+}: - `*_*%*_|-_*%*`(n*{n : nat}*{n : nat}+{n : nat}, m*{m : nat}+{m : nat}) + `%|-%`(n*{n : nat}*{n : nat}+{n : nat}, m*{m : nat}+{m : nat}) -- if (|m*{m : nat}+{m : nat}| = |n*{n : nat}*{n : nat}+{n : nat}|) -- (if (|m*{m : nat}| = |n*{n : nat}*{n : nat}|))+{m : nat n : nat} -- (if (|n*{n : nat}| = m))*{m : nat n : nat}+{m : nat n : nat} diff --git a/spectec/test-prose/TEST.md b/spectec/test-prose/TEST.md index cc61f85864..f3eea6ef2c 100644 --- a/spectec/test-prose/TEST.md +++ b/spectec/test-prose/TEST.md @@ -212,6 +212,24 @@ fone N canon_ N 1. Return (2 ^ ($signif(N) - 1)). +utf8 char_u0* +1. If (|char_u0*| is 1), then: + a. Let [ch] be char_u0*. + b. If (ch < 128), then: + 1) Let b be ch. + 2) Return [b]. + c. If ((128 ≤ ch) and ((ch < 2048) and (ch ≥ (b_2 - 128)))), then: + 1) Let ((2 ^ 6) · (b_1 - 192)) be (ch - (b_2 - 128)). + 2) Return [b_1, b_2]. + d. If ((((2048 ≤ ch) and (ch < 55296)) or ((57344 ≤ ch) and (ch < 65536))) and (ch ≥ (b_3 - 128))), then: + 1) Let (((2 ^ 12) · (b_1 - 224)) + ((2 ^ 6) · (b_2 - 128))) be (ch - (b_3 - 128)). + 2) Return [b_1, b_2, b_3]. + e. If ((65536 ≤ ch) and ((ch < 69632) and (ch ≥ (b_4 - 128)))), then: + 1) Let ((((2 ^ 18) · (b_1 - 240)) + ((2 ^ 12) · (b_2 - 128))) + ((2 ^ 6) · (b_3 - 128))) be (ch - (b_4 - 128)). + 2) Return [b_1, b_2, b_3, b_4]. +2. Let ch* be char_u0*. +3. Return $concat_($utf8([ch])*). + size valty_u0 1. If (valty_u0 is I32), then: a. Return 32. @@ -873,24 +891,6 @@ invoke fa val^n 5. Pop val^k from the stack. 6. Return val^k. -utf8 name_u0 -1. If (|name_u0| is 1), then: - a. Let [ch] be name_u0. - b. If (ch < 128), then: - 1) Let b be ch. - 2) Return [b]. - c. If ((128 ≤ ch) and ((ch < 2048) and (ch ≥ (b_2 - 128)))), then: - 1) Let ((2 ^ 6) · (b_1 - 192)) be (ch - (b_2 - 128)). - 2) Return [b_1, b_2]. - d. If ((((2048 ≤ ch) and (ch < 55296)) or ((57344 ≤ ch) and (ch < 65536))) and (ch ≥ (b_3 - 128))), then: - 1) Let (((2 ^ 12) · (b_1 - 224)) + ((2 ^ 6) · (b_2 - 128))) be (ch - (b_3 - 128)). - 2) Return [b_1, b_2, b_3]. - e. If ((65536 ≤ ch) and ((ch < 69632) and (ch ≥ (b_4 - 128)))), then: - 1) Let ((((2 ^ 18) · (b_1 - 240)) + ((2 ^ 12) · (b_2 - 128))) + ((2 ^ 6) · (b_3 - 128))) be (ch - (b_4 - 128)). - 2) Return [b_1, b_2, b_3, b_4]. -2. Let ch* be name_u0. -3. Return $concat_($utf8([ch])*). - execution_of_UNREACHABLE 1. Trap. @@ -1580,6 +1580,24 @@ fone N canon_ N 1. Return (2 ^ ($signif(N) - 1)). +utf8 char_u0* +1. If (|char_u0*| is 1), then: + a. Let [ch] be char_u0*. + b. If (ch < 128), then: + 1) Let b be ch. + 2) Return [b]. + c. If ((128 ≤ ch) and ((ch < 2048) and (ch ≥ (b_2 - 128)))), then: + 1) Let ((2 ^ 6) · (b_1 - 192)) be (ch - (b_2 - 128)). + 2) Return [b_1, b_2]. + d. If ((((2048 ≤ ch) and (ch < 55296)) or ((57344 ≤ ch) and (ch < 65536))) and (ch ≥ (b_3 - 128))), then: + 1) Let (((2 ^ 12) · (b_1 - 224)) + ((2 ^ 6) · (b_2 - 128))) be (ch - (b_3 - 128)). + 2) Return [b_1, b_2, b_3]. + e. If ((65536 ≤ ch) and ((ch < 69632) and (ch ≥ (b_4 - 128)))), then: + 1) Let ((((2 ^ 18) · (b_1 - 240)) + ((2 ^ 12) · (b_2 - 128))) + ((2 ^ 6) · (b_3 - 128))) be (ch - (b_4 - 128)). + 2) Return [b_1, b_2, b_3, b_4]. +2. Let ch* be char_u0*. +3. Return $concat_($utf8([ch])*). + size valty_u0 1. If (valty_u0 is I32), then: a. Return 32. @@ -2416,24 +2434,6 @@ invoke fa val^n 5. Pop val^k from the stack. 6. Return val^k. -utf8 name_u0 -1. If (|name_u0| is 1), then: - a. Let [ch] be name_u0. - b. If (ch < 128), then: - 1) Let b be ch. - 2) Return [b]. - c. If ((128 ≤ ch) and ((ch < 2048) and (ch ≥ (b_2 - 128)))), then: - 1) Let ((2 ^ 6) · (b_1 - 192)) be (ch - (b_2 - 128)). - 2) Return [b_1, b_2]. - d. If ((((2048 ≤ ch) and (ch < 55296)) or ((57344 ≤ ch) and (ch < 65536))) and (ch ≥ (b_3 - 128))), then: - 1) Let (((2 ^ 12) · (b_1 - 224)) + ((2 ^ 6) · (b_2 - 128))) be (ch - (b_3 - 128)). - 2) Return [b_1, b_2, b_3]. - e. If ((65536 ≤ ch) and ((ch < 69632) and (ch ≥ (b_4 - 128)))), then: - 1) Let ((((2 ^ 18) · (b_1 - 240)) + ((2 ^ 12) · (b_2 - 128))) + ((2 ^ 6) · (b_3 - 128))) be (ch - (b_4 - 128)). - 2) Return [b_1, b_2, b_3, b_4]. -2. Let ch* be name_u0. -3. Return $concat_($utf8([ch])*). - execution_of_UNREACHABLE 1. Trap. @@ -3796,6 +3796,24 @@ fone N canon_ N 1. Return (2 ^ ($signif(N) - 1)). +utf8 char_u0* +1. If (|char_u0*| is 1), then: + a. Let [ch] be char_u0*. + b. If (ch < 128), then: + 1) Let b be ch. + 2) Return [b]. + c. If ((128 ≤ ch) and ((ch < 2048) and (ch ≥ (b_2 - 128)))), then: + 1) Let ((2 ^ 6) · (b_1 - 192)) be (ch - (b_2 - 128)). + 2) Return [b_1, b_2]. + d. If ((((2048 ≤ ch) and (ch < 55296)) or ((57344 ≤ ch) and (ch < 65536))) and (ch ≥ (b_3 - 128))), then: + 1) Let (((2 ^ 12) · (b_1 - 224)) + ((2 ^ 6) · (b_2 - 128))) be (ch - (b_3 - 128)). + 2) Return [b_1, b_2, b_3]. + e. If ((65536 ≤ ch) and ((ch < 69632) and (ch ≥ (b_4 - 128)))), then: + 1) Let ((((2 ^ 18) · (b_1 - 240)) + ((2 ^ 12) · (b_2 - 128))) + ((2 ^ 6) · (b_3 - 128))) be (ch - (b_4 - 128)). + 2) Return [b_1, b_2, b_3, b_4]. +2. Let ch* be char_u0*. +3. Return $concat_($utf8([ch])*). + size numty_u0 1. If (numty_u0 is I32), then: a. Return 32. @@ -5263,24 +5281,6 @@ invoke fa val^n 8. Pop val^k from the stack. 9. Return val^k. -utf8 name_u0 -1. If (|name_u0| is 1), then: - a. Let [ch] be name_u0. - b. If (ch < 128), then: - 1) Let b be ch. - 2) Return [b]. - c. If ((128 ≤ ch) and ((ch < 2048) and (ch ≥ (b_2 - 128)))), then: - 1) Let ((2 ^ 6) · (b_1 - 192)) be (ch - (b_2 - 128)). - 2) Return [b_1, b_2]. - d. If ((((2048 ≤ ch) and (ch < 55296)) or ((57344 ≤ ch) and (ch < 65536))) and (ch ≥ (b_3 - 128))), then: - 1) Let (((2 ^ 12) · (b_1 - 224)) + ((2 ^ 6) · (b_2 - 128))) be (ch - (b_3 - 128)). - 2) Return [b_1, b_2, b_3]. - e. If ((65536 ≤ ch) and ((ch < 69632) and (ch ≥ (b_4 - 128)))), then: - 1) Let ((((2 ^ 18) · (b_1 - 240)) + ((2 ^ 12) · (b_2 - 128))) + ((2 ^ 6) · (b_3 - 128))) be (ch - (b_4 - 128)). - 2) Return [b_1, b_2, b_3, b_4]. -2. Let ch* be name_u0. -3. Return $concat_($utf8([ch])*). - execution_of_UNREACHABLE 1. Trap. From 1825999370c371999ac6cfba2c6e502eaaf07cba Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Wed, 28 Feb 2024 23:27:36 +0100 Subject: [PATCH 5/5] Typo --- document/core/syntax/types.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/document/core/syntax/types.rst b/document/core/syntax/types.rst index 3006058d3a..18263b1c16 100644 --- a/document/core/syntax/types.rst +++ b/document/core/syntax/types.rst @@ -66,7 +66,7 @@ Values of vector type can be stored in :ref:`memories `. Conventions ........... -* The notation ${:$vsize(t)} for :ref:`bit width ` extends to vector types as well, that is, ${:$vsize(V128} = 128}. +* The notation ${:$vsize(t)} for :ref:`bit width ` extends to vector types as well, that is, ${:$vsize(V128) = 128}. $${definition-ignore: vsize}