diff --git a/document/core/syntax/types.rst b/document/core/syntax/types.rst index c0f4631f3f..18263b1c16 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/spec/wasm-1.0/1-syntax.watsup b/spectec/spec/wasm-1.0/1-syntax.watsup index 6f390f0840..eeba7943c1 100644 --- a/spectec/spec/wasm-1.0/1-syntax.watsup +++ b/spectec/spec/wasm-1.0/1-syntax.watsup @@ -2,20 +2,8 @@ ;; Lists ;; -;; TODO: make alias -syntax list(syntax A) = | _LIST A* -- if |A*| < $(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 +;; TODO: enable writing X^n +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 8e9e2a2732..a0b5af8669 100644 --- a/spectec/spec/wasm-2.0/1-syntax.watsup +++ b/spectec/spec/wasm-2.0/1-syntax.watsup @@ -2,20 +2,8 @@ ;; Lists ;; -;; TODO: make alias -syntax list(syntax A) = | _LIST A* -- if |A*| < $(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 +;; TODO: enable writing X^n +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 ;; @@ -268,13 +269,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/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 b29b327b6d..20913e7cdd 100644 --- a/spectec/spec/wasm-3.0/1-syntax.watsup +++ b/spectec/spec/wasm-3.0/1-syntax.watsup @@ -2,20 +2,8 @@ ;; Lists ;; -;; TODO: enable side condition -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 +;; TODO: enable writing X^n +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 ;; @@ -252,14 +253,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 +274,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 +336,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 af6cae84a9..a56af661ed 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: @@ -827,11 +827,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: @@ -875,7 +875,7 @@ rule Step_read/vload_lane-val: z; (CONST I32 i) (VCONST V128 c_1) (VLOAD_LANE N x mo j) ~> (VCONST V128 c) -- if $ibytes(N, k) = $mem(z, x).DATA[i + mo.OFFSET : N/8] -- if N = $lsize(imm) ;; TODO: relate implicitly - -- if M = $($size(V128)/N) + -- if M = $($vsize(V128)/N) -- if c = $invlanes_(imm X M, $lanes_(imm X M, c_1)[[j] = k]) @@ -897,10 +897,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/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/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/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/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..77e345e5ab 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,13 +85,49 @@ 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), _) = (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/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..6e13ae42ab 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 - det_typcon tc | RangeT tes -> free_nl_list free_typenum tes | AtomT _ -> empty | SeqT ts -> free_list free_typ ts @@ -105,19 +106,16 @@ 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 (* 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 +and det_typcon ((t, prems), _) = det_typ t + det_prems prems (* Expressions *) @@ -154,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 @@ -182,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 @@ -202,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 e4200b6817..3a7a341c4f 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 @@ -41,8 +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_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/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..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) ) @@ -266,7 +267,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 +275,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..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,19 +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), _) -> + 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; @@ -280,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) @@ -297,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 @@ -367,6 +377,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) -> @@ -412,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 = @@ -459,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 a367bb6394..9ea58e61c1 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 @@ -37,17 +39,18 @@ 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' - | _ -> 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 @@ -55,11 +58,8 @@ let tup_exp' es' at = | _ -> Il.TupE es' $$ (at, tup_typ' (List.map note es') at) let tup_exp_bind' 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) + 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 @@ -223,6 +223,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 +232,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 +243,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 +273,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 +321,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 +496,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 +514,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 +522,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 +553,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 +588,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 +616,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,69 +635,146 @@ 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 eid' = Il.VarE id' $$ t.at % t' in + let bs' = [Il.ExpB (id', t', []) $ t.at] in + let prems' = [Il.IfPr (fe' eid' nt) $ t.at] in + Il.NotationT ([[]; []], (bs', Il.TupT [(eid', 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 _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_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' = 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 + 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_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 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.(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; + ( mixop, + (!acc_bs', tup_typ_bind' es' 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 : 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 @@ -670,43 +784,46 @@ 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] + [[]; []], [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, 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 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, ids1, ts1' = elab_typ_notation env tid t1 in - let _b2, mixop2, ids2, ts2' = elab_typ_notation env tid t2 in - true, merge_mixop (merge_mixop mixop1 [[elab_atom atom tid]]) mixop2, - ids1 @ ids2, ts1' @ ts2' + 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, 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 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, ids1, ts1' = elab_typ_notation env tid t1 in - b1, merge_mixop (merge_mixop [[Il.LParen]] mixop1) [[Il.RParen]], ids1, 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, _ids, 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'.at], [t'] + (if mixop1 = [[]; []] then mixop1 else [List.flatten mixop1] @ [[op]]), + [t'], [tit] ) | _ -> - false, [[]; []], ["_" $ t.at], [elab_typ env 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 *) @@ -732,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 @@ -756,12 +875,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 +890,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 +906,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 @@ -820,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 @@ -874,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' = @@ -883,6 +1007,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. *) @@ -1019,14 +1145,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)::_, [] -> @@ -1068,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 - 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 + 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 @@ -1104,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 @@ -1174,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' = @@ -1256,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' @@ -1263,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' = 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, e1' $$ at % tup_typ' 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 @@ -1277,29 +1402,84 @@ 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) -> + | 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 + 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 + 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' es'' e'.at) + | 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 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 _, 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) + | _, 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 -> + | _, _ 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 @@ -1314,10 +1494,13 @@ 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 "" @@ -1334,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 -> @@ -1419,16 +1602,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 = @@ -1446,8 +1630,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 = @@ -1461,10 +1645,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 *) @@ -1574,6 +1758,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 = @@ -1634,7 +1819,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 @@ -1645,8 +1830,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' = []) @@ -1656,7 +1841,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) @@ -1666,7 +1851,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 @@ -1676,12 +1861,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" @@ -1704,8 +1889,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' = 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) @@ -1714,24 +1899,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) @@ -1745,7 +1930,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')]); [] @@ -1763,7 +1948,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/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..df3ebb6f6b 100644 --- a/spectec/src/il/ast.ml +++ b/spectec/src/il/ast.ml @@ -78,18 +78,19 @@ 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 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] *) @@ -158,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 ae47291b73..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 @@ -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 @@ -105,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 36939ddd6a..5426758ccb 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 *) @@ -46,32 +51,43 @@ 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 _ -> 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 - | Some (AliasT t') -> reduce_typ env t' + (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 ) | _ -> 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) + 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)) @@ -79,9 +95,9 @@ 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' - | Some s -> Some (Subst.subst_deftyp s dt).it + 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) (* Expression Reduction *) @@ -237,15 +253,41 @@ 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 | 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 @@ -273,16 +315,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' -> @@ -290,6 +339,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 = @@ -331,6 +386,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 *) @@ -374,10 +433,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 *) @@ -392,6 +451,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 @@ -423,19 +483,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)) @@ -456,56 +520,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 @@ -514,19 +595,18 @@ 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 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 @@ -535,12 +615,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 = @@ -563,9 +669,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 dt1, Some dt2 -> Eq.eq_deftyp (dt1 $ t1.at) (dt2 $ t2.at) - | _, _ -> false + (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 + | dt1, dt2 -> Eq.eq_deftyp (dt1 $ t1'.at) (dt2 $ t2'.at) (* TODO *) ) | VarT _, _ -> let t1' = reduce_typ env t1 in @@ -573,19 +682,39 @@ 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 && Eq.eq_iter iter1 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 + | 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" @@ -615,36 +744,58 @@ 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 - | 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) -> + | 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 -> 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 (mixop1, t11)), Some (NotationT (mixop2, t21)) -> - mixop1 = mixop2 && sub_typ env t11 t21 + | NotationT tc1, _ -> + let (_op1, (_binds1, t11, _prems1), _) = tc1 in + sub_typ env t11 t2' + | _, NotationT tc2 -> + let (_op2, (_binds2, t21, _prems2), _) = tc2 in + sub_typ env t1' t21 | _, _ -> false ) + | VarT _, _ -> + (match (reduce_typdef env t1').it with + | NotationT tc1 -> + let (_op1, (_binds1, t11, _prems1), _) = tc1 in + sub_typ env t11 t2' + | _ -> false + ) + | _, VarT _ -> + (match (reduce_typdef env t2').it with + | NotationT tc2 -> + let (_op2, (_binds2, t21, _prems2), _) = tc2 in + sub_typ env t1' t21 + | _ -> false + ) | _, _ -> 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 = @@ -653,9 +804,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 *) @@ -664,16 +812,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 @@ -688,7 +836,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) | _, _ -> @@ -696,11 +844,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/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/free.ml b/spectec/src/il/free.ml index 363c069a4f..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,25 +75,28 @@ 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 = 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 @@ -128,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 d60edb521a..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,13 +124,15 @@ 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 | 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 +142,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 +150,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 +188,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 ^ "]" @@ -219,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 *) @@ -307,7 +311,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..1edb4c9eb4 100644 --- a/spectec/src/il/subst.ml +++ b/spectec/src/il/subst.ml @@ -67,21 +67,25 @@ 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 | 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) @@ -136,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 *) @@ -148,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 4f0c154e72..da9d13bc47 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 -> None (* cannot reduce *) - | 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 - | TupT xts -> xts +let as_tup_typ phrase env dir t at : (exp * typ) list = + match expand_typ env t with + | TupT ets -> ets | _ -> as_error at phrase dir t "(_,...,_)" let as_mix_typ phrase env dir t at : mixop * typ = - match expand_def env t with - | NotationT (mixop, t) -> mixop, t + 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 "| ..." @@ -180,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 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 *) @@ -246,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 _ -> @@ -258,24 +213,24 @@ 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 - | NotationT (mixop, t) -> - valid_typ_mix env mixop t dt.at + valid_typ env t + | 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 +238,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,21 +247,36 @@ 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 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 = @@ -332,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 @@ -343,10 +314,19 @@ 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 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" @@ -360,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; @@ -430,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 @@ -448,10 +429,19 @@ 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 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 @@ -469,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 @@ -484,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"; @@ -515,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 *) @@ -569,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 = @@ -587,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 ([], []) @@ -595,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 ([], []) @@ -644,12 +642,12 @@ 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 List.iter (valid_param env') ps; - valid_typ env' [] t; + valid_typ env' t; env.defs <- bind "function" env.defs id (ps, t, clauses) | _ -> () @@ -666,13 +664,13 @@ 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) -> 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/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..f1a0c07ff8 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 -> @@ -164,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 } @@ -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 3d84cd7c31..4f1d8073ea 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 ]; _ } @@ -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) -> @@ -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 ] @@ -206,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 @@ -232,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 @@ -246,6 +249,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 @@ -341,7 +349,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), @@ -407,7 +415,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 @@ -599,7 +607,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 = @@ -637,8 +645,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 3dd527882a..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 @@ -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..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) -> @@ -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..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 -> @@ -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 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 31dca47184..5d7b06e610 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,29 +64,28 @@ 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 -syntax list{syntax X}(syntax X) = X* +syntax list{syntax X}(syntax X) = `%`{X* : X*}(X*{X : X} : X*) + -- if (|X*{X : X}| < (2 ^ 32)) ;; 1-syntax.watsup -syntax char = nat +syntax bit = `%`{i : nat}(i : nat) + -- if ((i = 0) \/ (i = 1)) ;; 1-syntax.watsup -syntax name = char* +syntax byte = `%`{i : nat}(i : nat) + -- if ((i >= 0) /\ (i <= 255)) ;; 1-syntax.watsup -syntax bit = nat +syntax uN{N : N}(N) = `%`{i : nat}(i : nat) + -- if ((i >= 0) /\ (i <= ((2 ^ N) - 1))) ;; 1-syntax.watsup -syntax byte = nat - -;; 1-syntax.watsup -syntax uN{N : N}(N) = nat - -;; 1-syntax.watsup -syntax sN{N : N}(N) = int +syntax sN{N : N}(N) = `%`{i : int}(i : int) + -- if ((((i >= - ((2 ^ (N - 1)) : nat <: int)) /\ (i <= - (1 : nat <: int))) \/ (i = (0 : nat <: int))) \/ ((i >= + (1 : nat <: int)) /\ (i <= (((2 ^ (N - 1)) - 1) : nat <: int)))) ;; 1-syntax.watsup syntax iN{N : N}(N) = uN(N) @@ -148,8 +147,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) @@ -175,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 @@ -245,20 +273,20 @@ 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 | 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 +;; 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 @@ -266,40 +294,40 @@ 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, storagetype) +;; 1-syntax.watsup:176.1-177.18 +syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) -;; 1-syntax.watsup:178.1-178.70 -syntax functype = `%->%`(resulttype, resulttype) +;; 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) - | 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 +;; 1-syntax.watsup:190.1-191.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 +;; 1-syntax.watsup:193.1-194.22 syntax rectype = - | REC(list : list(syntax subtype)) + | 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) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY | EQ | I31 @@ -311,13 +339,13 @@ syntax heaptype = | EXTERN | NOEXTERN | BOT - | DEF(rectype : rectype, 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 = @@ -370,19 +398,19 @@ syntax imm = ;; 1-syntax.watsup syntax deftype = - | DEF(rectype : rectype, nat) + | DEF{rectype : rectype}(rectype : rectype, nat) ;; 1-syntax.watsup -syntax limits = `[%..%]`(u32, u32) +syntax limits = `[%..%]`{u32 : u32}(u32 : u32, u32) ;; 1-syntax.watsup -syntax globaltype = `%%`(mut, valtype) +syntax globaltype = `%%`{mut : mut, valtype : valtype}(mut : mut, valtype : valtype) ;; 1-syntax.watsup -syntax tabletype = `%%`(limits, reftype) +syntax tabletype = `%%`{limits : limits, reftype : reftype}(limits : limits, reftype : reftype) ;; 1-syntax.watsup -syntax memtype = `%I8`(limits) +syntax memtype = `%I8`{limits : limits}(limits : limits) ;; 1-syntax.watsup syntax elemtype = reftype @@ -392,23 +420,26 @@ 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(valtype : valtype) : nat +def $size(numtype : numtype) : nat ;; 2-syntax-aux.watsup - def $size(I32_valtype) = 32 + def $size(I32_numtype) = 32 ;; 2-syntax-aux.watsup - def $size(I64_valtype) = 64 + def $size(I64_numtype) = 64 ;; 2-syntax-aux.watsup - def $size(F32_valtype) = 32 + def $size(F32_numtype) = 32 ;; 2-syntax-aux.watsup - def $size(F64_valtype) = 64 + def $size(F64_numtype) = 64 + +;; 1-syntax.watsup +def $vsize(vectype : vectype) : nat ;; 2-syntax-aux.watsup - def $size(V128_valtype) = 128 + def $vsize(V128_vectype) = 128 ;; 1-syntax.watsup def $psize(packtype : packtype) : nat @@ -420,41 +451,44 @@ def $psize(packtype : packtype) : nat ;; 1-syntax.watsup def $lsize(lanetype : lanetype) : nat ;; 2-syntax-aux.watsup - def $lsize{numtype : numtype}((numtype : numtype <: lanetype)) = $size((numtype : numtype <: valtype)) + def $lsize{numtype : numtype}((numtype : numtype <: lanetype)) = $size(numtype) ;; 2-syntax-aux.watsup def $lsize{packtype : packtype}((packtype : packtype <: lanetype)) = $psize(packtype) ;; 1-syntax.watsup def $zsize(storagetype : storagetype) : nat ;; 2-syntax-aux.watsup - def $zsize{valtype : valtype}((valtype : valtype <: storagetype)) = $size(valtype) + def $zsize{numtype : numtype}((numtype : numtype <: storagetype)) = $size(numtype) + ;; 2-syntax-aux.watsup + def $zsize{vectype : vectype}((vectype : vectype <: storagetype)) = $vsize(vectype) ;; 2-syntax-aux.watsup def $zsize{packtype : packtype}((packtype : packtype <: storagetype)) = $psize(packtype) ;; 1-syntax.watsup -syntax dim = nat +syntax dim = `%`{i : nat}(i : nat) + -- if (((((i = 1) \/ (i = 2)) \/ (i = 4)) \/ (i = 8)) \/ (i = 16)) ;; 1-syntax.watsup -syntax shape = `%X%`(lanetype, dim) +syntax shape = `%X%`{lanetype : lanetype, dim : dim}(lanetype : lanetype, dim : dim) ;; 1-syntax.watsup def $lanetype(shape : shape) : lanetype ;; 2-syntax-aux.watsup - def $lanetype{lnn : lnn, N : N}(`%X%`(lnn, N)) = lnn + def $lanetype{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = lnn ;; 1-syntax.watsup -def $sizenn(valtype : valtype) : nat +def $sizenn(numtype : numtype) : nat ;; 1-syntax.watsup - def $sizenn{t : valtype}(t) = $size(t) + def $sizenn{nt : numtype}(nt) = $size(nt) ;; 1-syntax.watsup syntax num_(numtype : numtype) ;; 1-syntax.watsup - syntax num_{inn : inn}((inn : inn <: numtype)) = iN($sizenn((inn : inn <: valtype))) + syntax num_{inn : inn}((inn : inn <: numtype)) = iN($sizenn((inn : inn <: numtype))) ;; 1-syntax.watsup - syntax num_{fnn : fnn}((fnn : fnn <: numtype)) = fN($sizenn((fnn : fnn <: valtype))) + syntax num_{fnn : fnn}((fnn : fnn <: numtype)) = fN($sizenn((fnn : fnn <: numtype))) ;; 1-syntax.watsup @@ -475,7 +509,7 @@ syntax lane_(lanetype : lanetype) ;; 1-syntax.watsup -syntax vec_{vnn : vnn}(vnn) = vN($size((vnn : vnn <: valtype))) +syntax vec_{vnn : vnn}(vnn) = vN($vsize(vnn)) ;; 1-syntax.watsup syntax zval_(storagetype : storagetype) @@ -503,7 +537,7 @@ syntax unop_(numtype : numtype) | CLZ | CTZ | POPCNT - | EXTEND(n : n) + | EXTEND{n : n}(n : n) ;; 1-syntax.watsup @@ -524,13 +558,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 @@ -556,10 +590,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 @@ -579,23 +613,23 @@ syntax cvtop = | REINTERPRET ;; 1-syntax.watsup -syntax ishape = `%X%`(imm, dim) +syntax ishape = `%X%`{imm : imm, dim : dim}(imm : imm, dim : dim) ;; 1-syntax.watsup -syntax fshape = `%X%`(fnn, dim) +syntax fshape = `%X%`{fnn : fnn, dim : dim}(fnn : fnn, dim : dim) ;; 1-syntax.watsup -syntax pshape = `%X%`(pnn, dim) +syntax pshape = `%X%`{pnn : pnn, dim : dim}(pnn : pnn, dim : dim) ;; 1-syntax.watsup def $dim(shape : shape) : dim ;; 2-syntax-aux.watsup - def $dim{lnn : lnn, N : N}(`%X%`(lnn, N)) = N + def $dim{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = `%`(N) ;; 1-syntax.watsup def $shsize(shape : shape) : nat ;; 2-syntax-aux.watsup - def $shsize{lnn : lnn, N : N}(`%X%`(lnn, N)) = ($lsize(lnn) * N) + def $shsize{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = ($lsize(lnn) * N) ;; 1-syntax.watsup syntax vvunop = @@ -619,7 +653,7 @@ syntax vvtestop = ;; 1-syntax.watsup syntax vunop_(shape : shape) ;; 1-syntax.watsup - syntax vunop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + syntax vunop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ABS | NEG | POPCNT{imm : imm} @@ -627,7 +661,7 @@ syntax vunop_(shape : shape) ;; 1-syntax.watsup - syntax vunop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vunop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | ABS | NEG | SQRT @@ -640,12 +674,12 @@ syntax vunop_(shape : shape) ;; 1-syntax.watsup syntax vbinop_(shape : shape) ;; 1-syntax.watsup - syntax vbinop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + 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) @@ -653,14 +687,14 @@ 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) ;; 1-syntax.watsup - syntax vbinop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vbinop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | ADD | SUB | MUL @@ -672,23 +706,23 @@ syntax vbinop_(shape : shape) ;; 1-syntax.watsup -syntax vtestop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = +syntax vtestop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ALL_TRUE ;; 1-syntax.watsup syntax vrelop_(shape : shape) ;; 1-syntax.watsup - syntax vrelop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + 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 - syntax vrelop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vrelop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | EQ | NE | LT @@ -706,12 +740,12 @@ syntax vcvtop = | PROMOTE ;; 1-syntax.watsup -syntax vshiftop_{imm : imm, N : N}(`%X%`(imm, N)) = +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)) = +syntax vextunop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = | EXTADD_PAIRWISE -- if ((16 <= $lsize((imm_1 : imm <: lanetype))) /\ ($lsize((imm_1 : imm <: lanetype)) <= 32)) @@ -721,28 +755,28 @@ syntax half = | HIGH ;; 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) +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}(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, sx : sx) + | 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%?`(()?) @@ -750,113 +784,113 @@ syntax zero = `ZERO%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:521.1-533.78 +;; 1-syntax.watsup:523.1-535.78 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)) : dim <: nat))) - | 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) + -- if (ishape = `%X%`(I8_imm, `%`(16))) + | 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) - | 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 @@ -864,57 +898,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) +syntax type = TYPE{rectype : rectype}(rectype : rectype) ;; 1-syntax.watsup -syntax local = LOCAL(valtype) +syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`(typeidx, local*, 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, expr) +syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) ;; 1-syntax.watsup -syntax table = TABLE(tabletype, expr) +syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, expr : expr) ;; 1-syntax.watsup -syntax mem = MEMORY(memtype) +syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`(reftype, expr*, 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) +syntax data = DATA{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup -syntax start = START(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, externidx) +syntax export = EXPORT{name : name, externidx : externidx}(name : name, externidx : externidx) ;; 1-syntax.watsup -syntax import = IMPORT(name, name, 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 { @@ -924,10 +958,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 } @@ -937,9 +971,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 @@ -959,18 +993,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 { @@ -980,7 +1014,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 @@ -1025,7 +1059,7 @@ def $diffrt(reftype : reftype, reftype : reftype) : reftype ;; 2-syntax-aux.watsup syntax typevar = - | _IDX(typeidx : typeidx) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | REC(nat) ;; 2-syntax-aux.watsup @@ -1036,181 +1070,181 @@ def $idx(typeidx : typeidx) : typevar ;; 2-syntax-aux.watsup rec { -;; 2-syntax-aux.watsup:122.1-122.92 +;; 2-syntax-aux.watsup:125.1-125.92 def $subst_typevar(typevar : typevar, typevar*, heaptype*) : heaptype - ;; 2-syntax-aux.watsup:147.1-147.38 + ;; 2-syntax-aux.watsup:150.1-150.38 def $subst_typevar{xx : typevar}(xx, [], []) = (xx : typevar <: heaptype) - ;; 2-syntax-aux.watsup:148.1-148.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 + ;; 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' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = ht_1 -- if (xx = xx_1) - ;; 2-syntax-aux.watsup:149.1-149.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'}) + ;; 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' : 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 { -;; 2-syntax-aux.watsup:126.1-126.92 +;; 2-syntax-aux.watsup:129.1-129.92 def $subst_heaptype(heaptype : heaptype, typevar*, heaptype*) : heaptype - ;; 2-syntax-aux.watsup:154.1-154.67 - def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) - ;; 2-syntax-aux.watsup:155.1-155.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) - ;; 2-syntax-aux.watsup:156.1-156.55 - def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx}, ht*{ht}) = ht' + ;; 2-syntax-aux.watsup:157.1-157.67 + 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 : 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 : typevar}, ht*{ht : heaptype}) = ht' -- otherwise -;; 2-syntax-aux.watsup:127.1-127.92 +;; 2-syntax-aux.watsup:130.1-130.92 def $subst_reftype(reftype : reftype, typevar*, heaptype*) : reftype - ;; 2-syntax-aux.watsup:158.1-158.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})) + ;; 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 : typevar}, ht*{ht : heaptype}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})) -;; 2-syntax-aux.watsup:128.1-128.92 +;; 2-syntax-aux.watsup:131.1-131.92 def $subst_valtype(valtype : valtype, typevar*, heaptype*) : valtype - ;; 2-syntax-aux.watsup:160.1-160.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) - ;; 2-syntax-aux.watsup:161.1-161.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) - ;; 2-syntax-aux.watsup:162.1-162.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) - ;; 2-syntax-aux.watsup:163.1-163.40 - def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + ;; 2-syntax-aux.watsup:163.1-163.64 + 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 : 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 : 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 : typevar}, ht*{ht : heaptype}) = BOT_valtype -;; 2-syntax-aux.watsup:131.1-131.92 +;; 2-syntax-aux.watsup:134.1-134.92 def $subst_storagetype(storagetype : storagetype, typevar*, heaptype*) : storagetype - ;; 2-syntax-aux.watsup:167.1-167.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) - ;; 2-syntax-aux.watsup:168.1-168.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) + ;; 2-syntax-aux.watsup:170.1-170.66 + 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 : typevar}, ht*{ht : heaptype}) = ($subst_packtype(pt, xx*{xx : typevar}, ht*{ht : heaptype}) : packtype <: storagetype) -;; 2-syntax-aux.watsup:132.1-132.92 +;; 2-syntax-aux.watsup:135.1-135.92 def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype - ;; 2-syntax-aux.watsup:170.1-170.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})) + ;; 2-syntax-aux.watsup:173.1-173.80 + 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:134.1-134.92 +;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype - ;; 2-syntax-aux.watsup:172.1-172.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}) - ;; 2-syntax-aux.watsup:173.1-173.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})) - ;; 2-syntax-aux.watsup:174.1-174.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})) - -;; 2-syntax-aux.watsup:135.1-135.92 + ;; 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})) + ;; 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 + 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:176.1-177.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})) - ;; 2-syntax-aux.watsup:178.1-179.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})) + ;; 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 : 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' : 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:136.1-136.92 +;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype - ;; 2-syntax-aux.watsup:181.1-181.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}) + ;; 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})) -;; 2-syntax-aux.watsup:137.1-137.92 +;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype - ;; 2-syntax-aux.watsup:183.1-183.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) + ;; 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 : typevar}, ht*{ht : heaptype}) = DEF_deftype($subst_rectype(qt, xx*{xx : typevar}, ht*{ht : heaptype}), i) -;; 2-syntax-aux.watsup:140.1-140.92 +;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype - ;; 2-syntax-aux.watsup:186.1-186.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}) + ;; 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})) } ;; 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, x^n : idx^n}(rt, ht^n{ht}) = $subst_reftype(rt, $idx(x)^(x (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) + -- if (ishape = `%X%`(I8_imm, `%`(16))) + | 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) - | 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, admininstr*) +syntax config = `%;%`{state : state, admininstr* : admininstr*}(state : state, admininstr*{admininstr : admininstr} : admininstr*) ;; 4-runtime.watsup rec { @@ -2317,28 +2351,28 @@ 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? ;; 5-runtime-aux.watsup - def $default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) + def $default(I32_valtype) = ?(CONST_val(I32_numtype, `%`(0))) ;; 5-runtime-aux.watsup - def $default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) + def $default(I64_valtype) = ?(CONST_val(I64_numtype, `%`(0))) ;; 5-runtime-aux.watsup def $default(F32_valtype) = ?(CONST_val(F32_numtype, $fzero(32))) ;; 5-runtime-aux.watsup def $default(F64_valtype) = ?(CONST_val(F64_numtype, $fzero(64))) ;; 5-runtime-aux.watsup - def $default(V128_valtype) = ?(VCONST_val(V128_vectype, 0)) + def $default(V128_valtype) = ?(VCONST_val(V128_vectype, `%`(0))) ;; 5-runtime-aux.watsup def $default{ht : heaptype}(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) ;; 5-runtime-aux.watsup @@ -2349,14 +2383,14 @@ def $packval(storagetype : storagetype, val : val) : fieldval ;; 5-runtime-aux.watsup def $packval{t : valtype, val : val}((t : valtype <: storagetype), val) = (val : val <: fieldval) ;; 5-runtime-aux.watsup - def $packval{pt : packtype, i : nat}((pt : packtype <: storagetype), CONST_val(I32_numtype, i)) = PACK_fieldval(pt, $wrap(32, $psize(pt), i)) + def $packval{pt : packtype, i : nat}((pt : packtype <: storagetype), CONST_val(I32_numtype, `%`(i))) = PACK_fieldval(pt, $wrap(32, $psize(pt), `%`(i))) ;; 5-runtime-aux.watsup def $unpackval(storagetype : storagetype, sx?, fieldval : fieldval) : val ;; 5-runtime-aux.watsup def $unpackval{t : valtype, val : val}((t : valtype <: storagetype), ?(), (val : val <: fieldval)) = val ;; 5-runtime-aux.watsup - def $unpackval{pt : packtype, sx : sx, i : nat}((pt : packtype <: storagetype), ?(sx), PACK_fieldval(pt, i)) = CONST_val(I32_numtype, $ext($psize(pt), 32, sx, i)) + def $unpackval{pt : packtype, sx : sx, i : nat}((pt : packtype <: storagetype), ?(sx), PACK_fieldval(pt, `%`(i))) = CONST_val(I32_numtype, $ext($psize(pt), 32, sx, `%`(i))) ;; 5-runtime-aux.watsup rec { @@ -2366,9 +2400,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 } @@ -2380,9 +2414,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 } @@ -2394,9 +2428,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 } @@ -2408,9 +2442,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 } @@ -2477,82 +2511,82 @@ def $moduleinst(state : state) : moduleinst ;; 5-runtime-aux.watsup def $type(state : state, typeidx : typeidx) : deftype ;; 5-runtime-aux.watsup - def $type{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.MODULE_frame.TYPE_moduleinst[(x : uN(32) <: nat)] + def $type{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.MODULE_frame.TYPE_moduleinst[x.`%`.0] ;; 5-runtime-aux.watsup def $func(state : state, funcidx : funcidx) : funcinst ;; 5-runtime-aux.watsup - def $func{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[(x : uN(32) <: nat)]] + def $func{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $global(state : state, globalidx : globalidx) : globalinst ;; 5-runtime-aux.watsup - def $global{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[(x : uN(32) <: nat)]] + def $global{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $table(state : state, tableidx : tableidx) : tableinst ;; 5-runtime-aux.watsup - def $table{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]] + def $table{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $mem(state : state, memidx : memidx) : meminst ;; 5-runtime-aux.watsup - def $mem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[(x : uN(32) <: nat)]] + def $mem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $elem(state : state, tableidx : tableidx) : eleminst ;; 5-runtime-aux.watsup - def $elem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[(x : uN(32) <: nat)]] + def $elem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $data(state : state, dataidx : dataidx) : datainst ;; 5-runtime-aux.watsup - def $data{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[(x : uN(32) <: nat)]] + def $data{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $local(state : state, localidx : localidx) : val? ;; 5-runtime-aux.watsup - def $local{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.LOCAL_frame[(x : uN(32) <: nat)] + def $local{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.LOCAL_frame[x.`%`.0] ;; 5-runtime-aux.watsup def $with_local(state : state, localidx : localidx, val : val) : state ;; 5-runtime-aux.watsup - def $with_local{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[(x : uN(32) <: nat)] = ?(v)]) + def $with_local{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[x.`%`.0] = ?(v)]) ;; 5-runtime-aux.watsup def $with_global(state : state, globalidx : globalidx, val : val) : state ;; 5-runtime-aux.watsup - def $with_global{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[(x : uN(32) <: nat)]].VALUE_globalinst = v], f) + def $with_global{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x.`%`.0]].VALUE_globalinst = v], f) ;; 5-runtime-aux.watsup def $with_table(state : state, tableidx : tableidx, nat : nat, ref : ref) : state ;; 5-runtime-aux.watsup - def $with_table{s : store, f : frame, x : idx, i : nat, r : ref}(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]].ELEM_tableinst[i] = r], f) + def $with_table{s : store, f : frame, x : idx, i : nat, r : ref}(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]].ELEM_tableinst[i] = r], f) ;; 5-runtime-aux.watsup def $with_tableinst(state : state, tableidx : tableidx, tableinst : tableinst) : state ;; 5-runtime-aux.watsup - def $with_tableinst{s : store, f : frame, x : idx, ti : tableinst}(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]] = ti], f) + def $with_tableinst{s : store, f : frame, x : idx, ti : tableinst}(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]] = ti], f) ;; 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 : uN(32) <: nat)]].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 ;; 5-runtime-aux.watsup - def $with_meminst{s : store, f : frame, x : idx, mi : meminst}(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[(x : uN(32) <: nat)]] = mi], f) + def $with_meminst{s : store, f : frame, x : idx, mi : meminst}(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]] = mi], f) ;; 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 : uN(32) <: nat)]].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 : uN(32) <: nat)]].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 @@ -2567,29 +2601,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 @@ -2598,25 +2632,25 @@ syntax init = | UNSET ;; 6-typing.watsup -syntax localtype = `%%`(init, valtype) +syntax localtype = `%%`{init : init, valtype : valtype}(init : init, valtype : valtype) ;; 6-typing.watsup -syntax instrtype = `%->%*%`(resulttype, localidx*, 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 @@ -2627,7 +2661,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 : uN(32) <: nat)] = 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 @@ -2638,15 +2672,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) @@ -2669,7 +2703,7 @@ relation Heaptype_ok: `%|-%:_OK`(context, heaptype) ;; 6-typing.watsup rule typeidx{C : context, x : idx, dt : deftype}: `%|-%:_OK`(C, _IDX_heaptype(x)) - -- if (C.TYPE_context[(x : uN(32) <: nat)] = dt) + -- if (C.TYPE_context[x.`%`.0] = dt) ;; 6-typing.watsup rule rec{C : context, i : nat, st : subtype}: @@ -2708,25 +2742,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 : uN(32) <: nat)] = 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) + | OK{typeidx : typeidx}(typeidx : typeidx, nat) ;; 6-typing.watsup relation Packtype_ok: `%|-%:_OK`(context, packtype) @@ -2757,16 +2791,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}: @@ -2803,7 +2837,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 @@ -2838,7 +2872,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}: @@ -2858,17 +2892,17 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:319.1-321.52 rule typeidx-l{C : context, typeidx : typeidx, heaptype : heaptype}: `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) - -- Heaptype_sub: `%|-%<:%`(C, (C.TYPE_context[(typeidx : uN(32) <: nat)] : deftype <: heaptype), heaptype) + -- Heaptype_sub: `%|-%<:%`(C, (C.TYPE_context[typeidx.`%`.0] : deftype <: heaptype), heaptype) ;; 6-typing.watsup:323.1-325.52 rule typeidx-r{C : context, heaptype : heaptype, typeidx : typeidx}: `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, (C.TYPE_context[(typeidx : uN(32) <: nat)] : deftype <: heaptype)) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, (C.TYPE_context[typeidx.`%`.0] : deftype <: 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}: @@ -2964,8 +2998,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}: @@ -2981,19 +3015,19 @@ 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 : uN(32) <: nat) < (x : uN(32) <: nat)))*{y} - -- (if ($unrolldt(C.TYPE_context[(y : uN(32) <: nat)]) = 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 ;; 6-typing.watsup def $before{deftype : deftype, x : idx, i : nat}((deftype : deftype <: heaptype), x, i) = true ;; 6-typing.watsup - def $before{typeidx : typeidx, x : idx, i : nat}(_IDX_heaptype(typeidx), x, i) = ((typeidx : uN(32) <: nat) < (x : uN(32) <: nat)) + def $before{typeidx : typeidx, x : idx, i : nat}(_IDX_heaptype(typeidx), x, i) = (typeidx.`%`.0 < x.`%`.0) ;; 6-typing.watsup def $before{j : nat, x : idx, i : nat}(REC_heaptype(j), x, i) = (j < i) @@ -3002,7 +3036,7 @@ def $unrollht(context : context, heaptype : heaptype) : subtype ;; 6-typing.watsup def $unrollht{C : context, deftype : deftype}(C, (deftype : deftype <: heaptype)) = $unrolldt(deftype) ;; 6-typing.watsup - def $unrollht{C : context, typeidx : typeidx}(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[(typeidx : uN(32) <: nat)]) + def $unrollht{C : context, typeidx : typeidx}(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx.`%`.0]) ;; 6-typing.watsup def $unrollht{C : context, i : nat}(C, REC_heaptype(i)) = C.REC_context[i] @@ -3010,12 +3044,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 { @@ -3024,13 +3058,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}), 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 : uN(32) <: nat) + 1), (i + 1))) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) } ;; 6-typing.watsup @@ -3040,18 +3074,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}), 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 : uN(32) <: nat) + 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 @@ -3060,14 +3094,14 @@ 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 relation Limits_ok: `%|-%:%`(context, limits, nat) ;; 6-typing.watsup rule _{C : context, n_1 : n, n_2 : n, k : nat}: - `%|-%:%`(C, `[%..%]`(n_1, n_2), k) + `%|-%:%`(C, `[%..%]`(`%`(n_1), `%`(n_2)), k) -- if ((n_1 <= n_2) /\ (n_2 <= k)) ;; 6-typing.watsup @@ -3116,27 +3150,27 @@ 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}, 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 : uN(32) <: nat)] = `%%`(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) ;; 6-typing.watsup rule _{C : context, n_11 : n, n_12 : n, n_21 : n, n_22 : n}: - `%|-%<:%`(C, `[%..%]`(n_11, n_12), `[%..%]`(n_21, n_22)) + `%|-%<:%`(C, `[%..%]`(`%`(n_11), `%`(n_12)), `[%..%]`(`%`(n_21), `%`(n_22))) -- if (n_11 >= n_21) -- if (n_12 <= n_22) @@ -3195,16 +3229,16 @@ 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}: `%|-%:%`(C, _IDX_blocktype(x), ft) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], FUNC_comptype(ft)) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(ft)) ;; 6-typing.watsup rec { @@ -3213,77 +3247,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}, 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}: - `%|-%:%`(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}), `%->%`(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 : uN(32) <: nat)] = 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 : uN(32) <: nat)] = 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 : uN(32) <: nat)]))*{l} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[(l' : uN(32) <: nat)]) + `%|-%:%`(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} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[(l : uN(32) <: nat)] = 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 : uN(32) <: nat)] = 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 : uN(32) <: nat)] = 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) @@ -3291,8 +3325,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 : uN(32) <: nat)] = 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) @@ -3300,514 +3334,514 @@ 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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})) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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})) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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 : uN(32) <: nat)], 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)}: - `%|-%:%`(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 : numtype <: valtype)) = $size((nt_2 : numtype <: valtype))) + -- 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}), `%->%`([(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 <: valtype)) > $size((inn_2 : inn <: valtype)))) + -- 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))])) - -- if (C.FUNC_context[(x : uN(32) <: nat)] = dt) + `%|-%:%`(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}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, (rt : reftype <: storagetype)))) - -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[(y : uN(32) <: nat)], rt) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, (t : valtype <: storagetype)))) + `%|-%:%`(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 : uN(32) <: nat)] = OK) + -- 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}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + `%|-%:%`(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)], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), 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])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x_1 : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) - -- Expand: `%~~%`(C.TYPE_context[(x_2 : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt_2))) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- Storagetype_sub: `%|-%<:%`(C, (C.ELEM_context[(y : uN(32) <: nat)] : reftype <: storagetype), zt) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + `%|-%:%`(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 : uN(32) <: nat)] = OK) + -- 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}), `%->%`([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}: - `%|-%:%`(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}, 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}, 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}: - `%|-%:%`(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])) - -- if (C.LOCAL_context[(x : uN(32) <: nat)] = `%%`(init, 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])) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = `%%`(mut, 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], [])) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = `%%`(`MUT%?`(?(())), 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)])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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)], [])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = tt) + `%|-%:%`(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])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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], [])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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], [])) - -- if (C.TABLE_context[(x_1 : uN(32) <: nat)] = `%%`(lim_1, rt_1)) - -- if (C.TABLE_context[(x_2 : uN(32) <: nat)] = `%%`(lim_2, rt_2)) + `%|-%:%`(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], [])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt_1)) - -- if (C.ELEM_context[(y : uN(32) <: nat)] = rt_2) + `%|-%:%`(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), `%->%`([], [])) - -- if (C.ELEM_context[(x : uN(32) <: nat)] = rt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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], [])) - -- if (C.MEM_context[(x_1 : uN(32) <: nat)] = mt_1) - -- if (C.MEM_context[(x_2 : uN(32) <: nat)] = mt_2) + `%|-%:%`(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], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if (C.DATA_context[(y : uN(32) <: nat)] = OK) + `%|-%:%`(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), `%->%`([], [])) - -- if (C.DATA_context[(x : uN(32) <: nat)] = OK) + `%|-%:%`(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 sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if ((2 ^ n_A) <= ($size((nt : numtype <: valtype)) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size((nt : numtype <: valtype)) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + `%|-%:%`(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} + -- 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)], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if ((2 ^ n_A) <= ($size((nt : numtype <: valtype)) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size((nt : numtype <: valtype)) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + `%|-%:%`(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} + -- 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}: - `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [V128_valtype])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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 : uN(8) <: nat) < (128 / n)) + -- if (laneidx.`%`.0 < (128 / n)) - ;; 6-typing.watsup:1046.1-1049.36 + ;; 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], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if ((2 ^ n_A) <= ($size(V128_valtype) / 8)) + `%|-%:%`(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], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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 : uN(8) <: nat) < (128 / n)) + -- if (laneidx.`%`.0 < (128 / n)) ;; 6-typing.watsup:504.1-504.67 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}: - `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) - -- if (C.LOCAL_context[(x : uN(32) <: nat)] = `%%`(init, t)) + `%|-%:%`(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])) - -- if (C.LOCAL_context[(x : uN(32) <: nat)] = `%%`(init, 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}, `%->%*%`(t_1*{t_1}, x_1*{x_1} :: x_2*{x_2}, t_3*{t_3})) - -- (if (C.LOCAL_context[(x_1 : uN(32) <: nat)] = `%%`(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 { @@ -3817,7 +3851,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 @@ -3828,7 +3862,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 @@ -3852,7 +3886,7 @@ relation Instr_const: `%|-%CONST`(context, instr) ;; 6-typing.watsup rule global.get{C : context, x : idx, t : valtype}: `%|-%CONST`(C, GLOBAL.GET_instr(x)) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = `%%`(`MUT%?`(?()), t)) + -- if (C.GLOBAL_context[x.`%`.0] = `%%`(`MUT%?`(?()), t)) ;; 6-typing.watsup rule binop{C : context, inn : inn, binop : binop_((inn : inn <: numtype))}: @@ -3864,25 +3898,25 @@ 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) ;; 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}) - -- if (x = |C.TYPE_context|) - -- if (dt*{dt} = $rolldt(x, rectype)) - -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt}], rectype, OK_oktypeidx(x)) + `%|-%:%`(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)) ;; 6-typing.watsup relation Local_ok: `%|-%:%`(context, local, localtype) @@ -3900,10 +3934,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 : uN(32) <: nat)]) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], 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) @@ -3935,7 +3969,7 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) ;; 6-typing.watsup rule active{C : context, x : idx, expr : expr, rt : reftype, lim : limits}: `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} ;; 6-typing.watsup @@ -3950,8 +3984,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 @@ -3959,7 +3993,7 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) ;; 6-typing.watsup rule active{C : context, x : idx, expr : expr, mt : memtype}: `%|-%:_OK`(C, ACTIVE_datamode(x, expr)) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + -- if (C.MEM_context[x.`%`.0] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} ;; 6-typing.watsup @@ -3970,7 +4004,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 @@ -3978,7 +4012,7 @@ relation Start_ok: `%|-%:_OK`(context, start) ;; 6-typing.watsup rule _{C : context, x : idx}: `%|-%:_OK`(C, START(x)) - -- Expand: `%~~%`(C.FUNC_context[(x : uN(32) <: nat)], FUNC_comptype(`%->%`([], []))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`([]), `%`([])))) ;; 6-typing.watsup relation Import_ok: `%|-%:%`(context, import, externtype) @@ -3992,22 +4026,22 @@ relation Externidx_ok: `%|-%:%`(context, externidx, externtype) ;; 6-typing.watsup rule func{C : context, x : idx, dt : deftype}: `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) - -- if (C.FUNC_context[(x : uN(32) <: nat)] = dt) + -- if (C.FUNC_context[x.`%`.0] = dt) ;; 6-typing.watsup rule global{C : context, x : idx, gt : globaltype}: `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = gt) + -- if (C.GLOBAL_context[x.`%`.0] = gt) ;; 6-typing.watsup rule table{C : context, x : idx, tt : tabletype}: `%|-%:%`(C, TABLE_externidx(x), TABLE_externtype(tt)) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = tt) + -- if (C.TABLE_context[x.`%`.0] = tt) ;; 6-typing.watsup rule mem{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup relation Export_ok: `%|-%:%`(context, export, externtype) @@ -4020,55 +4054,55 @@ 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}) + `%|-%:%`(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 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}, dt_1*{} :: dt*{dt}) - -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, 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 : 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) @@ -4078,7 +4112,7 @@ relation Ref_ok: `%|-%:%`(store, ref, reftype) ;; 7-runtime-typing.watsup rule i31{s : store, i : nat}: - `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) + `%|-%:%`(s, REF.I31_NUM_ref(`%`(i)), REF_reftype(`NULL%?`(?()), I31_heaptype)) ;; 7-runtime-typing.watsup rule struct{s : store, a : addr, dt : deftype}: @@ -4104,644 +4138,644 @@ 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}?{t})], [(val_1 : val <: admininstr)]) - -- if (c =/= 0) + `%~>%`([(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)]) - -- if (c = 0) + `%~>%`([(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})]) - -- if (c =/= 0) + `%~>%`([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})]) - -- if (c = 0) + `%~>%`([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 : uN(32) <: nat) + 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}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) - -- if (c =/= 0) + `%~>%`([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)], []) - -- if (c = 0) + `%~>%`([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}, 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}: - `%*_~>%*`([(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 <: 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)}: - `%*_~>%*`([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})], [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}: - `%*_~>%*`([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)]) - -- if (c = $ine($size(V128_valtype), c_1, 0)) + `%~>%`([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), pnn : pnn, N : N, c' : vec_(V128_vnn), c : iN($lsize((pnn : pnn <: lanetype))), ci* : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), N)))*, k^N : nat^N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((pnn : pnn <: imm), N))], [VCONST_admininstr(V128_vectype, c')]) - -- if (ci*{ci} = $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_2)) - -- if (c*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_1) :: 0^(256 - N){}) - -- if (c' = $invlanes_(`%X%`((pnn : pnn <: lanetype), N), c*{}[(ci*{ci}[k] : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), N))) <: nat)]^(k%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((pnn : pnn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) + -- if (ci*{ci : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), `%`(N))))} = $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_2)) + -- if (c*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_1) :: `%`(0)^(256 - N){}) + -- if (c' = $invlanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c*{}[ci*{ci : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), `%`(N))))}[k].`%`.0]^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((pnn : pnn <: imm), N), i*{i})], [VCONST_admininstr(V128_vectype, c)]) - -- if (c'*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_1) :: $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_2)) - -- if (c = $invlanes_(`%X%`((pnn : pnn <: lanetype), N), c'*{}[i*{i}[k]]^(k%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((pnn : pnn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) + -- if (c'*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_1) :: $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_2)) + -- if (c = $invlanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c'*{}[i*{i : nat}[k]]^(k%*`([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{})) + `%~>%`([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)]) - -- if (c_2 = $lanes_(`%X%`((nt : numtype <: lanetype), N), c_1)[i]) + `%~>%`([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)]) - -- if (c_2 = $ext($psize(pt), 32, sx, $lanes_(`%X%`((pt : packtype <: lanetype), N), c_1)[i])) + `%~>%`([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)]) - -- if (c = $invlanes_(`%X%`(lnn, N), $lanes_(`%X%`(lnn, N), c_1)[[i] = $packnum(lnn, c_2)])) + `%~>%`([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)]) - -- 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'})) + 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' : 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), imm : imm, N : N, ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), N)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), N), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), N)))], [CONST_admininstr(I32_numtype, 1)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((imm : imm <: lanetype), N), c)) - -- (if (ci_1 =/= (0 : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), N))))))*{ci_1} + rule vtestop-true{c : vec_(V128_vnn), imm : imm, N : N, ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c)) + -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), imm : imm, N : N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), N), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), N)))], [CONST_admininstr(I32_numtype, 0)]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup - rule vbitmask{c : vec_(V128_vnn), imm : imm, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), N)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`(imm, N))], [CONST_admininstr(I32_numtype, ci)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((imm : imm <: lanetype), N), c)) - -- if ($ibits(32, ci) = $ilt($lsize((imm : imm <: lanetype)), S_sx, ci_1, 0)*{ci_1}) + rule vbitmask{c : vec_(V128_vnn), imm : imm, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`(imm, `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c)) + -- if ($ibits(32, ci) = `%`($ilt($lsize((imm : imm <: lanetype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($lsize((imm : imm <: lanetype)))}) ;; 8-reduction.watsup - rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*, ci_2* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*, cj_1* : iN($lsize((imm_2 : imm <: lanetype)))*, cj_2* : iN($lsize((imm_2 : imm <: lanetype)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`(imm_1, N_1), `%X%`(imm_2, N_2), sx)], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_1)) - -- if (ci_2*{ci_2} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_2)) - -- if (cj_1*{cj_1} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_1)*{ci_1}) - -- if (cj_2*{cj_2} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_2)*{ci_2}) - -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), N_2), cj_1*{cj_1} :: cj_2*{cj_2})) + rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*, cj_1* : iN($lsize((imm_2 : imm <: lanetype)))*, cj_2* : iN($lsize((imm_2 : imm <: lanetype)))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_1)) + -- if (ci_2*{ci_2 : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_2)) + -- if (cj_1*{cj_1 : iN($lsize((imm_2 : imm <: lanetype)))} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_1)*{ci_1 : iN($lsize((imm_1 : imm <: lanetype)))}) + -- if (cj_2*{cj_2 : iN($lsize((imm_2 : imm <: lanetype)))} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_2)*{ci_2 : iN($lsize((imm_1 : imm <: lanetype)))}) + -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), cj_1*{cj_1 : lane_($lanetype(`%X%`((imm_2 : imm <: lanetype), `%`(N_2))))} :: cj_2*{cj_2 : lane_($lanetype(`%X%`((imm_2 : imm <: 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'})) + 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' : 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), imm_2 : imm, N_2 : N, vcvtop : vcvtop, hf : half, imm_1 : imm, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((imm_2 : imm <: lanetype), N_2), vcvtop, ?(hf), `%X%`((imm_1 : imm <: lanetype), N_1), sx?{sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci*{ci} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_1)[$halfop(hf, 0, N_2) : N_2]) - -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), N_2), $vcvtop(`%X%`((imm_1 : imm <: lanetype), N_1), `%X%`((imm_2 : imm <: lanetype), N_2), vcvtop, sx?{sx}, ci)*{ci})) + rule vcvtop-half{c_1 : vec_(V128_vnn), imm_2 : imm, N_2 : N, vcvtop : vcvtop, hf : half, imm_1 : imm, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((imm_1 : imm <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci*{ci : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) + -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), $vcvtop(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), `%X%`((imm_2 : imm <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((imm_1 : imm <: 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 : nat <: lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), N_2))))^N_1{})) + 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)]) + -- 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} :: [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}: - `%~>%*`(`%;%*`(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 : uN(32) <: nat)]) 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})]), [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}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[(x : uN(32) <: nat)]) 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'}, (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}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[(x : uN(32) <: nat)])]) + `%~>%`(`%;%`(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} :: [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}: - `%~>%*`(`%;%*`(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} :: [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}: - `%~>%*`(`%;%*`(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} :: [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))) ;; 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}, 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}: - `%~>%*`(`%;%*`(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)) @@ -4749,7 +4783,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))) @@ -4757,354 +4791,354 @@ 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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + ($size((nt : numtype <: valtype)) / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- if ($nbytes(nt, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : ($size((nt : numtype <: valtype)) / 8)]) + `%~>%`(`%;%`(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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (n / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 <: valtype)), sx, c))]) - -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (n / 8)]) + `%~>%`(`%;%`(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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + ($size(V128_valtype) / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- if ($vbytes(V128_vectype, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : ($size(V128_valtype) / 8)]) + `%~>%`(`%;%`(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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + ((M * N) / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- (if ($ibytes(M, j) = $mem(z, x).DATA_meminst[((i + (mo.OFFSET_memop : uN(32) <: nat)) + ((k * M) / 8)) : (M / 8)]))^(k%`(`%;%`(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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- if ($ibytes(N, j) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)]) + `%~>%`(`%;%`(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)) - -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), M), (j : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), M))))^M{})) + -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(M)), `%`(j)^M{})) ;; 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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- if ($ibytes(N, j) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)]) - -- if (c = $ext(N, 128, U_sx, j)) + `%~>%`(`%;%`(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, c_1 : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, j)]), [TRAP_admininstr]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, 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, c_1 : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, c : vec_(V128_vnn), k : nat, imm : imm, M : M}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, j)]), [VCONST_admininstr(V128_vectype, c)]) - -- if ($ibytes(N, k) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(V128_vectype, 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 = ($size(V128_valtype) / N)) - -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), M), $lanes_(`%X%`((imm : imm <: lanetype), M), c_1)[[j] = (k : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), M))))])) + -- if (M = ($vsize(V128_vectype) / N)) + -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(M)), $lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c_1)[[j] = `%`(k)])) ;; 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]) 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}), `%;%*`(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}: - `%~>%`(`%;%*`(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 zt})) - -- if (fv = $packval(zt*{zt}[i], val)) + `%~>%`(`%;%`(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} :: [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}: - `%~>%`(`%;%*`(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])) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + ($size((nt : numtype <: valtype)) / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 : uN(32) <: nat)), ($size((nt : numtype <: valtype)) / 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}: - `%~>%`(`%;%*`(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 : uN(32) <: nat)) + (n / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 : uN(32) <: nat)), (n / 8), b*{b}), [])) - -- if (b*{b} = $ibytes(n, $wrap($size((inn : inn <: valtype)), 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}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + ($size(V128_valtype) / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 : uN(32) <: nat)), ($size(V128_valtype) / 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}: - `%~>%`(`%;%*`(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 : uN(32) <: nat)) + N) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 : uN(32) <: nat)), (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])) + -- 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 { @@ -5113,21 +5147,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*) +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 { @@ -5137,19 +5171,19 @@ 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 (fi = {TYPE mm.TYPE_moduleinst[(x : uN(32) <: nat)], MODULE mm, CODE func}) + -- if (func = FUNC(x, local*{local : local}, expr)) + -- if (fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func}) ;; 9-module.watsup rec { @@ -5159,9 +5193,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 @@ -5178,16 +5212,16 @@ 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 def $alloctable(store : store, tabletype : tabletype, ref : ref) : (store, tableaddr) ;; 9-module.watsup - def $alloctable{s : store, i : nat, j : nat, rt : reftype, ref : ref, ti : tableinst}(s, `%%`(`[%..%]`(i, j), rt), ref) = (s[TABLE_store =.. [ti]], |s.TABLE_store|) - -- if (ti = {TYPE `%%`(`[%..%]`(i, j), rt), ELEM ref^i{}}) + def $alloctable{s : store, i : nat, j : nat, rt : reftype, ref : ref, ti : tableinst}(s, `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ref) = (s[TABLE_store =.. [ti]], |s.TABLE_store|) + -- if (ti = {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM ref^i{}}) ;; 9-module.watsup rec { @@ -5197,16 +5231,16 @@ 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 def $allocmem(store : store, memtype : memtype) : (store, memaddr) ;; 9-module.watsup - def $allocmem{s : store, i : nat, j : nat, mi : meminst}(s, `%I8`(`[%..%]`(i, j))) = (s[MEM_store =.. [mi]], |s.MEM_store|) - -- if (mi = {TYPE `%I8`(`[%..%]`(i, j)), DATA 0^((i * 64) * $Ki){}}) + def $allocmem{s : store, i : nat, j : nat, mi : meminst}(s, `%I8`(`[%..%]`(`%`(i), `%`(j)))) = (s[MEM_store =.. [mi]], |s.MEM_store|) + -- if (mi = {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA `%`(0)^((i * 64) * $Ki){}}) ;; 9-module.watsup rec { @@ -5216,16 +5250,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 { @@ -5235,16 +5269,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 { @@ -5254,113 +5288,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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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}))) - -;; 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 : byte <: nat))) - ;; 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 : byte <: nat) - 192)) + ((b_2 : byte <: nat) - 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 : byte <: nat) - 224)) + ((2 ^ 6) * ((b_2 : byte <: nat) - 128))) + ((b_3 : byte <: nat) - 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 : byte <: nat) - 240)) + ((2 ^ 12) * ((b_2 : byte <: nat) - 128))) + ((2 ^ 6) * ((b_3 : byte <: nat) - 128))) + ((b_4 : byte <: nat) - 128)))) - ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(ch*{ch}) = $concat_(syntax byte, $utf8([ch])*{ch}) -} + -- 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) @@ -5379,14 +5392,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 = `...` @@ -5394,21 +5407,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) +syntax recordeq = `%++%=%`{recordstar : recordstar}(recordstar : recordstar, recordstar, recordstar) ;; C-conventions.watsup syntax pth = diff --git a/spectec/test-interpreter/TEST.md b/spectec/test-interpreter/TEST.md index 873201cfd4..a7b33a80ca 100644 --- a/spectec/test-interpreter/TEST.md +++ b/spectec/test-interpreter/TEST.md @@ -24468,110 +24468,110 @@ Expect: 26_984 : [i32] - 1/17 (5.88%) ===== ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast ===== -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:13.1-15.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:16.1-18.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:19.1-21.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:22.1-24.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:25.1-27.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:28.1-30.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:31.1-33.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:34.1-36.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:37.1-39.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:40.1-42.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:43.1-45.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:46.1-48.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:49.1-51.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:52.1-54.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:55.1-57.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:58.1-60.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:61.1-63.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:64.1-66.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:67.1-69.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:70.1-72.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:73.1-75.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:76.1-78.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:79.1-81.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:82.1-84.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:85.1-87.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:88.1-90.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:93.1-95.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:96.1-98.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:99.1-101.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:102.1-104.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:105.1-107.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:108.1-110.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:111.1-113.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:114.1-116.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:117.1-119.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:120.1-122.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:123.1-125.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:126.1-128.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:129.1-131.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:132.1-134.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:135.1-137.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:138.1-140.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:141.1-143.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:144.1-146.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:147.1-149.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:150.1-152.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:153.1-155.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:156.1-158.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:159.1-161.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:162.1-164.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:165.1-167.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:168.1-170.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:173.1-175.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:176.1-178.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:179.1-181.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:182.1-184.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:185.1-187.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:188.1-190.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:191.1-193.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:194.1-196.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:197.1-199.126 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:200.1-202.126 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:203.1-205.126 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:206.1-208.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:209.1-211.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:212.1-214.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:215.1-217.126 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:218.1-220.126 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:221.1-223.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:224.1-226.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:227.1-229.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:230.1-232.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:233.1-235.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:236.1-238.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:239.1-241.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:242.1-244.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:245.1-247.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:248.1-250.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:253.1-255.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:256.1-258.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:259.1-261.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:262.1-264.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:265.1-267.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:268.1-270.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:271.1-273.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:274.1-276.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:277.1-279.127 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:280.1-282.127 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:283.1-285.127 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:286.1-288.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:289.1-291.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:292.1-294.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:295.1-297.127 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:298.1-300.127 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:301.1-303.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:304.1-306.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:307.1-309.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:310.1-312.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:313.1-315.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:316.1-318.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:319.1-321.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:322.1-324.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:325.1-327.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:328.1-330.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:13.1-15.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:16.1-18.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:19.1-21.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:22.1-24.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:25.1-27.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:28.1-30.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:31.1-33.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:34.1-36.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:37.1-39.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:40.1-42.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:43.1-45.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:46.1-48.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:49.1-51.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:52.1-54.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:55.1-57.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:58.1-60.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:61.1-63.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:64.1-66.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:67.1-69.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:70.1-72.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:73.1-75.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:76.1-78.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:79.1-81.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:82.1-84.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:85.1-87.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:88.1-90.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:93.1-95.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:96.1-98.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:99.1-101.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:102.1-104.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:105.1-107.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:108.1-110.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:111.1-113.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:114.1-116.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:117.1-119.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:120.1-122.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:123.1-125.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:126.1-128.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:129.1-131.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:132.1-134.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:135.1-137.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:138.1-140.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:141.1-143.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:144.1-146.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:147.1-149.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:150.1-152.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:153.1-155.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:156.1-158.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:159.1-161.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:162.1-164.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:165.1-167.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:168.1-170.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:173.1-175.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:176.1-178.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:179.1-181.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:182.1-184.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:185.1-187.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:188.1-190.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:191.1-193.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:194.1-196.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:197.1-199.126 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:200.1-202.126 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:203.1-205.126 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:206.1-208.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:209.1-211.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:212.1-214.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:215.1-217.126 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:218.1-220.126 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:221.1-223.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:224.1-226.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:227.1-229.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:230.1-232.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:233.1-235.86 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:236.1-238.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:239.1-241.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:242.1-244.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:245.1-247.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:248.1-250.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:253.1-255.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:256.1-258.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:259.1-261.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:262.1-264.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:265.1-267.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:268.1-270.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:271.1-273.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:274.1-276.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:277.1-279.127 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:280.1-282.127 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:283.1-285.127 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:286.1-288.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:289.1-291.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:292.1-294.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:295.1-297.127 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:298.1-300.127 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:301.1-303.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:304.1-306.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:307.1-309.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:310.1-312.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:313.1-315.87 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:316.1-318.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:319.1-321.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:322.1-324.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:325.1-327.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i16x8_extmul_i8x16.wast:328.1-330.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) - 1/105 (0.95%) ===== ../../test-interpreter/spec-test-3/simd/simd_i16x8_q15mulr_sat_s.wast ===== @@ -24695,110 +24695,110 @@ Expect: 0 0 0 0 0 0 0 0 : [v128] - 1/17 (5.88%) ===== ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast ===== -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:13.1-15.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:16.1-18.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:19.1-21.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:22.1-24.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:25.1-27.82 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:28.1-30.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:31.1-33.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:34.1-36.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:37.1-39.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:40.1-42.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:43.1-45.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:46.1-48.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:49.1-51.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:52.1-54.98 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:55.1-57.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:58.1-60.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:61.1-63.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:64.1-66.114 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:67.1-69.114 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:70.1-72.114 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:73.1-75.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:76.1-78.82 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:79.1-81.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:82.1-84.98 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:85.1-87.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:88.1-90.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:93.1-95.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:96.1-98.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:99.1-101.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:102.1-104.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:105.1-107.83 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:108.1-110.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:111.1-113.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:114.1-116.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:117.1-119.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:120.1-122.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:123.1-125.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:126.1-128.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:129.1-131.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:132.1-134.99 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:135.1-137.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:138.1-140.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:141.1-143.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:144.1-146.115 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:147.1-149.115 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:150.1-152.115 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:153.1-155.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:156.1-158.83 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:159.1-161.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:162.1-164.99 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:165.1-167.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:168.1-170.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:173.1-175.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:176.1-178.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:179.1-181.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:182.1-184.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:185.1-187.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:188.1-190.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:191.1-193.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:194.1-196.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:197.1-199.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:200.1-202.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:203.1-205.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:206.1-208.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:209.1-211.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:212.1-214.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:215.1-217.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:218.1-220.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:221.1-223.114 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:224.1-226.114 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:227.1-229.114 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:230.1-232.114 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:233.1-235.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:236.1-238.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:239.1-241.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:242.1-244.114 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:245.1-247.114 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:248.1-250.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:253.1-255.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:256.1-258.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:259.1-261.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:262.1-264.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:265.1-267.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:268.1-270.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:271.1-273.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:274.1-276.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:277.1-279.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:280.1-282.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:283.1-285.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:286.1-288.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:289.1-291.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:292.1-294.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:295.1-297.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:298.1-300.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:301.1-303.115 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:304.1-306.115 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:307.1-309.115 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:310.1-312.115 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:313.1-315.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:316.1-318.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:319.1-321.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:322.1-324.115 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:325.1-327.115 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:328.1-330.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:13.1-15.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:16.1-18.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:19.1-21.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:22.1-24.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:25.1-27.82 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:28.1-30.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:31.1-33.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:34.1-36.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:37.1-39.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:40.1-42.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:43.1-45.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:46.1-48.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:49.1-51.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:52.1-54.98 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:55.1-57.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:58.1-60.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:61.1-63.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:64.1-66.114 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:67.1-69.114 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:70.1-72.114 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:73.1-75.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:76.1-78.82 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:79.1-81.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:82.1-84.98 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:85.1-87.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:88.1-90.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:93.1-95.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:96.1-98.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:99.1-101.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:102.1-104.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:105.1-107.83 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:108.1-110.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:111.1-113.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:114.1-116.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:117.1-119.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:120.1-122.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:123.1-125.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:126.1-128.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:129.1-131.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:132.1-134.99 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:135.1-137.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:138.1-140.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:141.1-143.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:144.1-146.115 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:147.1-149.115 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:150.1-152.115 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:153.1-155.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:156.1-158.83 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:159.1-161.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:162.1-164.99 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:165.1-167.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:168.1-170.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:173.1-175.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:176.1-178.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:179.1-181.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:182.1-184.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:185.1-187.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:188.1-190.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:191.1-193.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:194.1-196.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:197.1-199.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:200.1-202.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:203.1-205.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:206.1-208.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:209.1-211.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:212.1-214.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:215.1-217.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:218.1-220.118 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:221.1-223.114 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:224.1-226.114 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:227.1-229.114 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:230.1-232.114 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:233.1-235.78 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:236.1-238.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:239.1-241.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:242.1-244.114 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:245.1-247.114 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:248.1-250.102 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:253.1-255.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:256.1-258.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:259.1-261.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:262.1-264.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:265.1-267.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:268.1-270.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:271.1-273.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:274.1-276.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:277.1-279.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:280.1-282.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:283.1-285.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:286.1-288.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:289.1-291.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:292.1-294.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:295.1-297.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:298.1-300.119 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:301.1-303.115 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:304.1-306.115 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:307.1-309.115 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:310.1-312.115 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:313.1-315.79 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:316.1-318.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:319.1-321.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:322.1-324.115 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:325.1-327.115 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i32x4_extmul_i16x8.wast:328.1-330.103 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) - 1/105 (0.95%) ===== ../../test-interpreter/spec-test-3/simd/simd_i32x4_trunc_sat_f32x4.wast ===== @@ -24945,84 +24945,84 @@ Expect: 0 0 0 0 0 0 0 0 : [v128] - Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:82.1-84.94 (Failure("Algorithm not found: VEXBINOP")) - Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:85.1-87.92 (Failure("Algorithm not found: VEXBINOP")) - Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:88.1-90.74 (Failure("Algorithm not found: VEXBINOP")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:93.1-95.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:96.1-98.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:99.1-101.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:102.1-104.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:105.1-107.77 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:108.1-110.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:111.1-113.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:114.1-116.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:117.1-119.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:120.1-122.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:123.1-125.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:126.1-128.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:129.1-131.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:132.1-134.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:135.1-137.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:138.1-140.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:141.1-143.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:144.1-146.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:147.1-149.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:150.1-152.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:153.1-155.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:156.1-158.77 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:159.1-161.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:162.1-164.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:165.1-167.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:168.1-170.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:173.1-175.74 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:176.1-178.74 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:179.1-181.74 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:182.1-184.74 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:185.1-187.92 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:188.1-190.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:191.1-193.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:194.1-196.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:197.1-199.112 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:200.1-202.112 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:203.1-205.112 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:206.1-208.92 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:209.1-211.92 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:212.1-214.92 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:215.1-217.112 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:218.1-220.112 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:221.1-223.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:224.1-226.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:227.1-229.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:230.1-232.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:233.1-235.74 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:236.1-238.92 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:239.1-241.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:242.1-244.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:245.1-247.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:248.1-250.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:253.1-255.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:256.1-258.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:259.1-261.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:262.1-264.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:265.1-267.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:268.1-270.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:271.1-273.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:274.1-276.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:277.1-279.113 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:280.1-282.113 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:283.1-285.113 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:286.1-288.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:289.1-291.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:292.1-294.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:295.1-297.113 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:298.1-300.113 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:301.1-303.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:304.1-306.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:307.1-309.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:310.1-312.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:313.1-315.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:316.1-318.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:319.1-321.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:322.1-324.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:325.1-327.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) -- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:328.1-330.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), N_1), `%X%`((inn_2 : inn <: imm), N_2)), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:93.1-95.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:96.1-98.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:99.1-101.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:102.1-104.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:105.1-107.77 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:108.1-110.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:111.1-113.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:114.1-116.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:117.1-119.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:120.1-122.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:123.1-125.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:126.1-128.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:129.1-131.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:132.1-134.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:135.1-137.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:138.1-140.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:141.1-143.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:144.1-146.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:147.1-149.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:150.1-152.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:153.1-155.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:156.1-158.77 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:159.1-161.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:162.1-164.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:165.1-167.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:168.1-170.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:173.1-175.74 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:176.1-178.74 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:179.1-181.74 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:182.1-184.74 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:185.1-187.92 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:188.1-190.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:191.1-193.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:194.1-196.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:197.1-199.112 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:200.1-202.112 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:203.1-205.112 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:206.1-208.92 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:209.1-211.92 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:212.1-214.92 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:215.1-217.112 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:218.1-220.112 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:221.1-223.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:224.1-226.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:227.1-229.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:230.1-232.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:233.1-235.74 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:236.1-238.92 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:239.1-241.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:242.1-244.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:245.1-247.110 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:248.1-250.94 (Failure("Invalid assignment on value (EXTMUL LOW): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:253.1-255.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:256.1-258.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:259.1-261.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:262.1-264.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:265.1-267.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:268.1-270.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:271.1-273.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:274.1-276.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:277.1-279.113 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:280.1-282.113 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:283.1-285.113 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:286.1-288.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:289.1-291.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:292.1-294.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:295.1-297.113 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:298.1-300.113 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:301.1-303.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:304.1-306.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:307.1-309.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:310.1-312.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:313.1-315.75 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:316.1-318.93 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:319.1-321.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:322.1-324.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:325.1-327.111 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) +- Test failed at ../../test-interpreter/spec-test-3/simd/simd_i64x2_extmul_i32x4.wast:328.1-330.95 (Failure("Invalid assignment on value (EXTMUL HIGH): CaseE (DOT_vextbinop_(`%X%`((inn_1 : inn <: imm), `%`(N_1)), `%X%`((inn_2 : inn <: imm), `%`(N_2))), []) @3-numerics.watsup:446.42-446.45")) - 1/105 (0.95%) ===== ../../test-interpreter/spec-test-3/simd/simd_i8x16_arith.wast ===== diff --git a/spectec/test-latex/spec-gen.include-wasm-1.0.tex b/spectec/test-latex/spec-gen.include-wasm-1.0.tex index 87a859f384..e96c92c7fc 100644 --- a/spectec/test-latex/spec-gen.include-wasm-1.0.tex +++ b/spectec/test-latex/spec-gen.include-wasm-1.0.tex @@ -45,17 +45,8 @@ $$ \begin{array}{@{}lrrl@{}l@{}} -& {\mathit{list}}({\mathit{A}}) &::=& {{\mathit{A}}^\ast} &\quad - \mbox{if}~{|{{\mathit{A}}^\ast}|} < {2^{32}} \\ -\end{array} -$$ - -\vspace{1ex} - -$$ -\begin{array}{@{}lrrl@{}l@{}} -\mbox{(character)} & {\mathit{char}} &::=& \mathrm{U{+}00} ~|~ \dots ~|~ \mathrm{U{+}D7FF} ~|~ \mathrm{U{+}E000} ~|~ \dots ~|~ \mathrm{U{+}10FFFF} \\ -\mbox{(name)} & {\mathit{name}} &::=& {{\mathit{char}}^\ast} \\ +& {\mathit{list}}({\mathit{X}}) &::=& {{\mathit{X}}^\ast} &\quad + \mbox{if}~{|{{\mathit{X}}^\ast}|} < {2^{32}} \\ \end{array} $$ @@ -138,6 +129,21 @@ \vspace{1ex} +$$ +\begin{array}{@{}lrrl@{}l@{}} +\mbox{(character)} & {\mathit{char}} &::=& \mathrm{U{+}00} ~|~ \dots ~|~ \mathrm{U{+}D7FF} ~|~ \mathrm{U{+}E000} ~|~ \dots ~|~ \mathrm{U{+}10FFFF} \\ +\end{array} +$$ + +$$ +\begin{array}{@{}lrrl@{}l@{}} +\mbox{(name)} & {\mathit{name}} &::=& {{\mathit{char}}^\ast} &\quad + \mbox{if}~{|{\mathrm{utf{\scriptstyle8}}}({{\mathit{char}}^\ast})|} < {2^{32}} \\ +\end{array} +$$ + +\vspace{1ex} + $$ \begin{array}{@{}lrrl@{}l@{}} \mbox{(index)} & {\mathit{idx}} &::=& {\mathit{u{\scriptstyle32}}} \\ diff --git a/spectec/test-middlend/TEST.md b/spectec/test-middlend/TEST.md index 508013cfca..5738b83b9e 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,29 +54,28 @@ 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 -syntax list{syntax X}(syntax X) = X* +syntax list{syntax X}(syntax X) = `%`{X* : X*}(X*{X : X} : X*) + -- if (|X*{X : X}| < (2 ^ 32)) ;; 1-syntax.watsup -syntax char = nat +syntax bit = `%`{i : nat}(i : nat) + -- if ((i = 0) \/ (i = 1)) ;; 1-syntax.watsup -syntax name = char* +syntax byte = `%`{i : nat}(i : nat) + -- if ((i >= 0) /\ (i <= 255)) ;; 1-syntax.watsup -syntax bit = nat +syntax uN{N : N}(N) = `%`{i : nat}(i : nat) + -- if ((i >= 0) /\ (i <= ((2 ^ N) - 1))) ;; 1-syntax.watsup -syntax byte = nat - -;; 1-syntax.watsup -syntax uN{N : N}(N) = nat - -;; 1-syntax.watsup -syntax sN{N : N}(N) = int +syntax sN{N : N}(N) = `%`{i : int}(i : int) + -- if ((((i >= - ((2 ^ (N - 1)) : nat <: int)) /\ (i <= - (1 : nat <: int))) \/ (i = (0 : nat <: int))) \/ ((i >= + (1 : nat <: int)) /\ (i <= (((2 ^ (N - 1)) - 1) : nat <: int)))) ;; 1-syntax.watsup syntax iN{N : N}(N) = uN(N) @@ -138,8 +137,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) @@ -165,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 @@ -235,20 +263,20 @@ 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 | 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 +;; 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 @@ -256,40 +284,40 @@ 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, storagetype) +;; 1-syntax.watsup:176.1-177.18 +syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) -;; 1-syntax.watsup:178.1-178.70 -syntax functype = `%->%`(resulttype, resulttype) +;; 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) - | 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 +;; 1-syntax.watsup:190.1-191.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 +;; 1-syntax.watsup:193.1-194.22 syntax rectype = - | REC(list : list(syntax subtype)) + | 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) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY | EQ | I31 @@ -301,13 +329,13 @@ syntax heaptype = | EXTERN | NOEXTERN | BOT - | DEF(rectype : rectype, 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 = @@ -360,19 +388,19 @@ syntax imm = ;; 1-syntax.watsup syntax deftype = - | DEF(rectype : rectype, nat) + | DEF{rectype : rectype}(rectype : rectype, nat) ;; 1-syntax.watsup -syntax limits = `[%..%]`(u32, u32) +syntax limits = `[%..%]`{u32 : u32}(u32 : u32, u32) ;; 1-syntax.watsup -syntax globaltype = `%%`(mut, valtype) +syntax globaltype = `%%`{mut : mut, valtype : valtype}(mut : mut, valtype : valtype) ;; 1-syntax.watsup -syntax tabletype = `%%`(limits, reftype) +syntax tabletype = `%%`{limits : limits, reftype : reftype}(limits : limits, reftype : reftype) ;; 1-syntax.watsup -syntax memtype = `%I8`(limits) +syntax memtype = `%I8`{limits : limits}(limits : limits) ;; 1-syntax.watsup syntax elemtype = reftype @@ -382,23 +410,26 @@ 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(valtype : valtype) : nat +def $size(numtype : numtype) : nat ;; 2-syntax-aux.watsup - def $size(I32_valtype) = 32 + def $size(I32_numtype) = 32 ;; 2-syntax-aux.watsup - def $size(I64_valtype) = 64 + def $size(I64_numtype) = 64 ;; 2-syntax-aux.watsup - def $size(F32_valtype) = 32 + def $size(F32_numtype) = 32 ;; 2-syntax-aux.watsup - def $size(F64_valtype) = 64 + def $size(F64_numtype) = 64 + +;; 1-syntax.watsup +def $vsize(vectype : vectype) : nat ;; 2-syntax-aux.watsup - def $size(V128_valtype) = 128 + def $vsize(V128_vectype) = 128 ;; 1-syntax.watsup def $psize(packtype : packtype) : nat @@ -410,41 +441,44 @@ def $psize(packtype : packtype) : nat ;; 1-syntax.watsup def $lsize(lanetype : lanetype) : nat ;; 2-syntax-aux.watsup - def $lsize{numtype : numtype}((numtype : numtype <: lanetype)) = $size((numtype : numtype <: valtype)) + def $lsize{numtype : numtype}((numtype : numtype <: lanetype)) = $size(numtype) ;; 2-syntax-aux.watsup def $lsize{packtype : packtype}((packtype : packtype <: lanetype)) = $psize(packtype) ;; 1-syntax.watsup def $zsize(storagetype : storagetype) : nat ;; 2-syntax-aux.watsup - def $zsize{valtype : valtype}((valtype : valtype <: storagetype)) = $size(valtype) + def $zsize{numtype : numtype}((numtype : numtype <: storagetype)) = $size(numtype) + ;; 2-syntax-aux.watsup + def $zsize{vectype : vectype}((vectype : vectype <: storagetype)) = $vsize(vectype) ;; 2-syntax-aux.watsup def $zsize{packtype : packtype}((packtype : packtype <: storagetype)) = $psize(packtype) ;; 1-syntax.watsup -syntax dim = nat +syntax dim = `%`{i : nat}(i : nat) + -- if (((((i = 1) \/ (i = 2)) \/ (i = 4)) \/ (i = 8)) \/ (i = 16)) ;; 1-syntax.watsup -syntax shape = `%X%`(lanetype, dim) +syntax shape = `%X%`{lanetype : lanetype, dim : dim}(lanetype : lanetype, dim : dim) ;; 1-syntax.watsup def $lanetype(shape : shape) : lanetype ;; 2-syntax-aux.watsup - def $lanetype{lnn : lnn, N : N}(`%X%`(lnn, N)) = lnn + def $lanetype{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = lnn ;; 1-syntax.watsup -def $sizenn(valtype : valtype) : nat +def $sizenn(numtype : numtype) : nat ;; 1-syntax.watsup - def $sizenn{t : valtype}(t) = $size(t) + def $sizenn{nt : numtype}(nt) = $size(nt) ;; 1-syntax.watsup syntax num_(numtype : numtype) ;; 1-syntax.watsup - syntax num_{inn : inn}((inn : inn <: numtype)) = iN($sizenn((inn : inn <: valtype))) + syntax num_{inn : inn}((inn : inn <: numtype)) = iN($sizenn((inn : inn <: numtype))) ;; 1-syntax.watsup - syntax num_{fnn : fnn}((fnn : fnn <: numtype)) = fN($sizenn((fnn : fnn <: valtype))) + syntax num_{fnn : fnn}((fnn : fnn <: numtype)) = fN($sizenn((fnn : fnn <: numtype))) ;; 1-syntax.watsup @@ -465,7 +499,7 @@ syntax lane_(lanetype : lanetype) ;; 1-syntax.watsup -syntax vec_{vnn : vnn}(vnn) = vN($size((vnn : vnn <: valtype))) +syntax vec_{vnn : vnn}(vnn) = vN($vsize(vnn)) ;; 1-syntax.watsup syntax zval_(storagetype : storagetype) @@ -493,7 +527,7 @@ syntax unop_(numtype : numtype) | CLZ | CTZ | POPCNT - | EXTEND(n : n) + | EXTEND{n : n}(n : n) ;; 1-syntax.watsup @@ -514,13 +548,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 @@ -546,10 +580,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 @@ -569,23 +603,23 @@ syntax cvtop = | REINTERPRET ;; 1-syntax.watsup -syntax ishape = `%X%`(imm, dim) +syntax ishape = `%X%`{imm : imm, dim : dim}(imm : imm, dim : dim) ;; 1-syntax.watsup -syntax fshape = `%X%`(fnn, dim) +syntax fshape = `%X%`{fnn : fnn, dim : dim}(fnn : fnn, dim : dim) ;; 1-syntax.watsup -syntax pshape = `%X%`(pnn, dim) +syntax pshape = `%X%`{pnn : pnn, dim : dim}(pnn : pnn, dim : dim) ;; 1-syntax.watsup def $dim(shape : shape) : dim ;; 2-syntax-aux.watsup - def $dim{lnn : lnn, N : N}(`%X%`(lnn, N)) = N + def $dim{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = `%`(N) ;; 1-syntax.watsup def $shsize(shape : shape) : nat ;; 2-syntax-aux.watsup - def $shsize{lnn : lnn, N : N}(`%X%`(lnn, N)) = ($lsize(lnn) * N) + def $shsize{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = ($lsize(lnn) * N) ;; 1-syntax.watsup syntax vvunop = @@ -609,7 +643,7 @@ syntax vvtestop = ;; 1-syntax.watsup syntax vunop_(shape : shape) ;; 1-syntax.watsup - syntax vunop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + syntax vunop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ABS | NEG | POPCNT{imm : imm} @@ -617,7 +651,7 @@ syntax vunop_(shape : shape) ;; 1-syntax.watsup - syntax vunop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vunop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | ABS | NEG | SQRT @@ -630,12 +664,12 @@ syntax vunop_(shape : shape) ;; 1-syntax.watsup syntax vbinop_(shape : shape) ;; 1-syntax.watsup - syntax vbinop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + 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) @@ -643,14 +677,14 @@ 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) ;; 1-syntax.watsup - syntax vbinop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vbinop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | ADD | SUB | MUL @@ -662,23 +696,23 @@ syntax vbinop_(shape : shape) ;; 1-syntax.watsup -syntax vtestop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = +syntax vtestop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ALL_TRUE ;; 1-syntax.watsup syntax vrelop_(shape : shape) ;; 1-syntax.watsup - syntax vrelop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + 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 - syntax vrelop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vrelop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | EQ | NE | LT @@ -696,12 +730,12 @@ syntax vcvtop = | PROMOTE ;; 1-syntax.watsup -syntax vshiftop_{imm : imm, N : N}(`%X%`(imm, N)) = +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)) = +syntax vextunop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = | EXTADD_PAIRWISE -- if ((16 <= $lsize((imm_1 : imm <: lanetype))) /\ ($lsize((imm_1 : imm <: lanetype)) <= 32)) @@ -711,28 +745,28 @@ syntax half = | HIGH ;; 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) +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}(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, sx : sx) + | 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%?`(()?) @@ -740,113 +774,113 @@ syntax zero = `ZERO%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:521.1-533.78 +;; 1-syntax.watsup:523.1-535.78 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)) : dim <: nat))) - | 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) + -- if (ishape = `%X%`(I8_imm, `%`(16))) + | 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) - | 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 @@ -854,57 +888,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) +syntax type = TYPE{rectype : rectype}(rectype : rectype) ;; 1-syntax.watsup -syntax local = LOCAL(valtype) +syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`(typeidx, local*, 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, expr) +syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) ;; 1-syntax.watsup -syntax table = TABLE(tabletype, expr) +syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, expr : expr) ;; 1-syntax.watsup -syntax mem = MEMORY(memtype) +syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`(reftype, expr*, 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) +syntax data = DATA{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup -syntax start = START(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, externidx) +syntax export = EXPORT{name : name, externidx : externidx}(name : name, externidx : externidx) ;; 1-syntax.watsup -syntax import = IMPORT(name, name, 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 { @@ -914,10 +948,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 } @@ -927,9 +961,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 @@ -949,18 +983,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 { @@ -970,7 +1004,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 @@ -1015,7 +1049,7 @@ def $diffrt(reftype : reftype, reftype : reftype) : reftype ;; 2-syntax-aux.watsup syntax typevar = - | _IDX(typeidx : typeidx) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | REC(nat) ;; 2-syntax-aux.watsup @@ -1026,181 +1060,181 @@ def $idx(typeidx : typeidx) : typevar ;; 2-syntax-aux.watsup rec { -;; 2-syntax-aux.watsup:122.1-122.92 +;; 2-syntax-aux.watsup:125.1-125.92 def $subst_typevar(typevar : typevar, typevar*, heaptype*) : heaptype - ;; 2-syntax-aux.watsup:147.1-147.38 + ;; 2-syntax-aux.watsup:150.1-150.38 def $subst_typevar{xx : typevar}(xx, [], []) = (xx : typevar <: heaptype) - ;; 2-syntax-aux.watsup:148.1-148.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 + ;; 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' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = ht_1 -- if (xx = xx_1) - ;; 2-syntax-aux.watsup:149.1-149.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'}) + ;; 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' : 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 { -;; 2-syntax-aux.watsup:126.1-126.92 +;; 2-syntax-aux.watsup:129.1-129.92 def $subst_heaptype(heaptype : heaptype, typevar*, heaptype*) : heaptype - ;; 2-syntax-aux.watsup:154.1-154.67 - def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) - ;; 2-syntax-aux.watsup:155.1-155.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) - ;; 2-syntax-aux.watsup:156.1-156.55 - def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx}, ht*{ht}) = ht' + ;; 2-syntax-aux.watsup:157.1-157.67 + 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 : 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 : typevar}, ht*{ht : heaptype}) = ht' -- otherwise -;; 2-syntax-aux.watsup:127.1-127.92 +;; 2-syntax-aux.watsup:130.1-130.92 def $subst_reftype(reftype : reftype, typevar*, heaptype*) : reftype - ;; 2-syntax-aux.watsup:158.1-158.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})) + ;; 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 : typevar}, ht*{ht : heaptype}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})) -;; 2-syntax-aux.watsup:128.1-128.92 +;; 2-syntax-aux.watsup:131.1-131.92 def $subst_valtype(valtype : valtype, typevar*, heaptype*) : valtype - ;; 2-syntax-aux.watsup:160.1-160.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) - ;; 2-syntax-aux.watsup:161.1-161.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) - ;; 2-syntax-aux.watsup:162.1-162.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) - ;; 2-syntax-aux.watsup:163.1-163.40 - def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + ;; 2-syntax-aux.watsup:163.1-163.64 + 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 : 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 : 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 : typevar}, ht*{ht : heaptype}) = BOT_valtype -;; 2-syntax-aux.watsup:131.1-131.92 +;; 2-syntax-aux.watsup:134.1-134.92 def $subst_storagetype(storagetype : storagetype, typevar*, heaptype*) : storagetype - ;; 2-syntax-aux.watsup:167.1-167.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) - ;; 2-syntax-aux.watsup:168.1-168.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) + ;; 2-syntax-aux.watsup:170.1-170.66 + 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 : typevar}, ht*{ht : heaptype}) = ($subst_packtype(pt, xx*{xx : typevar}, ht*{ht : heaptype}) : packtype <: storagetype) -;; 2-syntax-aux.watsup:132.1-132.92 +;; 2-syntax-aux.watsup:135.1-135.92 def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype - ;; 2-syntax-aux.watsup:170.1-170.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})) + ;; 2-syntax-aux.watsup:173.1-173.80 + 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:134.1-134.92 +;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype - ;; 2-syntax-aux.watsup:172.1-172.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}) - ;; 2-syntax-aux.watsup:173.1-173.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})) - ;; 2-syntax-aux.watsup:174.1-174.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})) - -;; 2-syntax-aux.watsup:135.1-135.92 + ;; 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})) + ;; 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 + 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:176.1-177.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})) - ;; 2-syntax-aux.watsup:178.1-179.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})) + ;; 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 : 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' : 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:136.1-136.92 +;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype - ;; 2-syntax-aux.watsup:181.1-181.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}) + ;; 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})) -;; 2-syntax-aux.watsup:137.1-137.92 +;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype - ;; 2-syntax-aux.watsup:183.1-183.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) + ;; 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 : typevar}, ht*{ht : heaptype}) = DEF_deftype($subst_rectype(qt, xx*{xx : typevar}, ht*{ht : heaptype}), i) -;; 2-syntax-aux.watsup:140.1-140.92 +;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype - ;; 2-syntax-aux.watsup:186.1-186.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}) + ;; 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})) } ;; 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, x^n : idx^n}(rt, ht^n{ht}) = $subst_reftype(rt, $idx(x)^(x (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) + -- if (ishape = `%X%`(I8_imm, `%`(16))) + | 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) - | 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, admininstr*) +syntax config = `%;%`{state : state, admininstr* : admininstr*}(state : state, admininstr*{admininstr : admininstr} : admininstr*) ;; 4-runtime.watsup rec { @@ -2307,28 +2341,28 @@ 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? ;; 5-runtime-aux.watsup - def $default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) + def $default(I32_valtype) = ?(CONST_val(I32_numtype, `%`(0))) ;; 5-runtime-aux.watsup - def $default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) + def $default(I64_valtype) = ?(CONST_val(I64_numtype, `%`(0))) ;; 5-runtime-aux.watsup def $default(F32_valtype) = ?(CONST_val(F32_numtype, $fzero(32))) ;; 5-runtime-aux.watsup def $default(F64_valtype) = ?(CONST_val(F64_numtype, $fzero(64))) ;; 5-runtime-aux.watsup - def $default(V128_valtype) = ?(VCONST_val(V128_vectype, 0)) + def $default(V128_valtype) = ?(VCONST_val(V128_vectype, `%`(0))) ;; 5-runtime-aux.watsup def $default{ht : heaptype}(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) ;; 5-runtime-aux.watsup @@ -2339,14 +2373,14 @@ def $packval(storagetype : storagetype, val : val) : fieldval ;; 5-runtime-aux.watsup def $packval{t : valtype, val : val}((t : valtype <: storagetype), val) = (val : val <: fieldval) ;; 5-runtime-aux.watsup - def $packval{pt : packtype, i : nat}((pt : packtype <: storagetype), CONST_val(I32_numtype, i)) = PACK_fieldval(pt, $wrap(32, $psize(pt), i)) + def $packval{pt : packtype, i : nat}((pt : packtype <: storagetype), CONST_val(I32_numtype, `%`(i))) = PACK_fieldval(pt, $wrap(32, $psize(pt), `%`(i))) ;; 5-runtime-aux.watsup def $unpackval(storagetype : storagetype, sx?, fieldval : fieldval) : val ;; 5-runtime-aux.watsup def $unpackval{t : valtype, val : val}((t : valtype <: storagetype), ?(), (val : val <: fieldval)) = val ;; 5-runtime-aux.watsup - def $unpackval{pt : packtype, sx : sx, i : nat}((pt : packtype <: storagetype), ?(sx), PACK_fieldval(pt, i)) = CONST_val(I32_numtype, $ext($psize(pt), 32, sx, i)) + def $unpackval{pt : packtype, sx : sx, i : nat}((pt : packtype <: storagetype), ?(sx), PACK_fieldval(pt, `%`(i))) = CONST_val(I32_numtype, $ext($psize(pt), 32, sx, `%`(i))) ;; 5-runtime-aux.watsup rec { @@ -2356,9 +2390,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 } @@ -2370,9 +2404,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 } @@ -2384,9 +2418,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 } @@ -2398,9 +2432,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 } @@ -2467,82 +2501,82 @@ def $moduleinst(state : state) : moduleinst ;; 5-runtime-aux.watsup def $type(state : state, typeidx : typeidx) : deftype ;; 5-runtime-aux.watsup - def $type{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.MODULE_frame.TYPE_moduleinst[(x : uN(32) <: nat)] + def $type{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.MODULE_frame.TYPE_moduleinst[x.`%`.0] ;; 5-runtime-aux.watsup def $func(state : state, funcidx : funcidx) : funcinst ;; 5-runtime-aux.watsup - def $func{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[(x : uN(32) <: nat)]] + def $func{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $global(state : state, globalidx : globalidx) : globalinst ;; 5-runtime-aux.watsup - def $global{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[(x : uN(32) <: nat)]] + def $global{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $table(state : state, tableidx : tableidx) : tableinst ;; 5-runtime-aux.watsup - def $table{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]] + def $table{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $mem(state : state, memidx : memidx) : meminst ;; 5-runtime-aux.watsup - def $mem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[(x : uN(32) <: nat)]] + def $mem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $elem(state : state, tableidx : tableidx) : eleminst ;; 5-runtime-aux.watsup - def $elem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[(x : uN(32) <: nat)]] + def $elem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $data(state : state, dataidx : dataidx) : datainst ;; 5-runtime-aux.watsup - def $data{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[(x : uN(32) <: nat)]] + def $data{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $local(state : state, localidx : localidx) : val? ;; 5-runtime-aux.watsup - def $local{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.LOCAL_frame[(x : uN(32) <: nat)] + def $local{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.LOCAL_frame[x.`%`.0] ;; 5-runtime-aux.watsup def $with_local(state : state, localidx : localidx, val : val) : state ;; 5-runtime-aux.watsup - def $with_local{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[(x : uN(32) <: nat)] = ?(v)]) + def $with_local{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[x.`%`.0] = ?(v)]) ;; 5-runtime-aux.watsup def $with_global(state : state, globalidx : globalidx, val : val) : state ;; 5-runtime-aux.watsup - def $with_global{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[(x : uN(32) <: nat)]].VALUE_globalinst = v], f) + def $with_global{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x.`%`.0]].VALUE_globalinst = v], f) ;; 5-runtime-aux.watsup def $with_table(state : state, tableidx : tableidx, nat : nat, ref : ref) : state ;; 5-runtime-aux.watsup - def $with_table{s : store, f : frame, x : idx, i : nat, r : ref}(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]].ELEM_tableinst[i] = r], f) + def $with_table{s : store, f : frame, x : idx, i : nat, r : ref}(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]].ELEM_tableinst[i] = r], f) ;; 5-runtime-aux.watsup def $with_tableinst(state : state, tableidx : tableidx, tableinst : tableinst) : state ;; 5-runtime-aux.watsup - def $with_tableinst{s : store, f : frame, x : idx, ti : tableinst}(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]] = ti], f) + def $with_tableinst{s : store, f : frame, x : idx, ti : tableinst}(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]] = ti], f) ;; 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 : uN(32) <: nat)]].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 ;; 5-runtime-aux.watsup - def $with_meminst{s : store, f : frame, x : idx, mi : meminst}(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[(x : uN(32) <: nat)]] = mi], f) + def $with_meminst{s : store, f : frame, x : idx, mi : meminst}(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]] = mi], f) ;; 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 : uN(32) <: nat)]].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 : uN(32) <: nat)]].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 @@ -2557,29 +2591,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 @@ -2588,25 +2622,25 @@ syntax init = | UNSET ;; 6-typing.watsup -syntax localtype = `%%`(init, valtype) +syntax localtype = `%%`{init : init, valtype : valtype}(init : init, valtype : valtype) ;; 6-typing.watsup -syntax instrtype = `%->%*%`(resulttype, localidx*, 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 @@ -2617,7 +2651,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 : uN(32) <: nat)] = 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 @@ -2628,15 +2662,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) @@ -2659,7 +2693,7 @@ relation Heaptype_ok: `%|-%:_OK`(context, heaptype) ;; 6-typing.watsup rule typeidx{C : context, x : idx, dt : deftype}: `%|-%:_OK`(C, _IDX_heaptype(x)) - -- if (C.TYPE_context[(x : uN(32) <: nat)] = dt) + -- if (C.TYPE_context[x.`%`.0] = dt) ;; 6-typing.watsup rule rec{C : context, i : nat, st : subtype}: @@ -2698,25 +2732,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 : uN(32) <: nat)] = 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) + | OK{typeidx : typeidx}(typeidx : typeidx, nat) ;; 6-typing.watsup relation Packtype_ok: `%|-%:_OK`(context, packtype) @@ -2747,16 +2781,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}: @@ -2793,7 +2827,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 @@ -2828,7 +2862,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}: @@ -2848,17 +2882,17 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:319.1-321.52 rule typeidx-l{C : context, typeidx : typeidx, heaptype : heaptype}: `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) - -- Heaptype_sub: `%|-%<:%`(C, (C.TYPE_context[(typeidx : uN(32) <: nat)] : deftype <: heaptype), heaptype) + -- Heaptype_sub: `%|-%<:%`(C, (C.TYPE_context[typeidx.`%`.0] : deftype <: heaptype), heaptype) ;; 6-typing.watsup:323.1-325.52 rule typeidx-r{C : context, heaptype : heaptype, typeidx : typeidx}: `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, (C.TYPE_context[(typeidx : uN(32) <: nat)] : deftype <: heaptype)) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, (C.TYPE_context[typeidx.`%`.0] : deftype <: 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}: @@ -2954,8 +2988,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}: @@ -2971,19 +3005,19 @@ 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 : uN(32) <: nat) < (x : uN(32) <: nat)))*{y} - -- (if ($unrolldt(C.TYPE_context[(y : uN(32) <: nat)]) = 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 ;; 6-typing.watsup def $before{deftype : deftype, x : idx, i : nat}((deftype : deftype <: heaptype), x, i) = true ;; 6-typing.watsup - def $before{typeidx : typeidx, x : idx, i : nat}(_IDX_heaptype(typeidx), x, i) = ((typeidx : uN(32) <: nat) < (x : uN(32) <: nat)) + def $before{typeidx : typeidx, x : idx, i : nat}(_IDX_heaptype(typeidx), x, i) = (typeidx.`%`.0 < x.`%`.0) ;; 6-typing.watsup def $before{j : nat, x : idx, i : nat}(REC_heaptype(j), x, i) = (j < i) @@ -2992,7 +3026,7 @@ def $unrollht(context : context, heaptype : heaptype) : subtype ;; 6-typing.watsup def $unrollht{C : context, deftype : deftype}(C, (deftype : deftype <: heaptype)) = $unrolldt(deftype) ;; 6-typing.watsup - def $unrollht{C : context, typeidx : typeidx}(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[(typeidx : uN(32) <: nat)]) + def $unrollht{C : context, typeidx : typeidx}(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx.`%`.0]) ;; 6-typing.watsup def $unrollht{C : context, i : nat}(C, REC_heaptype(i)) = C.REC_context[i] @@ -3000,12 +3034,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 { @@ -3014,13 +3048,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}), 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 : uN(32) <: nat) + 1), (i + 1))) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) } ;; 6-typing.watsup @@ -3030,18 +3064,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}), 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 : uN(32) <: nat) + 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 @@ -3050,14 +3084,14 @@ 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 relation Limits_ok: `%|-%:%`(context, limits, nat) ;; 6-typing.watsup rule _{C : context, n_1 : n, n_2 : n, k : nat}: - `%|-%:%`(C, `[%..%]`(n_1, n_2), k) + `%|-%:%`(C, `[%..%]`(`%`(n_1), `%`(n_2)), k) -- if ((n_1 <= n_2) /\ (n_2 <= k)) ;; 6-typing.watsup @@ -3106,27 +3140,27 @@ 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}, 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 : uN(32) <: nat)] = `%%`(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) ;; 6-typing.watsup rule _{C : context, n_11 : n, n_12 : n, n_21 : n, n_22 : n}: - `%|-%<:%`(C, `[%..%]`(n_11, n_12), `[%..%]`(n_21, n_22)) + `%|-%<:%`(C, `[%..%]`(`%`(n_11), `%`(n_12)), `[%..%]`(`%`(n_21), `%`(n_22))) -- if (n_11 >= n_21) -- if (n_12 <= n_22) @@ -3185,16 +3219,16 @@ 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}: `%|-%:%`(C, _IDX_blocktype(x), ft) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], FUNC_comptype(ft)) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(ft)) ;; 6-typing.watsup rec { @@ -3203,77 +3237,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}, 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}: - `%|-%:%`(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}), `%->%`(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 : uN(32) <: nat)] = 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 : uN(32) <: nat)] = 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 : uN(32) <: nat)]))*{l} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[(l' : uN(32) <: nat)]) + `%|-%:%`(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} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[(l : uN(32) <: nat)] = 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 : uN(32) <: nat)] = 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 : uN(32) <: nat)] = 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) @@ -3281,8 +3315,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 : uN(32) <: nat)] = 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) @@ -3290,514 +3324,514 @@ 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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})) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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})) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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 : uN(32) <: nat)], 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)}: - `%|-%:%`(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 : numtype <: valtype)) = $size((nt_2 : numtype <: valtype))) + -- 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}), `%->%`([(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 <: valtype)) > $size((inn_2 : inn <: valtype)))) + -- 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))])) - -- if (C.FUNC_context[(x : uN(32) <: nat)] = dt) + `%|-%:%`(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}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, (rt : reftype <: storagetype)))) - -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[(y : uN(32) <: nat)], rt) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, (t : valtype <: storagetype)))) + `%|-%:%`(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 : uN(32) <: nat)] = OK) + -- 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}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + `%|-%:%`(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)], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), 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])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x_1 : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) - -- Expand: `%~~%`(C.TYPE_context[(x_2 : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt_2))) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- Storagetype_sub: `%|-%<:%`(C, (C.ELEM_context[(y : uN(32) <: nat)] : reftype <: storagetype), zt) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + `%|-%:%`(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 : uN(32) <: nat)] = OK) + -- 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}), `%->%`([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}: - `%|-%:%`(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}, 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}, 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}: - `%|-%:%`(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])) - -- if (C.LOCAL_context[(x : uN(32) <: nat)] = `%%`(init, 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])) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = `%%`(mut, 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], [])) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = `%%`(`MUT%?`(?(())), 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)])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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)], [])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = tt) + `%|-%:%`(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])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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], [])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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], [])) - -- if (C.TABLE_context[(x_1 : uN(32) <: nat)] = `%%`(lim_1, rt_1)) - -- if (C.TABLE_context[(x_2 : uN(32) <: nat)] = `%%`(lim_2, rt_2)) + `%|-%:%`(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], [])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt_1)) - -- if (C.ELEM_context[(y : uN(32) <: nat)] = rt_2) + `%|-%:%`(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), `%->%`([], [])) - -- if (C.ELEM_context[(x : uN(32) <: nat)] = rt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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], [])) - -- if (C.MEM_context[(x_1 : uN(32) <: nat)] = mt_1) - -- if (C.MEM_context[(x_2 : uN(32) <: nat)] = mt_2) + `%|-%:%`(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], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if (C.DATA_context[(y : uN(32) <: nat)] = OK) + `%|-%:%`(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), `%->%`([], [])) - -- if (C.DATA_context[(x : uN(32) <: nat)] = OK) + `%|-%:%`(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 sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if ((2 ^ n_A) <= ($size((nt : numtype <: valtype)) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size((nt : numtype <: valtype)) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + `%|-%:%`(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} + -- 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)], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if ((2 ^ n_A) <= ($size((nt : numtype <: valtype)) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size((nt : numtype <: valtype)) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + `%|-%:%`(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} + -- 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}: - `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [V128_valtype])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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 : uN(8) <: nat) < (128 / n)) + -- if (laneidx.`%`.0 < (128 / n)) - ;; 6-typing.watsup:1046.1-1049.36 + ;; 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], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if ((2 ^ n_A) <= ($size(V128_valtype) / 8)) + `%|-%:%`(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], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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 : uN(8) <: nat) < (128 / n)) + -- if (laneidx.`%`.0 < (128 / n)) ;; 6-typing.watsup:504.1-504.67 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}: - `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) - -- if (C.LOCAL_context[(x : uN(32) <: nat)] = `%%`(init, t)) + `%|-%:%`(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])) - -- if (C.LOCAL_context[(x : uN(32) <: nat)] = `%%`(init, 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}, `%->%*%`(t_1*{t_1}, x_1*{x_1} :: x_2*{x_2}, t_3*{t_3})) - -- (if (C.LOCAL_context[(x_1 : uN(32) <: nat)] = `%%`(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 { @@ -3807,7 +3841,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 @@ -3818,7 +3852,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,7 +3876,7 @@ relation Instr_const: `%|-%CONST`(context, instr) ;; 6-typing.watsup rule global.get{C : context, x : idx, t : valtype}: `%|-%CONST`(C, GLOBAL.GET_instr(x)) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = `%%`(`MUT%?`(?()), t)) + -- if (C.GLOBAL_context[x.`%`.0] = `%%`(`MUT%?`(?()), t)) ;; 6-typing.watsup rule binop{C : context, inn : inn, binop : binop_((inn : inn <: numtype))}: @@ -3854,25 +3888,25 @@ 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) ;; 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}) - -- if (x = |C.TYPE_context|) - -- if (dt*{dt} = $rolldt(x, rectype)) - -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt}], rectype, OK_oktypeidx(x)) + `%|-%:%`(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)) ;; 6-typing.watsup relation Local_ok: `%|-%:%`(context, local, localtype) @@ -3890,10 +3924,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 : uN(32) <: nat)]) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], 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) @@ -3925,7 +3959,7 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) ;; 6-typing.watsup rule active{C : context, x : idx, expr : expr, rt : reftype, lim : limits}: `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} ;; 6-typing.watsup @@ -3940,8 +3974,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 @@ -3949,7 +3983,7 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) ;; 6-typing.watsup rule active{C : context, x : idx, expr : expr, mt : memtype}: `%|-%:_OK`(C, ACTIVE_datamode(x, expr)) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + -- if (C.MEM_context[x.`%`.0] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} ;; 6-typing.watsup @@ -3960,7 +3994,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 @@ -3968,7 +4002,7 @@ relation Start_ok: `%|-%:_OK`(context, start) ;; 6-typing.watsup rule _{C : context, x : idx}: `%|-%:_OK`(C, START(x)) - -- Expand: `%~~%`(C.FUNC_context[(x : uN(32) <: nat)], FUNC_comptype(`%->%`([], []))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`([]), `%`([])))) ;; 6-typing.watsup relation Import_ok: `%|-%:%`(context, import, externtype) @@ -3982,22 +4016,22 @@ relation Externidx_ok: `%|-%:%`(context, externidx, externtype) ;; 6-typing.watsup rule func{C : context, x : idx, dt : deftype}: `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) - -- if (C.FUNC_context[(x : uN(32) <: nat)] = dt) + -- if (C.FUNC_context[x.`%`.0] = dt) ;; 6-typing.watsup rule global{C : context, x : idx, gt : globaltype}: `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = gt) + -- if (C.GLOBAL_context[x.`%`.0] = gt) ;; 6-typing.watsup rule table{C : context, x : idx, tt : tabletype}: `%|-%:%`(C, TABLE_externidx(x), TABLE_externtype(tt)) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = tt) + -- if (C.TABLE_context[x.`%`.0] = tt) ;; 6-typing.watsup rule mem{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup relation Export_ok: `%|-%:%`(context, export, externtype) @@ -4010,55 +4044,55 @@ 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}) + `%|-%:%`(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 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}, dt_1*{} :: dt*{dt}) - -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, 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 : 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) @@ -4068,7 +4102,7 @@ relation Ref_ok: `%|-%:%`(store, ref, reftype) ;; 7-runtime-typing.watsup rule i31{s : store, i : nat}: - `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) + `%|-%:%`(s, REF.I31_NUM_ref(`%`(i)), REF_reftype(`NULL%?`(?()), I31_heaptype)) ;; 7-runtime-typing.watsup rule struct{s : store, a : addr, dt : deftype}: @@ -4094,644 +4128,644 @@ 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}?{t})], [(val_1 : val <: admininstr)]) - -- if (c =/= 0) + `%~>%`([(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)]) - -- if (c = 0) + `%~>%`([(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})]) - -- if (c =/= 0) + `%~>%`([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})]) - -- if (c = 0) + `%~>%`([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 : uN(32) <: nat) + 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}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) - -- if (c =/= 0) + `%~>%`([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)], []) - -- if (c = 0) + `%~>%`([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}, 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}: - `%*_~>%*`([(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 <: 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)}: - `%*_~>%*`([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})], [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}: - `%*_~>%*`([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)]) - -- if (c = $ine($size(V128_valtype), c_1, 0)) + `%~>%`([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), pnn : pnn, N : N, c' : vec_(V128_vnn), c : iN($lsize((pnn : pnn <: lanetype))), ci* : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), N)))*, k^N : nat^N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((pnn : pnn <: imm), N))], [VCONST_admininstr(V128_vectype, c')]) - -- if (ci*{ci} = $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_2)) - -- if (c*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_1) :: 0^(256 - N){}) - -- if (c' = $invlanes_(`%X%`((pnn : pnn <: lanetype), N), c*{}[(ci*{ci}[k] : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), N))) <: nat)]^(k%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((pnn : pnn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) + -- if (ci*{ci : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), `%`(N))))} = $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_2)) + -- if (c*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_1) :: `%`(0)^(256 - N){}) + -- if (c' = $invlanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c*{}[ci*{ci : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), `%`(N))))}[k].`%`.0]^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((pnn : pnn <: imm), N), i*{i})], [VCONST_admininstr(V128_vectype, c)]) - -- if (c'*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_1) :: $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_2)) - -- if (c = $invlanes_(`%X%`((pnn : pnn <: lanetype), N), c'*{}[i*{i}[k]]^(k%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((pnn : pnn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) + -- if (c'*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_1) :: $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_2)) + -- if (c = $invlanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c'*{}[i*{i : nat}[k]]^(k%*`([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{})) + `%~>%`([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)]) - -- if (c_2 = $lanes_(`%X%`((nt : numtype <: lanetype), N), c_1)[i]) + `%~>%`([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)]) - -- if (c_2 = $ext($psize(pt), 32, sx, $lanes_(`%X%`((pt : packtype <: lanetype), N), c_1)[i])) + `%~>%`([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)]) - -- if (c = $invlanes_(`%X%`(lnn, N), $lanes_(`%X%`(lnn, N), c_1)[[i] = $packnum(lnn, c_2)])) + `%~>%`([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)]) - -- 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'})) + 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' : 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), imm : imm, N : N, ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), N)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), N), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), N)))], [CONST_admininstr(I32_numtype, 1)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((imm : imm <: lanetype), N), c)) - -- (if (ci_1 =/= (0 : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), N))))))*{ci_1} + rule vtestop-true{c : vec_(V128_vnn), imm : imm, N : N, ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c)) + -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), imm : imm, N : N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), N), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), N)))], [CONST_admininstr(I32_numtype, 0)]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup - rule vbitmask{c : vec_(V128_vnn), imm : imm, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), N)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`(imm, N))], [CONST_admininstr(I32_numtype, ci)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((imm : imm <: lanetype), N), c)) - -- if ($ibits(32, ci) = $ilt($lsize((imm : imm <: lanetype)), S_sx, ci_1, 0)*{ci_1}) + rule vbitmask{c : vec_(V128_vnn), imm : imm, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`(imm, `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c)) + -- if ($ibits(32, ci) = `%`($ilt($lsize((imm : imm <: lanetype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($lsize((imm : imm <: lanetype)))}) ;; 8-reduction.watsup - rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*, ci_2* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*, cj_1* : iN($lsize((imm_2 : imm <: lanetype)))*, cj_2* : iN($lsize((imm_2 : imm <: lanetype)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`(imm_1, N_1), `%X%`(imm_2, N_2), sx)], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_1)) - -- if (ci_2*{ci_2} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_2)) - -- if (cj_1*{cj_1} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_1)*{ci_1}) - -- if (cj_2*{cj_2} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_2)*{ci_2}) - -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), N_2), cj_1*{cj_1} :: cj_2*{cj_2})) + rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*, cj_1* : iN($lsize((imm_2 : imm <: lanetype)))*, cj_2* : iN($lsize((imm_2 : imm <: lanetype)))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_1)) + -- if (ci_2*{ci_2 : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_2)) + -- if (cj_1*{cj_1 : iN($lsize((imm_2 : imm <: lanetype)))} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_1)*{ci_1 : iN($lsize((imm_1 : imm <: lanetype)))}) + -- if (cj_2*{cj_2 : iN($lsize((imm_2 : imm <: lanetype)))} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_2)*{ci_2 : iN($lsize((imm_1 : imm <: lanetype)))}) + -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), cj_1*{cj_1 : lane_($lanetype(`%X%`((imm_2 : imm <: lanetype), `%`(N_2))))} :: cj_2*{cj_2 : lane_($lanetype(`%X%`((imm_2 : imm <: 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'})) + 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' : 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), imm_2 : imm, N_2 : N, vcvtop : vcvtop, hf : half, imm_1 : imm, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((imm_2 : imm <: lanetype), N_2), vcvtop, ?(hf), `%X%`((imm_1 : imm <: lanetype), N_1), sx?{sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci*{ci} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_1)[$halfop(hf, 0, N_2) : N_2]) - -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), N_2), $vcvtop(`%X%`((imm_1 : imm <: lanetype), N_1), `%X%`((imm_2 : imm <: lanetype), N_2), vcvtop, sx?{sx}, ci)*{ci})) + rule vcvtop-half{c_1 : vec_(V128_vnn), imm_2 : imm, N_2 : N, vcvtop : vcvtop, hf : half, imm_1 : imm, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((imm_1 : imm <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci*{ci : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) + -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), $vcvtop(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), `%X%`((imm_2 : imm <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((imm_1 : imm <: 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 : nat <: lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), N_2))))^N_1{})) + 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)]) + -- 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} :: [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}: - `%~>%*`(`%;%*`(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 : uN(32) <: nat)]) 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})]), [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}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[(x : uN(32) <: nat)]) 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'}, (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}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[(x : uN(32) <: nat)])]) + `%~>%`(`%;%`(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} :: [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}: - `%~>%*`(`%;%*`(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} :: [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}: - `%~>%*`(`%;%*`(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} :: [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))) ;; 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}, 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}: - `%~>%*`(`%;%*`(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)) @@ -4739,7 +4773,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))) @@ -4747,354 +4781,354 @@ 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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + ($size((nt : numtype <: valtype)) / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- if ($nbytes(nt, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : ($size((nt : numtype <: valtype)) / 8)]) + `%~>%`(`%;%`(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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (n / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 <: valtype)), sx, c))]) - -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (n / 8)]) + `%~>%`(`%;%`(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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + ($size(V128_valtype) / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- if ($vbytes(V128_vectype, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : ($size(V128_valtype) / 8)]) + `%~>%`(`%;%`(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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + ((M * N) / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- (if ($ibytes(M, j) = $mem(z, x).DATA_meminst[((i + (mo.OFFSET_memop : uN(32) <: nat)) + ((k * M) / 8)) : (M / 8)]))^(k%`(`%;%`(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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- if ($ibytes(N, j) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)]) + `%~>%`(`%;%`(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)) - -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), M), (j : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), M))))^M{})) + -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(M)), `%`(j)^M{})) ;; 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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- if ($ibytes(N, j) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)]) - -- if (c = $ext(N, 128, U_sx, j)) + `%~>%`(`%;%`(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, c_1 : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, j)]), [TRAP_admininstr]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, 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, c_1 : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, c : vec_(V128_vnn), k : nat, imm : imm, M : M}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, j)]), [VCONST_admininstr(V128_vectype, c)]) - -- if ($ibytes(N, k) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(V128_vectype, 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 = ($size(V128_valtype) / N)) - -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), M), $lanes_(`%X%`((imm : imm <: lanetype), M), c_1)[[j] = (k : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), M))))])) + -- if (M = ($vsize(V128_vectype) / N)) + -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(M)), $lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c_1)[[j] = `%`(k)])) ;; 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]) 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}), `%;%*`(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}: - `%~>%`(`%;%*`(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 zt})) - -- if (fv = $packval(zt*{zt}[i], val)) + `%~>%`(`%;%`(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} :: [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}: - `%~>%`(`%;%*`(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])) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + ($size((nt : numtype <: valtype)) / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 : uN(32) <: nat)), ($size((nt : numtype <: valtype)) / 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}: - `%~>%`(`%;%*`(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 : uN(32) <: nat)) + (n / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 : uN(32) <: nat)), (n / 8), b*{b}), [])) - -- if (b*{b} = $ibytes(n, $wrap($size((inn : inn <: valtype)), 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}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + ($size(V128_valtype) / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 : uN(32) <: nat)), ($size(V128_valtype) / 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}: - `%~>%`(`%;%*`(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 : uN(32) <: nat)) + N) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 : uN(32) <: nat)), (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])) + -- 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 { @@ -5103,21 +5137,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*) +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 { @@ -5127,19 +5161,19 @@ 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 (fi = {TYPE mm.TYPE_moduleinst[(x : uN(32) <: nat)], MODULE mm, CODE func}) + -- if (func = FUNC(x, local*{local : local}, expr)) + -- if (fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func}) ;; 9-module.watsup rec { @@ -5149,9 +5183,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 @@ -5168,16 +5202,16 @@ 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 def $alloctable(store : store, tabletype : tabletype, ref : ref) : (store, tableaddr) ;; 9-module.watsup - def $alloctable{s : store, i : nat, j : nat, rt : reftype, ref : ref, ti : tableinst}(s, `%%`(`[%..%]`(i, j), rt), ref) = (s[TABLE_store =.. [ti]], |s.TABLE_store|) - -- if (ti = {TYPE `%%`(`[%..%]`(i, j), rt), ELEM ref^i{}}) + def $alloctable{s : store, i : nat, j : nat, rt : reftype, ref : ref, ti : tableinst}(s, `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ref) = (s[TABLE_store =.. [ti]], |s.TABLE_store|) + -- if (ti = {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM ref^i{}}) ;; 9-module.watsup rec { @@ -5187,16 +5221,16 @@ 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 def $allocmem(store : store, memtype : memtype) : (store, memaddr) ;; 9-module.watsup - def $allocmem{s : store, i : nat, j : nat, mi : meminst}(s, `%I8`(`[%..%]`(i, j))) = (s[MEM_store =.. [mi]], |s.MEM_store|) - -- if (mi = {TYPE `%I8`(`[%..%]`(i, j)), DATA 0^((i * 64) * $Ki){}}) + def $allocmem{s : store, i : nat, j : nat, mi : meminst}(s, `%I8`(`[%..%]`(`%`(i), `%`(j)))) = (s[MEM_store =.. [mi]], |s.MEM_store|) + -- if (mi = {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA `%`(0)^((i * 64) * $Ki){}}) ;; 9-module.watsup rec { @@ -5206,16 +5240,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 { @@ -5225,16 +5259,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 { @@ -5244,113 +5278,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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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}))) - -;; 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 : byte <: nat))) - ;; 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 : byte <: nat) - 192)) + ((b_2 : byte <: nat) - 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 : byte <: nat) - 224)) + ((2 ^ 6) * ((b_2 : byte <: nat) - 128))) + ((b_3 : byte <: nat) - 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 : byte <: nat) - 240)) + ((2 ^ 12) * ((b_2 : byte <: nat) - 128))) + ((2 ^ 6) * ((b_3 : byte <: nat) - 128))) + ((b_4 : byte <: nat) - 128)))) - ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(ch*{ch}) = $concat_(syntax byte, $utf8([ch])*{ch}) -} + -- 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) @@ -5369,14 +5382,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 = `...` @@ -5384,21 +5397,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) +syntax recordeq = `%++%=%`{recordstar : recordstar}(recordstar : recordstar, recordstar, recordstar) ;; C-conventions.watsup syntax pth = @@ -5454,7 +5467,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 @@ -5465,29 +5478,28 @@ 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 -syntax list{syntax X}(syntax X) = X* - -;; 1-syntax.watsup -syntax char = nat - -;; 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 = nat +syntax bit = `%`{i : nat}(i : nat) + -- if ((i = 0) \/ (i = 1)) ;; 1-syntax.watsup -syntax byte = nat +syntax byte = `%`{i : nat}(i : nat) + -- if ((i >= 0) /\ (i <= 255)) ;; 1-syntax.watsup -syntax uN{N : N}(N) = nat +syntax uN{N : N}(N) = `%`{i : nat}(i : nat) + -- if ((i >= 0) /\ (i <= ((2 ^ N) - 1))) ;; 1-syntax.watsup -syntax sN{N : N}(N) = int +syntax sN{N : N}(N) = `%`{i : int}(i : int) + -- if ((((i >= - ((2 ^ (N - 1)) : nat <: int)) /\ (i <= - (1 : nat <: int))) \/ (i = (0 : nat <: int))) \/ ((i >= + (1 : nat <: int)) /\ (i <= (((2 ^ (N - 1)) - 1) : nat <: int)))) ;; 1-syntax.watsup syntax iN{N : N}(N) = uN(N) @@ -5549,8 +5561,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) @@ -5576,6 +5588,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 @@ -5646,20 +5687,20 @@ 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 | 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 +;; 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 @@ -5667,40 +5708,40 @@ 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, storagetype) +;; 1-syntax.watsup:176.1-177.18 +syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) -;; 1-syntax.watsup:178.1-178.70 -syntax functype = `%->%`(resulttype, resulttype) +;; 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) - | 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 +;; 1-syntax.watsup:190.1-191.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 +;; 1-syntax.watsup:193.1-194.22 syntax rectype = - | REC(list : list(syntax subtype)) + | 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) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY | EQ | I31 @@ -5712,13 +5753,13 @@ syntax heaptype = | EXTERN | NOEXTERN | BOT - | DEF(rectype : rectype, 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 = @@ -5771,19 +5812,19 @@ syntax imm = ;; 1-syntax.watsup syntax deftype = - | DEF(rectype : rectype, nat) + | DEF{rectype : rectype}(rectype : rectype, nat) ;; 1-syntax.watsup -syntax limits = `[%..%]`(u32, u32) +syntax limits = `[%..%]`{u32 : u32}(u32 : u32, u32) ;; 1-syntax.watsup -syntax globaltype = `%%`(mut, valtype) +syntax globaltype = `%%`{mut : mut, valtype : valtype}(mut : mut, valtype : valtype) ;; 1-syntax.watsup -syntax tabletype = `%%`(limits, reftype) +syntax tabletype = `%%`{limits : limits, reftype : reftype}(limits : limits, reftype : reftype) ;; 1-syntax.watsup -syntax memtype = `%I8`(limits) +syntax memtype = `%I8`{limits : limits}(limits : limits) ;; 1-syntax.watsup syntax elemtype = reftype @@ -5793,24 +5834,26 @@ 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(valtype : valtype) : nat? +def $size(numtype : numtype) : nat ;; 2-syntax-aux.watsup - def $size(I32_valtype) = ?(32) + def $size(I32_numtype) = 32 ;; 2-syntax-aux.watsup - def $size(I64_valtype) = ?(64) + def $size(I64_numtype) = 64 ;; 2-syntax-aux.watsup - def $size(F32_valtype) = ?(32) + def $size(F32_numtype) = 32 ;; 2-syntax-aux.watsup - def $size(F64_valtype) = ?(64) + def $size(F64_numtype) = 64 + +;; 1-syntax.watsup +def $vsize(vectype : vectype) : nat ;; 2-syntax-aux.watsup - def $size(V128_valtype) = ?(128) - def $size{x0 : valtype}(x0) = ?() + def $vsize(V128_vectype) = 128 ;; 1-syntax.watsup def $psize(packtype : packtype) : nat @@ -5822,41 +5865,44 @@ def $psize(packtype : packtype) : nat ;; 1-syntax.watsup def $lsize(lanetype : lanetype) : nat ;; 2-syntax-aux.watsup - def $lsize{numtype : numtype}((numtype : numtype <: lanetype)) = !($size((numtype : numtype <: valtype))) + def $lsize{numtype : numtype}((numtype : numtype <: lanetype)) = $size(numtype) ;; 2-syntax-aux.watsup def $lsize{packtype : packtype}((packtype : packtype <: lanetype)) = $psize(packtype) ;; 1-syntax.watsup def $zsize(storagetype : storagetype) : nat ;; 2-syntax-aux.watsup - def $zsize{valtype : valtype}((valtype : valtype <: storagetype)) = !($size(valtype)) + def $zsize{numtype : numtype}((numtype : numtype <: storagetype)) = $size(numtype) + ;; 2-syntax-aux.watsup + def $zsize{vectype : vectype}((vectype : vectype <: storagetype)) = $vsize(vectype) ;; 2-syntax-aux.watsup def $zsize{packtype : packtype}((packtype : packtype <: storagetype)) = $psize(packtype) ;; 1-syntax.watsup -syntax dim = nat +syntax dim = `%`{i : nat}(i : nat) + -- if (((((i = 1) \/ (i = 2)) \/ (i = 4)) \/ (i = 8)) \/ (i = 16)) ;; 1-syntax.watsup -syntax shape = `%X%`(lanetype, dim) +syntax shape = `%X%`{lanetype : lanetype, dim : dim}(lanetype : lanetype, dim : dim) ;; 1-syntax.watsup def $lanetype(shape : shape) : lanetype ;; 2-syntax-aux.watsup - def $lanetype{lnn : lnn, N : N}(`%X%`(lnn, N)) = lnn + def $lanetype{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = lnn ;; 1-syntax.watsup -def $sizenn(valtype : valtype) : nat +def $sizenn(numtype : numtype) : nat ;; 1-syntax.watsup - def $sizenn{t : valtype}(t) = !($size(t)) + def $sizenn{nt : numtype}(nt) = $size(nt) ;; 1-syntax.watsup syntax num_(numtype : numtype) ;; 1-syntax.watsup - syntax num_{inn : inn}((inn : inn <: numtype)) = iN($sizenn((inn : inn <: valtype))) + syntax num_{inn : inn}((inn : inn <: numtype)) = iN($sizenn((inn : inn <: numtype))) ;; 1-syntax.watsup - syntax num_{fnn : fnn}((fnn : fnn <: numtype)) = fN($sizenn((fnn : fnn <: valtype))) + syntax num_{fnn : fnn}((fnn : fnn <: numtype)) = fN($sizenn((fnn : fnn <: numtype))) ;; 1-syntax.watsup @@ -5877,7 +5923,7 @@ syntax lane_(lanetype : lanetype) ;; 1-syntax.watsup -syntax vec_{vnn : vnn}(vnn) = vN(!($size((vnn : vnn <: valtype)))) +syntax vec_{vnn : vnn}(vnn) = vN($vsize(vnn)) ;; 1-syntax.watsup syntax zval_(storagetype : storagetype) @@ -5905,7 +5951,7 @@ syntax unop_(numtype : numtype) | CLZ | CTZ | POPCNT - | EXTEND(n : n) + | EXTEND{n : n}(n : n) ;; 1-syntax.watsup @@ -5926,13 +5972,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 @@ -5958,10 +6004,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 @@ -5981,23 +6027,23 @@ syntax cvtop = | REINTERPRET ;; 1-syntax.watsup -syntax ishape = `%X%`(imm, dim) +syntax ishape = `%X%`{imm : imm, dim : dim}(imm : imm, dim : dim) ;; 1-syntax.watsup -syntax fshape = `%X%`(fnn, dim) +syntax fshape = `%X%`{fnn : fnn, dim : dim}(fnn : fnn, dim : dim) ;; 1-syntax.watsup -syntax pshape = `%X%`(pnn, dim) +syntax pshape = `%X%`{pnn : pnn, dim : dim}(pnn : pnn, dim : dim) ;; 1-syntax.watsup def $dim(shape : shape) : dim ;; 2-syntax-aux.watsup - def $dim{lnn : lnn, N : N}(`%X%`(lnn, N)) = N + def $dim{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = `%`(N) ;; 1-syntax.watsup def $shsize(shape : shape) : nat ;; 2-syntax-aux.watsup - def $shsize{lnn : lnn, N : N}(`%X%`(lnn, N)) = ($lsize(lnn) * N) + def $shsize{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = ($lsize(lnn) * N) ;; 1-syntax.watsup syntax vvunop = @@ -6021,7 +6067,7 @@ syntax vvtestop = ;; 1-syntax.watsup syntax vunop_(shape : shape) ;; 1-syntax.watsup - syntax vunop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + syntax vunop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ABS | NEG | POPCNT{imm : imm} @@ -6029,7 +6075,7 @@ syntax vunop_(shape : shape) ;; 1-syntax.watsup - syntax vunop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vunop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | ABS | NEG | SQRT @@ -6042,12 +6088,12 @@ syntax vunop_(shape : shape) ;; 1-syntax.watsup syntax vbinop_(shape : shape) ;; 1-syntax.watsup - syntax vbinop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + 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) @@ -6055,14 +6101,14 @@ 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) ;; 1-syntax.watsup - syntax vbinop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vbinop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | ADD | SUB | MUL @@ -6074,23 +6120,23 @@ syntax vbinop_(shape : shape) ;; 1-syntax.watsup -syntax vtestop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = +syntax vtestop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ALL_TRUE ;; 1-syntax.watsup syntax vrelop_(shape : shape) ;; 1-syntax.watsup - syntax vrelop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + 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 - syntax vrelop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vrelop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | EQ | NE | LT @@ -6108,12 +6154,12 @@ syntax vcvtop = | PROMOTE ;; 1-syntax.watsup -syntax vshiftop_{imm : imm, N : N}(`%X%`(imm, N)) = +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)) = +syntax vextunop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = | EXTADD_PAIRWISE -- if ((16 <= $lsize((imm_1 : imm <: lanetype))) /\ ($lsize((imm_1 : imm <: lanetype)) <= 32)) @@ -6123,28 +6169,28 @@ syntax half = | HIGH ;; 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) +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}(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, sx : sx) + | 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%?`(()?) @@ -6152,113 +6198,113 @@ syntax zero = `ZERO%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:521.1-533.78 +;; 1-syntax.watsup:523.1-535.78 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)) : dim <: nat))) - | 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) + -- if (ishape = `%X%`(I8_imm, `%`(16))) + | 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) - | 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 @@ -6266,57 +6312,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) +syntax type = TYPE{rectype : rectype}(rectype : rectype) ;; 1-syntax.watsup -syntax local = LOCAL(valtype) +syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`(typeidx, local*, 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, expr) +syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) ;; 1-syntax.watsup -syntax table = TABLE(tabletype, expr) +syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, expr : expr) ;; 1-syntax.watsup -syntax mem = MEMORY(memtype) +syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`(reftype, expr*, 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) +syntax data = DATA{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup -syntax start = START(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, externidx) +syntax export = EXPORT{name : name, externidx : externidx}(name : name, externidx : externidx) ;; 1-syntax.watsup -syntax import = IMPORT(name, name, 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 { @@ -6326,10 +6372,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 } @@ -6339,9 +6385,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 @@ -6361,18 +6407,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 { @@ -6382,7 +6428,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 @@ -6429,7 +6475,7 @@ def $diffrt(reftype : reftype, reftype : reftype) : reftype ;; 2-syntax-aux.watsup syntax typevar = - | _IDX(typeidx : typeidx) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | REC(nat) ;; 2-syntax-aux.watsup @@ -6440,181 +6486,181 @@ def $idx(typeidx : typeidx) : typevar ;; 2-syntax-aux.watsup rec { -;; 2-syntax-aux.watsup:122.1-122.92 +;; 2-syntax-aux.watsup:125.1-125.92 def $subst_typevar(typevar : typevar, typevar*, heaptype*) : heaptype - ;; 2-syntax-aux.watsup:147.1-147.38 + ;; 2-syntax-aux.watsup:150.1-150.38 def $subst_typevar{xx : typevar}(xx, [], []) = (xx : typevar <: heaptype) - ;; 2-syntax-aux.watsup:148.1-148.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 + ;; 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' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = ht_1 -- if (xx = xx_1) - ;; 2-syntax-aux.watsup:149.1-149.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'}) + ;; 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' : 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 { -;; 2-syntax-aux.watsup:126.1-126.92 +;; 2-syntax-aux.watsup:129.1-129.92 def $subst_heaptype(heaptype : heaptype, typevar*, heaptype*) : heaptype - ;; 2-syntax-aux.watsup:154.1-154.67 - def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) - ;; 2-syntax-aux.watsup:155.1-155.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) - ;; 2-syntax-aux.watsup:156.1-156.55 - def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx}, ht*{ht}) = ht' + ;; 2-syntax-aux.watsup:157.1-157.67 + 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 : 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 : typevar}, ht*{ht : heaptype}) = ht' -- otherwise -;; 2-syntax-aux.watsup:127.1-127.92 +;; 2-syntax-aux.watsup:130.1-130.92 def $subst_reftype(reftype : reftype, typevar*, heaptype*) : reftype - ;; 2-syntax-aux.watsup:158.1-158.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})) + ;; 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 : typevar}, ht*{ht : heaptype}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})) -;; 2-syntax-aux.watsup:128.1-128.92 +;; 2-syntax-aux.watsup:131.1-131.92 def $subst_valtype(valtype : valtype, typevar*, heaptype*) : valtype - ;; 2-syntax-aux.watsup:160.1-160.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) - ;; 2-syntax-aux.watsup:161.1-161.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) - ;; 2-syntax-aux.watsup:162.1-162.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) - ;; 2-syntax-aux.watsup:163.1-163.40 - def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + ;; 2-syntax-aux.watsup:163.1-163.64 + 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 : 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 : 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 : typevar}, ht*{ht : heaptype}) = BOT_valtype -;; 2-syntax-aux.watsup:131.1-131.92 +;; 2-syntax-aux.watsup:134.1-134.92 def $subst_storagetype(storagetype : storagetype, typevar*, heaptype*) : storagetype - ;; 2-syntax-aux.watsup:167.1-167.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) - ;; 2-syntax-aux.watsup:168.1-168.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) + ;; 2-syntax-aux.watsup:170.1-170.66 + 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 : typevar}, ht*{ht : heaptype}) = ($subst_packtype(pt, xx*{xx : typevar}, ht*{ht : heaptype}) : packtype <: storagetype) -;; 2-syntax-aux.watsup:132.1-132.92 +;; 2-syntax-aux.watsup:135.1-135.92 def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype - ;; 2-syntax-aux.watsup:170.1-170.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})) + ;; 2-syntax-aux.watsup:173.1-173.80 + 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:134.1-134.92 +;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype - ;; 2-syntax-aux.watsup:172.1-172.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}) - ;; 2-syntax-aux.watsup:173.1-173.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})) - ;; 2-syntax-aux.watsup:174.1-174.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})) - -;; 2-syntax-aux.watsup:135.1-135.92 + ;; 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})) + ;; 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 + 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:176.1-177.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})) - ;; 2-syntax-aux.watsup:178.1-179.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})) + ;; 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 : 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' : 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:136.1-136.92 +;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype - ;; 2-syntax-aux.watsup:181.1-181.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}) + ;; 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})) -;; 2-syntax-aux.watsup:137.1-137.92 +;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype - ;; 2-syntax-aux.watsup:183.1-183.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) + ;; 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 : typevar}, ht*{ht : heaptype}) = DEF_deftype($subst_rectype(qt, xx*{xx : typevar}, ht*{ht : heaptype}), i) -;; 2-syntax-aux.watsup:140.1-140.92 +;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype - ;; 2-syntax-aux.watsup:186.1-186.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}) + ;; 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})) } ;; 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, x^n : idx^n}(rt, ht^n{ht}) = $subst_reftype(rt, $idx(x)^(x (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) + -- if (ishape = `%X%`(I8_imm, `%`(16))) + | 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) - | 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, admininstr*) +syntax config = `%;%`{state : state, admininstr* : admininstr*}(state : state, admininstr*{admininstr : admininstr} : admininstr*) ;; 4-runtime.watsup rec { @@ -7721,28 +7767,28 @@ 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? ;; 5-runtime-aux.watsup - def $default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) + def $default(I32_valtype) = ?(CONST_val(I32_numtype, `%`(0))) ;; 5-runtime-aux.watsup - def $default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) + def $default(I64_valtype) = ?(CONST_val(I64_numtype, `%`(0))) ;; 5-runtime-aux.watsup def $default(F32_valtype) = ?(CONST_val(F32_numtype, $fzero(32))) ;; 5-runtime-aux.watsup def $default(F64_valtype) = ?(CONST_val(F64_numtype, $fzero(64))) ;; 5-runtime-aux.watsup - def $default(V128_valtype) = ?(VCONST_val(V128_vectype, 0)) + def $default(V128_valtype) = ?(VCONST_val(V128_vectype, `%`(0))) ;; 5-runtime-aux.watsup def $default{ht : heaptype}(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) ;; 5-runtime-aux.watsup @@ -7753,14 +7799,14 @@ def $packval(storagetype : storagetype, val : val) : fieldval ;; 5-runtime-aux.watsup def $packval{t : valtype, val : val}((t : valtype <: storagetype), val) = (val : val <: fieldval) ;; 5-runtime-aux.watsup - def $packval{pt : packtype, i : nat}((pt : packtype <: storagetype), CONST_val(I32_numtype, i)) = PACK_fieldval(pt, $wrap(32, $psize(pt), i)) + def $packval{pt : packtype, i : nat}((pt : packtype <: storagetype), CONST_val(I32_numtype, `%`(i))) = PACK_fieldval(pt, $wrap(32, $psize(pt), `%`(i))) ;; 5-runtime-aux.watsup def $unpackval(storagetype : storagetype, sx?, fieldval : fieldval) : val ;; 5-runtime-aux.watsup def $unpackval{t : valtype, val : val}((t : valtype <: storagetype), ?(), (val : val <: fieldval)) = val ;; 5-runtime-aux.watsup - def $unpackval{pt : packtype, sx : sx, i : nat}((pt : packtype <: storagetype), ?(sx), PACK_fieldval(pt, i)) = CONST_val(I32_numtype, $ext($psize(pt), 32, sx, i)) + def $unpackval{pt : packtype, sx : sx, i : nat}((pt : packtype <: storagetype), ?(sx), PACK_fieldval(pt, `%`(i))) = CONST_val(I32_numtype, $ext($psize(pt), 32, sx, `%`(i))) ;; 5-runtime-aux.watsup rec { @@ -7770,9 +7816,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 } @@ -7784,9 +7830,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 } @@ -7798,9 +7844,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 } @@ -7812,9 +7858,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 } @@ -7881,82 +7927,82 @@ def $moduleinst(state : state) : moduleinst ;; 5-runtime-aux.watsup def $type(state : state, typeidx : typeidx) : deftype ;; 5-runtime-aux.watsup - def $type{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.MODULE_frame.TYPE_moduleinst[(x : uN(32) <: nat)] + def $type{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.MODULE_frame.TYPE_moduleinst[x.`%`.0] ;; 5-runtime-aux.watsup def $func(state : state, funcidx : funcidx) : funcinst ;; 5-runtime-aux.watsup - def $func{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[(x : uN(32) <: nat)]] + def $func{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $global(state : state, globalidx : globalidx) : globalinst ;; 5-runtime-aux.watsup - def $global{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[(x : uN(32) <: nat)]] + def $global{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $table(state : state, tableidx : tableidx) : tableinst ;; 5-runtime-aux.watsup - def $table{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]] + def $table{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $mem(state : state, memidx : memidx) : meminst ;; 5-runtime-aux.watsup - def $mem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[(x : uN(32) <: nat)]] + def $mem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $elem(state : state, tableidx : tableidx) : eleminst ;; 5-runtime-aux.watsup - def $elem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[(x : uN(32) <: nat)]] + def $elem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $data(state : state, dataidx : dataidx) : datainst ;; 5-runtime-aux.watsup - def $data{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[(x : uN(32) <: nat)]] + def $data{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $local(state : state, localidx : localidx) : val? ;; 5-runtime-aux.watsup - def $local{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.LOCAL_frame[(x : uN(32) <: nat)] + def $local{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.LOCAL_frame[x.`%`.0] ;; 5-runtime-aux.watsup def $with_local(state : state, localidx : localidx, val : val) : state ;; 5-runtime-aux.watsup - def $with_local{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[(x : uN(32) <: nat)] = ?(v)]) + def $with_local{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[x.`%`.0] = ?(v)]) ;; 5-runtime-aux.watsup def $with_global(state : state, globalidx : globalidx, val : val) : state ;; 5-runtime-aux.watsup - def $with_global{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[(x : uN(32) <: nat)]].VALUE_globalinst = v], f) + def $with_global{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x.`%`.0]].VALUE_globalinst = v], f) ;; 5-runtime-aux.watsup def $with_table(state : state, tableidx : tableidx, nat : nat, ref : ref) : state ;; 5-runtime-aux.watsup - def $with_table{s : store, f : frame, x : idx, i : nat, r : ref}(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]].ELEM_tableinst[i] = r], f) + def $with_table{s : store, f : frame, x : idx, i : nat, r : ref}(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]].ELEM_tableinst[i] = r], f) ;; 5-runtime-aux.watsup def $with_tableinst(state : state, tableidx : tableidx, tableinst : tableinst) : state ;; 5-runtime-aux.watsup - def $with_tableinst{s : store, f : frame, x : idx, ti : tableinst}(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]] = ti], f) + def $with_tableinst{s : store, f : frame, x : idx, ti : tableinst}(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]] = ti], f) ;; 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 : uN(32) <: nat)]].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 ;; 5-runtime-aux.watsup - def $with_meminst{s : store, f : frame, x : idx, mi : meminst}(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[(x : uN(32) <: nat)]] = mi], f) + def $with_meminst{s : store, f : frame, x : idx, mi : meminst}(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]] = mi], f) ;; 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 : uN(32) <: nat)]].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 : uN(32) <: nat)]].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 @@ -7971,20 +8017,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) = ?() @@ -7992,9 +8038,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) = ?() @@ -8004,25 +8050,25 @@ syntax init = | UNSET ;; 6-typing.watsup -syntax localtype = `%%`(init, valtype) +syntax localtype = `%%`{init : init, valtype : valtype}(init : init, valtype : valtype) ;; 6-typing.watsup -syntax instrtype = `%->%*%`(resulttype, localidx*, 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 @@ -8033,7 +8079,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 : uN(32) <: nat)] = 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 @@ -8044,15 +8090,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) @@ -8075,7 +8121,7 @@ relation Heaptype_ok: `%|-%:_OK`(context, heaptype) ;; 6-typing.watsup rule typeidx{C : context, x : idx, dt : deftype}: `%|-%:_OK`(C, _IDX_heaptype(x)) - -- if (C.TYPE_context[(x : uN(32) <: nat)] = dt) + -- if (C.TYPE_context[x.`%`.0] = dt) ;; 6-typing.watsup rule rec{C : context, i : nat, st : subtype}: @@ -8114,25 +8160,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 : uN(32) <: nat)] = 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) + | OK{typeidx : typeidx}(typeidx : typeidx, nat) ;; 6-typing.watsup relation Packtype_ok: `%|-%:_OK`(context, packtype) @@ -8163,16 +8209,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}: @@ -8209,7 +8255,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 @@ -8244,7 +8290,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}: @@ -8264,17 +8310,17 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:319.1-321.52 rule typeidx-l{C : context, typeidx : typeidx, heaptype : heaptype}: `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) - -- Heaptype_sub: `%|-%<:%`(C, (C.TYPE_context[(typeidx : uN(32) <: nat)] : deftype <: heaptype), heaptype) + -- Heaptype_sub: `%|-%<:%`(C, (C.TYPE_context[typeidx.`%`.0] : deftype <: heaptype), heaptype) ;; 6-typing.watsup:323.1-325.52 rule typeidx-r{C : context, heaptype : heaptype, typeidx : typeidx}: `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, (C.TYPE_context[(typeidx : uN(32) <: nat)] : deftype <: heaptype)) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, (C.TYPE_context[typeidx.`%`.0] : deftype <: 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}: @@ -8370,8 +8416,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}: @@ -8387,19 +8433,19 @@ 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 : uN(32) <: nat) < (x : uN(32) <: nat)))*{y} - -- (if ($unrolldt(C.TYPE_context[(y : uN(32) <: nat)]) = 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 ;; 6-typing.watsup def $before{deftype : deftype, x : idx, i : nat}((deftype : deftype <: heaptype), x, i) = true ;; 6-typing.watsup - def $before{typeidx : typeidx, x : idx, i : nat}(_IDX_heaptype(typeidx), x, i) = ((typeidx : uN(32) <: nat) < (x : uN(32) <: nat)) + def $before{typeidx : typeidx, x : idx, i : nat}(_IDX_heaptype(typeidx), x, i) = (typeidx.`%`.0 < x.`%`.0) ;; 6-typing.watsup def $before{j : nat, x : idx, i : nat}(REC_heaptype(j), x, i) = (j < i) @@ -8408,7 +8454,7 @@ def $unrollht(context : context, heaptype : heaptype) : subtype ;; 6-typing.watsup def $unrollht{C : context, deftype : deftype}(C, (deftype : deftype <: heaptype)) = $unrolldt(deftype) ;; 6-typing.watsup - def $unrollht{C : context, typeidx : typeidx}(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[(typeidx : uN(32) <: nat)]) + def $unrollht{C : context, typeidx : typeidx}(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx.`%`.0]) ;; 6-typing.watsup def $unrollht{C : context, i : nat}(C, REC_heaptype(i)) = C.REC_context[i] @@ -8416,12 +8462,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 { @@ -8430,13 +8476,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}), 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 : uN(32) <: nat) + 1), (i + 1))) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) } ;; 6-typing.watsup @@ -8446,18 +8492,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}), 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 : uN(32) <: nat) + 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 @@ -8466,14 +8512,14 @@ 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 relation Limits_ok: `%|-%:%`(context, limits, nat) ;; 6-typing.watsup rule _{C : context, n_1 : n, n_2 : n, k : nat}: - `%|-%:%`(C, `[%..%]`(n_1, n_2), k) + `%|-%:%`(C, `[%..%]`(`%`(n_1), `%`(n_2)), k) -- if ((n_1 <= n_2) /\ (n_2 <= k)) ;; 6-typing.watsup @@ -8522,27 +8568,27 @@ 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}, 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 : uN(32) <: nat)] = `%%`(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) ;; 6-typing.watsup rule _{C : context, n_11 : n, n_12 : n, n_21 : n, n_22 : n}: - `%|-%<:%`(C, `[%..%]`(n_11, n_12), `[%..%]`(n_21, n_22)) + `%|-%<:%`(C, `[%..%]`(`%`(n_11), `%`(n_12)), `[%..%]`(`%`(n_21), `%`(n_22))) -- if (n_11 >= n_21) -- if (n_12 <= n_22) @@ -8601,16 +8647,16 @@ 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}: `%|-%:%`(C, _IDX_blocktype(x), ft) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], FUNC_comptype(ft)) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(ft)) ;; 6-typing.watsup rec { @@ -8619,77 +8665,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}, 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}: - `%|-%:%`(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}), `%->%`(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 : uN(32) <: nat)] = 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 : uN(32) <: nat)] = 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 : uN(32) <: nat)]))*{l} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[(l' : uN(32) <: nat)]) + `%|-%:%`(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} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[(l : uN(32) <: nat)] = 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 : uN(32) <: nat)] = 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 : uN(32) <: nat)] = 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) @@ -8697,8 +8743,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 : uN(32) <: nat)] = 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) @@ -8706,514 +8752,514 @@ 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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})) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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})) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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 : uN(32) <: nat)], 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)}: - `%|-%:%`(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 : numtype <: valtype))) = !($size((nt_2 : numtype <: valtype)))) + -- 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}), `%->%`([(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 <: valtype))) > !($size((inn_2 : inn <: valtype))))) + -- 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))])) - -- if (C.FUNC_context[(x : uN(32) <: nat)] = dt) + `%|-%:%`(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}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, (rt : reftype <: storagetype)))) - -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[(y : uN(32) <: nat)], rt) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, (t : valtype <: storagetype)))) + `%|-%:%`(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 : uN(32) <: nat)] = OK) + -- 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}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + `%|-%:%`(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)], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), 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])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x_1 : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) - -- Expand: `%~~%`(C.TYPE_context[(x_2 : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt_2))) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- Storagetype_sub: `%|-%<:%`(C, (C.ELEM_context[(y : uN(32) <: nat)] : reftype <: storagetype), zt) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + `%|-%:%`(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 : uN(32) <: nat)] = OK) + -- 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}), `%->%`([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}: - `%|-%:%`(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}, 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}, 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}: - `%|-%:%`(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])) - -- if (C.LOCAL_context[(x : uN(32) <: nat)] = `%%`(init, 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])) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = `%%`(mut, 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], [])) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = `%%`(`MUT%?`(?(())), 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)])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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)], [])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = tt) + `%|-%:%`(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])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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], [])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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], [])) - -- if (C.TABLE_context[(x_1 : uN(32) <: nat)] = `%%`(lim_1, rt_1)) - -- if (C.TABLE_context[(x_2 : uN(32) <: nat)] = `%%`(lim_2, rt_2)) + `%|-%:%`(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], [])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt_1)) - -- if (C.ELEM_context[(y : uN(32) <: nat)] = rt_2) + `%|-%:%`(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), `%->%`([], [])) - -- if (C.ELEM_context[(x : uN(32) <: nat)] = rt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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], [])) - -- if (C.MEM_context[(x_1 : uN(32) <: nat)] = mt_1) - -- if (C.MEM_context[(x_2 : uN(32) <: nat)] = mt_2) + `%|-%:%`(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], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if (C.DATA_context[(y : uN(32) <: nat)] = OK) + `%|-%:%`(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), `%->%`([], [])) - -- if (C.DATA_context[(x : uN(32) <: nat)] = OK) + `%|-%:%`(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 sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if ((2 ^ n_A) <= (!($size((nt : numtype <: valtype))) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (!($size((nt : numtype <: valtype))) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + `%|-%:%`(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} + -- 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)], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if ((2 ^ n_A) <= (!($size((nt : numtype <: valtype))) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (!($size((nt : numtype <: valtype))) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + `%|-%:%`(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} + -- 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}: - `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [V128_valtype])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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 : uN(8) <: nat) < (128 / n)) + -- if (laneidx.`%`.0 < (128 / n)) - ;; 6-typing.watsup:1046.1-1049.36 + ;; 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], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if ((2 ^ n_A) <= (!($size(V128_valtype)) / 8)) + `%|-%:%`(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], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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 : uN(8) <: nat) < (128 / n)) + -- if (laneidx.`%`.0 < (128 / n)) ;; 6-typing.watsup:504.1-504.67 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}: - `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) - -- if (C.LOCAL_context[(x : uN(32) <: nat)] = `%%`(init, t)) + `%|-%:%`(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])) - -- if (C.LOCAL_context[(x : uN(32) <: nat)] = `%%`(init, 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}, `%->%*%`(t_1*{t_1}, x_1*{x_1} :: x_2*{x_2}, t_3*{t_3})) - -- (if (C.LOCAL_context[(x_1 : uN(32) <: nat)] = `%%`(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 { @@ -9223,7 +9269,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 @@ -9234,7 +9280,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 @@ -9258,7 +9304,7 @@ relation Instr_const: `%|-%CONST`(context, instr) ;; 6-typing.watsup rule global.get{C : context, x : idx, t : valtype}: `%|-%CONST`(C, GLOBAL.GET_instr(x)) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = `%%`(`MUT%?`(?()), t)) + -- if (C.GLOBAL_context[x.`%`.0] = `%%`(`MUT%?`(?()), t)) ;; 6-typing.watsup rule binop{C : context, inn : inn, binop : binop_((inn : inn <: numtype))}: @@ -9270,25 +9316,25 @@ 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) ;; 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}) - -- if (x = |C.TYPE_context|) - -- if (dt*{dt} = $rolldt(x, rectype)) - -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt}], rectype, OK_oktypeidx(x)) + `%|-%:%`(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)) ;; 6-typing.watsup relation Local_ok: `%|-%:%`(context, local, localtype) @@ -9306,10 +9352,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 : uN(32) <: nat)]) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], 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) @@ -9341,7 +9387,7 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) ;; 6-typing.watsup rule active{C : context, x : idx, expr : expr, rt : reftype, lim : limits}: `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} ;; 6-typing.watsup @@ -9356,8 +9402,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 @@ -9365,7 +9411,7 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) ;; 6-typing.watsup rule active{C : context, x : idx, expr : expr, mt : memtype}: `%|-%:_OK`(C, ACTIVE_datamode(x, expr)) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + -- if (C.MEM_context[x.`%`.0] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} ;; 6-typing.watsup @@ -9376,7 +9422,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 @@ -9384,7 +9430,7 @@ relation Start_ok: `%|-%:_OK`(context, start) ;; 6-typing.watsup rule _{C : context, x : idx}: `%|-%:_OK`(C, START(x)) - -- Expand: `%~~%`(C.FUNC_context[(x : uN(32) <: nat)], FUNC_comptype(`%->%`([], []))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`([]), `%`([])))) ;; 6-typing.watsup relation Import_ok: `%|-%:%`(context, import, externtype) @@ -9398,22 +9444,22 @@ relation Externidx_ok: `%|-%:%`(context, externidx, externtype) ;; 6-typing.watsup rule func{C : context, x : idx, dt : deftype}: `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) - -- if (C.FUNC_context[(x : uN(32) <: nat)] = dt) + -- if (C.FUNC_context[x.`%`.0] = dt) ;; 6-typing.watsup rule global{C : context, x : idx, gt : globaltype}: `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = gt) + -- if (C.GLOBAL_context[x.`%`.0] = gt) ;; 6-typing.watsup rule table{C : context, x : idx, tt : tabletype}: `%|-%:%`(C, TABLE_externidx(x), TABLE_externtype(tt)) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = tt) + -- if (C.TABLE_context[x.`%`.0] = tt) ;; 6-typing.watsup rule mem{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup relation Export_ok: `%|-%:%`(context, export, externtype) @@ -9426,55 +9472,55 @@ 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}) + `%|-%:%`(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 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}, dt_1*{} :: dt*{dt}) - -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, 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 : 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) @@ -9484,7 +9530,7 @@ relation Ref_ok: `%|-%:%`(store, ref, reftype) ;; 7-runtime-typing.watsup rule i31{s : store, i : nat}: - `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) + `%|-%:%`(s, REF.I31_NUM_ref(`%`(i)), REF_reftype(`NULL%?`(?()), I31_heaptype)) ;; 7-runtime-typing.watsup rule struct{s : store, a : addr, dt : deftype}: @@ -9510,644 +9556,644 @@ 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}?{t})], [(val_1 : val <: admininstr)]) - -- if (c =/= 0) + `%~>%`([(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)]) - -- if (c = 0) + `%~>%`([(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})]) - -- if (c =/= 0) + `%~>%`([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})]) - -- if (c = 0) + `%~>%`([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 : uN(32) <: nat) + 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}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) - -- if (c =/= 0) + `%~>%`([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)], []) - -- if (c = 0) + `%~>%`([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}, 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}: - `%*_~>%*`([(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 <: 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)}: - `%*_~>%*`([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})], [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}: - `%*_~>%*`([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)]) - -- if (c = $ine(!($size(V128_valtype)), c_1, 0)) + `%~>%`([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), pnn : pnn, N : N, c' : vec_(V128_vnn), c : iN($lsize((pnn : pnn <: lanetype))), ci* : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), N)))*, k^N : nat^N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((pnn : pnn <: imm), N))], [VCONST_admininstr(V128_vectype, c')]) - -- if (ci*{ci} = $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_2)) - -- if (c*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_1) :: 0^(256 - N){}) - -- if (c' = $invlanes_(`%X%`((pnn : pnn <: lanetype), N), c*{}[(ci*{ci}[k] : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), N))) <: nat)]^(k%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((pnn : pnn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) + -- if (ci*{ci : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), `%`(N))))} = $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_2)) + -- if (c*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_1) :: `%`(0)^(256 - N){}) + -- if (c' = $invlanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c*{}[ci*{ci : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), `%`(N))))}[k].`%`.0]^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((pnn : pnn <: imm), N), i*{i})], [VCONST_admininstr(V128_vectype, c)]) - -- if (c'*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_1) :: $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_2)) - -- if (c = $invlanes_(`%X%`((pnn : pnn <: lanetype), N), c'*{}[i*{i}[k]]^(k%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((pnn : pnn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) + -- if (c'*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_1) :: $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_2)) + -- if (c = $invlanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c'*{}[i*{i : nat}[k]]^(k%*`([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{})) + `%~>%`([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)]) - -- if (c_2 = $lanes_(`%X%`((nt : numtype <: lanetype), N), c_1)[i]) + `%~>%`([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)]) - -- if (c_2 = $ext($psize(pt), 32, sx, $lanes_(`%X%`((pt : packtype <: lanetype), N), c_1)[i])) + `%~>%`([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)]) - -- if (c = $invlanes_(`%X%`(lnn, N), $lanes_(`%X%`(lnn, N), c_1)[[i] = $packnum(lnn, c_2)])) + `%~>%`([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)]) - -- 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'})) + 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' : 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), imm : imm, N : N, ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), N)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), N), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), N)))], [CONST_admininstr(I32_numtype, 1)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((imm : imm <: lanetype), N), c)) - -- (if (ci_1 =/= (0 : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), N))))))*{ci_1} + rule vtestop-true{c : vec_(V128_vnn), imm : imm, N : N, ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c)) + -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), imm : imm, N : N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), N), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), N)))], [CONST_admininstr(I32_numtype, 0)]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup - rule vbitmask{c : vec_(V128_vnn), imm : imm, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), N)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`(imm, N))], [CONST_admininstr(I32_numtype, ci)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((imm : imm <: lanetype), N), c)) - -- if ($ibits(32, ci) = $ilt($lsize((imm : imm <: lanetype)), S_sx, ci_1, 0)*{ci_1}) + rule vbitmask{c : vec_(V128_vnn), imm : imm, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`(imm, `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c)) + -- if ($ibits(32, ci) = `%`($ilt($lsize((imm : imm <: lanetype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($lsize((imm : imm <: lanetype)))}) ;; 8-reduction.watsup - rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*, ci_2* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*, cj_1* : iN($lsize((imm_2 : imm <: lanetype)))*, cj_2* : iN($lsize((imm_2 : imm <: lanetype)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`(imm_1, N_1), `%X%`(imm_2, N_2), sx)], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_1)) - -- if (ci_2*{ci_2} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_2)) - -- if (cj_1*{cj_1} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_1)*{ci_1}) - -- if (cj_2*{cj_2} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_2)*{ci_2}) - -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), N_2), cj_1*{cj_1} :: cj_2*{cj_2})) + rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*, cj_1* : iN($lsize((imm_2 : imm <: lanetype)))*, cj_2* : iN($lsize((imm_2 : imm <: lanetype)))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_1)) + -- if (ci_2*{ci_2 : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_2)) + -- if (cj_1*{cj_1 : iN($lsize((imm_2 : imm <: lanetype)))} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_1)*{ci_1 : iN($lsize((imm_1 : imm <: lanetype)))}) + -- if (cj_2*{cj_2 : iN($lsize((imm_2 : imm <: lanetype)))} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_2)*{ci_2 : iN($lsize((imm_1 : imm <: lanetype)))}) + -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), cj_1*{cj_1 : lane_($lanetype(`%X%`((imm_2 : imm <: lanetype), `%`(N_2))))} :: cj_2*{cj_2 : lane_($lanetype(`%X%`((imm_2 : imm <: 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'})) + 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' : 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), imm_2 : imm, N_2 : N, vcvtop : vcvtop, hf : half, imm_1 : imm, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((imm_2 : imm <: lanetype), N_2), vcvtop, ?(hf), `%X%`((imm_1 : imm <: lanetype), N_1), sx?{sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci*{ci} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_1)[$halfop(hf, 0, N_2) : N_2]) - -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), N_2), $vcvtop(`%X%`((imm_1 : imm <: lanetype), N_1), `%X%`((imm_2 : imm <: lanetype), N_2), vcvtop, sx?{sx}, ci)*{ci})) + rule vcvtop-half{c_1 : vec_(V128_vnn), imm_2 : imm, N_2 : N, vcvtop : vcvtop, hf : half, imm_1 : imm, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((imm_1 : imm <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci*{ci : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) + -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), $vcvtop(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), `%X%`((imm_2 : imm <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((imm_1 : imm <: 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 : nat <: lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), N_2))))^N_1{})) + 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)]) + -- 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} :: [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}: - `%~>%*`(`%;%*`(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 : uN(32) <: nat)]) 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})]), [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}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[(x : uN(32) <: nat)]) 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'}, (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}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[(x : uN(32) <: nat)])]) + `%~>%`(`%;%`(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} :: [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}: - `%~>%*`(`%;%*`(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} :: [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}: - `%~>%*`(`%;%*`(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} :: [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))) ;; 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}, 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}: - `%~>%*`(`%;%*`(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))) @@ -10155,7 +10201,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)))) @@ -10163,354 +10209,354 @@ 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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (!($size((nt : numtype <: valtype))) / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- if ($nbytes(nt, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (!($size((nt : numtype <: valtype))) / 8)]) + `%~>%`(`%;%`(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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (n / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 <: valtype))), sx, c))]) - -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (n / 8)]) + `%~>%`(`%;%`(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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (!($size(V128_valtype)) / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- if ($vbytes(V128_vectype, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (!($size(V128_valtype)) / 8)]) + `%~>%`(`%;%`(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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + ((M * N) / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- (if ($ibytes(M, j) = $mem(z, x).DATA_meminst[((i + (mo.OFFSET_memop : uN(32) <: nat)) + ((k * M) / 8)) : (M / 8)]))^(k%`(`%;%`(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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- if ($ibytes(N, j) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)]) + `%~>%`(`%;%`(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)) - -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), M), (j : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), M))))^M{})) + -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(M)), `%`(j)^M{})) ;; 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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- if ($ibytes(N, j) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)]) - -- if (c = $ext(N, 128, U_sx, j)) + `%~>%`(`%;%`(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, c_1 : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, j)]), [TRAP_admininstr]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, 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, c_1 : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, c : vec_(V128_vnn), k : nat, imm : imm, M : M}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, j)]), [VCONST_admininstr(V128_vectype, c)]) - -- if ($ibytes(N, k) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)]) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(V128_vectype, 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 = (!($size(V128_valtype)) / N)) - -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), M), $lanes_(`%X%`((imm : imm <: lanetype), M), c_1)[[j] = (k : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), M))))])) + -- if (M = ($vsize(V128_vectype) / N)) + -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(M)), $lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c_1)[[j] = `%`(k)])) ;; 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]) 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}), `%;%*`(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}: - `%~>%`(`%;%*`(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 zt})) - -- if (fv = $packval(zt*{zt}[i], val)) + `%~>%`(`%;%`(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} :: [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}: - `%~>%`(`%;%*`(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])) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (!($size((nt : numtype <: valtype))) / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 : uN(32) <: nat)), (!($size((nt : numtype <: valtype))) / 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}: - `%~>%`(`%;%*`(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 : uN(32) <: nat)) + (n / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 : uN(32) <: nat)), (n / 8), b*{b}), [])) - -- if (b*{b} = $ibytes(n, $wrap(!($size((inn : inn <: valtype))), 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}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (!($size(V128_valtype)) / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 : uN(32) <: nat)), (!($size(V128_valtype)) / 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}: - `%~>%`(`%;%*`(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 : uN(32) <: nat)) + N) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 : uN(32) <: nat)), (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])) + -- 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 { @@ -10519,21 +10565,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*) +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 { @@ -10543,19 +10589,19 @@ 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 (fi = {TYPE mm.TYPE_moduleinst[(x : uN(32) <: nat)], MODULE mm, CODE func}) + -- if (func = FUNC(x, local*{local : local}, expr)) + -- if (fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func}) ;; 9-module.watsup rec { @@ -10565,9 +10611,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 @@ -10584,16 +10630,16 @@ 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 def $alloctable(store : store, tabletype : tabletype, ref : ref) : (store, tableaddr) ;; 9-module.watsup - def $alloctable{s : store, i : nat, j : nat, rt : reftype, ref : ref, ti : tableinst}(s, `%%`(`[%..%]`(i, j), rt), ref) = (s[TABLE_store =.. [ti]], |s.TABLE_store|) - -- if (ti = {TYPE `%%`(`[%..%]`(i, j), rt), ELEM ref^i{}}) + def $alloctable{s : store, i : nat, j : nat, rt : reftype, ref : ref, ti : tableinst}(s, `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ref) = (s[TABLE_store =.. [ti]], |s.TABLE_store|) + -- if (ti = {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM ref^i{}}) ;; 9-module.watsup rec { @@ -10603,16 +10649,16 @@ 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 def $allocmem(store : store, memtype : memtype) : (store, memaddr) ;; 9-module.watsup - def $allocmem{s : store, i : nat, j : nat, mi : meminst}(s, `%I8`(`[%..%]`(i, j))) = (s[MEM_store =.. [mi]], |s.MEM_store|) - -- if (mi = {TYPE `%I8`(`[%..%]`(i, j)), DATA 0^((i * 64) * $Ki){}}) + def $allocmem{s : store, i : nat, j : nat, mi : meminst}(s, `%I8`(`[%..%]`(`%`(i), `%`(j)))) = (s[MEM_store =.. [mi]], |s.MEM_store|) + -- if (mi = {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA `%`(0)^((i * 64) * $Ki){}}) ;; 9-module.watsup rec { @@ -10622,16 +10668,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 { @@ -10641,16 +10687,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 { @@ -10660,113 +10706,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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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}))) - -;; 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 : byte <: nat))) - ;; 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 : byte <: nat) - 192)) + ((b_2 : byte <: nat) - 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 : byte <: nat) - 224)) + ((2 ^ 6) * ((b_2 : byte <: nat) - 128))) + ((b_3 : byte <: nat) - 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 : byte <: nat) - 240)) + ((2 ^ 12) * ((b_2 : byte <: nat) - 128))) + ((2 ^ 6) * ((b_3 : byte <: nat) - 128))) + ((b_4 : byte <: nat) - 128)))) - ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(ch*{ch}) = $concat_(syntax byte, $utf8([ch])*{ch}) -} + -- 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) @@ -10785,14 +10810,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 = `...` @@ -10800,21 +10825,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) +syntax recordeq = `%++%=%`{recordstar : recordstar}(recordstar : recordstar, recordstar, recordstar) ;; C-conventions.watsup syntax pth = @@ -10870,7 +10895,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 @@ -10881,29 +10906,28 @@ 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 -syntax list{syntax X}(syntax X) = X* - -;; 1-syntax.watsup -syntax char = nat +syntax list{syntax X}(syntax X) = `%`{X* : X*}(X*{X : X} : X*) + -- if (|X*{X : X}| < (2 ^ 32)) ;; 1-syntax.watsup -syntax name = char* +syntax bit = `%`{i : nat}(i : nat) + -- if ((i = 0) \/ (i = 1)) ;; 1-syntax.watsup -syntax bit = nat +syntax byte = `%`{i : nat}(i : nat) + -- if ((i >= 0) /\ (i <= 255)) ;; 1-syntax.watsup -syntax byte = nat +syntax uN{N : N}(N) = `%`{i : nat}(i : nat) + -- if ((i >= 0) /\ (i <= ((2 ^ N) - 1))) ;; 1-syntax.watsup -syntax uN{N : N}(N) = nat - -;; 1-syntax.watsup -syntax sN{N : N}(N) = int +syntax sN{N : N}(N) = `%`{i : int}(i : int) + -- if ((((i >= - ((2 ^ (N - 1)) : nat <: int)) /\ (i <= - (1 : nat <: int))) \/ (i = (0 : nat <: int))) \/ ((i >= + (1 : nat <: int)) /\ (i <= (((2 ^ (N - 1)) - 1) : nat <: int)))) ;; 1-syntax.watsup syntax iN{N : N}(N) = uN(N) @@ -10965,8 +10989,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) @@ -10992,6 +11016,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 @@ -11062,20 +11115,20 @@ 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 | 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 +;; 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 @@ -11083,40 +11136,40 @@ 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, storagetype) +;; 1-syntax.watsup:176.1-177.18 +syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) -;; 1-syntax.watsup:178.1-178.70 -syntax functype = `%->%`(resulttype, resulttype) +;; 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) - | 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 +;; 1-syntax.watsup:190.1-191.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 +;; 1-syntax.watsup:193.1-194.22 syntax rectype = - | REC(list : list(syntax subtype)) + | 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) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY | EQ | I31 @@ -11128,13 +11181,13 @@ syntax heaptype = | EXTERN | NOEXTERN | BOT - | DEF(rectype : rectype, 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 = @@ -11187,19 +11240,19 @@ syntax imm = ;; 1-syntax.watsup syntax deftype = - | DEF(rectype : rectype, nat) + | DEF{rectype : rectype}(rectype : rectype, nat) ;; 1-syntax.watsup -syntax limits = `[%..%]`(u32, u32) +syntax limits = `[%..%]`{u32 : u32}(u32 : u32, u32) ;; 1-syntax.watsup -syntax globaltype = `%%`(mut, valtype) +syntax globaltype = `%%`{mut : mut, valtype : valtype}(mut : mut, valtype : valtype) ;; 1-syntax.watsup -syntax tabletype = `%%`(limits, reftype) +syntax tabletype = `%%`{limits : limits, reftype : reftype}(limits : limits, reftype : reftype) ;; 1-syntax.watsup -syntax memtype = `%I8`(limits) +syntax memtype = `%I8`{limits : limits}(limits : limits) ;; 1-syntax.watsup syntax elemtype = reftype @@ -11209,24 +11262,26 @@ 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(valtype : valtype) : nat? +def $size(numtype : numtype) : nat ;; 2-syntax-aux.watsup - def $size(I32_valtype) = ?(32) + def $size(I32_numtype) = 32 ;; 2-syntax-aux.watsup - def $size(I64_valtype) = ?(64) + def $size(I64_numtype) = 64 ;; 2-syntax-aux.watsup - def $size(F32_valtype) = ?(32) + def $size(F32_numtype) = 32 ;; 2-syntax-aux.watsup - def $size(F64_valtype) = ?(64) + def $size(F64_numtype) = 64 + +;; 1-syntax.watsup +def $vsize(vectype : vectype) : nat ;; 2-syntax-aux.watsup - def $size(V128_valtype) = ?(128) - def $size{x0 : valtype}(x0) = ?() + def $vsize(V128_vectype) = 128 ;; 1-syntax.watsup def $psize(packtype : packtype) : nat @@ -11238,41 +11293,44 @@ def $psize(packtype : packtype) : nat ;; 1-syntax.watsup def $lsize(lanetype : lanetype) : nat ;; 2-syntax-aux.watsup - def $lsize{numtype : numtype}((numtype : numtype <: lanetype)) = !($size((numtype : numtype <: valtype))) + def $lsize{numtype : numtype}((numtype : numtype <: lanetype)) = $size(numtype) ;; 2-syntax-aux.watsup def $lsize{packtype : packtype}((packtype : packtype <: lanetype)) = $psize(packtype) ;; 1-syntax.watsup def $zsize(storagetype : storagetype) : nat ;; 2-syntax-aux.watsup - def $zsize{valtype : valtype}((valtype : valtype <: storagetype)) = !($size(valtype)) + def $zsize{numtype : numtype}((numtype : numtype <: storagetype)) = $size(numtype) + ;; 2-syntax-aux.watsup + def $zsize{vectype : vectype}((vectype : vectype <: storagetype)) = $vsize(vectype) ;; 2-syntax-aux.watsup def $zsize{packtype : packtype}((packtype : packtype <: storagetype)) = $psize(packtype) ;; 1-syntax.watsup -syntax dim = nat +syntax dim = `%`{i : nat}(i : nat) + -- if (((((i = 1) \/ (i = 2)) \/ (i = 4)) \/ (i = 8)) \/ (i = 16)) ;; 1-syntax.watsup -syntax shape = `%X%`(lanetype, dim) +syntax shape = `%X%`{lanetype : lanetype, dim : dim}(lanetype : lanetype, dim : dim) ;; 1-syntax.watsup def $lanetype(shape : shape) : lanetype ;; 2-syntax-aux.watsup - def $lanetype{lnn : lnn, N : N}(`%X%`(lnn, N)) = lnn + def $lanetype{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = lnn ;; 1-syntax.watsup -def $sizenn(valtype : valtype) : nat +def $sizenn(numtype : numtype) : nat ;; 1-syntax.watsup - def $sizenn{t : valtype}(t) = !($size(t)) + def $sizenn{nt : numtype}(nt) = $size(nt) ;; 1-syntax.watsup syntax num_(numtype : numtype) ;; 1-syntax.watsup - syntax num_{inn : inn}((inn : inn <: numtype)) = iN($sizenn((inn : inn <: valtype))) + syntax num_{inn : inn}((inn : inn <: numtype)) = iN($sizenn((inn : inn <: numtype))) ;; 1-syntax.watsup - syntax num_{fnn : fnn}((fnn : fnn <: numtype)) = fN($sizenn((fnn : fnn <: valtype))) + syntax num_{fnn : fnn}((fnn : fnn <: numtype)) = fN($sizenn((fnn : fnn <: numtype))) ;; 1-syntax.watsup @@ -11293,7 +11351,7 @@ syntax lane_(lanetype : lanetype) ;; 1-syntax.watsup -syntax vec_{vnn : vnn}(vnn) = vN(!($size((vnn : vnn <: valtype)))) +syntax vec_{vnn : vnn}(vnn) = vN($vsize(vnn)) ;; 1-syntax.watsup syntax zval_(storagetype : storagetype) @@ -11321,7 +11379,7 @@ syntax unop_(numtype : numtype) | CLZ | CTZ | POPCNT - | EXTEND(n : n) + | EXTEND{n : n}(n : n) ;; 1-syntax.watsup @@ -11342,13 +11400,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 @@ -11374,10 +11432,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 @@ -11397,23 +11455,23 @@ syntax cvtop = | REINTERPRET ;; 1-syntax.watsup -syntax ishape = `%X%`(imm, dim) +syntax ishape = `%X%`{imm : imm, dim : dim}(imm : imm, dim : dim) ;; 1-syntax.watsup -syntax fshape = `%X%`(fnn, dim) +syntax fshape = `%X%`{fnn : fnn, dim : dim}(fnn : fnn, dim : dim) ;; 1-syntax.watsup -syntax pshape = `%X%`(pnn, dim) +syntax pshape = `%X%`{pnn : pnn, dim : dim}(pnn : pnn, dim : dim) ;; 1-syntax.watsup def $dim(shape : shape) : dim ;; 2-syntax-aux.watsup - def $dim{lnn : lnn, N : N}(`%X%`(lnn, N)) = N + def $dim{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = `%`(N) ;; 1-syntax.watsup def $shsize(shape : shape) : nat ;; 2-syntax-aux.watsup - def $shsize{lnn : lnn, N : N}(`%X%`(lnn, N)) = ($lsize(lnn) * N) + def $shsize{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = ($lsize(lnn) * N) ;; 1-syntax.watsup syntax vvunop = @@ -11437,7 +11495,7 @@ syntax vvtestop = ;; 1-syntax.watsup syntax vunop_(shape : shape) ;; 1-syntax.watsup - syntax vunop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + syntax vunop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ABS | NEG | POPCNT{imm : imm} @@ -11445,7 +11503,7 @@ syntax vunop_(shape : shape) ;; 1-syntax.watsup - syntax vunop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vunop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | ABS | NEG | SQRT @@ -11458,12 +11516,12 @@ syntax vunop_(shape : shape) ;; 1-syntax.watsup syntax vbinop_(shape : shape) ;; 1-syntax.watsup - syntax vbinop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + 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) @@ -11471,14 +11529,14 @@ 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) ;; 1-syntax.watsup - syntax vbinop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vbinop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | ADD | SUB | MUL @@ -11490,23 +11548,23 @@ syntax vbinop_(shape : shape) ;; 1-syntax.watsup -syntax vtestop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = +syntax vtestop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ALL_TRUE ;; 1-syntax.watsup syntax vrelop_(shape : shape) ;; 1-syntax.watsup - syntax vrelop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + 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 - syntax vrelop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vrelop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | EQ | NE | LT @@ -11524,12 +11582,12 @@ syntax vcvtop = | PROMOTE ;; 1-syntax.watsup -syntax vshiftop_{imm : imm, N : N}(`%X%`(imm, N)) = +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)) = +syntax vextunop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = | EXTADD_PAIRWISE -- if ((16 <= $lsize((imm_1 : imm <: lanetype))) /\ ($lsize((imm_1 : imm <: lanetype)) <= 32)) @@ -11539,28 +11597,28 @@ syntax half = | HIGH ;; 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) +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}(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, sx : sx) + | 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%?`(()?) @@ -11568,113 +11626,113 @@ syntax zero = `ZERO%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:521.1-533.78 +;; 1-syntax.watsup:523.1-535.78 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)) : dim <: nat))) - | 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) + -- if (ishape = `%X%`(I8_imm, `%`(16))) + | 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) - | 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 @@ -11682,57 +11740,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) +syntax type = TYPE{rectype : rectype}(rectype : rectype) ;; 1-syntax.watsup -syntax local = LOCAL(valtype) +syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`(typeidx, local*, 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, expr) +syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) ;; 1-syntax.watsup -syntax table = TABLE(tabletype, expr) +syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, expr : expr) ;; 1-syntax.watsup -syntax mem = MEMORY(memtype) +syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`(reftype, expr*, 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) +syntax data = DATA{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup -syntax start = START(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, externidx) +syntax export = EXPORT{name : name, externidx : externidx}(name : name, externidx : externidx) ;; 1-syntax.watsup -syntax import = IMPORT(name, name, 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 { @@ -11742,10 +11800,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 } @@ -11755,9 +11813,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 @@ -11777,18 +11835,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 { @@ -11798,7 +11856,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 @@ -11845,7 +11903,7 @@ def $diffrt(reftype : reftype, reftype : reftype) : reftype ;; 2-syntax-aux.watsup syntax typevar = - | _IDX(typeidx : typeidx) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | REC(nat) ;; 2-syntax-aux.watsup @@ -11856,181 +11914,181 @@ def $idx(typeidx : typeidx) : typevar ;; 2-syntax-aux.watsup rec { -;; 2-syntax-aux.watsup:122.1-122.92 +;; 2-syntax-aux.watsup:125.1-125.92 def $subst_typevar(typevar : typevar, typevar*, heaptype*) : heaptype - ;; 2-syntax-aux.watsup:147.1-147.38 + ;; 2-syntax-aux.watsup:150.1-150.38 def $subst_typevar{xx : typevar}(xx, [], []) = (xx : typevar <: heaptype) - ;; 2-syntax-aux.watsup:148.1-148.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 + ;; 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' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = ht_1 -- if (xx = xx_1) - ;; 2-syntax-aux.watsup:149.1-149.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'}) + ;; 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' : 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 { -;; 2-syntax-aux.watsup:126.1-126.92 +;; 2-syntax-aux.watsup:129.1-129.92 def $subst_heaptype(heaptype : heaptype, typevar*, heaptype*) : heaptype - ;; 2-syntax-aux.watsup:154.1-154.67 - def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) - ;; 2-syntax-aux.watsup:155.1-155.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) - ;; 2-syntax-aux.watsup:156.1-156.55 - def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx}, ht*{ht}) = ht' + ;; 2-syntax-aux.watsup:157.1-157.67 + 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 : 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 : typevar}, ht*{ht : heaptype}) = ht' -- otherwise -;; 2-syntax-aux.watsup:127.1-127.92 +;; 2-syntax-aux.watsup:130.1-130.92 def $subst_reftype(reftype : reftype, typevar*, heaptype*) : reftype - ;; 2-syntax-aux.watsup:158.1-158.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})) + ;; 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 : typevar}, ht*{ht : heaptype}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})) -;; 2-syntax-aux.watsup:128.1-128.92 +;; 2-syntax-aux.watsup:131.1-131.92 def $subst_valtype(valtype : valtype, typevar*, heaptype*) : valtype - ;; 2-syntax-aux.watsup:160.1-160.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) - ;; 2-syntax-aux.watsup:161.1-161.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) - ;; 2-syntax-aux.watsup:162.1-162.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) - ;; 2-syntax-aux.watsup:163.1-163.40 - def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + ;; 2-syntax-aux.watsup:163.1-163.64 + 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 : 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 : 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 : typevar}, ht*{ht : heaptype}) = BOT_valtype -;; 2-syntax-aux.watsup:131.1-131.92 +;; 2-syntax-aux.watsup:134.1-134.92 def $subst_storagetype(storagetype : storagetype, typevar*, heaptype*) : storagetype - ;; 2-syntax-aux.watsup:167.1-167.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) - ;; 2-syntax-aux.watsup:168.1-168.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) + ;; 2-syntax-aux.watsup:170.1-170.66 + 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 : typevar}, ht*{ht : heaptype}) = ($subst_packtype(pt, xx*{xx : typevar}, ht*{ht : heaptype}) : packtype <: storagetype) -;; 2-syntax-aux.watsup:132.1-132.92 +;; 2-syntax-aux.watsup:135.1-135.92 def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype - ;; 2-syntax-aux.watsup:170.1-170.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})) + ;; 2-syntax-aux.watsup:173.1-173.80 + 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:134.1-134.92 +;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype - ;; 2-syntax-aux.watsup:172.1-172.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}) - ;; 2-syntax-aux.watsup:173.1-173.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})) - ;; 2-syntax-aux.watsup:174.1-174.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})) - -;; 2-syntax-aux.watsup:135.1-135.92 + ;; 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})) + ;; 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 + 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:176.1-177.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})) - ;; 2-syntax-aux.watsup:178.1-179.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})) + ;; 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 : 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' : 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:136.1-136.92 +;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype - ;; 2-syntax-aux.watsup:181.1-181.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}) + ;; 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})) -;; 2-syntax-aux.watsup:137.1-137.92 +;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype - ;; 2-syntax-aux.watsup:183.1-183.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) + ;; 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 : typevar}, ht*{ht : heaptype}) = DEF_deftype($subst_rectype(qt, xx*{xx : typevar}, ht*{ht : heaptype}), i) -;; 2-syntax-aux.watsup:140.1-140.92 +;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype - ;; 2-syntax-aux.watsup:186.1-186.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}) + ;; 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})) } ;; 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, x^n : idx^n}(rt, ht^n{ht}) = $subst_reftype(rt, $idx(x)^(x (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) + -- if (ishape = `%X%`(I8_imm, `%`(16))) + | 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) - | 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, admininstr*) +syntax config = `%;%`{state : state, admininstr* : admininstr*}(state : state, admininstr*{admininstr : admininstr} : admininstr*) ;; 4-runtime.watsup rec { @@ -13137,28 +13195,28 @@ 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? ;; 5-runtime-aux.watsup - def $default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) + def $default(I32_valtype) = ?(CONST_val(I32_numtype, `%`(0))) ;; 5-runtime-aux.watsup - def $default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) + def $default(I64_valtype) = ?(CONST_val(I64_numtype, `%`(0))) ;; 5-runtime-aux.watsup def $default(F32_valtype) = ?(CONST_val(F32_numtype, $fzero(32))) ;; 5-runtime-aux.watsup def $default(F64_valtype) = ?(CONST_val(F64_numtype, $fzero(64))) ;; 5-runtime-aux.watsup - def $default(V128_valtype) = ?(VCONST_val(V128_vectype, 0)) + def $default(V128_valtype) = ?(VCONST_val(V128_vectype, `%`(0))) ;; 5-runtime-aux.watsup def $default{ht : heaptype}(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) ;; 5-runtime-aux.watsup @@ -13169,14 +13227,14 @@ def $packval(storagetype : storagetype, val : val) : fieldval ;; 5-runtime-aux.watsup def $packval{t : valtype, val : val}((t : valtype <: storagetype), val) = (val : val <: fieldval) ;; 5-runtime-aux.watsup - def $packval{pt : packtype, i : nat}((pt : packtype <: storagetype), CONST_val(I32_numtype, i)) = PACK_fieldval(pt, $wrap(32, $psize(pt), i)) + def $packval{pt : packtype, i : nat}((pt : packtype <: storagetype), CONST_val(I32_numtype, `%`(i))) = PACK_fieldval(pt, $wrap(32, $psize(pt), `%`(i))) ;; 5-runtime-aux.watsup def $unpackval(storagetype : storagetype, sx?, fieldval : fieldval) : val ;; 5-runtime-aux.watsup def $unpackval{t : valtype, val : val}((t : valtype <: storagetype), ?(), (val : val <: fieldval)) = val ;; 5-runtime-aux.watsup - def $unpackval{pt : packtype, sx : sx, i : nat}((pt : packtype <: storagetype), ?(sx), PACK_fieldval(pt, i)) = CONST_val(I32_numtype, $ext($psize(pt), 32, sx, i)) + def $unpackval{pt : packtype, sx : sx, i : nat}((pt : packtype <: storagetype), ?(sx), PACK_fieldval(pt, `%`(i))) = CONST_val(I32_numtype, $ext($psize(pt), 32, sx, `%`(i))) ;; 5-runtime-aux.watsup rec { @@ -13186,9 +13244,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 } @@ -13200,9 +13258,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 } @@ -13214,9 +13272,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 } @@ -13228,9 +13286,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 } @@ -13297,82 +13355,82 @@ def $moduleinst(state : state) : moduleinst ;; 5-runtime-aux.watsup def $type(state : state, typeidx : typeidx) : deftype ;; 5-runtime-aux.watsup - def $type{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.MODULE_frame.TYPE_moduleinst[(x : uN(32) <: nat)] + def $type{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.MODULE_frame.TYPE_moduleinst[x.`%`.0] ;; 5-runtime-aux.watsup def $func(state : state, funcidx : funcidx) : funcinst ;; 5-runtime-aux.watsup - def $func{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[(x : uN(32) <: nat)]] + def $func{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $global(state : state, globalidx : globalidx) : globalinst ;; 5-runtime-aux.watsup - def $global{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[(x : uN(32) <: nat)]] + def $global{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $table(state : state, tableidx : tableidx) : tableinst ;; 5-runtime-aux.watsup - def $table{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]] + def $table{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $mem(state : state, memidx : memidx) : meminst ;; 5-runtime-aux.watsup - def $mem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[(x : uN(32) <: nat)]] + def $mem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $elem(state : state, tableidx : tableidx) : eleminst ;; 5-runtime-aux.watsup - def $elem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[(x : uN(32) <: nat)]] + def $elem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $data(state : state, dataidx : dataidx) : datainst ;; 5-runtime-aux.watsup - def $data{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[(x : uN(32) <: nat)]] + def $data{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $local(state : state, localidx : localidx) : val? ;; 5-runtime-aux.watsup - def $local{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.LOCAL_frame[(x : uN(32) <: nat)] + def $local{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.LOCAL_frame[x.`%`.0] ;; 5-runtime-aux.watsup def $with_local(state : state, localidx : localidx, val : val) : state ;; 5-runtime-aux.watsup - def $with_local{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[(x : uN(32) <: nat)] = ?(v)]) + def $with_local{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[x.`%`.0] = ?(v)]) ;; 5-runtime-aux.watsup def $with_global(state : state, globalidx : globalidx, val : val) : state ;; 5-runtime-aux.watsup - def $with_global{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[(x : uN(32) <: nat)]].VALUE_globalinst = v], f) + def $with_global{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x.`%`.0]].VALUE_globalinst = v], f) ;; 5-runtime-aux.watsup def $with_table(state : state, tableidx : tableidx, nat : nat, ref : ref) : state ;; 5-runtime-aux.watsup - def $with_table{s : store, f : frame, x : idx, i : nat, r : ref}(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]].ELEM_tableinst[i] = r], f) + def $with_table{s : store, f : frame, x : idx, i : nat, r : ref}(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]].ELEM_tableinst[i] = r], f) ;; 5-runtime-aux.watsup def $with_tableinst(state : state, tableidx : tableidx, tableinst : tableinst) : state ;; 5-runtime-aux.watsup - def $with_tableinst{s : store, f : frame, x : idx, ti : tableinst}(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]] = ti], f) + def $with_tableinst{s : store, f : frame, x : idx, ti : tableinst}(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]] = ti], f) ;; 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 : uN(32) <: nat)]].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 ;; 5-runtime-aux.watsup - def $with_meminst{s : store, f : frame, x : idx, mi : meminst}(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[(x : uN(32) <: nat)]] = mi], f) + def $with_meminst{s : store, f : frame, x : idx, mi : meminst}(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]] = mi], f) ;; 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 : uN(32) <: nat)]].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 : uN(32) <: nat)]].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 @@ -13387,20 +13445,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) = ?() @@ -13408,9 +13466,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) = ?() @@ -13420,25 +13478,25 @@ syntax init = | UNSET ;; 6-typing.watsup -syntax localtype = `%%`(init, valtype) +syntax localtype = `%%`{init : init, valtype : valtype}(init : init, valtype : valtype) ;; 6-typing.watsup -syntax instrtype = `%->%*%`(resulttype, localidx*, 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 @@ -13449,7 +13507,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 : uN(32) <: nat)] = 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 @@ -13460,15 +13518,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) @@ -13491,7 +13549,7 @@ relation Heaptype_ok: `%|-%:_OK`(context, heaptype) ;; 6-typing.watsup rule typeidx{C : context, x : idx, dt : deftype}: `%|-%:_OK`(C, _IDX_heaptype(x)) - -- if (C.TYPE_context[(x : uN(32) <: nat)] = dt) + -- if (C.TYPE_context[x.`%`.0] = dt) ;; 6-typing.watsup rule rec{C : context, i : nat, st : subtype}: @@ -13530,25 +13588,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 : uN(32) <: nat)] = 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) + | OK{typeidx : typeidx}(typeidx : typeidx, nat) ;; 6-typing.watsup relation Packtype_ok: `%|-%:_OK`(context, packtype) @@ -13579,16 +13637,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}: @@ -13625,7 +13683,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 @@ -13660,7 +13718,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}: @@ -13680,17 +13738,17 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:319.1-321.52 rule typeidx-l{C : context, typeidx : typeidx, heaptype : heaptype}: `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) - -- Heaptype_sub: `%|-%<:%`(C, (C.TYPE_context[(typeidx : uN(32) <: nat)] : deftype <: heaptype), heaptype) + -- Heaptype_sub: `%|-%<:%`(C, (C.TYPE_context[typeidx.`%`.0] : deftype <: heaptype), heaptype) ;; 6-typing.watsup:323.1-325.52 rule typeidx-r{C : context, heaptype : heaptype, typeidx : typeidx}: `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, (C.TYPE_context[(typeidx : uN(32) <: nat)] : deftype <: heaptype)) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, (C.TYPE_context[typeidx.`%`.0] : deftype <: 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}: @@ -13786,8 +13844,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}: @@ -13803,19 +13861,19 @@ 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 : uN(32) <: nat) < (x : uN(32) <: nat)))*{y} - -- (if ($unrolldt(C.TYPE_context[(y : uN(32) <: nat)]) = 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 ;; 6-typing.watsup def $before{deftype : deftype, x : idx, i : nat}((deftype : deftype <: heaptype), x, i) = true ;; 6-typing.watsup - def $before{typeidx : typeidx, x : idx, i : nat}(_IDX_heaptype(typeidx), x, i) = ((typeidx : uN(32) <: nat) < (x : uN(32) <: nat)) + def $before{typeidx : typeidx, x : idx, i : nat}(_IDX_heaptype(typeidx), x, i) = (typeidx.`%`.0 < x.`%`.0) ;; 6-typing.watsup def $before{j : nat, x : idx, i : nat}(REC_heaptype(j), x, i) = (j < i) @@ -13824,7 +13882,7 @@ def $unrollht(context : context, heaptype : heaptype) : subtype ;; 6-typing.watsup def $unrollht{C : context, deftype : deftype}(C, (deftype : deftype <: heaptype)) = $unrolldt(deftype) ;; 6-typing.watsup - def $unrollht{C : context, typeidx : typeidx}(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[(typeidx : uN(32) <: nat)]) + def $unrollht{C : context, typeidx : typeidx}(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx.`%`.0]) ;; 6-typing.watsup def $unrollht{C : context, i : nat}(C, REC_heaptype(i)) = C.REC_context[i] @@ -13832,12 +13890,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 { @@ -13846,13 +13904,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}), 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 : uN(32) <: nat) + 1), (i + 1))) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) } ;; 6-typing.watsup @@ -13862,18 +13920,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}), 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 : uN(32) <: nat) + 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 @@ -13882,14 +13940,14 @@ 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 relation Limits_ok: `%|-%:%`(context, limits, nat) ;; 6-typing.watsup rule _{C : context, n_1 : n, n_2 : n, k : nat}: - `%|-%:%`(C, `[%..%]`(n_1, n_2), k) + `%|-%:%`(C, `[%..%]`(`%`(n_1), `%`(n_2)), k) -- if ((n_1 <= n_2) /\ (n_2 <= k)) ;; 6-typing.watsup @@ -13938,27 +13996,27 @@ 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}, 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 : uN(32) <: nat)] = `%%`(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) ;; 6-typing.watsup rule _{C : context, n_11 : n, n_12 : n, n_21 : n, n_22 : n}: - `%|-%<:%`(C, `[%..%]`(n_11, n_12), `[%..%]`(n_21, n_22)) + `%|-%<:%`(C, `[%..%]`(`%`(n_11), `%`(n_12)), `[%..%]`(`%`(n_21), `%`(n_22))) -- if (n_11 >= n_21) -- if (n_12 <= n_22) @@ -14017,16 +14075,16 @@ 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}: `%|-%:%`(C, _IDX_blocktype(x), ft) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], FUNC_comptype(ft)) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(ft)) ;; 6-typing.watsup rec { @@ -14035,77 +14093,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}, 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}: - `%|-%:%`(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}), `%->%`(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 : uN(32) <: nat)] = 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 : uN(32) <: nat)] = 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 : uN(32) <: nat)]))*{l} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[(l' : uN(32) <: nat)]) + `%|-%:%`(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} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[(l : uN(32) <: nat)] = 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 : uN(32) <: nat)] = 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 : uN(32) <: nat)] = 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) @@ -14113,8 +14171,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 : uN(32) <: nat)] = 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) @@ -14122,523 +14180,514 @@ 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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})) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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})) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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 : uN(32) <: nat)], 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)}: - `%|-%:%`(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, o0 : nat, o1 : nat}: - `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([(nt_2 : numtype <: valtype)], [(nt_1 : numtype <: valtype)])) - -- if ($size((nt_1 : numtype <: valtype)) = ?(o0)) - -- if ($size((nt_2 : numtype <: valtype)) = ?(o1)) + 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)]))) -- if (nt_1 =/= nt_2) - -- if (o0 = o1) + -- 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?, o0 : nat, o1 : nat}: - `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) - -- if ($size((inn_1 : inn <: valtype)) = ?(o0)) - -- if ($size((inn_2 : inn <: valtype)) = ?(o1)) + 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)]))) -- if (inn_1 =/= inn_2) - -- if ((sx?{sx} = ?()) <=> (o0 > o1)) + -- 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))])) - -- if (C.FUNC_context[(x : uN(32) <: nat)] = dt) + `%|-%:%`(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}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, (rt : reftype <: storagetype)))) - -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[(y : uN(32) <: nat)], rt) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, (t : valtype <: storagetype)))) + `%|-%:%`(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 : uN(32) <: nat)] = OK) + -- 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}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + `%|-%:%`(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)], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), 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])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x_1 : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) - -- Expand: `%~~%`(C.TYPE_context[(x_2 : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt_2))) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- Storagetype_sub: `%|-%<:%`(C, (C.ELEM_context[(y : uN(32) <: nat)] : reftype <: storagetype), zt) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + `%|-%:%`(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 : uN(32) <: nat)] = OK) + -- 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}), `%->%`([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}: - `%|-%:%`(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}, 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}, 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}: - `%|-%:%`(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])) - -- if (C.LOCAL_context[(x : uN(32) <: nat)] = `%%`(init, 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])) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = `%%`(mut, 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], [])) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = `%%`(`MUT%?`(?(())), 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)])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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)], [])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = tt) + `%|-%:%`(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])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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], [])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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], [])) - -- if (C.TABLE_context[(x_1 : uN(32) <: nat)] = `%%`(lim_1, rt_1)) - -- if (C.TABLE_context[(x_2 : uN(32) <: nat)] = `%%`(lim_2, rt_2)) + `%|-%:%`(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], [])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt_1)) - -- if (C.ELEM_context[(y : uN(32) <: nat)] = rt_2) + `%|-%:%`(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), `%->%`([], [])) - -- if (C.ELEM_context[(x : uN(32) <: nat)] = rt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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], [])) - -- if (C.MEM_context[(x_1 : uN(32) <: nat)] = mt_1) - -- if (C.MEM_context[(x_2 : uN(32) <: nat)] = mt_2) + `%|-%:%`(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], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if (C.DATA_context[(y : uN(32) <: nat)] = OK) + `%|-%:%`(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), `%->%`([], [])) - -- if (C.DATA_context[(x : uN(32) <: nat)] = OK) + `%|-%:%`(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, o0 : nat, o1? : nat?}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) - -- if ($size((nt : numtype <: valtype)) = ?(o0)) - -- (if ($size((nt : numtype <: valtype)) = ?(o1)))?{o1} - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if ((2 ^ n_A) <= (o0 / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + 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)]))) + -- 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} + -- 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, o0 : nat, o1? : nat?}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) - -- if ($size((nt : numtype <: valtype)) = ?(o0)) - -- (if ($size((nt : numtype <: valtype)) = ?(o1)))?{o1} - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if ((2 ^ n_A) <= (o0 / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + 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)]), `%`([]))) + -- 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} + -- 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}: - `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [V128_valtype])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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 : uN(8) <: nat) < (128 / n)) + -- if (laneidx.`%`.0 < (128 / n)) - ;; 6-typing.watsup:1046.1-1049.36 - rule vstore{C : context, x : idx, n_A : n, n_O : n, mt : memtype, o0 : nat}: - `%|-%:%`(C, VSTORE_instr(x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype V128_valtype], [])) - -- if ($size(V128_valtype) = ?(o0)) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if ((2 ^ n_A) <= (o0 / 8)) + ;; 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]), `%`([]))) + -- 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], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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 : uN(8) <: nat) < (128 / n)) + -- if (laneidx.`%`.0 < (128 / n)) ;; 6-typing.watsup:504.1-504.67 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}: - `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) - -- if (C.LOCAL_context[(x : uN(32) <: nat)] = `%%`(init, t)) + `%|-%:%`(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])) - -- if (C.LOCAL_context[(x : uN(32) <: nat)] = `%%`(init, 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}, `%->%*%`(t_1*{t_1}, x_1*{x_1} :: x_2*{x_2}, t_3*{t_3})) - -- (if (C.LOCAL_context[(x_1 : uN(32) <: nat)] = `%%`(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 { @@ -14648,7 +14697,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 @@ -14659,7 +14708,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 @@ -14683,7 +14732,7 @@ relation Instr_const: `%|-%CONST`(context, instr) ;; 6-typing.watsup rule global.get{C : context, x : idx, t : valtype}: `%|-%CONST`(C, GLOBAL.GET_instr(x)) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = `%%`(`MUT%?`(?()), t)) + -- if (C.GLOBAL_context[x.`%`.0] = `%%`(`MUT%?`(?()), t)) ;; 6-typing.watsup rule binop{C : context, inn : inn, binop : binop_((inn : inn <: numtype))}: @@ -14695,25 +14744,25 @@ 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) ;; 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}) - -- if (x = |C.TYPE_context|) - -- if (dt*{dt} = $rolldt(x, rectype)) - -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt}], rectype, OK_oktypeidx(x)) + `%|-%:%`(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)) ;; 6-typing.watsup relation Local_ok: `%|-%:%`(context, local, localtype) @@ -14731,10 +14780,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 : uN(32) <: nat)]) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], 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) @@ -14766,7 +14815,7 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) ;; 6-typing.watsup rule active{C : context, x : idx, expr : expr, rt : reftype, lim : limits}: `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} ;; 6-typing.watsup @@ -14781,8 +14830,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 @@ -14790,7 +14839,7 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) ;; 6-typing.watsup rule active{C : context, x : idx, expr : expr, mt : memtype}: `%|-%:_OK`(C, ACTIVE_datamode(x, expr)) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + -- if (C.MEM_context[x.`%`.0] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} ;; 6-typing.watsup @@ -14801,7 +14850,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 @@ -14809,7 +14858,7 @@ relation Start_ok: `%|-%:_OK`(context, start) ;; 6-typing.watsup rule _{C : context, x : idx}: `%|-%:_OK`(C, START(x)) - -- Expand: `%~~%`(C.FUNC_context[(x : uN(32) <: nat)], FUNC_comptype(`%->%`([], []))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`([]), `%`([])))) ;; 6-typing.watsup relation Import_ok: `%|-%:%`(context, import, externtype) @@ -14823,22 +14872,22 @@ relation Externidx_ok: `%|-%:%`(context, externidx, externtype) ;; 6-typing.watsup rule func{C : context, x : idx, dt : deftype}: `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) - -- if (C.FUNC_context[(x : uN(32) <: nat)] = dt) + -- if (C.FUNC_context[x.`%`.0] = dt) ;; 6-typing.watsup rule global{C : context, x : idx, gt : globaltype}: `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = gt) + -- if (C.GLOBAL_context[x.`%`.0] = gt) ;; 6-typing.watsup rule table{C : context, x : idx, tt : tabletype}: `%|-%:%`(C, TABLE_externidx(x), TABLE_externtype(tt)) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = tt) + -- if (C.TABLE_context[x.`%`.0] = tt) ;; 6-typing.watsup rule mem{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup relation Export_ok: `%|-%:%`(context, export, externtype) @@ -14851,55 +14900,55 @@ 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}) + `%|-%:%`(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 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}, dt_1*{} :: dt*{dt}) - -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, 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 : 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) @@ -14909,7 +14958,7 @@ relation Ref_ok: `%|-%:%`(store, ref, reftype) ;; 7-runtime-typing.watsup rule i31{s : store, i : nat}: - `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) + `%|-%:%`(s, REF.I31_NUM_ref(`%`(i)), REF_reftype(`NULL%?`(?()), I31_heaptype)) ;; 7-runtime-typing.watsup rule struct{s : store, a : addr, dt : deftype}: @@ -14935,647 +14984,646 @@ 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}?{t})], [(val_1 : val <: admininstr)]) - -- if (c =/= 0) + `%~>%`([(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)]) - -- if (c = 0) + `%~>%`([(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})]) - -- if (c =/= 0) + `%~>%`([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})]) - -- if (c = 0) + `%~>%`([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 : uN(32) <: nat) + 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}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) - -- if (c =/= 0) + `%~>%`([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)], []) - -- if (c = 0) + `%~>%`([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}, 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}: - `%*_~>%*`([(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 <: 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)}: - `%*_~>%*`([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})], [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}: - `%*_~>%*`([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), o0 : N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VVTESTOP_admininstr(V128_vectype, ANY_TRUE_vvtestop)], [CONST_admininstr(I32_numtype, c)]) - -- if ($size(V128_valtype) = ?(o0)) - -- if (c = $ine(o0, c_1, 0)) + 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)]) + -- if (c = $ine($vsize(V128_vectype), c_1, `%`(0))) ;; 8-reduction.watsup - rule vswizzle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), pnn : pnn, N : N, c' : vec_(V128_vnn), c : iN($lsize((pnn : pnn <: lanetype))), ci* : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), N)))*, k^N : nat^N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((pnn : pnn <: imm), N))], [VCONST_admininstr(V128_vectype, c')]) - -- if (ci*{ci} = $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_2)) - -- if (c*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_1) :: 0^(256 - N){}) - -- if (c' = $invlanes_(`%X%`((pnn : pnn <: lanetype), N), c*{}[(ci*{ci}[k] : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), N))) <: nat)]^(k%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((pnn : pnn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) + -- if (ci*{ci : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), `%`(N))))} = $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_2)) + -- if (c*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_1) :: `%`(0)^(256 - N){}) + -- if (c' = $invlanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c*{}[ci*{ci : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), `%`(N))))}[k].`%`.0]^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((pnn : pnn <: imm), N), i*{i})], [VCONST_admininstr(V128_vectype, c)]) - -- if (c'*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_1) :: $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_2)) - -- if (c = $invlanes_(`%X%`((pnn : pnn <: lanetype), N), c'*{}[i*{i}[k]]^(k%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((pnn : pnn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) + -- if (c'*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_1) :: $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_2)) + -- if (c = $invlanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c'*{}[i*{i : nat}[k]]^(k%*`([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{})) + `%~>%`([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)]) - -- if (c_2 = $lanes_(`%X%`((nt : numtype <: lanetype), N), c_1)[i]) + `%~>%`([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)]) - -- if (c_2 = $ext($psize(pt), 32, sx, $lanes_(`%X%`((pt : packtype <: lanetype), N), c_1)[i])) + `%~>%`([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)]) - -- if (c = $invlanes_(`%X%`(lnn, N), $lanes_(`%X%`(lnn, N), c_1)[[i] = $packnum(lnn, c_2)])) + `%~>%`([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)]) - -- 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'})) + 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' : 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), imm : imm, N : N, ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), N)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), N), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), N)))], [CONST_admininstr(I32_numtype, 1)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((imm : imm <: lanetype), N), c)) - -- (if (ci_1 =/= (0 : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), N))))))*{ci_1} + rule vtestop-true{c : vec_(V128_vnn), imm : imm, N : N, ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c)) + -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), imm : imm, N : N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), N), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), N)))], [CONST_admininstr(I32_numtype, 0)]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup - rule vbitmask{c : vec_(V128_vnn), imm : imm, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), N)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`(imm, N))], [CONST_admininstr(I32_numtype, ci)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((imm : imm <: lanetype), N), c)) - -- if ($ibits(32, ci) = $ilt($lsize((imm : imm <: lanetype)), S_sx, ci_1, 0)*{ci_1}) + rule vbitmask{c : vec_(V128_vnn), imm : imm, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`(imm, `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c)) + -- if ($ibits(32, ci) = `%`($ilt($lsize((imm : imm <: lanetype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($lsize((imm : imm <: lanetype)))}) ;; 8-reduction.watsup - rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*, ci_2* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*, cj_1* : iN($lsize((imm_2 : imm <: lanetype)))*, cj_2* : iN($lsize((imm_2 : imm <: lanetype)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`(imm_1, N_1), `%X%`(imm_2, N_2), sx)], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_1)) - -- if (ci_2*{ci_2} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_2)) - -- if (cj_1*{cj_1} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_1)*{ci_1}) - -- if (cj_2*{cj_2} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_2)*{ci_2}) - -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), N_2), cj_1*{cj_1} :: cj_2*{cj_2})) + rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*, cj_1* : iN($lsize((imm_2 : imm <: lanetype)))*, cj_2* : iN($lsize((imm_2 : imm <: lanetype)))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_1)) + -- if (ci_2*{ci_2 : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_2)) + -- if (cj_1*{cj_1 : iN($lsize((imm_2 : imm <: lanetype)))} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_1)*{ci_1 : iN($lsize((imm_1 : imm <: lanetype)))}) + -- if (cj_2*{cj_2 : iN($lsize((imm_2 : imm <: lanetype)))} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_2)*{ci_2 : iN($lsize((imm_1 : imm <: lanetype)))}) + -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), cj_1*{cj_1 : lane_($lanetype(`%X%`((imm_2 : imm <: lanetype), `%`(N_2))))} :: cj_2*{cj_2 : lane_($lanetype(`%X%`((imm_2 : imm <: 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'})) + 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' : 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), imm_2 : imm, N_2 : N, vcvtop : vcvtop, hf : half, imm_1 : imm, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((imm_2 : imm <: lanetype), N_2), vcvtop, ?(hf), `%X%`((imm_1 : imm <: lanetype), N_1), sx?{sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci*{ci} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_1)[$halfop(hf, 0, N_2) : N_2]) - -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), N_2), $vcvtop(`%X%`((imm_1 : imm <: lanetype), N_1), `%X%`((imm_2 : imm <: lanetype), N_2), vcvtop, sx?{sx}, ci)*{ci})) + rule vcvtop-half{c_1 : vec_(V128_vnn), imm_2 : imm, N_2 : N, vcvtop : vcvtop, hf : half, imm_1 : imm, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((imm_1 : imm <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci*{ci : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) + -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), $vcvtop(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), `%X%`((imm_2 : imm <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((imm_1 : imm <: 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 : nat <: lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), N_2))))^N_1{})) + 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)]) + -- 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} :: [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}: - `%~>%*`(`%;%*`(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 : uN(32) <: nat)]) 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})]), [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}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[(x : uN(32) <: nat)]) 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'}, (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}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[(x : uN(32) <: nat)])]) + `%~>%`(`%;%`(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} :: [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}: - `%~>%*`(`%;%*`(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} :: [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}: - `%~>%*`(`%;%*`(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} :: [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))) ;; 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}, 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}: - `%~>%*`(`%;%*`(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))) @@ -15584,7 +15632,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))) @@ -15593,369 +15641,356 @@ 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, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) - -- if ($size((nt : numtype <: valtype)) = ?(o0)) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + 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]) + -- 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), o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) - -- if ($size((nt : numtype <: valtype)) = ?(o0)) - -- if ($nbytes(nt, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (o0 / 8)]) + 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)]) + -- 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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (n / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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), o0 : N}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [CONST_admininstr((inn : inn <: numtype), $ext(n, o0, sx, c))]) - -- if ($size((inn : inn <: valtype)) = ?(o0)) - -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (n / 8)]) + 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))]) + -- 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, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VLOAD_admininstr(?(), x, mo)]), [TRAP_admininstr]) - -- if ($size(V128_valtype) = ?(o0)) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + rule vload-oob{z : state, i : nat, x : idx, mo : memop}: + `%~>%`(`%;%`(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), o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VLOAD_admininstr(?(), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) - -- if ($size(V128_valtype) = ?(o0)) - -- if ($vbytes(V128_vectype, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (o0 / 8)]) + 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)]) + -- 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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + ((M * N) / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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, o0 : nat, o1^N : N^N}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) - -- if ($size((inn : inn <: valtype)) = ?(o0)) - -- (if ($size((inn : inn <: valtype)) = ?(o1)))^N{o1} - -- (if ($ibytes(M, j) = $mem(z, x).DATA_meminst[((i + (mo.OFFSET_memop : uN(32) <: nat)) + ((k * M) / 8)) : (M / 8)]))^(k%`(`%;%`(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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- if ($ibytes(N, j) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)]) + `%~>%`(`%;%`(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)) - -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), M), (j : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), M))))^M{})) + -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(M)), `%`(j)^M{})) ;; 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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- if ($ibytes(N, j) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)]) - -- if (c = $ext(N, 128, U_sx, j)) + `%~>%`(`%;%`(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, c_1 : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, j)]), [TRAP_admininstr]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, 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, c_1 : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, c : vec_(V128_vnn), k : nat, imm : imm, M : M, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, j)]), [VCONST_admininstr(V128_vectype, c)]) - -- if ($size(V128_valtype) = ?(o0)) - -- if ($ibytes(N, k) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)]) + rule vload_lane-val{z : state, i : nat, c_1 : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, c : vec_(V128_vnn), k : nat, imm : imm, M : M}: + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(V128_vectype, 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 = (o0 / N)) - -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), M), $lanes_(`%X%`((imm : imm <: lanetype), M), c_1)[[j] = (k : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), M))))])) + -- if (M = ($vsize(V128_vectype) / N)) + -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(M)), $lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c_1)[[j] = `%`(k)])) ;; 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]) 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}), `%;%*`(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}: - `%~>%`(`%;%*`(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 zt})) - -- if (fv = $packval(zt*{zt}[i], val)) + `%~>%`(`%;%`(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} :: [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}: - `%~>%`(`%;%*`(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, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if ($size((nt : numtype <: valtype)) = ?(o0)) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + 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])) + -- 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*, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + (mo.OFFSET_memop : uN(32) <: nat)), (o0 / 8), b*{b}), [])) - -- if ($size((nt : numtype <: valtype)) = ?(o0)) - -- if (b*{b} = $nbytes(nt, c)) + 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}), [])) + -- 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])) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (n / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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*, o0 : M}: - `%~>%`(`%;%*`(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 : uN(32) <: nat)), (n / 8), b*{b}), [])) - -- if ($size((inn : inn <: valtype)) = ?(o0)) - -- if (b*{b} = $ibytes(n, $wrap(o0, n, c))) + 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}), [])) + -- 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, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if ($size(V128_valtype) = ?(o0)) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + 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])) + -- 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*, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + (mo.OFFSET_memop : uN(32) <: nat)), (o0 / 8), b*{b}), [])) - -- if ($size(V128_valtype) = ?(o0)) - -- if (b*{b} = $vbytes(V128_vectype, c)) + 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}), [])) + -- 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])) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + N) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 : uN(32) <: nat)), (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])) + -- 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 { @@ -15964,21 +15999,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*) +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 { @@ -15988,19 +16023,19 @@ 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 (fi = {TYPE mm.TYPE_moduleinst[(x : uN(32) <: nat)], MODULE mm, CODE func}) + -- if (func = FUNC(x, local*{local : local}, expr)) + -- if (fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func}) ;; 9-module.watsup rec { @@ -16010,9 +16045,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 @@ -16029,16 +16064,16 @@ 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 def $alloctable(store : store, tabletype : tabletype, ref : ref) : (store, tableaddr) ;; 9-module.watsup - def $alloctable{s : store, i : nat, j : nat, rt : reftype, ref : ref, ti : tableinst}(s, `%%`(`[%..%]`(i, j), rt), ref) = (s[TABLE_store =.. [ti]], |s.TABLE_store|) - -- if (ti = {TYPE `%%`(`[%..%]`(i, j), rt), ELEM ref^i{}}) + def $alloctable{s : store, i : nat, j : nat, rt : reftype, ref : ref, ti : tableinst}(s, `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ref) = (s[TABLE_store =.. [ti]], |s.TABLE_store|) + -- if (ti = {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM ref^i{}}) ;; 9-module.watsup rec { @@ -16048,16 +16083,16 @@ 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 def $allocmem(store : store, memtype : memtype) : (store, memaddr) ;; 9-module.watsup - def $allocmem{s : store, i : nat, j : nat, mi : meminst}(s, `%I8`(`[%..%]`(i, j))) = (s[MEM_store =.. [mi]], |s.MEM_store|) - -- if (mi = {TYPE `%I8`(`[%..%]`(i, j)), DATA 0^((i * 64) * $Ki){}}) + def $allocmem{s : store, i : nat, j : nat, mi : meminst}(s, `%I8`(`[%..%]`(`%`(i), `%`(j)))) = (s[MEM_store =.. [mi]], |s.MEM_store|) + -- if (mi = {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA `%`(0)^((i * 64) * $Ki){}}) ;; 9-module.watsup rec { @@ -16067,16 +16102,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 { @@ -16086,16 +16121,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 { @@ -16105,113 +16140,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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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}))) - -;; 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 : byte <: nat))) - ;; 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 : byte <: nat) - 192)) + ((b_2 : byte <: nat) - 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 : byte <: nat) - 224)) + ((2 ^ 6) * ((b_2 : byte <: nat) - 128))) + ((b_3 : byte <: nat) - 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 : byte <: nat) - 240)) + ((2 ^ 12) * ((b_2 : byte <: nat) - 128))) + ((2 ^ 6) * ((b_3 : byte <: nat) - 128))) + ((b_4 : byte <: nat) - 128)))) - ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(ch*{ch}) = $concat_(syntax byte, $utf8([ch])*{ch}) -} + -- 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) @@ -16230,14 +16244,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 = `...` @@ -16245,21 +16259,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) +syntax recordeq = `%++%=%`{recordstar : recordstar}(recordstar : recordstar, recordstar, recordstar) ;; C-conventions.watsup syntax pth = @@ -16315,7 +16329,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 @@ -16326,29 +16340,28 @@ 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 -syntax list{syntax X}(syntax X) = X* - -;; 1-syntax.watsup -syntax char = nat +syntax list{syntax X}(syntax X) = `%`{X* : X*}(X*{X : X} : X*) + -- if (|X*{X : X}| < (2 ^ 32)) ;; 1-syntax.watsup -syntax name = char* +syntax bit = `%`{i : nat}(i : nat) + -- if ((i = 0) \/ (i = 1)) ;; 1-syntax.watsup -syntax bit = nat +syntax byte = `%`{i : nat}(i : nat) + -- if ((i >= 0) /\ (i <= 255)) ;; 1-syntax.watsup -syntax byte = nat +syntax uN{N : N}(N) = `%`{i : nat}(i : nat) + -- if ((i >= 0) /\ (i <= ((2 ^ N) - 1))) ;; 1-syntax.watsup -syntax uN{N : N}(N) = nat - -;; 1-syntax.watsup -syntax sN{N : N}(N) = int +syntax sN{N : N}(N) = `%`{i : int}(i : int) + -- if ((((i >= - ((2 ^ (N - 1)) : nat <: int)) /\ (i <= - (1 : nat <: int))) \/ (i = (0 : nat <: int))) \/ ((i >= + (1 : nat <: int)) /\ (i <= (((2 ^ (N - 1)) - 1) : nat <: int)))) ;; 1-syntax.watsup syntax iN{N : N}(N) = uN(N) @@ -16410,8 +16423,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) @@ -16437,6 +16450,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 @@ -16507,20 +16549,20 @@ 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 | 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 +;; 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 @@ -16528,40 +16570,40 @@ 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, storagetype) +;; 1-syntax.watsup:176.1-177.18 +syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) -;; 1-syntax.watsup:178.1-178.70 -syntax functype = `%->%`(resulttype, resulttype) +;; 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) - | 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 +;; 1-syntax.watsup:190.1-191.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 +;; 1-syntax.watsup:193.1-194.22 syntax rectype = - | REC(list : list(syntax subtype)) + | 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) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY | EQ | I31 @@ -16573,13 +16615,13 @@ syntax heaptype = | EXTERN | NOEXTERN | BOT - | DEF(rectype : rectype, 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 = @@ -16632,19 +16674,19 @@ syntax imm = ;; 1-syntax.watsup syntax deftype = - | DEF(rectype : rectype, nat) + | DEF{rectype : rectype}(rectype : rectype, nat) ;; 1-syntax.watsup -syntax limits = `[%..%]`(u32, u32) +syntax limits = `[%..%]`{u32 : u32}(u32 : u32, u32) ;; 1-syntax.watsup -syntax globaltype = `%%`(mut, valtype) +syntax globaltype = `%%`{mut : mut, valtype : valtype}(mut : mut, valtype : valtype) ;; 1-syntax.watsup -syntax tabletype = `%%`(limits, reftype) +syntax tabletype = `%%`{limits : limits, reftype : reftype}(limits : limits, reftype : reftype) ;; 1-syntax.watsup -syntax memtype = `%I8`(limits) +syntax memtype = `%I8`{limits : limits}(limits : limits) ;; 1-syntax.watsup syntax elemtype = reftype @@ -16654,24 +16696,26 @@ 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(valtype : valtype) : nat? +def $size(numtype : numtype) : nat ;; 2-syntax-aux.watsup - def $size(I32_valtype) = ?(32) + def $size(I32_numtype) = 32 ;; 2-syntax-aux.watsup - def $size(I64_valtype) = ?(64) + def $size(I64_numtype) = 64 ;; 2-syntax-aux.watsup - def $size(F32_valtype) = ?(32) + def $size(F32_numtype) = 32 ;; 2-syntax-aux.watsup - def $size(F64_valtype) = ?(64) + def $size(F64_numtype) = 64 + +;; 1-syntax.watsup +def $vsize(vectype : vectype) : nat ;; 2-syntax-aux.watsup - def $size(V128_valtype) = ?(128) - def $size{x0 : valtype}(x0) = ?() + def $vsize(V128_vectype) = 128 ;; 1-syntax.watsup def $psize(packtype : packtype) : nat @@ -16683,41 +16727,44 @@ def $psize(packtype : packtype) : nat ;; 1-syntax.watsup def $lsize(lanetype : lanetype) : nat ;; 2-syntax-aux.watsup - def $lsize{numtype : numtype}((numtype : numtype <: lanetype)) = !($size((numtype : numtype <: valtype))) + def $lsize{numtype : numtype}((numtype : numtype <: lanetype)) = $size(numtype) ;; 2-syntax-aux.watsup def $lsize{packtype : packtype}((packtype : packtype <: lanetype)) = $psize(packtype) ;; 1-syntax.watsup def $zsize(storagetype : storagetype) : nat ;; 2-syntax-aux.watsup - def $zsize{valtype : valtype}((valtype : valtype <: storagetype)) = !($size(valtype)) + def $zsize{numtype : numtype}((numtype : numtype <: storagetype)) = $size(numtype) + ;; 2-syntax-aux.watsup + def $zsize{vectype : vectype}((vectype : vectype <: storagetype)) = $vsize(vectype) ;; 2-syntax-aux.watsup def $zsize{packtype : packtype}((packtype : packtype <: storagetype)) = $psize(packtype) ;; 1-syntax.watsup -syntax dim = nat +syntax dim = `%`{i : nat}(i : nat) + -- if (((((i = 1) \/ (i = 2)) \/ (i = 4)) \/ (i = 8)) \/ (i = 16)) ;; 1-syntax.watsup -syntax shape = `%X%`(lanetype, dim) +syntax shape = `%X%`{lanetype : lanetype, dim : dim}(lanetype : lanetype, dim : dim) ;; 1-syntax.watsup def $lanetype(shape : shape) : lanetype ;; 2-syntax-aux.watsup - def $lanetype{lnn : lnn, N : N}(`%X%`(lnn, N)) = lnn + def $lanetype{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = lnn ;; 1-syntax.watsup -def $sizenn(valtype : valtype) : nat +def $sizenn(numtype : numtype) : nat ;; 1-syntax.watsup - def $sizenn{t : valtype}(t) = !($size(t)) + def $sizenn{nt : numtype}(nt) = $size(nt) ;; 1-syntax.watsup syntax num_(numtype : numtype) ;; 1-syntax.watsup - syntax num_{inn : inn}((inn : inn <: numtype)) = iN($sizenn((inn : inn <: valtype))) + syntax num_{inn : inn}((inn : inn <: numtype)) = iN($sizenn((inn : inn <: numtype))) ;; 1-syntax.watsup - syntax num_{fnn : fnn}((fnn : fnn <: numtype)) = fN($sizenn((fnn : fnn <: valtype))) + syntax num_{fnn : fnn}((fnn : fnn <: numtype)) = fN($sizenn((fnn : fnn <: numtype))) ;; 1-syntax.watsup @@ -16738,7 +16785,7 @@ syntax lane_(lanetype : lanetype) ;; 1-syntax.watsup -syntax vec_{vnn : vnn}(vnn) = vN(!($size((vnn : vnn <: valtype)))) +syntax vec_{vnn : vnn}(vnn) = vN($vsize(vnn)) ;; 1-syntax.watsup syntax zval_(storagetype : storagetype) @@ -16766,7 +16813,7 @@ syntax unop_(numtype : numtype) | CLZ | CTZ | POPCNT - | EXTEND(n : n) + | EXTEND{n : n}(n : n) ;; 1-syntax.watsup @@ -16787,13 +16834,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 @@ -16819,10 +16866,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 @@ -16842,23 +16889,23 @@ syntax cvtop = | REINTERPRET ;; 1-syntax.watsup -syntax ishape = `%X%`(imm, dim) +syntax ishape = `%X%`{imm : imm, dim : dim}(imm : imm, dim : dim) ;; 1-syntax.watsup -syntax fshape = `%X%`(fnn, dim) +syntax fshape = `%X%`{fnn : fnn, dim : dim}(fnn : fnn, dim : dim) ;; 1-syntax.watsup -syntax pshape = `%X%`(pnn, dim) +syntax pshape = `%X%`{pnn : pnn, dim : dim}(pnn : pnn, dim : dim) ;; 1-syntax.watsup def $dim(shape : shape) : dim ;; 2-syntax-aux.watsup - def $dim{lnn : lnn, N : N}(`%X%`(lnn, N)) = N + def $dim{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = `%`(N) ;; 1-syntax.watsup def $shsize(shape : shape) : nat ;; 2-syntax-aux.watsup - def $shsize{lnn : lnn, N : N}(`%X%`(lnn, N)) = ($lsize(lnn) * N) + def $shsize{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = ($lsize(lnn) * N) ;; 1-syntax.watsup syntax vvunop = @@ -16882,7 +16929,7 @@ syntax vvtestop = ;; 1-syntax.watsup syntax vunop_(shape : shape) ;; 1-syntax.watsup - syntax vunop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + syntax vunop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ABS | NEG | POPCNT{imm : imm} @@ -16890,7 +16937,7 @@ syntax vunop_(shape : shape) ;; 1-syntax.watsup - syntax vunop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vunop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | ABS | NEG | SQRT @@ -16903,12 +16950,12 @@ syntax vunop_(shape : shape) ;; 1-syntax.watsup syntax vbinop_(shape : shape) ;; 1-syntax.watsup - syntax vbinop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + 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) @@ -16916,14 +16963,14 @@ 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) ;; 1-syntax.watsup - syntax vbinop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vbinop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | ADD | SUB | MUL @@ -16935,23 +16982,23 @@ syntax vbinop_(shape : shape) ;; 1-syntax.watsup -syntax vtestop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = +syntax vtestop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ALL_TRUE ;; 1-syntax.watsup syntax vrelop_(shape : shape) ;; 1-syntax.watsup - syntax vrelop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + 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 - syntax vrelop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vrelop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | EQ | NE | LT @@ -16969,12 +17016,12 @@ syntax vcvtop = | PROMOTE ;; 1-syntax.watsup -syntax vshiftop_{imm : imm, N : N}(`%X%`(imm, N)) = +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)) = +syntax vextunop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = | EXTADD_PAIRWISE -- if ((16 <= $lsize((imm_1 : imm <: lanetype))) /\ ($lsize((imm_1 : imm <: lanetype)) <= 32)) @@ -16984,28 +17031,28 @@ syntax half = | HIGH ;; 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) +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}(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, sx : sx) + | 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%?`(()?) @@ -17013,113 +17060,113 @@ syntax zero = `ZERO%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:521.1-533.78 +;; 1-syntax.watsup:523.1-535.78 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)) : dim <: nat))) - | 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) + -- if (ishape = `%X%`(I8_imm, `%`(16))) + | 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) - | 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 @@ -17127,57 +17174,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) +syntax type = TYPE{rectype : rectype}(rectype : rectype) ;; 1-syntax.watsup -syntax local = LOCAL(valtype) +syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`(typeidx, local*, 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, expr) +syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) ;; 1-syntax.watsup -syntax table = TABLE(tabletype, expr) +syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, expr : expr) ;; 1-syntax.watsup -syntax mem = MEMORY(memtype) +syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`(reftype, expr*, 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) +syntax data = DATA{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup -syntax start = START(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, externidx) +syntax export = EXPORT{name : name, externidx : externidx}(name : name, externidx : externidx) ;; 1-syntax.watsup -syntax import = IMPORT(name, name, 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 { @@ -17187,10 +17234,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 } @@ -17200,9 +17247,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 @@ -17222,18 +17269,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 { @@ -17243,7 +17290,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 @@ -17290,7 +17337,7 @@ def $diffrt(reftype : reftype, reftype : reftype) : reftype ;; 2-syntax-aux.watsup syntax typevar = - | _IDX(typeidx : typeidx) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | REC(nat) ;; 2-syntax-aux.watsup @@ -17301,181 +17348,181 @@ def $idx(typeidx : typeidx) : typevar ;; 2-syntax-aux.watsup rec { -;; 2-syntax-aux.watsup:122.1-122.92 +;; 2-syntax-aux.watsup:125.1-125.92 def $subst_typevar(typevar : typevar, typevar*, heaptype*) : heaptype - ;; 2-syntax-aux.watsup:147.1-147.38 + ;; 2-syntax-aux.watsup:150.1-150.38 def $subst_typevar{xx : typevar}(xx, [], []) = (xx : typevar <: heaptype) - ;; 2-syntax-aux.watsup:148.1-148.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 + ;; 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' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = ht_1 -- if (xx = xx_1) - ;; 2-syntax-aux.watsup:149.1-149.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'}) + ;; 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' : 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 { -;; 2-syntax-aux.watsup:126.1-126.92 +;; 2-syntax-aux.watsup:129.1-129.92 def $subst_heaptype(heaptype : heaptype, typevar*, heaptype*) : heaptype - ;; 2-syntax-aux.watsup:154.1-154.67 - def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) - ;; 2-syntax-aux.watsup:155.1-155.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) - ;; 2-syntax-aux.watsup:156.1-156.55 - def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx}, ht*{ht}) = ht' + ;; 2-syntax-aux.watsup:157.1-157.67 + 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 : 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 : typevar}, ht*{ht : heaptype}) = ht' -- otherwise -;; 2-syntax-aux.watsup:127.1-127.92 +;; 2-syntax-aux.watsup:130.1-130.92 def $subst_reftype(reftype : reftype, typevar*, heaptype*) : reftype - ;; 2-syntax-aux.watsup:158.1-158.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})) + ;; 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 : typevar}, ht*{ht : heaptype}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})) -;; 2-syntax-aux.watsup:128.1-128.92 +;; 2-syntax-aux.watsup:131.1-131.92 def $subst_valtype(valtype : valtype, typevar*, heaptype*) : valtype - ;; 2-syntax-aux.watsup:160.1-160.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) - ;; 2-syntax-aux.watsup:161.1-161.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) - ;; 2-syntax-aux.watsup:162.1-162.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) - ;; 2-syntax-aux.watsup:163.1-163.40 - def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + ;; 2-syntax-aux.watsup:163.1-163.64 + 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 : 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 : 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 : typevar}, ht*{ht : heaptype}) = BOT_valtype -;; 2-syntax-aux.watsup:131.1-131.92 +;; 2-syntax-aux.watsup:134.1-134.92 def $subst_storagetype(storagetype : storagetype, typevar*, heaptype*) : storagetype - ;; 2-syntax-aux.watsup:167.1-167.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) - ;; 2-syntax-aux.watsup:168.1-168.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) + ;; 2-syntax-aux.watsup:170.1-170.66 + 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 : typevar}, ht*{ht : heaptype}) = ($subst_packtype(pt, xx*{xx : typevar}, ht*{ht : heaptype}) : packtype <: storagetype) -;; 2-syntax-aux.watsup:132.1-132.92 +;; 2-syntax-aux.watsup:135.1-135.92 def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype - ;; 2-syntax-aux.watsup:170.1-170.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})) + ;; 2-syntax-aux.watsup:173.1-173.80 + 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:134.1-134.92 +;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype - ;; 2-syntax-aux.watsup:172.1-172.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}) - ;; 2-syntax-aux.watsup:173.1-173.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})) - ;; 2-syntax-aux.watsup:174.1-174.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})) - -;; 2-syntax-aux.watsup:135.1-135.92 + ;; 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})) + ;; 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 + 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:176.1-177.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})) - ;; 2-syntax-aux.watsup:178.1-179.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})) + ;; 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 : 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' : 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:136.1-136.92 +;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype - ;; 2-syntax-aux.watsup:181.1-181.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}) + ;; 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})) -;; 2-syntax-aux.watsup:137.1-137.92 +;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype - ;; 2-syntax-aux.watsup:183.1-183.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) + ;; 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 : typevar}, ht*{ht : heaptype}) = DEF_deftype($subst_rectype(qt, xx*{xx : typevar}, ht*{ht : heaptype}), i) -;; 2-syntax-aux.watsup:140.1-140.92 +;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype - ;; 2-syntax-aux.watsup:186.1-186.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}) + ;; 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})) } ;; 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, x^n : idx^n}(rt, ht^n{ht}) = $subst_reftype(rt, $idx(x)^(x (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) + -- if (ishape = `%X%`(I8_imm, `%`(16))) + | 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) - | 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, admininstr*) +syntax config = `%;%`{state : state, admininstr* : admininstr*}(state : state, admininstr*{admininstr : admininstr} : admininstr*) ;; 4-runtime.watsup rec { @@ -18582,28 +18629,28 @@ 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? ;; 5-runtime-aux.watsup - def $default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) + def $default(I32_valtype) = ?(CONST_val(I32_numtype, `%`(0))) ;; 5-runtime-aux.watsup - def $default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) + def $default(I64_valtype) = ?(CONST_val(I64_numtype, `%`(0))) ;; 5-runtime-aux.watsup def $default(F32_valtype) = ?(CONST_val(F32_numtype, $fzero(32))) ;; 5-runtime-aux.watsup def $default(F64_valtype) = ?(CONST_val(F64_numtype, $fzero(64))) ;; 5-runtime-aux.watsup - def $default(V128_valtype) = ?(VCONST_val(V128_vectype, 0)) + def $default(V128_valtype) = ?(VCONST_val(V128_vectype, `%`(0))) ;; 5-runtime-aux.watsup def $default{ht : heaptype}(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) ;; 5-runtime-aux.watsup @@ -18614,14 +18661,14 @@ def $packval(storagetype : storagetype, val : val) : fieldval ;; 5-runtime-aux.watsup def $packval{t : valtype, val : val}((t : valtype <: storagetype), val) = (val : val <: fieldval) ;; 5-runtime-aux.watsup - def $packval{pt : packtype, i : nat}((pt : packtype <: storagetype), CONST_val(I32_numtype, i)) = PACK_fieldval(pt, $wrap(32, $psize(pt), i)) + def $packval{pt : packtype, i : nat}((pt : packtype <: storagetype), CONST_val(I32_numtype, `%`(i))) = PACK_fieldval(pt, $wrap(32, $psize(pt), `%`(i))) ;; 5-runtime-aux.watsup def $unpackval(storagetype : storagetype, sx?, fieldval : fieldval) : val ;; 5-runtime-aux.watsup def $unpackval{t : valtype, val : val}((t : valtype <: storagetype), ?(), (val : val <: fieldval)) = val ;; 5-runtime-aux.watsup - def $unpackval{pt : packtype, sx : sx, i : nat}((pt : packtype <: storagetype), ?(sx), PACK_fieldval(pt, i)) = CONST_val(I32_numtype, $ext($psize(pt), 32, sx, i)) + def $unpackval{pt : packtype, sx : sx, i : nat}((pt : packtype <: storagetype), ?(sx), PACK_fieldval(pt, `%`(i))) = CONST_val(I32_numtype, $ext($psize(pt), 32, sx, `%`(i))) ;; 5-runtime-aux.watsup rec { @@ -18631,9 +18678,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 } @@ -18645,9 +18692,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 } @@ -18659,9 +18706,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 } @@ -18673,9 +18720,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 } @@ -18742,82 +18789,82 @@ def $moduleinst(state : state) : moduleinst ;; 5-runtime-aux.watsup def $type(state : state, typeidx : typeidx) : deftype ;; 5-runtime-aux.watsup - def $type{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.MODULE_frame.TYPE_moduleinst[(x : uN(32) <: nat)] + def $type{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.MODULE_frame.TYPE_moduleinst[x.`%`.0] ;; 5-runtime-aux.watsup def $func(state : state, funcidx : funcidx) : funcinst ;; 5-runtime-aux.watsup - def $func{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[(x : uN(32) <: nat)]] + def $func{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $global(state : state, globalidx : globalidx) : globalinst ;; 5-runtime-aux.watsup - def $global{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[(x : uN(32) <: nat)]] + def $global{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $table(state : state, tableidx : tableidx) : tableinst ;; 5-runtime-aux.watsup - def $table{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]] + def $table{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $mem(state : state, memidx : memidx) : meminst ;; 5-runtime-aux.watsup - def $mem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[(x : uN(32) <: nat)]] + def $mem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $elem(state : state, tableidx : tableidx) : eleminst ;; 5-runtime-aux.watsup - def $elem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[(x : uN(32) <: nat)]] + def $elem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $data(state : state, dataidx : dataidx) : datainst ;; 5-runtime-aux.watsup - def $data{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[(x : uN(32) <: nat)]] + def $data{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $local(state : state, localidx : localidx) : val? ;; 5-runtime-aux.watsup - def $local{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.LOCAL_frame[(x : uN(32) <: nat)] + def $local{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.LOCAL_frame[x.`%`.0] ;; 5-runtime-aux.watsup def $with_local(state : state, localidx : localidx, val : val) : state ;; 5-runtime-aux.watsup - def $with_local{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[(x : uN(32) <: nat)] = ?(v)]) + def $with_local{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[x.`%`.0] = ?(v)]) ;; 5-runtime-aux.watsup def $with_global(state : state, globalidx : globalidx, val : val) : state ;; 5-runtime-aux.watsup - def $with_global{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[(x : uN(32) <: nat)]].VALUE_globalinst = v], f) + def $with_global{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x.`%`.0]].VALUE_globalinst = v], f) ;; 5-runtime-aux.watsup def $with_table(state : state, tableidx : tableidx, nat : nat, ref : ref) : state ;; 5-runtime-aux.watsup - def $with_table{s : store, f : frame, x : idx, i : nat, r : ref}(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]].ELEM_tableinst[i] = r], f) + def $with_table{s : store, f : frame, x : idx, i : nat, r : ref}(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]].ELEM_tableinst[i] = r], f) ;; 5-runtime-aux.watsup def $with_tableinst(state : state, tableidx : tableidx, tableinst : tableinst) : state ;; 5-runtime-aux.watsup - def $with_tableinst{s : store, f : frame, x : idx, ti : tableinst}(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]] = ti], f) + def $with_tableinst{s : store, f : frame, x : idx, ti : tableinst}(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]] = ti], f) ;; 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 : uN(32) <: nat)]].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 ;; 5-runtime-aux.watsup - def $with_meminst{s : store, f : frame, x : idx, mi : meminst}(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[(x : uN(32) <: nat)]] = mi], f) + def $with_meminst{s : store, f : frame, x : idx, mi : meminst}(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]] = mi], f) ;; 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 : uN(32) <: nat)]].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 : uN(32) <: nat)]].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 @@ -18832,20 +18879,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) = ?() @@ -18853,9 +18900,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) = ?() @@ -18865,25 +18912,25 @@ syntax init = | UNSET ;; 6-typing.watsup -syntax localtype = `%%`(init, valtype) +syntax localtype = `%%`{init : init, valtype : valtype}(init : init, valtype : valtype) ;; 6-typing.watsup -syntax instrtype = `%->%*%`(resulttype, localidx*, 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 @@ -18894,7 +18941,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 : uN(32) <: nat)] = 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 @@ -18905,15 +18952,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) @@ -18936,7 +18983,7 @@ relation Heaptype_ok: `%|-%:_OK`(context, heaptype) ;; 6-typing.watsup rule typeidx{C : context, x : idx, dt : deftype}: `%|-%:_OK`(C, _IDX_heaptype(x)) - -- if (C.TYPE_context[(x : uN(32) <: nat)] = dt) + -- if (C.TYPE_context[x.`%`.0] = dt) ;; 6-typing.watsup rule rec{C : context, i : nat, st : subtype}: @@ -18975,25 +19022,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 : uN(32) <: nat)] = 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) + | OK{typeidx : typeidx}(typeidx : typeidx, nat) ;; 6-typing.watsup relation Packtype_ok: `%|-%:_OK`(context, packtype) @@ -19024,16 +19071,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}: @@ -19070,7 +19117,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 @@ -19105,7 +19152,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}: @@ -19125,17 +19172,17 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:319.1-321.52 rule typeidx-l{C : context, typeidx : typeidx, heaptype : heaptype}: `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) - -- Heaptype_sub: `%|-%<:%`(C, (C.TYPE_context[(typeidx : uN(32) <: nat)] : deftype <: heaptype), heaptype) + -- Heaptype_sub: `%|-%<:%`(C, (C.TYPE_context[typeidx.`%`.0] : deftype <: heaptype), heaptype) ;; 6-typing.watsup:323.1-325.52 rule typeidx-r{C : context, heaptype : heaptype, typeidx : typeidx}: `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, (C.TYPE_context[(typeidx : uN(32) <: nat)] : deftype <: heaptype)) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, (C.TYPE_context[typeidx.`%`.0] : deftype <: 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}: @@ -19231,8 +19278,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}: @@ -19248,19 +19295,19 @@ 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 : uN(32) <: nat) < (x : uN(32) <: nat)))*{y} - -- (if ($unrolldt(C.TYPE_context[(y : uN(32) <: nat)]) = 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 ;; 6-typing.watsup def $before{deftype : deftype, x : idx, i : nat}((deftype : deftype <: heaptype), x, i) = true ;; 6-typing.watsup - def $before{typeidx : typeidx, x : idx, i : nat}(_IDX_heaptype(typeidx), x, i) = ((typeidx : uN(32) <: nat) < (x : uN(32) <: nat)) + def $before{typeidx : typeidx, x : idx, i : nat}(_IDX_heaptype(typeidx), x, i) = (typeidx.`%`.0 < x.`%`.0) ;; 6-typing.watsup def $before{j : nat, x : idx, i : nat}(REC_heaptype(j), x, i) = (j < i) @@ -19269,7 +19316,7 @@ def $unrollht(context : context, heaptype : heaptype) : subtype ;; 6-typing.watsup def $unrollht{C : context, deftype : deftype}(C, (deftype : deftype <: heaptype)) = $unrolldt(deftype) ;; 6-typing.watsup - def $unrollht{C : context, typeidx : typeidx}(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[(typeidx : uN(32) <: nat)]) + def $unrollht{C : context, typeidx : typeidx}(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx.`%`.0]) ;; 6-typing.watsup def $unrollht{C : context, i : nat}(C, REC_heaptype(i)) = C.REC_context[i] @@ -19277,12 +19324,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 { @@ -19291,13 +19338,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}), 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 : uN(32) <: nat) + 1), (i + 1))) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) } ;; 6-typing.watsup @@ -19307,18 +19354,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}), 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 : uN(32) <: nat) + 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 @@ -19327,14 +19374,14 @@ 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 relation Limits_ok: `%|-%:%`(context, limits, nat) ;; 6-typing.watsup rule _{C : context, n_1 : n, n_2 : n, k : nat}: - `%|-%:%`(C, `[%..%]`(n_1, n_2), k) + `%|-%:%`(C, `[%..%]`(`%`(n_1), `%`(n_2)), k) -- if ((n_1 <= n_2) /\ (n_2 <= k)) ;; 6-typing.watsup @@ -19383,27 +19430,27 @@ 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}, 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 : uN(32) <: nat)] = `%%`(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) ;; 6-typing.watsup rule _{C : context, n_11 : n, n_12 : n, n_21 : n, n_22 : n}: - `%|-%<:%`(C, `[%..%]`(n_11, n_12), `[%..%]`(n_21, n_22)) + `%|-%<:%`(C, `[%..%]`(`%`(n_11), `%`(n_12)), `[%..%]`(`%`(n_21), `%`(n_22))) -- if (n_11 >= n_21) -- if (n_12 <= n_22) @@ -19462,16 +19509,16 @@ 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}: `%|-%:%`(C, _IDX_blocktype(x), ft) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], FUNC_comptype(ft)) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(ft)) ;; 6-typing.watsup rec { @@ -19480,77 +19527,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}, 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}: - `%|-%:%`(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}), `%->%`(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 : uN(32) <: nat)] = 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 : uN(32) <: nat)] = 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 : uN(32) <: nat)]))*{l} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[(l' : uN(32) <: nat)]) + `%|-%:%`(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} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[(l : uN(32) <: nat)] = 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 : uN(32) <: nat)] = 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 : uN(32) <: nat)] = 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) @@ -19558,8 +19605,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 : uN(32) <: nat)] = 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) @@ -19567,523 +19614,514 @@ 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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})) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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})) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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 : uN(32) <: nat)], 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)}: - `%|-%:%`(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, o0 : nat, o1 : nat}: - `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([(nt_2 : numtype <: valtype)], [(nt_1 : numtype <: valtype)])) - -- if ($size((nt_1 : numtype <: valtype)) = ?(o0)) - -- if ($size((nt_2 : numtype <: valtype)) = ?(o1)) + 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)]))) -- if (nt_1 =/= nt_2) - -- if (o0 = o1) + -- 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?, o0 : nat, o1 : nat}: - `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) - -- if ($size((inn_1 : inn <: valtype)) = ?(o0)) - -- if ($size((inn_2 : inn <: valtype)) = ?(o1)) + 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)]))) -- if (inn_1 =/= inn_2) - -- if ((sx?{sx} = ?()) <=> (o0 > o1)) + -- 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))])) - -- if (C.FUNC_context[(x : uN(32) <: nat)] = dt) + `%|-%:%`(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}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], 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 : uN(32) <: nat)], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, (rt : reftype <: storagetype)))) - -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[(y : uN(32) <: nat)], rt) + `%|-%:%`(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))])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, (t : valtype <: storagetype)))) + `%|-%:%`(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 : uN(32) <: nat)] = OK) + -- 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}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + `%|-%:%`(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)], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), 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])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x_1 : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) - -- Expand: `%~~%`(C.TYPE_context[(x_2 : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt_2))) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- Storagetype_sub: `%|-%<:%`(C, (C.ELEM_context[(y : uN(32) <: nat)] : reftype <: storagetype), zt) + `%|-%:%`(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], [])) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + `%|-%:%`(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 : uN(32) <: nat)] = OK) + -- 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}), `%->%`([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}: - `%|-%:%`(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}, 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}, 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}: - `%|-%:%`(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])) - -- if (C.LOCAL_context[(x : uN(32) <: nat)] = `%%`(init, 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])) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = `%%`(mut, 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], [])) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = `%%`(`MUT%?`(?(())), 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)])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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)], [])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = tt) + `%|-%:%`(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])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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], [])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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], [])) - -- if (C.TABLE_context[(x_1 : uN(32) <: nat)] = `%%`(lim_1, rt_1)) - -- if (C.TABLE_context[(x_2 : uN(32) <: nat)] = `%%`(lim_2, rt_2)) + `%|-%:%`(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], [])) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt_1)) - -- if (C.ELEM_context[(y : uN(32) <: nat)] = rt_2) + `%|-%:%`(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), `%->%`([], [])) - -- if (C.ELEM_context[(x : uN(32) <: nat)] = rt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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], [])) - -- if (C.MEM_context[(x_1 : uN(32) <: nat)] = mt_1) - -- if (C.MEM_context[(x_2 : uN(32) <: nat)] = mt_2) + `%|-%:%`(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], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if (C.DATA_context[(y : uN(32) <: nat)] = OK) + `%|-%:%`(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), `%->%`([], [])) - -- if (C.DATA_context[(x : uN(32) <: nat)] = OK) + `%|-%:%`(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, o0 : nat, o1? : nat?}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) - -- if ($size((nt : numtype <: valtype)) = ?(o0)) - -- (if ($size((nt : numtype <: valtype)) = ?(o1)))?{o1} - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if ((2 ^ n_A) <= (o0 / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + 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)]))) + -- 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} + -- 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, o0 : nat, o1? : nat?}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) - -- if ($size((nt : numtype <: valtype)) = ?(o0)) - -- (if ($size((nt : numtype <: valtype)) = ?(o1)))?{o1} - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if ((2 ^ n_A) <= (o0 / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + 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)]), `%`([]))) + -- 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} + -- 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}: - `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [V128_valtype])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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 : uN(8) <: nat) < (128 / n)) + -- if (laneidx.`%`.0 < (128 / n)) - ;; 6-typing.watsup:1046.1-1049.36 - rule vstore{C : context, x : idx, n_A : n, n_O : n, mt : memtype, o0 : nat}: - `%|-%:%`(C, VSTORE_instr(x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype V128_valtype], [])) - -- if ($size(V128_valtype) = ?(o0)) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if ((2 ^ n_A) <= (o0 / 8)) + ;; 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]), `%`([]))) + -- 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], [])) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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 : uN(8) <: nat) < (128 / n)) + -- if (laneidx.`%`.0 < (128 / n)) ;; 6-typing.watsup:504.1-504.67 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}: - `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) - -- if (C.LOCAL_context[(x : uN(32) <: nat)] = `%%`(init, t)) + `%|-%:%`(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])) - -- if (C.LOCAL_context[(x : uN(32) <: nat)] = `%%`(init, 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}, `%->%*%`(t_1*{t_1}, x_1*{x_1} :: x_2*{x_2}, t_3*{t_3})) - -- (if (C.LOCAL_context[(x_1 : uN(32) <: nat)] = `%%`(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 { @@ -20093,7 +20131,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 @@ -20104,7 +20142,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 @@ -20128,7 +20166,7 @@ relation Instr_const: `%|-%CONST`(context, instr) ;; 6-typing.watsup rule global.get{C : context, x : idx, t : valtype}: `%|-%CONST`(C, GLOBAL.GET_instr(x)) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = `%%`(`MUT%?`(?()), t)) + -- if (C.GLOBAL_context[x.`%`.0] = `%%`(`MUT%?`(?()), t)) ;; 6-typing.watsup rule binop{C : context, inn : inn, binop : binop_((inn : inn <: numtype))}: @@ -20140,25 +20178,25 @@ 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) ;; 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}) - -- if (x = |C.TYPE_context|) - -- if (dt*{dt} = $rolldt(x, rectype)) - -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt}], rectype, OK_oktypeidx(x)) + `%|-%:%`(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)) ;; 6-typing.watsup relation Local_ok: `%|-%:%`(context, local, localtype) @@ -20176,10 +20214,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 : uN(32) <: nat)]) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], 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) @@ -20211,7 +20249,7 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) ;; 6-typing.watsup rule active{C : context, x : idx, expr : expr, rt : reftype, lim : limits}: `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} ;; 6-typing.watsup @@ -20226,8 +20264,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 @@ -20235,7 +20273,7 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) ;; 6-typing.watsup rule active{C : context, x : idx, expr : expr, mt : memtype}: `%|-%:_OK`(C, ACTIVE_datamode(x, expr)) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + -- if (C.MEM_context[x.`%`.0] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} ;; 6-typing.watsup @@ -20246,7 +20284,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 @@ -20254,7 +20292,7 @@ relation Start_ok: `%|-%:_OK`(context, start) ;; 6-typing.watsup rule _{C : context, x : idx}: `%|-%:_OK`(C, START(x)) - -- Expand: `%~~%`(C.FUNC_context[(x : uN(32) <: nat)], FUNC_comptype(`%->%`([], []))) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`([]), `%`([])))) ;; 6-typing.watsup relation Import_ok: `%|-%:%`(context, import, externtype) @@ -20268,22 +20306,22 @@ relation Externidx_ok: `%|-%:%`(context, externidx, externtype) ;; 6-typing.watsup rule func{C : context, x : idx, dt : deftype}: `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) - -- if (C.FUNC_context[(x : uN(32) <: nat)] = dt) + -- if (C.FUNC_context[x.`%`.0] = dt) ;; 6-typing.watsup rule global{C : context, x : idx, gt : globaltype}: `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = gt) + -- if (C.GLOBAL_context[x.`%`.0] = gt) ;; 6-typing.watsup rule table{C : context, x : idx, tt : tabletype}: `%|-%:%`(C, TABLE_externidx(x), TABLE_externtype(tt)) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = tt) + -- if (C.TABLE_context[x.`%`.0] = tt) ;; 6-typing.watsup rule mem{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup relation Export_ok: `%|-%:%`(context, export, externtype) @@ -20296,55 +20334,55 @@ 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}) + `%|-%:%`(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 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}, dt_1*{} :: dt*{dt}) - -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, 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 : 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) @@ -20354,7 +20392,7 @@ relation Ref_ok: `%|-%:%`(store, ref, reftype) ;; 7-runtime-typing.watsup rule i31{s : store, i : nat}: - `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) + `%|-%:%`(s, REF.I31_NUM_ref(`%`(i)), REF_reftype(`NULL%?`(?()), I31_heaptype)) ;; 7-runtime-typing.watsup rule struct{s : store, a : addr, dt : deftype}: @@ -20380,647 +20418,646 @@ 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}?{t})], [(val_1 : val <: admininstr)]) - -- if (c =/= 0) + `%~>%`([(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)]) - -- if (c = 0) + `%~>%`([(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})]) - -- if (c =/= 0) + `%~>%`([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})]) - -- if (c = 0) + `%~>%`([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 : uN(32) <: nat) + 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}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) - -- if (c =/= 0) + `%~>%`([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)], []) - -- if (c = 0) + `%~>%`([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}, 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}: - `%*_~>%*`([(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 <: 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)}: - `%*_~>%*`([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})], [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}: - `%*_~>%*`([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), o0 : N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VVTESTOP_admininstr(V128_vectype, ANY_TRUE_vvtestop)], [CONST_admininstr(I32_numtype, c)]) - -- if ($size(V128_valtype) = ?(o0)) - -- if (c = $ine(o0, c_1, 0)) + 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)]) + -- if (c = $ine($vsize(V128_vectype), c_1, `%`(0))) ;; 8-reduction.watsup - rule vswizzle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), pnn : pnn, N : N, c' : vec_(V128_vnn), c : iN($lsize((pnn : pnn <: lanetype))), ci* : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), N)))*, k^N : nat^N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((pnn : pnn <: imm), N))], [VCONST_admininstr(V128_vectype, c')]) - -- if (ci*{ci} = $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_2)) - -- if (c*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_1) :: 0^(256 - N){}) - -- if (c' = $invlanes_(`%X%`((pnn : pnn <: lanetype), N), c*{}[(ci*{ci}[k] : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), N))) <: nat)]^(k%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((pnn : pnn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) + -- if (ci*{ci : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), `%`(N))))} = $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_2)) + -- if (c*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_1) :: `%`(0)^(256 - N){}) + -- if (c' = $invlanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c*{}[ci*{ci : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), `%`(N))))}[k].`%`.0]^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((pnn : pnn <: imm), N), i*{i})], [VCONST_admininstr(V128_vectype, c)]) - -- if (c'*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_1) :: $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_2)) - -- if (c = $invlanes_(`%X%`((pnn : pnn <: lanetype), N), c'*{}[i*{i}[k]]^(k%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((pnn : pnn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) + -- if (c'*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_1) :: $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_2)) + -- if (c = $invlanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c'*{}[i*{i : nat}[k]]^(k%*`([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{})) + `%~>%`([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)]) - -- if (c_2 = $lanes_(`%X%`((nt : numtype <: lanetype), N), c_1)[i]) + `%~>%`([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)]) - -- if (c_2 = $ext($psize(pt), 32, sx, $lanes_(`%X%`((pt : packtype <: lanetype), N), c_1)[i])) + `%~>%`([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)]) - -- if (c = $invlanes_(`%X%`(lnn, N), $lanes_(`%X%`(lnn, N), c_1)[[i] = $packnum(lnn, c_2)])) + `%~>%`([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)]) - -- 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'})) + 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' : 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), imm : imm, N : N, ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), N)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), N), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), N)))], [CONST_admininstr(I32_numtype, 1)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((imm : imm <: lanetype), N), c)) - -- (if (ci_1 =/= (0 : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), N))))))*{ci_1} + rule vtestop-true{c : vec_(V128_vnn), imm : imm, N : N, ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c)) + -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), imm : imm, N : N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), N), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), N)))], [CONST_admininstr(I32_numtype, 0)]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup - rule vbitmask{c : vec_(V128_vnn), imm : imm, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), N)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`(imm, N))], [CONST_admininstr(I32_numtype, ci)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((imm : imm <: lanetype), N), c)) - -- if ($ibits(32, ci) = $ilt($lsize((imm : imm <: lanetype)), S_sx, ci_1, 0)*{ci_1}) + rule vbitmask{c : vec_(V128_vnn), imm : imm, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`(imm, `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c)) + -- if ($ibits(32, ci) = `%`($ilt($lsize((imm : imm <: lanetype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($lsize((imm : imm <: lanetype)))}) ;; 8-reduction.watsup - rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*, ci_2* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*, cj_1* : iN($lsize((imm_2 : imm <: lanetype)))*, cj_2* : iN($lsize((imm_2 : imm <: lanetype)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`(imm_1, N_1), `%X%`(imm_2, N_2), sx)], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_1)) - -- if (ci_2*{ci_2} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_2)) - -- if (cj_1*{cj_1} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_1)*{ci_1}) - -- if (cj_2*{cj_2} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_2)*{ci_2}) - -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), N_2), cj_1*{cj_1} :: cj_2*{cj_2})) + rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*, cj_1* : iN($lsize((imm_2 : imm <: lanetype)))*, cj_2* : iN($lsize((imm_2 : imm <: lanetype)))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_1)) + -- if (ci_2*{ci_2 : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_2)) + -- if (cj_1*{cj_1 : iN($lsize((imm_2 : imm <: lanetype)))} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_1)*{ci_1 : iN($lsize((imm_1 : imm <: lanetype)))}) + -- if (cj_2*{cj_2 : iN($lsize((imm_2 : imm <: lanetype)))} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_2)*{ci_2 : iN($lsize((imm_1 : imm <: lanetype)))}) + -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), cj_1*{cj_1 : lane_($lanetype(`%X%`((imm_2 : imm <: lanetype), `%`(N_2))))} :: cj_2*{cj_2 : lane_($lanetype(`%X%`((imm_2 : imm <: 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'})) + 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' : 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), imm_2 : imm, N_2 : N, vcvtop : vcvtop, hf : half, imm_1 : imm, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((imm_2 : imm <: lanetype), N_2), vcvtop, ?(hf), `%X%`((imm_1 : imm <: lanetype), N_1), sx?{sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci*{ci} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_1)[$halfop(hf, 0, N_2) : N_2]) - -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), N_2), $vcvtop(`%X%`((imm_1 : imm <: lanetype), N_1), `%X%`((imm_2 : imm <: lanetype), N_2), vcvtop, sx?{sx}, ci)*{ci})) + rule vcvtop-half{c_1 : vec_(V128_vnn), imm_2 : imm, N_2 : N, vcvtop : vcvtop, hf : half, imm_1 : imm, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((imm_1 : imm <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci*{ci : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) + -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), $vcvtop(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), `%X%`((imm_2 : imm <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((imm_1 : imm <: 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 : nat <: lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), N_2))))^N_1{})) + 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)]) + -- 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} :: [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}: - `%~>%*`(`%;%*`(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 : uN(32) <: nat)]) 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})]), [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}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[(x : uN(32) <: nat)]) 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'}, (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}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[(x : uN(32) <: nat)])]) + `%~>%`(`%;%`(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} :: [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}: - `%~>%*`(`%;%*`(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} :: [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}: - `%~>%*`(`%;%*`(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} :: [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))) ;; 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}, 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}: - `%~>%*`(`%;%*`(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))) @@ -21029,7 +21066,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))) @@ -21038,369 +21075,356 @@ 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, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) - -- if ($size((nt : numtype <: valtype)) = ?(o0)) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + 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]) + -- 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), o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) - -- if ($size((nt : numtype <: valtype)) = ?(o0)) - -- if ($nbytes(nt, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (o0 / 8)]) + 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)]) + -- 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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (n / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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), o0 : N}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [CONST_admininstr((inn : inn <: numtype), $ext(n, o0, sx, c))]) - -- if ($size((inn : inn <: valtype)) = ?(o0)) - -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (n / 8)]) + 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))]) + -- 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, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VLOAD_admininstr(?(), x, mo)]), [TRAP_admininstr]) - -- if ($size(V128_valtype) = ?(o0)) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + rule vload-oob{z : state, i : nat, x : idx, mo : memop}: + `%~>%`(`%;%`(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), o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VLOAD_admininstr(?(), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) - -- if ($size(V128_valtype) = ?(o0)) - -- if ($vbytes(V128_vectype, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (o0 / 8)]) + 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)]) + -- 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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + ((M * N) / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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, o0 : nat, o1^N : N^N}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) - -- if ($size((inn : inn <: valtype)) = ?(o0)) - -- (if ($size((inn : inn <: valtype)) = ?(o1)))^N{o1} - -- (if ($ibytes(M, j) = $mem(z, x).DATA_meminst[((i + (mo.OFFSET_memop : uN(32) <: nat)) + ((k * M) / 8)) : (M / 8)]))^(k%`(`%;%`(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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- if ($ibytes(N, j) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)]) + `%~>%`(`%;%`(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)) - -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), M), (j : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), M))))^M{})) + -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(M)), `%`(j)^M{})) ;; 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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- if ($ibytes(N, j) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)]) - -- if (c = $ext(N, 128, U_sx, j)) + `%~>%`(`%;%`(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, c_1 : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, j)]), [TRAP_admininstr]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, 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, c_1 : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, c : vec_(V128_vnn), k : nat, imm : imm, M : M, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, j)]), [VCONST_admininstr(V128_vectype, c)]) - -- if ($size(V128_valtype) = ?(o0)) - -- if ($ibytes(N, k) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)]) + rule vload_lane-val{z : state, i : nat, c_1 : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, c : vec_(V128_vnn), k : nat, imm : imm, M : M}: + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(V128_vectype, 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 = (o0 / N)) - -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), M), $lanes_(`%X%`((imm : imm <: lanetype), M), c_1)[[j] = (k : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), M))))])) + -- if (M = ($vsize(V128_vectype) / N)) + -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(M)), $lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c_1)[[j] = `%`(k)])) ;; 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]) 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}), `%;%*`(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}: - `%~>%`(`%;%*`(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 zt})) - -- if (fv = $packval(zt*{zt}[i], val)) + `%~>%`(`%;%`(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} :: [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}: - `%~>%`(`%;%*`(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, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if ($size((nt : numtype <: valtype)) = ?(o0)) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + 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])) + -- 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*, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + (mo.OFFSET_memop : uN(32) <: nat)), (o0 / 8), b*{b}), [])) - -- if ($size((nt : numtype <: valtype)) = ?(o0)) - -- if (b*{b} = $nbytes(nt, c)) + 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}), [])) + -- 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])) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (n / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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*, o0 : M}: - `%~>%`(`%;%*`(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 : uN(32) <: nat)), (n / 8), b*{b}), [])) - -- if ($size((inn : inn <: valtype)) = ?(o0)) - -- if (b*{b} = $ibytes(n, $wrap(o0, n, c))) + 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}), [])) + -- 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, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if ($size(V128_valtype) = ?(o0)) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + 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])) + -- 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*, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + (mo.OFFSET_memop : uN(32) <: nat)), (o0 / 8), b*{b}), [])) - -- if ($size(V128_valtype) = ?(o0)) - -- if (b*{b} = $vbytes(V128_vectype, c)) + 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}), [])) + -- 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])) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + N) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 : uN(32) <: nat)), (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])) + -- 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 { @@ -21409,21 +21433,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*) +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 { @@ -21433,19 +21457,19 @@ 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 (fi = {TYPE mm.TYPE_moduleinst[(x : uN(32) <: nat)], MODULE mm, CODE func}) + -- if (func = FUNC(x, local*{local : local}, expr)) + -- if (fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func}) ;; 9-module.watsup rec { @@ -21455,9 +21479,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 @@ -21474,16 +21498,16 @@ 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 def $alloctable(store : store, tabletype : tabletype, ref : ref) : (store, tableaddr) ;; 9-module.watsup - def $alloctable{s : store, i : nat, j : nat, rt : reftype, ref : ref, ti : tableinst}(s, `%%`(`[%..%]`(i, j), rt), ref) = (s[TABLE_store =.. [ti]], |s.TABLE_store|) - -- if (ti = {TYPE `%%`(`[%..%]`(i, j), rt), ELEM ref^i{}}) + def $alloctable{s : store, i : nat, j : nat, rt : reftype, ref : ref, ti : tableinst}(s, `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ref) = (s[TABLE_store =.. [ti]], |s.TABLE_store|) + -- if (ti = {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM ref^i{}}) ;; 9-module.watsup rec { @@ -21493,16 +21517,16 @@ 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 def $allocmem(store : store, memtype : memtype) : (store, memaddr) ;; 9-module.watsup - def $allocmem{s : store, i : nat, j : nat, mi : meminst}(s, `%I8`(`[%..%]`(i, j))) = (s[MEM_store =.. [mi]], |s.MEM_store|) - -- if (mi = {TYPE `%I8`(`[%..%]`(i, j)), DATA 0^((i * 64) * $Ki){}}) + def $allocmem{s : store, i : nat, j : nat, mi : meminst}(s, `%I8`(`[%..%]`(`%`(i), `%`(j)))) = (s[MEM_store =.. [mi]], |s.MEM_store|) + -- if (mi = {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA `%`(0)^((i * 64) * $Ki){}}) ;; 9-module.watsup rec { @@ -21512,16 +21536,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 { @@ -21531,16 +21555,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 { @@ -21550,113 +21574,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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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}))) - -;; 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 : byte <: nat))) - ;; 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 : byte <: nat) - 192)) + ((b_2 : byte <: nat) - 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 : byte <: nat) - 224)) + ((2 ^ 6) * ((b_2 : byte <: nat) - 128))) + ((b_3 : byte <: nat) - 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 : byte <: nat) - 240)) + ((2 ^ 12) * ((b_2 : byte <: nat) - 128))) + ((2 ^ 6) * ((b_3 : byte <: nat) - 128))) + ((b_4 : byte <: nat) - 128)))) - ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(ch*{ch}) = $concat_(syntax byte, $utf8([ch])*{ch}) -} + -- 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) @@ -21675,14 +21678,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 = `...` @@ -21690,21 +21693,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) +syntax recordeq = `%++%=%`{recordstar : recordstar}(recordstar : recordstar, recordstar, recordstar) ;; C-conventions.watsup syntax pth = @@ -21760,7 +21763,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 @@ -21771,29 +21774,28 @@ 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 -syntax list{syntax X}(syntax X) = X* - -;; 1-syntax.watsup -syntax char = nat - -;; 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 = nat +syntax bit = `%`{i : nat}(i : nat) + -- if ((i = 0) \/ (i = 1)) ;; 1-syntax.watsup -syntax byte = nat +syntax byte = `%`{i : nat}(i : nat) + -- if ((i >= 0) /\ (i <= 255)) ;; 1-syntax.watsup -syntax uN{N : N}(N) = nat +syntax uN{N : N}(N) = `%`{i : nat}(i : nat) + -- if ((i >= 0) /\ (i <= ((2 ^ N) - 1))) ;; 1-syntax.watsup -syntax sN{N : N}(N) = int +syntax sN{N : N}(N) = `%`{i : int}(i : int) + -- if ((((i >= - ((2 ^ (N - 1)) : nat <: int)) /\ (i <= - (1 : nat <: int))) \/ (i = (0 : nat <: int))) \/ ((i >= + (1 : nat <: int)) /\ (i <= (((2 ^ (N - 1)) - 1) : nat <: int)))) ;; 1-syntax.watsup syntax iN{N : N}(N) = uN(N) @@ -21855,8 +21857,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) @@ -21882,6 +21884,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 @@ -21952,20 +21983,20 @@ 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 | 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 +;; 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 @@ -21973,40 +22004,40 @@ 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, storagetype) +;; 1-syntax.watsup:176.1-177.18 +syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) -;; 1-syntax.watsup:178.1-178.70 -syntax functype = `%->%`(resulttype, resulttype) +;; 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) - | 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 +;; 1-syntax.watsup:190.1-191.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 +;; 1-syntax.watsup:193.1-194.22 syntax rectype = - | REC(list : list(syntax subtype)) + | 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) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY | EQ | I31 @@ -22018,13 +22049,13 @@ syntax heaptype = | EXTERN | NOEXTERN | BOT - | DEF(rectype : rectype, 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 = @@ -22077,19 +22108,19 @@ syntax imm = ;; 1-syntax.watsup syntax deftype = - | DEF(rectype : rectype, nat) + | DEF{rectype : rectype}(rectype : rectype, nat) ;; 1-syntax.watsup -syntax limits = `[%..%]`(u32, u32) +syntax limits = `[%..%]`{u32 : u32}(u32 : u32, u32) ;; 1-syntax.watsup -syntax globaltype = `%%`(mut, valtype) +syntax globaltype = `%%`{mut : mut, valtype : valtype}(mut : mut, valtype : valtype) ;; 1-syntax.watsup -syntax tabletype = `%%`(limits, reftype) +syntax tabletype = `%%`{limits : limits, reftype : reftype}(limits : limits, reftype : reftype) ;; 1-syntax.watsup -syntax memtype = `%I8`(limits) +syntax memtype = `%I8`{limits : limits}(limits : limits) ;; 1-syntax.watsup syntax elemtype = reftype @@ -22099,24 +22130,26 @@ 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(valtype : valtype) : nat? +def $size(numtype : numtype) : nat ;; 2-syntax-aux.watsup - def $size(I32_valtype) = ?(32) + def $size(I32_numtype) = 32 ;; 2-syntax-aux.watsup - def $size(I64_valtype) = ?(64) + def $size(I64_numtype) = 64 ;; 2-syntax-aux.watsup - def $size(F32_valtype) = ?(32) + def $size(F32_numtype) = 32 ;; 2-syntax-aux.watsup - def $size(F64_valtype) = ?(64) + def $size(F64_numtype) = 64 + +;; 1-syntax.watsup +def $vsize(vectype : vectype) : nat ;; 2-syntax-aux.watsup - def $size(V128_valtype) = ?(128) - def $size{x0 : valtype}(x0) = ?() + def $vsize(V128_vectype) = 128 ;; 1-syntax.watsup def $psize(packtype : packtype) : nat @@ -22128,41 +22161,44 @@ def $psize(packtype : packtype) : nat ;; 1-syntax.watsup def $lsize(lanetype : lanetype) : nat ;; 2-syntax-aux.watsup - def $lsize{numtype : numtype}((numtype : numtype <: lanetype)) = !($size((numtype : numtype <: valtype))) + def $lsize{numtype : numtype}((numtype : numtype <: lanetype)) = $size(numtype) ;; 2-syntax-aux.watsup def $lsize{packtype : packtype}((packtype : packtype <: lanetype)) = $psize(packtype) ;; 1-syntax.watsup def $zsize(storagetype : storagetype) : nat ;; 2-syntax-aux.watsup - def $zsize{valtype : valtype}((valtype : valtype <: storagetype)) = !($size(valtype)) + def $zsize{numtype : numtype}((numtype : numtype <: storagetype)) = $size(numtype) + ;; 2-syntax-aux.watsup + def $zsize{vectype : vectype}((vectype : vectype <: storagetype)) = $vsize(vectype) ;; 2-syntax-aux.watsup def $zsize{packtype : packtype}((packtype : packtype <: storagetype)) = $psize(packtype) ;; 1-syntax.watsup -syntax dim = nat +syntax dim = `%`{i : nat}(i : nat) + -- if (((((i = 1) \/ (i = 2)) \/ (i = 4)) \/ (i = 8)) \/ (i = 16)) ;; 1-syntax.watsup -syntax shape = `%X%`(lanetype, dim) +syntax shape = `%X%`{lanetype : lanetype, dim : dim}(lanetype : lanetype, dim : dim) ;; 1-syntax.watsup def $lanetype(shape : shape) : lanetype ;; 2-syntax-aux.watsup - def $lanetype{lnn : lnn, N : N}(`%X%`(lnn, N)) = lnn + def $lanetype{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = lnn ;; 1-syntax.watsup -def $sizenn(valtype : valtype) : nat +def $sizenn(numtype : numtype) : nat ;; 1-syntax.watsup - def $sizenn{t : valtype}(t) = !($size(t)) + def $sizenn{nt : numtype}(nt) = $size(nt) ;; 1-syntax.watsup syntax num_(numtype : numtype) ;; 1-syntax.watsup - syntax num_{inn : inn}((inn : inn <: numtype)) = iN($sizenn((inn : inn <: valtype))) + syntax num_{inn : inn}((inn : inn <: numtype)) = iN($sizenn((inn : inn <: numtype))) ;; 1-syntax.watsup - syntax num_{fnn : fnn}((fnn : fnn <: numtype)) = fN($sizenn((fnn : fnn <: valtype))) + syntax num_{fnn : fnn}((fnn : fnn <: numtype)) = fN($sizenn((fnn : fnn <: numtype))) ;; 1-syntax.watsup @@ -22183,7 +22219,7 @@ syntax lane_(lanetype : lanetype) ;; 1-syntax.watsup -syntax vec_{vnn : vnn}(vnn) = vN(!($size((vnn : vnn <: valtype)))) +syntax vec_{vnn : vnn}(vnn) = vN($vsize(vnn)) ;; 1-syntax.watsup syntax zval_(storagetype : storagetype) @@ -22211,7 +22247,7 @@ syntax unop_(numtype : numtype) | CLZ | CTZ | POPCNT - | EXTEND(n : n) + | EXTEND{n : n}(n : n) ;; 1-syntax.watsup @@ -22232,13 +22268,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 @@ -22264,10 +22300,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 @@ -22287,23 +22323,23 @@ syntax cvtop = | REINTERPRET ;; 1-syntax.watsup -syntax ishape = `%X%`(imm, dim) +syntax ishape = `%X%`{imm : imm, dim : dim}(imm : imm, dim : dim) ;; 1-syntax.watsup -syntax fshape = `%X%`(fnn, dim) +syntax fshape = `%X%`{fnn : fnn, dim : dim}(fnn : fnn, dim : dim) ;; 1-syntax.watsup -syntax pshape = `%X%`(pnn, dim) +syntax pshape = `%X%`{pnn : pnn, dim : dim}(pnn : pnn, dim : dim) ;; 1-syntax.watsup def $dim(shape : shape) : dim ;; 2-syntax-aux.watsup - def $dim{lnn : lnn, N : N}(`%X%`(lnn, N)) = N + def $dim{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = `%`(N) ;; 1-syntax.watsup def $shsize(shape : shape) : nat ;; 2-syntax-aux.watsup - def $shsize{lnn : lnn, N : N}(`%X%`(lnn, N)) = ($lsize(lnn) * N) + def $shsize{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = ($lsize(lnn) * N) ;; 1-syntax.watsup syntax vvunop = @@ -22327,7 +22363,7 @@ syntax vvtestop = ;; 1-syntax.watsup syntax vunop_(shape : shape) ;; 1-syntax.watsup - syntax vunop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + syntax vunop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ABS | NEG | POPCNT{imm : imm} @@ -22335,7 +22371,7 @@ syntax vunop_(shape : shape) ;; 1-syntax.watsup - syntax vunop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vunop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | ABS | NEG | SQRT @@ -22348,12 +22384,12 @@ syntax vunop_(shape : shape) ;; 1-syntax.watsup syntax vbinop_(shape : shape) ;; 1-syntax.watsup - syntax vbinop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + 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) @@ -22361,14 +22397,14 @@ 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) ;; 1-syntax.watsup - syntax vbinop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vbinop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | ADD | SUB | MUL @@ -22380,23 +22416,23 @@ syntax vbinop_(shape : shape) ;; 1-syntax.watsup -syntax vtestop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = +syntax vtestop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ALL_TRUE ;; 1-syntax.watsup syntax vrelop_(shape : shape) ;; 1-syntax.watsup - syntax vrelop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + 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 - syntax vrelop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vrelop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | EQ | NE | LT @@ -22414,12 +22450,12 @@ syntax vcvtop = | PROMOTE ;; 1-syntax.watsup -syntax vshiftop_{imm : imm, N : N}(`%X%`(imm, N)) = +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)) = +syntax vextunop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = | EXTADD_PAIRWISE -- if ((16 <= $lsize((imm_1 : imm <: lanetype))) /\ ($lsize((imm_1 : imm <: lanetype)) <= 32)) @@ -22429,28 +22465,28 @@ syntax half = | HIGH ;; 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) +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}(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, sx : sx) + | 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%?`(()?) @@ -22458,113 +22494,113 @@ syntax zero = `ZERO%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:521.1-533.78 +;; 1-syntax.watsup:523.1-535.78 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)) : dim <: nat))) - | 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) + -- if (ishape = `%X%`(I8_imm, `%`(16))) + | 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) - | 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 @@ -22572,57 +22608,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) +syntax type = TYPE{rectype : rectype}(rectype : rectype) ;; 1-syntax.watsup -syntax local = LOCAL(valtype) +syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`(typeidx, local*, 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, expr) +syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) ;; 1-syntax.watsup -syntax table = TABLE(tabletype, expr) +syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, expr : expr) ;; 1-syntax.watsup -syntax mem = MEMORY(memtype) +syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`(reftype, expr*, 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) +syntax data = DATA{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup -syntax start = START(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, externidx) +syntax export = EXPORT{name : name, externidx : externidx}(name : name, externidx : externidx) ;; 1-syntax.watsup -syntax import = IMPORT(name, name, 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 { @@ -22632,10 +22668,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 } @@ -22645,9 +22681,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 @@ -22667,18 +22703,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 { @@ -22688,7 +22724,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 @@ -22735,7 +22771,7 @@ def $diffrt(reftype : reftype, reftype : reftype) : reftype ;; 2-syntax-aux.watsup syntax typevar = - | _IDX(typeidx : typeidx) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | REC(nat) ;; 2-syntax-aux.watsup @@ -22746,181 +22782,181 @@ def $idx(typeidx : typeidx) : typevar ;; 2-syntax-aux.watsup rec { -;; 2-syntax-aux.watsup:122.1-122.92 +;; 2-syntax-aux.watsup:125.1-125.92 def $subst_typevar(typevar : typevar, typevar*, heaptype*) : heaptype - ;; 2-syntax-aux.watsup:147.1-147.38 + ;; 2-syntax-aux.watsup:150.1-150.38 def $subst_typevar{xx : typevar}(xx, [], []) = (xx : typevar <: heaptype) - ;; 2-syntax-aux.watsup:148.1-148.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 + ;; 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' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = ht_1 -- if (xx = xx_1) - ;; 2-syntax-aux.watsup:149.1-149.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'}) + ;; 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' : 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 { -;; 2-syntax-aux.watsup:126.1-126.92 +;; 2-syntax-aux.watsup:129.1-129.92 def $subst_heaptype(heaptype : heaptype, typevar*, heaptype*) : heaptype - ;; 2-syntax-aux.watsup:154.1-154.67 - def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) - ;; 2-syntax-aux.watsup:155.1-155.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) - ;; 2-syntax-aux.watsup:156.1-156.55 - def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx}, ht*{ht}) = ht' + ;; 2-syntax-aux.watsup:157.1-157.67 + 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 : 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 : typevar}, ht*{ht : heaptype}) = ht' -- otherwise -;; 2-syntax-aux.watsup:127.1-127.92 +;; 2-syntax-aux.watsup:130.1-130.92 def $subst_reftype(reftype : reftype, typevar*, heaptype*) : reftype - ;; 2-syntax-aux.watsup:158.1-158.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})) + ;; 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 : typevar}, ht*{ht : heaptype}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})) -;; 2-syntax-aux.watsup:128.1-128.92 +;; 2-syntax-aux.watsup:131.1-131.92 def $subst_valtype(valtype : valtype, typevar*, heaptype*) : valtype - ;; 2-syntax-aux.watsup:160.1-160.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) - ;; 2-syntax-aux.watsup:161.1-161.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) - ;; 2-syntax-aux.watsup:162.1-162.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) - ;; 2-syntax-aux.watsup:163.1-163.40 - def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + ;; 2-syntax-aux.watsup:163.1-163.64 + 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 : 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 : 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 : typevar}, ht*{ht : heaptype}) = BOT_valtype -;; 2-syntax-aux.watsup:131.1-131.92 +;; 2-syntax-aux.watsup:134.1-134.92 def $subst_storagetype(storagetype : storagetype, typevar*, heaptype*) : storagetype - ;; 2-syntax-aux.watsup:167.1-167.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) - ;; 2-syntax-aux.watsup:168.1-168.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) + ;; 2-syntax-aux.watsup:170.1-170.66 + 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 : typevar}, ht*{ht : heaptype}) = ($subst_packtype(pt, xx*{xx : typevar}, ht*{ht : heaptype}) : packtype <: storagetype) -;; 2-syntax-aux.watsup:132.1-132.92 +;; 2-syntax-aux.watsup:135.1-135.92 def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype - ;; 2-syntax-aux.watsup:170.1-170.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})) + ;; 2-syntax-aux.watsup:173.1-173.80 + 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:134.1-134.92 +;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype - ;; 2-syntax-aux.watsup:172.1-172.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}) - ;; 2-syntax-aux.watsup:173.1-173.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})) - ;; 2-syntax-aux.watsup:174.1-174.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})) - -;; 2-syntax-aux.watsup:135.1-135.92 + ;; 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})) + ;; 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 + 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:176.1-177.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})) - ;; 2-syntax-aux.watsup:178.1-179.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})) + ;; 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 : 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' : 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:136.1-136.92 +;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype - ;; 2-syntax-aux.watsup:181.1-181.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}) + ;; 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})) -;; 2-syntax-aux.watsup:137.1-137.92 +;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype - ;; 2-syntax-aux.watsup:183.1-183.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) + ;; 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 : typevar}, ht*{ht : heaptype}) = DEF_deftype($subst_rectype(qt, xx*{xx : typevar}, ht*{ht : heaptype}), i) -;; 2-syntax-aux.watsup:140.1-140.92 +;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype - ;; 2-syntax-aux.watsup:186.1-186.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}) + ;; 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})) } ;; 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, x^n : idx^n}(rt, ht^n{ht}) = $subst_reftype(rt, $idx(x)^(x (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) + -- if (ishape = `%X%`(I8_imm, `%`(16))) + | 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) - | 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, admininstr*) +syntax config = `%;%`{state : state, admininstr* : admininstr*}(state : state, admininstr*{admininstr : admininstr} : admininstr*) ;; 4-runtime.watsup rec { @@ -24027,28 +24063,28 @@ 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? ;; 5-runtime-aux.watsup - def $default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) + def $default(I32_valtype) = ?(CONST_val(I32_numtype, `%`(0))) ;; 5-runtime-aux.watsup - def $default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) + def $default(I64_valtype) = ?(CONST_val(I64_numtype, `%`(0))) ;; 5-runtime-aux.watsup def $default(F32_valtype) = ?(CONST_val(F32_numtype, $fzero(32))) ;; 5-runtime-aux.watsup def $default(F64_valtype) = ?(CONST_val(F64_numtype, $fzero(64))) ;; 5-runtime-aux.watsup - def $default(V128_valtype) = ?(VCONST_val(V128_vectype, 0)) + def $default(V128_valtype) = ?(VCONST_val(V128_vectype, `%`(0))) ;; 5-runtime-aux.watsup def $default{ht : heaptype}(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) ;; 5-runtime-aux.watsup @@ -24059,14 +24095,14 @@ def $packval(storagetype : storagetype, val : val) : fieldval ;; 5-runtime-aux.watsup def $packval{t : valtype, val : val}((t : valtype <: storagetype), val) = (val : val <: fieldval) ;; 5-runtime-aux.watsup - def $packval{pt : packtype, i : nat}((pt : packtype <: storagetype), CONST_val(I32_numtype, i)) = PACK_fieldval(pt, $wrap(32, $psize(pt), i)) + def $packval{pt : packtype, i : nat}((pt : packtype <: storagetype), CONST_val(I32_numtype, `%`(i))) = PACK_fieldval(pt, $wrap(32, $psize(pt), `%`(i))) ;; 5-runtime-aux.watsup def $unpackval(storagetype : storagetype, sx?, fieldval : fieldval) : val ;; 5-runtime-aux.watsup def $unpackval{t : valtype, val : val}((t : valtype <: storagetype), ?(), (val : val <: fieldval)) = val ;; 5-runtime-aux.watsup - def $unpackval{pt : packtype, sx : sx, i : nat}((pt : packtype <: storagetype), ?(sx), PACK_fieldval(pt, i)) = CONST_val(I32_numtype, $ext($psize(pt), 32, sx, i)) + def $unpackval{pt : packtype, sx : sx, i : nat}((pt : packtype <: storagetype), ?(sx), PACK_fieldval(pt, `%`(i))) = CONST_val(I32_numtype, $ext($psize(pt), 32, sx, `%`(i))) ;; 5-runtime-aux.watsup rec { @@ -24076,9 +24112,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 } @@ -24090,9 +24126,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 } @@ -24104,9 +24140,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 } @@ -24118,9 +24154,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 } @@ -24187,82 +24223,82 @@ def $moduleinst(state : state) : moduleinst ;; 5-runtime-aux.watsup def $type(state : state, typeidx : typeidx) : deftype ;; 5-runtime-aux.watsup - def $type{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.MODULE_frame.TYPE_moduleinst[(x : uN(32) <: nat)] + def $type{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.MODULE_frame.TYPE_moduleinst[x.`%`.0] ;; 5-runtime-aux.watsup def $func(state : state, funcidx : funcidx) : funcinst ;; 5-runtime-aux.watsup - def $func{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[(x : uN(32) <: nat)]] + def $func{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $global(state : state, globalidx : globalidx) : globalinst ;; 5-runtime-aux.watsup - def $global{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[(x : uN(32) <: nat)]] + def $global{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $table(state : state, tableidx : tableidx) : tableinst ;; 5-runtime-aux.watsup - def $table{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]] + def $table{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $mem(state : state, memidx : memidx) : meminst ;; 5-runtime-aux.watsup - def $mem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[(x : uN(32) <: nat)]] + def $mem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $elem(state : state, tableidx : tableidx) : eleminst ;; 5-runtime-aux.watsup - def $elem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[(x : uN(32) <: nat)]] + def $elem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $data(state : state, dataidx : dataidx) : datainst ;; 5-runtime-aux.watsup - def $data{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[(x : uN(32) <: nat)]] + def $data{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $local(state : state, localidx : localidx) : val? ;; 5-runtime-aux.watsup - def $local{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.LOCAL_frame[(x : uN(32) <: nat)] + def $local{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.LOCAL_frame[x.`%`.0] ;; 5-runtime-aux.watsup def $with_local(state : state, localidx : localidx, val : val) : state ;; 5-runtime-aux.watsup - def $with_local{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[(x : uN(32) <: nat)] = ?(v)]) + def $with_local{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[x.`%`.0] = ?(v)]) ;; 5-runtime-aux.watsup def $with_global(state : state, globalidx : globalidx, val : val) : state ;; 5-runtime-aux.watsup - def $with_global{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[(x : uN(32) <: nat)]].VALUE_globalinst = v], f) + def $with_global{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x.`%`.0]].VALUE_globalinst = v], f) ;; 5-runtime-aux.watsup def $with_table(state : state, tableidx : tableidx, nat : nat, ref : ref) : state ;; 5-runtime-aux.watsup - def $with_table{s : store, f : frame, x : idx, i : nat, r : ref}(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]].ELEM_tableinst[i] = r], f) + def $with_table{s : store, f : frame, x : idx, i : nat, r : ref}(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]].ELEM_tableinst[i] = r], f) ;; 5-runtime-aux.watsup def $with_tableinst(state : state, tableidx : tableidx, tableinst : tableinst) : state ;; 5-runtime-aux.watsup - def $with_tableinst{s : store, f : frame, x : idx, ti : tableinst}(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]] = ti], f) + def $with_tableinst{s : store, f : frame, x : idx, ti : tableinst}(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]] = ti], f) ;; 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 : uN(32) <: nat)]].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 ;; 5-runtime-aux.watsup - def $with_meminst{s : store, f : frame, x : idx, mi : meminst}(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[(x : uN(32) <: nat)]] = mi], f) + def $with_meminst{s : store, f : frame, x : idx, mi : meminst}(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]] = mi], f) ;; 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 : uN(32) <: nat)]].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 : uN(32) <: nat)]].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 @@ -24277,20 +24313,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) = ?() @@ -24298,9 +24334,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) = ?() @@ -24310,25 +24346,25 @@ syntax init = | UNSET ;; 6-typing.watsup -syntax localtype = `%%`(init, valtype) +syntax localtype = `%%`{init : init, valtype : valtype}(init : init, valtype : valtype) ;; 6-typing.watsup -syntax instrtype = `%->%*%`(resulttype, localidx*, 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 @@ -24339,7 +24375,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 : uN(32) <: nat)] = 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 @@ -24350,15 +24386,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) @@ -24381,8 +24417,8 @@ relation Heaptype_ok: `%|-%:_OK`(context, heaptype) ;; 6-typing.watsup rule typeidx{C : context, x : idx, dt : deftype}: `%|-%:_OK`(C, _IDX_heaptype(x)) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- if (C.TYPE_context[(x : uN(32) <: nat)] = dt) + -- if (x.`%`.0 < |C.TYPE_context|) + -- if (C.TYPE_context[x.`%`.0] = dt) ;; 6-typing.watsup rule rec{C : context, i : nat, st : subtype}: @@ -24422,27 +24458,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 : uN(32) <: nat) < |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 : uN(32) <: nat)] = 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) + | OK{typeidx : typeidx}(typeidx : typeidx, nat) ;; 6-typing.watsup relation Packtype_ok: `%|-%:_OK`(context, packtype) @@ -24473,16 +24509,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}: @@ -24519,7 +24555,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 @@ -24554,7 +24590,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}: @@ -24574,20 +24610,20 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:319.1-321.52 rule typeidx-l{C : context, typeidx : typeidx, heaptype : heaptype}: `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) - -- if ((typeidx : uN(32) <: nat) < |C.TYPE_context|) - -- Heaptype_sub: `%|-%<:%`(C, (C.TYPE_context[(typeidx : uN(32) <: nat)] : deftype <: heaptype), heaptype) + -- if (typeidx.`%`.0 < |C.TYPE_context|) + -- Heaptype_sub: `%|-%<:%`(C, (C.TYPE_context[typeidx.`%`.0] : deftype <: heaptype), heaptype) ;; 6-typing.watsup:323.1-325.52 rule typeidx-r{C : context, heaptype : heaptype, typeidx : typeidx}: `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) - -- if ((typeidx : uN(32) <: nat) < |C.TYPE_context|) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, (C.TYPE_context[(typeidx : uN(32) <: nat)] : deftype <: heaptype)) + -- if (typeidx.`%`.0 < |C.TYPE_context|) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, (C.TYPE_context[typeidx.`%`.0] : deftype <: 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 (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}: @@ -24683,9 +24719,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}: @@ -24701,22 +24737,22 @@ 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 : uN(32) <: nat) < |C.TYPE_context|))*{ct' y y'} - -- if (|y*{y}| <= 1) - -- (if ((y : uN(32) <: nat) < (x : uN(32) <: nat)))*{y} - -- (if ($unrolldt(C.TYPE_context[(y : uN(32) <: nat)]) = 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 ;; 6-typing.watsup def $before{deftype : deftype, x : idx, i : nat}((deftype : deftype <: heaptype), x, i) = true ;; 6-typing.watsup - def $before{typeidx : typeidx, x : idx, i : nat}(_IDX_heaptype(typeidx), x, i) = ((typeidx : uN(32) <: nat) < (x : uN(32) <: nat)) + def $before{typeidx : typeidx, x : idx, i : nat}(_IDX_heaptype(typeidx), x, i) = (typeidx.`%`.0 < x.`%`.0) ;; 6-typing.watsup def $before{j : nat, x : idx, i : nat}(REC_heaptype(j), x, i) = (j < i) @@ -24725,7 +24761,7 @@ def $unrollht(context : context, heaptype : heaptype) : subtype ;; 6-typing.watsup def $unrollht{C : context, deftype : deftype}(C, (deftype : deftype <: heaptype)) = $unrolldt(deftype) ;; 6-typing.watsup - def $unrollht{C : context, typeidx : typeidx}(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[(typeidx : uN(32) <: nat)]) + def $unrollht{C : context, typeidx : typeidx}(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx.`%`.0]) ;; 6-typing.watsup def $unrollht{C : context, i : nat}(C, REC_heaptype(i)) = C.REC_context[i] @@ -24733,14 +24769,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 { @@ -24749,13 +24785,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}), 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 : uN(32) <: nat) + 1), (i + 1))) + -- Rectype_ok2: `%|-%:%`(C, REC_rectype(`%`(st*{st : subtype})), OK_oktypeidxnat(`%`((x.`%`.0 + 1)), (i + 1))) } ;; 6-typing.watsup @@ -24765,18 +24801,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}), 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 : uN(32) <: nat) + 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 @@ -24785,14 +24821,14 @@ 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 relation Limits_ok: `%|-%:%`(context, limits, nat) ;; 6-typing.watsup rule _{C : context, n_1 : n, n_2 : n, k : nat}: - `%|-%:%`(C, `[%..%]`(n_1, n_2), k) + `%|-%:%`(C, `[%..%]`(`%`(n_1), `%`(n_2)), k) -- if ((n_1 <= n_2) /\ (n_2 <= k)) ;; 6-typing.watsup @@ -24841,30 +24877,30 @@ 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}, 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 : uN(32) <: nat) < |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 : uN(32) <: nat)] = `%%`(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) ;; 6-typing.watsup rule _{C : context, n_11 : n, n_12 : n, n_21 : n, n_22 : n}: - `%|-%<:%`(C, `[%..%]`(n_11, n_12), `[%..%]`(n_21, n_22)) + `%|-%<:%`(C, `[%..%]`(`%`(n_11), `%`(n_12)), `[%..%]`(`%`(n_21), `%`(n_22))) -- if (n_11 >= n_21) -- if (n_12 <= n_22) @@ -24923,17 +24959,17 @@ 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}: `%|-%:%`(C, _IDX_blocktype(x), ft) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], FUNC_comptype(ft)) + -- if (x.`%`.0 < |C.TYPE_context|) + -- Expand: `%~~%`(C.TYPE_context[x.`%`.0], FUNC_comptype(ft)) ;; 6-typing.watsup rec { @@ -24942,84 +24978,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}, 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}: - `%|-%:%`(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}), `%->%`(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 ((l : uN(32) <: nat) < |C.LABEL_context|) - -- if (C.LABEL_context[(l : uN(32) <: nat)] = t*{t}) + `%|-%:%`(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})) ;; 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 ((l : uN(32) <: nat) < |C.LABEL_context|) - -- if (C.LABEL_context[(l : uN(32) <: nat)] = 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 : 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 : uN(32) <: nat) < |C.LABEL_context|))*{l} - -- if ((l' : uN(32) <: nat) < |C.LABEL_context|) - -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[(l : uN(32) <: nat)]))*{l} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[(l' : uN(32) <: nat)]) + `%|-%:%`(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].`%`.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} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if ((l : uN(32) <: nat) < |C.LABEL_context|) - -- if (C.LABEL_context[(l : uN(32) <: nat)] = t*{t}) + `%|-%:%`(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})) -- 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 ((l : uN(32) <: nat) < |C.LABEL_context|) - -- if (C.LABEL_context[(l : uN(32) <: nat)] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) + `%|-%:%`(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)])) -- 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 ((l : uN(32) <: nat) < |C.LABEL_context|) - -- if (C.LABEL_context[(l : uN(32) <: nat)] = 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 (l.`%`.0 < |C.LABEL_context|) + -- 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) @@ -25027,9 +25063,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)])) - -- if ((l : uN(32) <: nat) < |C.LABEL_context|) - -- if (C.LABEL_context[(l : uN(32) <: nat)] = 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 (l.`%`.0 < |C.LABEL_context|) + -- 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) @@ -25037,595 +25073,584 @@ 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})) - -- if ((x : uN(32) <: nat) < |C.FUNC_context|) - -- Expand: `%~~%`(C.FUNC_context[(x : uN(32) <: nat)], FUNC_comptype(`%->%`(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 : 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})) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], 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}))) + -- if (x.`%`.0 < |C.TYPE_context|) + -- 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})) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) - -- if ((y : uN(32) <: nat) < |C.TYPE_context|) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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 : uN(32) <: nat)], 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})) - -- if ((x : uN(32) <: nat) < |C.FUNC_context|) - -- Expand: `%~~%`(C.FUNC_context[(x : uN(32) <: nat)], 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}))) + -- 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}) ;; 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})) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], 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}))) + -- 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}) ;; 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})) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) - -- if ((y : uN(32) <: nat) < |C.TYPE_context|) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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 : uN(32) <: nat)], 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)}: - `%|-%:%`(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, o0 : nat, o1 : nat}: - `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([(nt_2 : numtype <: valtype)], [(nt_1 : numtype <: valtype)])) - -- if ($size((nt_1 : numtype <: valtype)) = ?(o0)) - -- if ($size((nt_2 : numtype <: valtype)) = ?(o1)) + 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)]))) -- if (nt_1 =/= nt_2) - -- if (o0 = o1) + -- 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?, o0 : nat, o1 : nat}: - `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) - -- if ($size((inn_1 : inn <: valtype)) = ?(o0)) - -- if ($size((inn_2 : inn <: valtype)) = ?(o1)) + 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)]))) -- if (inn_1 =/= inn_2) - -- if ((sx?{sx} = ?()) <=> (o0 > o1)) + -- 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))])) - -- if ((x : uN(32) <: nat) < |C.FUNC_context|) - -- if (C.FUNC_context[(x : uN(32) <: nat)] = dt) + `%|-%:%`(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}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- if (|mut*{mut}| = |zt*{zt}|) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + `%|-%:%`(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}))) ;; 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))])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- if (|mut*{mut}| = |zt*{zt}|) - -- if (|val*{val}| = |zt*{zt}|) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], 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))]))) + -- 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}))) + -- (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)])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- if (i < |yt*{yt}|) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], 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)]))) + -- if (x.`%`.0 < |C.TYPE_context|) + -- 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 : uN(32) <: nat) < |C.TYPE_context|) - -- if (i < |yt*{yt}|) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), 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}))) + -- 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))])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) + `%|-%:%`(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))])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) + `%|-%:%`(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))])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) + `%|-%:%`(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))])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- if ((y : uN(32) <: nat) < |C.ELEM_context|) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, (rt : reftype <: storagetype)))) - -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[(y : uN(32) <: nat)], rt) + `%|-%:%`(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)))) + -- 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))])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- if ((y : uN(32) <: nat) < |C.DATA_context|) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, (t : valtype <: storagetype)))) + `%|-%:%`(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)))) -- if ((t = (numtype : numtype <: valtype)) \/ (t = (vectype : vectype <: valtype))) - -- if (C.DATA_context[(y : uN(32) <: nat)] = OK) + -- 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}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) : typevar <: heaptype)) I32_valtype], [$unpack(zt)])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + `%|-%:%`(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)], [])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), 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])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + `%|-%:%`(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], [])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + `%|-%:%`(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], [])) - -- if ((x_1 : uN(32) <: nat) < |C.TYPE_context|) - -- if ((x_2 : uN(32) <: nat) < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[(x_1 : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) - -- Expand: `%~~%`(C.TYPE_context[(x_2 : uN(32) <: nat)], ARRAY_comptype(`%%`(mut, zt_2))) + `%|-%:%`(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))) + -- 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], [])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- if ((y : uN(32) <: nat) < |C.ELEM_context|) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- Storagetype_sub: `%|-%<:%`(C, (C.ELEM_context[(y : uN(32) <: nat)] : reftype <: storagetype), zt) + `%|-%:%`(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))) + -- 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], [])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- if ((y : uN(32) <: nat) < |C.DATA_context|) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + `%|-%:%`(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))) -- if ((t = (numtype : numtype <: valtype)) \/ (t = (vectype : vectype <: valtype))) - -- if (C.DATA_context[(y : uN(32) <: nat)] = OK) + -- 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}), `%->%`([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}: - `%|-%:%`(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}, 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}, 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}: - `%|-%:%`(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])) - -- if ((x : uN(32) <: nat) < |C.LOCAL_context|) - -- if (C.LOCAL_context[(x : uN(32) <: nat)] = `%%`(init, 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])) - -- if ((x : uN(32) <: nat) < |C.GLOBAL_context|) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = `%%`(mut, 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], [])) - -- if ((x : uN(32) <: nat) < |C.GLOBAL_context|) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = `%%`(`MUT%?`(?(())), 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)])) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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)], [])) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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])) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = tt) + `%|-%:%`(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])) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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], [])) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + `%|-%:%`(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], [])) - -- if ((x_1 : uN(32) <: nat) < |C.TABLE_context|) - -- if ((x_2 : uN(32) <: nat) < |C.TABLE_context|) - -- if (C.TABLE_context[(x_1 : uN(32) <: nat)] = `%%`(lim_1, rt_1)) - -- if (C.TABLE_context[(x_2 : uN(32) <: nat)] = `%%`(lim_2, rt_2)) + `%|-%:%`(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)) + -- 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], [])) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) - -- if ((y : uN(32) <: nat) < |C.ELEM_context|) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt_1)) - -- if (C.ELEM_context[(y : uN(32) <: nat)] = rt_2) + `%|-%:%`(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)) + -- 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), `%->%`([], [])) - -- if ((x : uN(32) <: nat) < |C.ELEM_context|) - -- if (C.ELEM_context[(x : uN(32) <: nat)] = rt) + `%|-%:%`(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])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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], [])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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], [])) - -- if ((x_1 : uN(32) <: nat) < |C.MEM_context|) - -- if ((x_2 : uN(32) <: nat) < |C.MEM_context|) - -- if (C.MEM_context[(x_1 : uN(32) <: nat)] = mt_1) - -- if (C.MEM_context[(x_2 : uN(32) <: nat)] = mt_2) + `%|-%:%`(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) + -- 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], [])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- if ((y : uN(32) <: nat) < |C.DATA_context|) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if (C.DATA_context[(y : uN(32) <: nat)] = OK) + `%|-%:%`(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) + -- 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), `%->%`([], [])) - -- if ((x : uN(32) <: nat) < |C.DATA_context|) - -- if (C.DATA_context[(x : uN(32) <: nat)] = OK) + `%|-%:%`(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, o0 : nat, o1? : nat?}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- if ((n?{n} = ?()) <=> (o1?{o1} = ?())) - -- if ((n?{n} = ?()) <=> (sx?{sx} = ?())) - -- if ($size((nt : numtype <: valtype)) = ?(o0)) - -- (if ($size((nt : numtype <: valtype)) = ?(o1)))?{o1} - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if ((2 ^ n_A) <= (o0 / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + 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)]))) + -- if (x.`%`.0 < |C.MEM_context|) + -- 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 : 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, o0 : nat, o1? : nat?}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- if ((n?{n} = ?()) <=> (o1?{o1} = ?())) - -- if ($size((nt : numtype <: valtype)) = ?(o0)) - -- (if ($size((nt : numtype <: valtype)) = ?(o1)))?{o1} - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if ((2 ^ n_A) <= (o0 / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} - -- if ((n?{n} = ?()) \/ (nt = (inn : inn <: numtype))) + 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)]), `%`([]))) + -- 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 : 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}: - `%|-%:%`(C, VLOAD_instr(?(SHAPE_vloadop(M, N, sx)), x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [V128_valtype])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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)) - -- if ((laneidx : uN(8) <: nat) < (128 / n)) + -- if (laneidx.`%`.0 < (128 / n)) - ;; 6-typing.watsup:1046.1-1049.36 - rule vstore{C : context, x : idx, n_A : n, n_O : n, mt : memtype, o0 : nat}: - `%|-%:%`(C, VSTORE_instr(x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype V128_valtype], [])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- if ($size(V128_valtype) = ?(o0)) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) - -- if ((2 ^ n_A) <= (o0 / 8)) + ;; 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]), `%`([]))) + -- 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], [])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + `%|-%:%`(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)) - -- if ((laneidx : uN(8) <: nat) < (128 / n)) + -- if (laneidx.`%`.0 < (128 / n)) ;; 6-typing.watsup:504.1-504.67 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}: - `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) - -- if ((x : uN(32) <: nat) < |C.LOCAL_context|) - -- if (C.LOCAL_context[(x : uN(32) <: nat)] = `%%`(init, t)) + `%|-%:%`(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])) - -- if ((x : uN(32) <: nat) < |C.LOCAL_context|) - -- if (C.LOCAL_context[(x : uN(32) <: nat)] = `%%`(init, 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}, `%->%*%`(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 : uN(32) <: nat) < |C.LOCAL_context|))*{init t x_1} - -- (if (C.LOCAL_context[(x_1 : uN(32) <: nat)] = `%%`(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 { @@ -25635,7 +25660,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 @@ -25646,7 +25671,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 @@ -25670,8 +25695,8 @@ relation Instr_const: `%|-%CONST`(context, instr) ;; 6-typing.watsup rule global.get{C : context, x : idx, t : valtype}: `%|-%CONST`(C, GLOBAL.GET_instr(x)) - -- if ((x : uN(32) <: nat) < |C.GLOBAL_context|) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = `%%`(`MUT%?`(?()), t)) + -- if (x.`%`.0 < |C.GLOBAL_context|) + -- if (C.GLOBAL_context[x.`%`.0] = `%%`(`MUT%?`(?()), t)) ;; 6-typing.watsup rule binop{C : context, inn : inn, binop : binop_((inn : inn <: numtype))}: @@ -25683,25 +25708,25 @@ 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) ;; 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}) - -- if (x = |C.TYPE_context|) - -- if (dt*{dt} = $rolldt(x, rectype)) - -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt}], rectype, OK_oktypeidx(x)) + `%|-%:%`(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)) ;; 6-typing.watsup relation Local_ok: `%|-%:%`(context, local, localtype) @@ -25719,12 +25744,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 : uN(32) <: nat)]) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- if (|local*{local}| = |lt*{lt}|) - -- Expand: `%~~%`(C.TYPE_context[(x : uN(32) <: nat)], 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]) + -- 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})))) + -- (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) @@ -25756,8 +25781,8 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) ;; 6-typing.watsup rule active{C : context, x : idx, expr : expr, rt : reftype, lim : limits}: `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = `%%`(lim, rt)) + -- if (x.`%`.0 < |C.TABLE_context|) + -- if (C.TABLE_context[x.`%`.0] = `%%`(lim, rt)) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} ;; 6-typing.watsup @@ -25772,8 +25797,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 @@ -25781,8 +25806,8 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) ;; 6-typing.watsup rule active{C : context, x : idx, expr : expr, mt : memtype}: `%|-%:_OK`(C, ACTIVE_datamode(x, expr)) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + -- if (x.`%`.0 < |C.MEM_context|) + -- if (C.MEM_context[x.`%`.0] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} ;; 6-typing.watsup @@ -25793,7 +25818,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 @@ -25801,8 +25826,8 @@ relation Start_ok: `%|-%:_OK`(context, start) ;; 6-typing.watsup rule _{C : context, x : idx}: `%|-%:_OK`(C, START(x)) - -- if ((x : uN(32) <: nat) < |C.FUNC_context|) - -- Expand: `%~~%`(C.FUNC_context[(x : uN(32) <: nat)], FUNC_comptype(`%->%`([], []))) + -- if (x.`%`.0 < |C.FUNC_context|) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`([]), `%`([])))) ;; 6-typing.watsup relation Import_ok: `%|-%:%`(context, import, externtype) @@ -25816,26 +25841,26 @@ relation Externidx_ok: `%|-%:%`(context, externidx, externtype) ;; 6-typing.watsup rule func{C : context, x : idx, dt : deftype}: `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) - -- if ((x : uN(32) <: nat) < |C.FUNC_context|) - -- if (C.FUNC_context[(x : uN(32) <: nat)] = dt) + -- if (x.`%`.0 < |C.FUNC_context|) + -- if (C.FUNC_context[x.`%`.0] = dt) ;; 6-typing.watsup rule global{C : context, x : idx, gt : globaltype}: `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) - -- if ((x : uN(32) <: nat) < |C.GLOBAL_context|) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = gt) + -- if (x.`%`.0 < |C.GLOBAL_context|) + -- if (C.GLOBAL_context[x.`%`.0] = gt) ;; 6-typing.watsup rule table{C : context, x : idx, tt : tabletype}: `%|-%:%`(C, TABLE_externidx(x), TABLE_externtype(tt)) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) - -- if (C.TABLE_context[(x : uN(32) <: nat)] = tt) + -- if (x.`%`.0 < |C.TABLE_context|) + -- if (C.TABLE_context[x.`%`.0] = tt) ;; 6-typing.watsup rule mem{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + -- if (x.`%`.0 < |C.MEM_context|) + -- if (C.MEM_context[x.`%`.0] = mt) ;; 6-typing.watsup relation Export_ok: `%|-%:%`(context, export, externtype) @@ -25848,61 +25873,61 @@ 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}) + `%|-%:%`(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 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}, dt_1*{} :: dt*{dt}) - -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, 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 : 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) @@ -25912,7 +25937,7 @@ relation Ref_ok: `%|-%:%`(store, ref, reftype) ;; 7-runtime-typing.watsup rule i31{s : store, i : nat}: - `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) + `%|-%:%`(s, REF.I31_NUM_ref(`%`(i)), REF_reftype(`NULL%?`(?()), I31_heaptype)) ;; 7-runtime-typing.watsup rule struct{s : store, a : addr, dt : deftype}: @@ -25941,544 +25966,543 @@ 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}?{t})], [(val_1 : val <: admininstr)]) - -- if (c =/= 0) + `%~>%`([(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)]) - -- if (c = 0) + `%~>%`([(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})]) - -- if (c =/= 0) + `%~>%`([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})]) - -- if (c = 0) + `%~>%`([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 : uN(32) <: nat) + 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}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) - -- if (c =/= 0) + `%~>%`([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)], []) - -- if (c = 0) + `%~>%`([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}, 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}: - `%*_~>%*`([(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 <: 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)}: - `%*_~>%*`([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})], [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}: - `%*_~>%*`([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), o0 : N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VVTESTOP_admininstr(V128_vectype, ANY_TRUE_vvtestop)], [CONST_admininstr(I32_numtype, c)]) - -- if ($size(V128_valtype) = ?(o0)) - -- if (c = $ine(o0, c_1, 0)) + 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)]) + -- if (c = $ine($vsize(V128_vectype), c_1, `%`(0))) ;; 8-reduction.watsup - rule vswizzle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), pnn : pnn, N : N, c' : vec_(V128_vnn), c : iN($lsize((pnn : pnn <: lanetype))), ci* : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), N)))*, k^N : nat^N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((pnn : pnn <: imm), N))], [VCONST_admininstr(V128_vectype, c')]) - -- (if ((ci*{ci}[k] : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), N))) <: nat) < |c*{}|))^(k%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((pnn : pnn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) + -- (if (ci*{ci : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), `%`(N))))}[k].`%`.0 < |c*{}|))^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((pnn : pnn <: 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%`((pnn : pnn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) + -- (if (i*{i : nat}[k] < |c'*{}|))^(k%*`([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{})) + `%~>%`([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)]) - -- if (i < |$lanes_(`%X%`((nt : numtype <: lanetype), N), c_1)|) - -- if (c_2 = $lanes_(`%X%`((nt : numtype <: lanetype), N), c_1)[i]) + `%~>%`([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)]) - -- 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])) + `%~>%`([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)]) - -- if (c = $invlanes_(`%X%`(lnn, N), $lanes_(`%X%`(lnn, N), c_1)[[i] = $packnum(lnn, c_2)])) + `%~>%`([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)]) - -- 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'})) + 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' : 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), imm : imm, N : N, ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), N)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), N), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), N)))], [CONST_admininstr(I32_numtype, 1)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((imm : imm <: lanetype), N), c)) - -- (if (ci_1 =/= (0 : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), N))))))*{ci_1} + rule vtestop-true{c : vec_(V128_vnn), imm : imm, N : N, ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c)) + -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), imm : imm, N : N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), N), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), N)))], [CONST_admininstr(I32_numtype, 0)]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup - rule vbitmask{c : vec_(V128_vnn), imm : imm, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), N)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`(imm, N))], [CONST_admininstr(I32_numtype, ci)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((imm : imm <: lanetype), N), c)) - -- if ($ibits(32, ci) = $ilt($lsize((imm : imm <: lanetype)), S_sx, ci_1, 0)*{ci_1}) + rule vbitmask{c : vec_(V128_vnn), imm : imm, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`(imm, `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c)) + -- if ($ibits(32, ci) = `%`($ilt($lsize((imm : imm <: lanetype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($lsize((imm : imm <: lanetype)))}) ;; 8-reduction.watsup - rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*, ci_2* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*, cj_1* : iN($lsize((imm_2 : imm <: lanetype)))*, cj_2* : iN($lsize((imm_2 : imm <: lanetype)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`(imm_1, N_1), `%X%`(imm_2, N_2), sx)], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci_1*{ci_1} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_1)) - -- if (ci_2*{ci_2} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_2)) - -- if (cj_1*{cj_1} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_1)*{ci_1}) - -- if (cj_2*{cj_2} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_2)*{ci_2}) - -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), N_2), cj_1*{cj_1} :: cj_2*{cj_2})) + rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*, cj_1* : iN($lsize((imm_2 : imm <: lanetype)))*, cj_2* : iN($lsize((imm_2 : imm <: lanetype)))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci_1*{ci_1 : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_1)) + -- if (ci_2*{ci_2 : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_2)) + -- if (cj_1*{cj_1 : iN($lsize((imm_2 : imm <: lanetype)))} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_1)*{ci_1 : iN($lsize((imm_1 : imm <: lanetype)))}) + -- if (cj_2*{cj_2 : iN($lsize((imm_2 : imm <: lanetype)))} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_2)*{ci_2 : iN($lsize((imm_1 : imm <: lanetype)))}) + -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), cj_1*{cj_1 : lane_($lanetype(`%X%`((imm_2 : imm <: lanetype), `%`(N_2))))} :: cj_2*{cj_2 : lane_($lanetype(`%X%`((imm_2 : imm <: 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'})) + 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' : 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), imm_2 : imm, N_2 : N, vcvtop : vcvtop, hf : half, imm_1 : imm, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((imm_2 : imm <: lanetype), N_2), vcvtop, ?(hf), `%X%`((imm_1 : imm <: lanetype), N_1), sx?{sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- if (ci*{ci} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_1)[$halfop(hf, 0, N_2) : N_2]) - -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), N_2), $vcvtop(`%X%`((imm_1 : imm <: lanetype), N_1), `%X%`((imm_2 : imm <: lanetype), N_2), vcvtop, sx?{sx}, ci)*{ci})) + rule vcvtop-half{c_1 : vec_(V128_vnn), imm_2 : imm, N_2 : N, vcvtop : vcvtop, hf : half, imm_1 : imm, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((imm_1 : imm <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + -- if (ci*{ci : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2]) + -- if (c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), $vcvtop(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), `%X%`((imm_2 : imm <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((imm_1 : imm <: 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 : nat <: lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), N_2))))^N_1{})) + 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)]) + -- 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} :: [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}: - `%~>%*`(`%;%*`(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 : uN(32) <: nat)]) CALL_REF_admininstr(?())]) - -- if ((x : uN(32) <: nat) < |$funcaddr(z)|) + `%~>%`(`%;%`(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})]), [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}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[(x : uN(32) <: nat)]) RETURN_CALL_REF_admininstr(?())]) - -- if ((x : uN(32) <: nat) < |$funcaddr(z)|) + `%~>%`(`%;%`(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'}, (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}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[(x : uN(32) <: nat)])]) - -- if ((x : uN(32) <: nat) < |$funcaddr(z)|) + `%~>%`(`%;%`(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} :: [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}: - `%~>%*`(`%;%*`(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} :: [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}: - `%~>%*`(`%;%*`(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} :: [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]) @@ -26486,129 +26510,129 @@ 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}, 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}: - `%~>%*`(`%;%*`(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))) @@ -26617,7 +26641,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))) @@ -26626,227 +26650,219 @@ 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, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) - -- if ($size((nt : numtype <: valtype)) = ?(o0)) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + 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]) + -- 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), o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) - -- if ($size((nt : numtype <: valtype)) = ?(o0)) - -- if ($nbytes(nt, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (o0 / 8)]) + 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)]) + -- 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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (n / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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), o0 : N}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [CONST_admininstr((inn : inn <: numtype), $ext(n, o0, sx, c))]) - -- if ($size((inn : inn <: valtype)) = ?(o0)) - -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (n / 8)]) + 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))]) + -- 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, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VLOAD_admininstr(?(), x, mo)]), [TRAP_admininstr]) - -- if ($size(V128_valtype) = ?(o0)) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + rule vload-oob{z : state, i : nat, x : idx, mo : memop}: + `%~>%`(`%;%`(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), o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VLOAD_admininstr(?(), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) - -- if ($size(V128_valtype) = ?(o0)) - -- if ($vbytes(V128_vectype, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (o0 / 8)]) + 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)]) + -- 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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + ((M * N) / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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, o0 : nat, o1^N : N^N}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) - -- if ($size((inn : inn <: valtype)) = ?(o0)) - -- (if ($size((inn : inn <: valtype)) = ?(o1)))^N{o1} - -- (if ($ibytes(M, j) = $mem(z, x).DATA_meminst[((i + (mo.OFFSET_memop : uN(32) <: nat)) + ((k * M) / 8)) : (M / 8)]))^(k%`(`%;%`(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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- if ($ibytes(N, j) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)]) + `%~>%`(`%;%`(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)) - -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), M), (j : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), M))))^M{})) + -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(M)), `%`(j)^M{})) ;; 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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- if ($ibytes(N, j) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)]) - -- if (c = $ext(N, 128, U_sx, j)) + `%~>%`(`%;%`(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, c_1 : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, j)]), [TRAP_admininstr]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, 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, c_1 : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, c : vec_(V128_vnn), k : nat, imm : imm, M : M, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, j)]), [VCONST_admininstr(V128_vectype, c)]) - -- if ($size(V128_valtype) = ?(o0)) - -- if ($ibytes(N, k) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)]) + rule vload_lane-val{z : state, i : nat, c_1 : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, c : vec_(V128_vnn), k : nat, imm : imm, M : M}: + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(V128_vectype, 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 = (o0 / N)) - -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), M), $lanes_(`%X%`((imm : imm <: lanetype), M), c_1)[[j] = (k : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), M))))])) + -- if (M = ($vsize(V128_vectype) / N)) + -- if (c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(M)), $lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c_1)[[j] = `%`(k)])) ;; 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]) 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 @@ -26854,149 +26870,144 @@ 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}), `%;%*`(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}: - `%~>%`(`%;%*`(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}| = |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}: - `%~>%`(`%;%*`(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, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if ($size((nt : numtype <: valtype)) = ?(o0)) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + 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])) + -- 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*, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + (mo.OFFSET_memop : uN(32) <: nat)), (o0 / 8), b*{b}), [])) - -- if ($size((nt : numtype <: valtype)) = ?(o0)) - -- if (b*{b} = $nbytes(nt, c)) + 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}), [])) + -- 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])) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (n / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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*, o0 : M}: - `%~>%`(`%;%*`(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 : uN(32) <: nat)), (n / 8), b*{b}), [])) - -- if ($size((inn : inn <: valtype)) = ?(o0)) - -- if (b*{b} = $ibytes(n, $wrap(o0, n, c))) + 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}), [])) + -- 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, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if ($size(V128_valtype) = ?(o0)) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + 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])) + -- 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*, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + (mo.OFFSET_memop : uN(32) <: nat)), (o0 / 8), b*{b}), [])) - -- if ($size(V128_valtype) = ?(o0)) - -- if (b*{b} = $vbytes(V128_vectype, c)) + 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}), [])) + -- 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])) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + N) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 : uN(32) <: nat)), (N / 8), b*{b}), [])) - -- if (j < |$lanes_(`%X%`((imm : imm <: lanetype), M), c)|) + `%~>%`(`%;%`(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])) + -- 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 { @@ -27005,21 +27016,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*) +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 { @@ -27029,19 +27040,19 @@ 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 (fi = {TYPE mm.TYPE_moduleinst[(x : uN(32) <: nat)], MODULE mm, CODE func}) + -- if (func = FUNC(x, local*{local : local}, expr)) + -- if (fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func}) ;; 9-module.watsup rec { @@ -27051,9 +27062,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 @@ -27070,16 +27081,16 @@ 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 def $alloctable(store : store, tabletype : tabletype, ref : ref) : (store, tableaddr) ;; 9-module.watsup - def $alloctable{s : store, i : nat, j : nat, rt : reftype, ref : ref, ti : tableinst}(s, `%%`(`[%..%]`(i, j), rt), ref) = (s[TABLE_store =.. [ti]], |s.TABLE_store|) - -- if (ti = {TYPE `%%`(`[%..%]`(i, j), rt), ELEM ref^i{}}) + def $alloctable{s : store, i : nat, j : nat, rt : reftype, ref : ref, ti : tableinst}(s, `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ref) = (s[TABLE_store =.. [ti]], |s.TABLE_store|) + -- if (ti = {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM ref^i{}}) ;; 9-module.watsup rec { @@ -27089,16 +27100,16 @@ 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 def $allocmem(store : store, memtype : memtype) : (store, memaddr) ;; 9-module.watsup - def $allocmem{s : store, i : nat, j : nat, mi : meminst}(s, `%I8`(`[%..%]`(i, j))) = (s[MEM_store =.. [mi]], |s.MEM_store|) - -- if (mi = {TYPE `%I8`(`[%..%]`(i, j)), DATA 0^((i * 64) * $Ki){}}) + def $allocmem{s : store, i : nat, j : nat, mi : meminst}(s, `%I8`(`[%..%]`(`%`(i), `%`(j)))) = (s[MEM_store =.. [mi]], |s.MEM_store|) + -- if (mi = {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA `%`(0)^((i * 64) * $Ki){}}) ;; 9-module.watsup rec { @@ -27108,16 +27119,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 { @@ -27127,16 +27138,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 { @@ -27146,113 +27157,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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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}))) - -;; 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 : byte <: nat))) - ;; 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 : byte <: nat) - 192)) + ((b_2 : byte <: nat) - 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 : byte <: nat) - 224)) + ((2 ^ 6) * ((b_2 : byte <: nat) - 128))) + ((b_3 : byte <: nat) - 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 : byte <: nat) - 240)) + ((2 ^ 12) * ((b_2 : byte <: nat) - 128))) + ((2 ^ 6) * ((b_3 : byte <: nat) - 128))) + ((b_4 : byte <: nat) - 128)))) - ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(ch*{ch}) = $concat_(syntax byte, $utf8([ch])*{ch}) -} + -- 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) @@ -27271,14 +27261,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 = `...` @@ -27286,21 +27276,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) +syntax recordeq = `%++%=%`{recordstar : recordstar}(recordstar : recordstar, recordstar, recordstar) ;; C-conventions.watsup syntax pth = @@ -27356,7 +27346,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 @@ -27367,29 +27357,28 @@ 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 -syntax list{syntax X}(syntax X) = X* - -;; 1-syntax.watsup -syntax char = nat - -;; 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 = nat +syntax bit = `%`{i : nat}(i : nat) + -- if ((i = 0) \/ (i = 1)) ;; 1-syntax.watsup -syntax byte = nat +syntax byte = `%`{i : nat}(i : nat) + -- if ((i >= 0) /\ (i <= 255)) ;; 1-syntax.watsup -syntax uN{N : N}(N) = nat +syntax uN{N : N}(N) = `%`{i : nat}(i : nat) + -- if ((i >= 0) /\ (i <= ((2 ^ N) - 1))) ;; 1-syntax.watsup -syntax sN{N : N}(N) = int +syntax sN{N : N}(N) = `%`{i : int}(i : int) + -- if ((((i >= - ((2 ^ (N - 1)) : nat <: int)) /\ (i <= - (1 : nat <: int))) \/ (i = (0 : nat <: int))) \/ ((i >= + (1 : nat <: int)) /\ (i <= (((2 ^ (N - 1)) - 1) : nat <: int)))) ;; 1-syntax.watsup syntax iN{N : N}(N) = uN(N) @@ -27451,8 +27440,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) @@ -27478,6 +27467,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 @@ -27548,20 +27572,20 @@ 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 | 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 +;; 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 @@ -27569,40 +27593,40 @@ 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, storagetype) +;; 1-syntax.watsup:176.1-177.18 +syntax fieldtype = `%%`{mut : mut, storagetype : storagetype}(mut : mut, storagetype : storagetype) -;; 1-syntax.watsup:178.1-178.70 -syntax functype = `%->%`(resulttype, resulttype) +;; 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) - | 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 +;; 1-syntax.watsup:190.1-191.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 +;; 1-syntax.watsup:193.1-194.22 syntax rectype = - | REC(list : list(syntax subtype)) + | 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) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | ANY | EQ | I31 @@ -27614,13 +27638,13 @@ syntax heaptype = | EXTERN | NOEXTERN | BOT - | DEF(rectype : rectype, 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 = @@ -27673,19 +27697,19 @@ syntax imm = ;; 1-syntax.watsup syntax deftype = - | DEF(rectype : rectype, nat) + | DEF{rectype : rectype}(rectype : rectype, nat) ;; 1-syntax.watsup -syntax limits = `[%..%]`(u32, u32) +syntax limits = `[%..%]`{u32 : u32}(u32 : u32, u32) ;; 1-syntax.watsup -syntax globaltype = `%%`(mut, valtype) +syntax globaltype = `%%`{mut : mut, valtype : valtype}(mut : mut, valtype : valtype) ;; 1-syntax.watsup -syntax tabletype = `%%`(limits, reftype) +syntax tabletype = `%%`{limits : limits, reftype : reftype}(limits : limits, reftype : reftype) ;; 1-syntax.watsup -syntax memtype = `%I8`(limits) +syntax memtype = `%I8`{limits : limits}(limits : limits) ;; 1-syntax.watsup syntax elemtype = reftype @@ -27695,24 +27719,26 @@ 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(valtype : valtype) : nat? +def $size(numtype : numtype) : nat ;; 2-syntax-aux.watsup - def $size(I32_valtype) = ?(32) + def $size(I32_numtype) = 32 ;; 2-syntax-aux.watsup - def $size(I64_valtype) = ?(64) + def $size(I64_numtype) = 64 ;; 2-syntax-aux.watsup - def $size(F32_valtype) = ?(32) + def $size(F32_numtype) = 32 ;; 2-syntax-aux.watsup - def $size(F64_valtype) = ?(64) + def $size(F64_numtype) = 64 + +;; 1-syntax.watsup +def $vsize(vectype : vectype) : nat ;; 2-syntax-aux.watsup - def $size(V128_valtype) = ?(128) - def $size{x0 : valtype}(x0) = ?() + def $vsize(V128_vectype) = 128 ;; 1-syntax.watsup def $psize(packtype : packtype) : nat @@ -27724,41 +27750,44 @@ def $psize(packtype : packtype) : nat ;; 1-syntax.watsup def $lsize(lanetype : lanetype) : nat ;; 2-syntax-aux.watsup - def $lsize{numtype : numtype}((numtype : numtype <: lanetype)) = !($size((numtype : numtype <: valtype))) + def $lsize{numtype : numtype}((numtype : numtype <: lanetype)) = $size(numtype) ;; 2-syntax-aux.watsup def $lsize{packtype : packtype}((packtype : packtype <: lanetype)) = $psize(packtype) ;; 1-syntax.watsup def $zsize(storagetype : storagetype) : nat ;; 2-syntax-aux.watsup - def $zsize{valtype : valtype}((valtype : valtype <: storagetype)) = !($size(valtype)) + def $zsize{numtype : numtype}((numtype : numtype <: storagetype)) = $size(numtype) + ;; 2-syntax-aux.watsup + def $zsize{vectype : vectype}((vectype : vectype <: storagetype)) = $vsize(vectype) ;; 2-syntax-aux.watsup def $zsize{packtype : packtype}((packtype : packtype <: storagetype)) = $psize(packtype) ;; 1-syntax.watsup -syntax dim = nat +syntax dim = `%`{i : nat}(i : nat) + -- if (((((i = 1) \/ (i = 2)) \/ (i = 4)) \/ (i = 8)) \/ (i = 16)) ;; 1-syntax.watsup -syntax shape = `%X%`(lanetype, dim) +syntax shape = `%X%`{lanetype : lanetype, dim : dim}(lanetype : lanetype, dim : dim) ;; 1-syntax.watsup def $lanetype(shape : shape) : lanetype ;; 2-syntax-aux.watsup - def $lanetype{lnn : lnn, N : N}(`%X%`(lnn, N)) = lnn + def $lanetype{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = lnn ;; 1-syntax.watsup -def $sizenn(valtype : valtype) : nat +def $sizenn(numtype : numtype) : nat ;; 1-syntax.watsup - def $sizenn{t : valtype}(t) = !($size(t)) + def $sizenn{nt : numtype}(nt) = $size(nt) ;; 1-syntax.watsup syntax num_(numtype : numtype) ;; 1-syntax.watsup - syntax num_{inn : inn}((inn : inn <: numtype)) = iN($sizenn((inn : inn <: valtype))) + syntax num_{inn : inn}((inn : inn <: numtype)) = iN($sizenn((inn : inn <: numtype))) ;; 1-syntax.watsup - syntax num_{fnn : fnn}((fnn : fnn <: numtype)) = fN($sizenn((fnn : fnn <: valtype))) + syntax num_{fnn : fnn}((fnn : fnn <: numtype)) = fN($sizenn((fnn : fnn <: numtype))) ;; 1-syntax.watsup @@ -27779,7 +27808,7 @@ syntax lane_(lanetype : lanetype) ;; 1-syntax.watsup -syntax vec_{vnn : vnn}(vnn) = vN(!($size((vnn : vnn <: valtype)))) +syntax vec_{vnn : vnn}(vnn) = vN($vsize(vnn)) ;; 1-syntax.watsup syntax zval_(storagetype : storagetype) @@ -27807,7 +27836,7 @@ syntax unop_(numtype : numtype) | CLZ | CTZ | POPCNT - | EXTEND(n : n) + | EXTEND{n : n}(n : n) ;; 1-syntax.watsup @@ -27828,13 +27857,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 @@ -27860,10 +27889,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 @@ -27883,23 +27912,23 @@ syntax cvtop = | REINTERPRET ;; 1-syntax.watsup -syntax ishape = `%X%`(imm, dim) +syntax ishape = `%X%`{imm : imm, dim : dim}(imm : imm, dim : dim) ;; 1-syntax.watsup -syntax fshape = `%X%`(fnn, dim) +syntax fshape = `%X%`{fnn : fnn, dim : dim}(fnn : fnn, dim : dim) ;; 1-syntax.watsup -syntax pshape = `%X%`(pnn, dim) +syntax pshape = `%X%`{pnn : pnn, dim : dim}(pnn : pnn, dim : dim) ;; 1-syntax.watsup def $dim(shape : shape) : dim ;; 2-syntax-aux.watsup - def $dim{lnn : lnn, N : N}(`%X%`(lnn, N)) = N + def $dim{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = `%`(N) ;; 1-syntax.watsup def $shsize(shape : shape) : nat ;; 2-syntax-aux.watsup - def $shsize{lnn : lnn, N : N}(`%X%`(lnn, N)) = ($lsize(lnn) * N) + def $shsize{lnn : lnn, N : N}(`%X%`(lnn, `%`(N))) = ($lsize(lnn) * N) ;; 1-syntax.watsup syntax vvunop = @@ -27923,7 +27952,7 @@ syntax vvtestop = ;; 1-syntax.watsup syntax vunop_(shape : shape) ;; 1-syntax.watsup - syntax vunop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + syntax vunop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ABS | NEG | POPCNT{imm : imm} @@ -27931,7 +27960,7 @@ syntax vunop_(shape : shape) ;; 1-syntax.watsup - syntax vunop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vunop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | ABS | NEG | SQRT @@ -27944,12 +27973,12 @@ syntax vunop_(shape : shape) ;; 1-syntax.watsup syntax vbinop_(shape : shape) ;; 1-syntax.watsup - syntax vbinop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + 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) @@ -27957,14 +27986,14 @@ 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) ;; 1-syntax.watsup - syntax vbinop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vbinop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | ADD | SUB | MUL @@ -27976,23 +28005,23 @@ syntax vbinop_(shape : shape) ;; 1-syntax.watsup -syntax vtestop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = +syntax vtestop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), `%`(N))) = | ALL_TRUE ;; 1-syntax.watsup syntax vrelop_(shape : shape) ;; 1-syntax.watsup - syntax vrelop_{imm : imm, N : N}(`%X%`((imm : imm <: lanetype), N)) = + 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 - syntax vrelop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), N)) = + syntax vrelop_{fnn : fnn, N : N}(`%X%`((fnn : fnn <: lanetype), `%`(N))) = | EQ | NE | LT @@ -28010,12 +28039,12 @@ syntax vcvtop = | PROMOTE ;; 1-syntax.watsup -syntax vshiftop_{imm : imm, N : N}(`%X%`(imm, N)) = +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)) = +syntax vextunop_{imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N}(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2))) = | EXTADD_PAIRWISE -- if ((16 <= $lsize((imm_1 : imm <: lanetype))) /\ ($lsize((imm_1 : imm <: lanetype)) <= 32)) @@ -28025,28 +28054,28 @@ syntax half = | HIGH ;; 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) +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}(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, sx : sx) + | 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%?`(()?) @@ -28054,113 +28083,113 @@ syntax zero = `ZERO%?`(()?) ;; 1-syntax.watsup rec { -;; 1-syntax.watsup:521.1-533.78 +;; 1-syntax.watsup:523.1-535.78 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)) : dim <: nat))) - | 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) + -- if (ishape = `%X%`(I8_imm, `%`(16))) + | 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) - | 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 @@ -28168,57 +28197,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) +syntax type = TYPE{rectype : rectype}(rectype : rectype) ;; 1-syntax.watsup -syntax local = LOCAL(valtype) +syntax local = LOCAL{valtype : valtype}(valtype : valtype) ;; 1-syntax.watsup -syntax func = `FUNC%%*%`(typeidx, local*, 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, expr) +syntax global = GLOBAL{globaltype : globaltype, expr : expr}(globaltype : globaltype, expr : expr) ;; 1-syntax.watsup -syntax table = TABLE(tabletype, expr) +syntax table = TABLE{tabletype : tabletype, expr : expr}(tabletype : tabletype, expr : expr) ;; 1-syntax.watsup -syntax mem = MEMORY(memtype) +syntax mem = MEMORY{memtype : memtype}(memtype : memtype) ;; 1-syntax.watsup -syntax elem = `ELEM%%*%`(reftype, expr*, 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) +syntax data = DATA{byte* : byte*, datamode : datamode}(byte*{byte : byte} : byte*, datamode : datamode) ;; 1-syntax.watsup -syntax start = START(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, externidx) +syntax export = EXPORT{name : name, externidx : externidx}(name : name, externidx : externidx) ;; 1-syntax.watsup -syntax import = IMPORT(name, name, 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 { @@ -28228,10 +28257,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 } @@ -28241,9 +28270,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 @@ -28263,18 +28292,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 { @@ -28284,7 +28313,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 @@ -28331,7 +28360,7 @@ def $diffrt(reftype : reftype, reftype : reftype) : reftype ;; 2-syntax-aux.watsup syntax typevar = - | _IDX(typeidx : typeidx) + | _IDX{typeidx : typeidx}(typeidx : typeidx) | REC(nat) ;; 2-syntax-aux.watsup @@ -28342,181 +28371,181 @@ def $idx(typeidx : typeidx) : typevar ;; 2-syntax-aux.watsup rec { -;; 2-syntax-aux.watsup:122.1-122.92 +;; 2-syntax-aux.watsup:125.1-125.92 def $subst_typevar(typevar : typevar, typevar*, heaptype*) : heaptype - ;; 2-syntax-aux.watsup:147.1-147.38 + ;; 2-syntax-aux.watsup:150.1-150.38 def $subst_typevar{xx : typevar}(xx, [], []) = (xx : typevar <: heaptype) - ;; 2-syntax-aux.watsup:148.1-148.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 + ;; 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' : typevar}, [ht_1] :: ht'*{ht' : heaptype}) = ht_1 -- if (xx = xx_1) - ;; 2-syntax-aux.watsup:149.1-149.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'}) + ;; 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' : 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 { -;; 2-syntax-aux.watsup:126.1-126.92 +;; 2-syntax-aux.watsup:129.1-129.92 def $subst_heaptype(heaptype : heaptype, typevar*, heaptype*) : heaptype - ;; 2-syntax-aux.watsup:154.1-154.67 - def $subst_heaptype{xx' : typevar, xx* : typevar*, ht* : heaptype*}((xx' : typevar <: heaptype), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) - ;; 2-syntax-aux.watsup:155.1-155.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) - ;; 2-syntax-aux.watsup:156.1-156.55 - def $subst_heaptype{ht' : heaptype, xx* : typevar*, ht* : heaptype*}(ht', xx*{xx}, ht*{ht}) = ht' + ;; 2-syntax-aux.watsup:157.1-157.67 + 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 : 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 : typevar}, ht*{ht : heaptype}) = ht' -- otherwise -;; 2-syntax-aux.watsup:127.1-127.92 +;; 2-syntax-aux.watsup:130.1-130.92 def $subst_reftype(reftype : reftype, typevar*, heaptype*) : reftype - ;; 2-syntax-aux.watsup:158.1-158.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})) + ;; 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 : typevar}, ht*{ht : heaptype}) = REF_reftype(nul, $subst_heaptype(ht', xx*{xx : typevar}, ht*{ht : heaptype})) -;; 2-syntax-aux.watsup:128.1-128.92 +;; 2-syntax-aux.watsup:131.1-131.92 def $subst_valtype(valtype : valtype, typevar*, heaptype*) : valtype - ;; 2-syntax-aux.watsup:160.1-160.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) - ;; 2-syntax-aux.watsup:161.1-161.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) - ;; 2-syntax-aux.watsup:162.1-162.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) - ;; 2-syntax-aux.watsup:163.1-163.40 - def $subst_valtype{xx* : typevar*, ht* : heaptype*}(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + ;; 2-syntax-aux.watsup:163.1-163.64 + 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 : 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 : 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 : typevar}, ht*{ht : heaptype}) = BOT_valtype -;; 2-syntax-aux.watsup:131.1-131.92 +;; 2-syntax-aux.watsup:134.1-134.92 def $subst_storagetype(storagetype : storagetype, typevar*, heaptype*) : storagetype - ;; 2-syntax-aux.watsup:167.1-167.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) - ;; 2-syntax-aux.watsup:168.1-168.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) + ;; 2-syntax-aux.watsup:170.1-170.66 + 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 : typevar}, ht*{ht : heaptype}) = ($subst_packtype(pt, xx*{xx : typevar}, ht*{ht : heaptype}) : packtype <: storagetype) -;; 2-syntax-aux.watsup:132.1-132.92 +;; 2-syntax-aux.watsup:135.1-135.92 def $subst_fieldtype(fieldtype : fieldtype, typevar*, heaptype*) : fieldtype - ;; 2-syntax-aux.watsup:170.1-170.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})) + ;; 2-syntax-aux.watsup:173.1-173.80 + 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:134.1-134.92 +;; 2-syntax-aux.watsup:137.1-137.92 def $subst_comptype(comptype : comptype, typevar*, heaptype*) : comptype - ;; 2-syntax-aux.watsup:172.1-172.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}) - ;; 2-syntax-aux.watsup:173.1-173.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})) - ;; 2-syntax-aux.watsup:174.1-174.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})) - -;; 2-syntax-aux.watsup:135.1-135.92 + ;; 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})) + ;; 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 + 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:176.1-177.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})) - ;; 2-syntax-aux.watsup:178.1-179.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})) + ;; 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 : 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' : 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:136.1-136.92 +;; 2-syntax-aux.watsup:139.1-139.92 def $subst_rectype(rectype : rectype, typevar*, heaptype*) : rectype - ;; 2-syntax-aux.watsup:181.1-181.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}) + ;; 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})) -;; 2-syntax-aux.watsup:137.1-137.92 +;; 2-syntax-aux.watsup:140.1-140.92 def $subst_deftype(deftype : deftype, typevar*, heaptype*) : deftype - ;; 2-syntax-aux.watsup:183.1-183.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) + ;; 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 : typevar}, ht*{ht : heaptype}) = DEF_deftype($subst_rectype(qt, xx*{xx : typevar}, ht*{ht : heaptype}), i) -;; 2-syntax-aux.watsup:140.1-140.92 +;; 2-syntax-aux.watsup:143.1-143.92 def $subst_functype(functype : functype, typevar*, heaptype*) : functype - ;; 2-syntax-aux.watsup:186.1-186.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}) + ;; 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})) } ;; 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, x^n : idx^n}(rt, ht^n{ht}) = $subst_reftype(rt, $idx(x)^(x (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) + -- if (ishape = `%X%`(I8_imm, `%`(16))) + | 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) - | 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, admininstr*) +syntax config = `%;%`{state : state, admininstr* : admininstr*}(state : state, admininstr*{admininstr : admininstr} : admininstr*) ;; 4-runtime.watsup rec { @@ -29624,28 +29653,28 @@ 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? ;; 5-runtime-aux.watsup - def $default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) + def $default(I32_valtype) = ?(CONST_val(I32_numtype, `%`(0))) ;; 5-runtime-aux.watsup - def $default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) + def $default(I64_valtype) = ?(CONST_val(I64_numtype, `%`(0))) ;; 5-runtime-aux.watsup def $default(F32_valtype) = ?(CONST_val(F32_numtype, $fzero(32))) ;; 5-runtime-aux.watsup def $default(F64_valtype) = ?(CONST_val(F64_numtype, $fzero(64))) ;; 5-runtime-aux.watsup - def $default(V128_valtype) = ?(VCONST_val(V128_vectype, 0)) + def $default(V128_valtype) = ?(VCONST_val(V128_vectype, `%`(0))) ;; 5-runtime-aux.watsup def $default{ht : heaptype}(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) ;; 5-runtime-aux.watsup @@ -29656,14 +29685,14 @@ def $packval(storagetype : storagetype, val : val) : fieldval ;; 5-runtime-aux.watsup def $packval{t : valtype, val : val}((t : valtype <: storagetype), val) = (val : val <: fieldval) ;; 5-runtime-aux.watsup - def $packval{pt : packtype, i : nat}((pt : packtype <: storagetype), CONST_val(I32_numtype, i)) = PACK_fieldval(pt, $wrap(32, $psize(pt), i)) + def $packval{pt : packtype, i : nat}((pt : packtype <: storagetype), CONST_val(I32_numtype, `%`(i))) = PACK_fieldval(pt, $wrap(32, $psize(pt), `%`(i))) ;; 5-runtime-aux.watsup def $unpackval(storagetype : storagetype, sx?, fieldval : fieldval) : val ;; 5-runtime-aux.watsup def $unpackval{t : valtype, val : val}((t : valtype <: storagetype), ?(), (val : val <: fieldval)) = val ;; 5-runtime-aux.watsup - def $unpackval{pt : packtype, sx : sx, i : nat}((pt : packtype <: storagetype), ?(sx), PACK_fieldval(pt, i)) = CONST_val(I32_numtype, $ext($psize(pt), 32, sx, i)) + def $unpackval{pt : packtype, sx : sx, i : nat}((pt : packtype <: storagetype), ?(sx), PACK_fieldval(pt, `%`(i))) = CONST_val(I32_numtype, $ext($psize(pt), 32, sx, `%`(i))) ;; 5-runtime-aux.watsup rec { @@ -29673,9 +29702,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 } @@ -29687,9 +29716,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 } @@ -29701,9 +29730,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 } @@ -29715,9 +29744,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 } @@ -29784,82 +29813,82 @@ def $moduleinst(state : state) : moduleinst ;; 5-runtime-aux.watsup def $type(state : state, typeidx : typeidx) : deftype ;; 5-runtime-aux.watsup - def $type{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.MODULE_frame.TYPE_moduleinst[(x : uN(32) <: nat)] + def $type{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.MODULE_frame.TYPE_moduleinst[x.`%`.0] ;; 5-runtime-aux.watsup def $func(state : state, funcidx : funcidx) : funcinst ;; 5-runtime-aux.watsup - def $func{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[(x : uN(32) <: nat)]] + def $func{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $global(state : state, globalidx : globalidx) : globalinst ;; 5-runtime-aux.watsup - def $global{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[(x : uN(32) <: nat)]] + def $global{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $table(state : state, tableidx : tableidx) : tableinst ;; 5-runtime-aux.watsup - def $table{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]] + def $table{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $mem(state : state, memidx : memidx) : meminst ;; 5-runtime-aux.watsup - def $mem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[(x : uN(32) <: nat)]] + def $mem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $elem(state : state, tableidx : tableidx) : eleminst ;; 5-runtime-aux.watsup - def $elem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[(x : uN(32) <: nat)]] + def $elem{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $data(state : state, dataidx : dataidx) : datainst ;; 5-runtime-aux.watsup - def $data{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[(x : uN(32) <: nat)]] + def $data{s : store, f : frame, x : idx}(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[x.`%`.0]] ;; 5-runtime-aux.watsup def $local(state : state, localidx : localidx) : val? ;; 5-runtime-aux.watsup - def $local{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.LOCAL_frame[(x : uN(32) <: nat)] + def $local{s : store, f : frame, x : idx}(`%;%`(s, f), x) = f.LOCAL_frame[x.`%`.0] ;; 5-runtime-aux.watsup def $with_local(state : state, localidx : localidx, val : val) : state ;; 5-runtime-aux.watsup - def $with_local{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[(x : uN(32) <: nat)] = ?(v)]) + def $with_local{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[x.`%`.0] = ?(v)]) ;; 5-runtime-aux.watsup def $with_global(state : state, globalidx : globalidx, val : val) : state ;; 5-runtime-aux.watsup - def $with_global{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[(x : uN(32) <: nat)]].VALUE_globalinst = v], f) + def $with_global{s : store, f : frame, x : idx, v : val}(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x.`%`.0]].VALUE_globalinst = v], f) ;; 5-runtime-aux.watsup def $with_table(state : state, tableidx : tableidx, nat : nat, ref : ref) : state ;; 5-runtime-aux.watsup - def $with_table{s : store, f : frame, x : idx, i : nat, r : ref}(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]].ELEM_tableinst[i] = r], f) + def $with_table{s : store, f : frame, x : idx, i : nat, r : ref}(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]].ELEM_tableinst[i] = r], f) ;; 5-runtime-aux.watsup def $with_tableinst(state : state, tableidx : tableidx, tableinst : tableinst) : state ;; 5-runtime-aux.watsup - def $with_tableinst{s : store, f : frame, x : idx, ti : tableinst}(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[(x : uN(32) <: nat)]] = ti], f) + def $with_tableinst{s : store, f : frame, x : idx, ti : tableinst}(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x.`%`.0]] = ti], f) ;; 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 : uN(32) <: nat)]].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 ;; 5-runtime-aux.watsup - def $with_meminst{s : store, f : frame, x : idx, mi : meminst}(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[(x : uN(32) <: nat)]] = mi], f) + def $with_meminst{s : store, f : frame, x : idx, mi : meminst}(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x.`%`.0]] = mi], f) ;; 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 : uN(32) <: nat)]].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 : uN(32) <: nat)]].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 @@ -29874,31 +29903,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 @@ -29907,25 +29936,25 @@ syntax init = | UNSET ;; 6-typing.watsup -syntax localtype = `%%`(init, valtype) +syntax localtype = `%%`{init : init, valtype : valtype}(init : init, valtype : valtype) ;; 6-typing.watsup -syntax instrtype = `%->%*%`(resulttype, localidx*, 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 @@ -29936,7 +29965,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 : uN(32) <: nat)] = 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 @@ -29947,15 +29976,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) @@ -29978,8 +30007,8 @@ relation Heaptype_ok: `%|-%:_OK`(context, heaptype) ;; 6-typing.watsup rule typeidx{C : context, x : idx, dt : deftype}: `%|-%:_OK`(C, _IDX_heaptype(x)) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- if (C.TYPE_context[(x : uN(32) <: nat)] = dt) + -- if (x.`%`.0 < |C.TYPE_context|) + -- if (C.TYPE_context[x.`%`.0] = dt) ;; 6-typing.watsup rule rec{C : context, i : nat, st : subtype}: @@ -30019,27 +30048,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 : uN(32) <: nat) < |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 : uN(32) <: nat)] = 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) + | OK{typeidx : typeidx}(typeidx : typeidx, nat) ;; 6-typing.watsup relation Packtype_ok: `%|-%:_OK`(context, packtype) @@ -30070,16 +30099,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}: @@ -30116,7 +30145,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 @@ -30151,7 +30180,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}: @@ -30171,20 +30200,20 @@ relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) ;; 6-typing.watsup:319.1-321.52 rule typeidx-l{C : context, typeidx : typeidx, heaptype : heaptype}: `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) - -- if ((typeidx : uN(32) <: nat) < |C.TYPE_context|) - -- Heaptype_sub: `%|-%<:%`(C, (C.TYPE_context[(typeidx : uN(32) <: nat)] : deftype <: heaptype), heaptype) + -- if (typeidx.`%`.0 < |C.TYPE_context|) + -- Heaptype_sub: `%|-%<:%`(C, (C.TYPE_context[typeidx.`%`.0] : deftype <: heaptype), heaptype) ;; 6-typing.watsup:323.1-325.52 rule typeidx-r{C : context, heaptype : heaptype, typeidx : typeidx}: `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) - -- if ((typeidx : uN(32) <: nat) < |C.TYPE_context|) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, (C.TYPE_context[(typeidx : uN(32) <: nat)] : deftype <: heaptype)) + -- if (typeidx.`%`.0 < |C.TYPE_context|) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, (C.TYPE_context[typeidx.`%`.0] : deftype <: 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 (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}: @@ -30280,9 +30309,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}: @@ -30298,22 +30327,22 @@ 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 : uN(32) <: nat) < |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 : uN(32) <: nat) < (x : uN(32) <: nat)))*{y} - -- (if ($unrolldt(C.TYPE_context[(y : uN(32) <: nat)]) = 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 ;; 6-typing.watsup def $before{deftype : deftype, x : idx, i : nat}((deftype : deftype <: heaptype), x, i) = true ;; 6-typing.watsup - def $before{typeidx : typeidx, x : idx, i : nat}(_IDX_heaptype(typeidx), x, i) = ((typeidx : uN(32) <: nat) < (x : uN(32) <: nat)) + def $before{typeidx : typeidx, x : idx, i : nat}(_IDX_heaptype(typeidx), x, i) = (typeidx.`%`.0 < x.`%`.0) ;; 6-typing.watsup def $before{j : nat, x : idx, i : nat}(REC_heaptype(j), x, i) = (j < i) @@ -30322,7 +30351,7 @@ def $unrollht(context : context, heaptype : heaptype) : subtype ;; 6-typing.watsup def $unrollht{C : context, deftype : deftype}(C, (deftype : deftype <: heaptype)) = $unrolldt(deftype) ;; 6-typing.watsup - def $unrollht{C : context, typeidx : typeidx}(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[(typeidx : uN(32) <: nat)]) + def $unrollht{C : context, typeidx : typeidx}(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx.`%`.0]) ;; 6-typing.watsup def $unrollht{C : context, i : nat}(C, REC_heaptype(i)) = C.REC_context[i] @@ -30330,14 +30359,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 { @@ -30346,12 +30375,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}), OK_oktypeidxnat(x, i)) - -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidxnat(((x : uN(32) <: nat) + 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)) } @@ -30362,18 +30391,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}), OK_oktypeidx(x)) - -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(((x : uN(32) <: nat) + 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 @@ -30382,14 +30411,14 @@ 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 relation Limits_ok: `%|-%:%`(context, limits, nat) ;; 6-typing.watsup rule _{C : context, n_1 : n, n_2 : n, k : nat}: - `%|-%:%`(C, `[%..%]`(n_1, n_2), k) + `%|-%:%`(C, `[%..%]`(`%`(n_1), `%`(n_2)), k) -- if (n_1 <= n_2) -- if (n_2 <= k) @@ -30439,30 +30468,30 @@ 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}, 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 : uN(32) <: nat) < |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 : uN(32) <: nat)] = `%%`(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) ;; 6-typing.watsup rule _{C : context, n_11 : n, n_12 : n, n_21 : n, n_22 : n}: - `%|-%<:%`(C, `[%..%]`(n_11, n_12), `[%..%]`(n_21, n_22)) + `%|-%<:%`(C, `[%..%]`(`%`(n_11), `%`(n_12)), `[%..%]`(`%`(n_21), `%`(n_22))) -- if (n_11 >= n_21) -- if (n_12 <= n_22) @@ -30521,17 +30550,17 @@ 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}: `%|-%:%`(C, _IDX_blocktype(x), ft) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- where FUNC_comptype(ft) = $expanddt(C.TYPE_context[(x : uN(32) <: nat)]) + -- if (x.`%`.0 < |C.TYPE_context|) + -- where FUNC_comptype(ft) = $expanddt(C.TYPE_context[x.`%`.0]) ;; 6-typing.watsup rec { @@ -30540,739 +30569,722 @@ 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}: - `%|-%:%`(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}), `%->%`(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})) - -- if ((l : uN(32) <: nat) < |C.LABEL_context|) - -- where t*{t} = C.LABEL_context[(l : uN(32) <: nat)] + `%|-%:%`(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] ;; 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 ((l : uN(32) <: nat) < |C.LABEL_context|) - -- where t*{t} = C.LABEL_context[(l : uN(32) <: nat)] + `%|-%:%`(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] ;; 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 : uN(32) <: nat) < |C.LABEL_context|))*{l} - -- if ((l' : uN(32) <: nat) < |C.LABEL_context|) - -- (Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[(l : uN(32) <: nat)]))*{l} - -- Resulttype_sub: `%|-%*_<:%*`(C, t*{t}, C.LABEL_context[(l' : uN(32) <: nat)]) + `%|-%:%`(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].`%`.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} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if ((l : uN(32) <: nat) < |C.LABEL_context|) + `%|-%:%`(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 : uN(32) <: nat)] + -- 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})) - -- if ((l : uN(32) <: nat) < |C.LABEL_context|) - -- where t*{t} :: [REF_valtype(`NULL%?`(?()), ht)] = C.LABEL_context[(l : uN(32) <: nat)] + `%|-%:%`(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] -- 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 ((l : uN(32) <: nat) < |C.LABEL_context|) + `%|-%:%`(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 : uN(32) <: nat)] + -- 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)])) - -- if ((l : uN(32) <: nat) < |C.LABEL_context|) + `%|-%:%`(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 : uN(32) <: nat)] + -- 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})) - -- if ((x : uN(32) <: nat) < |C.FUNC_context|) - -- where FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2})) = $expanddt(C.FUNC_context[(x : uN(32) <: nat)]) + `%|-%:%`(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]) ;; 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})) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- where FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2})) = $expanddt(C.TYPE_context[(x : uN(32) <: nat)]) + `%|-%:%`(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]) ;; 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})) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) - -- if ((y : uN(32) <: nat) < |C.TYPE_context|) - -- where `%%`(lim, rt) = C.TABLE_context[(x : uN(32) <: nat)] - -- where FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2})) = $expanddt(C.TYPE_context[(y : uN(32) <: nat)]) + `%|-%:%`(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]) -- 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})) - -- if ((x : uN(32) <: nat) < |C.FUNC_context|) - -- where FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2})) = $expanddt(C.FUNC_context[(x : uN(32) <: nat)]) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) + `%|-%:%`(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}))) ;; 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})) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- where FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2})) = $expanddt(C.TYPE_context[(x : uN(32) <: nat)]) - -- Resulttype_sub: `%|-%*_<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - -- if (C.RETURN_context = ?(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}))) + -- 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}))) ;; 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})) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) - -- if ((y : uN(32) <: nat) < |C.TYPE_context|) - -- where `%%`(lim, rt) = C.TABLE_context[(x : uN(32) <: nat)] - -- where FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2})) = $expanddt(C.TYPE_context[(y : uN(32) <: nat)]) + `%|-%:%`(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]) -- 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)}: - `%|-%:%`(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, o0 : nat, o1 : nat}: - `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([(nt_2 : numtype <: valtype)], [(nt_1 : numtype <: valtype)])) + 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)]))) -- if (nt_1 =/= nt_2) - -- where ?(o1) = $size((nt_2 : numtype <: valtype)) - -- where o0 = o1 - -- if ($size((nt_1 : numtype <: valtype)) = ?(o0)) + -- 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?, o0 : nat, o1 : nat}: - `%|-%:%`(C, CVTOP_instr((inn_1 : inn <: numtype), CONVERT_cvtop, (inn_2 : inn <: numtype), sx?{sx}), `%->%`([(inn_2 : inn <: valtype)], [(inn_1 : inn <: valtype)])) + 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)]))) -- if (inn_1 =/= inn_2) - -- where ?(o0) = $size((inn_1 : inn <: valtype)) - -- where ?(o1) = $size((inn_2 : inn <: valtype)) - -- if ((sx?{sx} = ?()) <=> (o0 > o1)) + -- 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))])) - -- if ((x : uN(32) <: nat) < |C.FUNC_context|) - -- where dt = C.FUNC_context[(x : uN(32) <: nat)] + `%|-%:%`(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}, [REF_valtype(`NULL%?`(?()), ($idx(x) : typevar <: heaptype))])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- where STRUCT_comptype(`%%`(mut, zt)*{mut zt}) = $expanddt(C.TYPE_context[(x : uN(32) <: nat)]) - -- if (|mut*{mut}| = |zt*{zt}|) + `%|-%:%`(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]) + -- 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))])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- where STRUCT_comptype(`%%`(mut, zt)*{mut zt}) = $expanddt(C.TYPE_context[(x : uN(32) <: nat)]) - -- if (|mut*{mut}| = |zt*{zt}|) - -- (where ?(val) = $default($unpack(zt)))*{val zt} - -- if (|val*{val}| = |zt*{zt}|) + `%|-%:%`(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]) + -- 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)])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- where STRUCT_comptype(yt*{yt}) = $expanddt(C.TYPE_context[(x : uN(32) <: nat)]) - -- if (i < |yt*{yt}|) - -- where `%%`(mut, zt) = yt*{yt}[i] - -- 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)]))) + -- if (x.`%`.0 < |C.TYPE_context|) + -- 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 : uN(32) <: nat) < |C.TYPE_context|) - -- where STRUCT_comptype(yt*{yt}) = $expanddt(C.TYPE_context[(x : uN(32) <: nat)]) - -- if (i < |yt*{yt}|) - -- where `%%`(`MUT%?`(?(())), zt) = yt*{yt}[i] + `%|-%:%`(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]) + -- 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))])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt(C.TYPE_context[(x : uN(32) <: nat)]) + `%|-%:%`(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))])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt(C.TYPE_context[(x : uN(32) <: nat)]) + `%|-%:%`(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))])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt(C.TYPE_context[(x : uN(32) <: nat)]) + `%|-%:%`(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))])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- if ((y : uN(32) <: nat) < |C.ELEM_context|) - -- where ARRAY_comptype(`%%`(mut, (rt : reftype <: storagetype))) = $expanddt(C.TYPE_context[(x : uN(32) <: nat)]) - -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[(y : uN(32) <: nat)], rt) + `%|-%:%`(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]) + -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y.`%`.0], rt) ;; 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))])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- if ((y : uN(32) <: nat) < |C.DATA_context|) - -- if (C.DATA_context[(y : uN(32) <: nat)] = OK) - -- where ARRAY_comptype(`%%`(mut, (t : valtype <: storagetype))) = $expanddt(C.TYPE_context[(x : uN(32) <: nat)]) + `%|-%:%`(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) + -- where ARRAY_comptype(`%%`(mut, (t : valtype <: storagetype))) = $expanddt(C.TYPE_context[x.`%`.0]) -- where (numtype : numtype <: valtype) = t ;; 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))])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- if ((y : uN(32) <: nat) < |C.DATA_context|) - -- if (C.DATA_context[(y : uN(32) <: nat)] = OK) - -- where ARRAY_comptype(`%%`(mut, (t : valtype <: storagetype))) = $expanddt(C.TYPE_context[(x : uN(32) <: nat)]) + `%|-%:%`(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) + -- where ARRAY_comptype(`%%`(mut, (t : valtype <: storagetype))) = $expanddt(C.TYPE_context[x.`%`.0]) -- where (vectype : vectype <: valtype) = t ;; 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)])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- where ARRAY_comptype(`%%`(mut, zt)) = $expanddt(C.TYPE_context[(x : uN(32) <: nat)]) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpack(zt) : valtype <: storagetype))) + `%|-%:%`(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)], [])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- where ARRAY_comptype(`%%`(`MUT%?`(?(())), zt)) = $expanddt(C.TYPE_context[(x : uN(32) <: nat)]) + `%|-%:%`(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])) - -- where $expanddt(C.TYPE_context[(x : uN(32) <: nat)]) = ARRAY_comptype(`%%`(`MUT%?`(?(())), zt)) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) + `%|-%:%`(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], [])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- where ARRAY_comptype(`%%`(`MUT%?`(?(())), zt)) = $expanddt(C.TYPE_context[(x : uN(32) <: nat)]) + `%|-%:%`(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], [])) - -- if ((x_1 : uN(32) <: nat) < |C.TYPE_context|) - -- if ((x_2 : uN(32) <: nat) < |C.TYPE_context|) - -- where ARRAY_comptype(`%%`(mut, zt_2)) = $expanddt(C.TYPE_context[(x_2 : uN(32) <: nat)]) + `%|-%:%`(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]) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) - -- if ($expanddt(C.TYPE_context[(x_1 : uN(32) <: nat)]) = ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) + -- if ($expanddt(C.TYPE_context[x_1.`%`.0]) = ARRAY_comptype(`%%`(`MUT%?`(?(())), 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], [])) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- if ((y : uN(32) <: nat) < |C.ELEM_context|) - -- Storagetype_sub: `%|-%<:%`(C, (C.ELEM_context[(y : uN(32) <: nat)] : reftype <: storagetype), zt) - -- if ($expanddt(C.TYPE_context[(x : uN(32) <: nat)]) = ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + `%|-%:%`(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) + -- if ($expanddt(C.TYPE_context[x.`%`.0]) = ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 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], [])) - -- if ((y : uN(32) <: nat) < |C.DATA_context|) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- if (C.DATA_context[(y : uN(32) <: nat)] = OK) + `%|-%:%`(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) -- where (numtype : numtype <: valtype) = t - -- if ($expanddt(C.TYPE_context[(x : uN(32) <: nat)]) = ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- if ($expanddt(C.TYPE_context[x.`%`.0]) = ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 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], [])) - -- if ((y : uN(32) <: nat) < |C.DATA_context|) - -- if ((x : uN(32) <: nat) < |C.TYPE_context|) - -- if (C.DATA_context[(y : uN(32) <: nat)] = OK) + `%|-%:%`(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) -- where t = (vectype : vectype <: valtype) - -- if ($expanddt(C.TYPE_context[(x : uN(32) <: nat)]) = ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- if ($expanddt(C.TYPE_context[x.`%`.0]) = ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) ;; 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}), `%->%`([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}: - `%|-%:%`(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}, 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}, 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}: - `%|-%:%`(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])) - -- if ((x : uN(32) <: nat) < |C.LOCAL_context|) - -- where `%%`(init, t) = C.LOCAL_context[(x : uN(32) <: nat)] + `%|-%:%`(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])) - -- if ((x : uN(32) <: nat) < |C.GLOBAL_context|) - -- where `%%`(mut, t) = C.GLOBAL_context[(x : uN(32) <: nat)] + `%|-%:%`(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], [])) - -- if ((x : uN(32) <: nat) < |C.GLOBAL_context|) - -- where `%%`(`MUT%?`(?(())), t) = C.GLOBAL_context[(x : uN(32) <: nat)] + `%|-%:%`(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)])) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) - -- where `%%`(lim, rt) = C.TABLE_context[(x : uN(32) <: nat)] + `%|-%:%`(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)], [])) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) - -- where `%%`(lim, rt) = C.TABLE_context[(x : uN(32) <: nat)] + `%|-%:%`(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])) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) - -- where tt = C.TABLE_context[(x : uN(32) <: nat)] + `%|-%:%`(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])) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) - -- where `%%`(lim, rt) = C.TABLE_context[(x : uN(32) <: nat)] + `%|-%:%`(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], [])) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) - -- where `%%`(lim, rt) = C.TABLE_context[(x : uN(32) <: nat)] + `%|-%:%`(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], [])) - -- if ((x_1 : uN(32) <: nat) < |C.TABLE_context|) - -- if ((x_2 : uN(32) <: nat) < |C.TABLE_context|) - -- where `%%`(lim_1, rt_1) = C.TABLE_context[(x_1 : uN(32) <: nat)] - -- where `%%`(lim_2, rt_2) = C.TABLE_context[(x_2 : uN(32) <: nat)] + `%|-%:%`(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] + -- where `%%`(lim_2, rt_2) = C.TABLE_context[x_2.`%`.0] -- 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], [])) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) - -- if ((y : uN(32) <: nat) < |C.ELEM_context|) - -- where rt_2 = C.ELEM_context[(y : uN(32) <: nat)] - -- where `%%`(lim, rt_1) = C.TABLE_context[(x : uN(32) <: nat)] + `%|-%:%`(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] + -- where `%%`(lim, rt_1) = C.TABLE_context[x.`%`.0] -- 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), `%->%`([], [])) - -- if ((x : uN(32) <: nat) < |C.ELEM_context|) - -- where rt = C.ELEM_context[(x : uN(32) <: nat)] + `%|-%:%`(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])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- where mt = C.MEM_context[(x : uN(32) <: nat)] + `%|-%:%`(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])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- where mt = C.MEM_context[(x : uN(32) <: nat)] + `%|-%:%`(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], [])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- where mt = C.MEM_context[(x : uN(32) <: nat)] + `%|-%:%`(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], [])) - -- if ((x_1 : uN(32) <: nat) < |C.MEM_context|) - -- if ((x_2 : uN(32) <: nat) < |C.MEM_context|) - -- where mt_1 = C.MEM_context[(x_1 : uN(32) <: nat)] - -- where mt_2 = C.MEM_context[(x_2 : uN(32) <: nat)] + `%|-%:%`(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] + -- where mt_2 = C.MEM_context[x_2.`%`.0] ;; 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], [])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- if ((y : uN(32) <: nat) < |C.DATA_context|) - -- if (C.DATA_context[(y : uN(32) <: nat)] = OK) - -- where mt = C.MEM_context[(x : uN(32) <: nat)] + `%|-%:%`(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) + -- where mt = C.MEM_context[x.`%`.0] ;; 6-typing.watsup:1007.1-1009.23 rule data.drop{C : context, x : idx}: - `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) - -- if ((x : uN(32) <: nat) < |C.DATA_context|) - -- if (C.DATA_context[(x : uN(32) <: nat)] = OK) + `%|-%:%`(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, o0 : nat, o1? : nat?}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- if ((n?{n} = ?()) <=> (sx?{sx} = ?())) - -- if (n?{n} = ?()) - -- where mt = C.MEM_context[(x : uN(32) <: nat)] - -- where ?(o0) = $size((nt : numtype <: valtype)) - -- (where ?(o1) = $size((nt : numtype <: valtype)))?{o1} - -- if ((n?{n} = ?()) <=> (o1?{o1} = ?())) - -- if ((2 ^ n_A) <= (o0 / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} + 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)]))) + -- if (x.`%`.0 < |C.MEM_context|) + -- 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 : 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, o0 : nat, o1? : nat?}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [(nt : numtype <: valtype)])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- if ((n?{n} = ?()) <=> (sx?{sx} = ?())) + 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)]))) + -- if (x.`%`.0 < |C.MEM_context|) + -- 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 : nat} -- where (inn : inn <: numtype) = nt - -- where mt = C.MEM_context[(x : uN(32) <: nat)] - -- where ?(o0) = $size((nt : numtype <: valtype)) - -- (where ?(o1) = $size((nt : numtype <: valtype)))?{o1} - -- if ((n?{n} = ?()) <=> (o1?{o1} = ?())) - -- if ((2 ^ n_A) <= (o0 / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} + -- 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, o0 : nat, o1? : nat?}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- if (n?{n} = ?()) - -- where mt = C.MEM_context[(x : uN(32) <: nat)] - -- where ?(o0) = $size((nt : numtype <: valtype)) - -- (where ?(o1) = $size((nt : numtype <: valtype)))?{o1} - -- if ((n?{n} = ?()) <=> (o1?{o1} = ?())) - -- if ((2 ^ n_A) <= (o0 / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} + 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)]), `%`([]))) + -- 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} + -- 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, o0 : nat, o1? : nat?}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype (nt : numtype <: valtype)], [])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) + 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)]), `%`([]))) + -- 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} -- where (inn : inn <: numtype) = nt - -- where mt = C.MEM_context[(x : uN(32) <: nat)] - -- where ?(o0) = $size((nt : numtype <: valtype)) - -- (where ?(o1) = $size((nt : numtype <: valtype)))?{o1} - -- if ((n?{n} = ?()) <=> (o1?{o1} = ?())) - -- if ((2 ^ n_A) <= (o0 / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} + -- where mt = C.MEM_context[x.`%`.0] ;; 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])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) + `%|-%:%`(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 : uN(32) <: nat)] + -- 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])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) + `%|-%:%`(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 : uN(32) <: nat)] + -- 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])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) + `%|-%:%`(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 : uN(32) <: nat)] + -- 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])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) + `%|-%:%`(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 : uN(8) <: nat) < (128 / n)) - -- where mt = C.MEM_context[(x : uN(32) <: nat)] + -- if (laneidx.`%`.0 < (128 / n)) + -- where mt = C.MEM_context[x.`%`.0] - ;; 6-typing.watsup:1046.1-1049.36 - rule vstore{C : context, x : idx, n_A : n, n_O : n, mt : memtype, o0 : nat}: - `%|-%:%`(C, VSTORE_instr(x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype V128_valtype], [])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- where mt = C.MEM_context[(x : uN(32) <: nat)] - -- where ?(o0) = $size(V128_valtype) - -- if ((2 ^ n_A) <= (o0 / 8)) + ;; 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]), `%`([]))) + -- 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], [])) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) + `%|-%:%`(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 : uN(8) <: nat) < (128 / n)) - -- where mt = C.MEM_context[(x : uN(32) <: nat)] + -- if (laneidx.`%`.0 < (128 / n)) + -- where mt = C.MEM_context[x.`%`.0] ;; 6-typing.watsup:504.1-504.67 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}: - `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) - -- if ((x : uN(32) <: nat) < |C.LOCAL_context|) - -- where `%%`(init, t) = C.LOCAL_context[(x : uN(32) <: nat)] + `%|-%:%`(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])) - -- if ((x : uN(32) <: nat) < |C.LOCAL_context|) - -- where `%%`(init, t) = C.LOCAL_context[(x : uN(32) <: nat)] + `%|-%:%`(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}, `%->%*%`(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 : uN(32) <: nat) < |C.LOCAL_context|))*{init t x_1} - -- (if (C.LOCAL_context[(x_1 : uN(32) <: nat)] = `%%`(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}))) + -- 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} + -- 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 { @@ -31282,7 +31294,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 @@ -31293,7 +31305,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 @@ -31317,8 +31329,8 @@ relation Instr_const: `%|-%CONST`(context, instr) ;; 6-typing.watsup rule global.get{C : context, x : idx, t : valtype}: `%|-%CONST`(C, GLOBAL.GET_instr(x)) - -- if ((x : uN(32) <: nat) < |C.GLOBAL_context|) - -- if (C.GLOBAL_context[(x : uN(32) <: nat)] = `%%`(`MUT%?`(?()), t)) + -- if (x.`%`.0 < |C.GLOBAL_context|) + -- if (C.GLOBAL_context[x.`%`.0] = `%%`(`MUT%?`(?()), t)) ;; 6-typing.watsup rule binop{C : context, inn : inn, binop : binop_((inn : inn <: numtype))}: @@ -31330,25 +31342,25 @@ 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) ;; 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}) - -- if (x = |C.TYPE_context|) - -- if (dt*{dt} = $rolldt(x, rectype)) - -- Rectype_ok: `%|-%:%`(C[TYPE_context =.. dt*{dt}], rectype, OK_oktypeidx(x)) + `%|-%:%`(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 relation Local_ok: `%|-%:%`(context, local, localtype) @@ -31366,12 +31378,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 : uN(32) <: nat)]) - -- if ((x : uN(32) <: nat) < |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 : uN(32) <: nat)]) - -- 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}) + `%|-%:%`(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]) + -- 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) @@ -31403,9 +31415,9 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) ;; 6-typing.watsup rule active{C : context, x : idx, expr : expr, rt : reftype, lim : limits}: `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) + -- if (x.`%`.0 < |C.TABLE_context|) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} - -- where `%%`(lim, rt) = C.TABLE_context[(x : uN(32) <: nat)] + -- where `%%`(lim, rt) = C.TABLE_context[x.`%`.0] ;; 6-typing.watsup rule passive{C : context, rt : reftype}: @@ -31419,8 +31431,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 @@ -31428,8 +31440,8 @@ relation Datamode_ok: `%|-%:_OK`(context, datamode) ;; 6-typing.watsup rule active{C : context, x : idx, expr : expr, mt : memtype}: `%|-%:_OK`(C, ACTIVE_datamode(x, expr)) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- if (C.MEM_context[(x : uN(32) <: nat)] = mt) + -- if (x.`%`.0 < |C.MEM_context|) + -- if (C.MEM_context[x.`%`.0] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} ;; 6-typing.watsup @@ -31440,7 +31452,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 @@ -31448,8 +31460,8 @@ relation Start_ok: `%|-%:_OK`(context, start) ;; 6-typing.watsup rule _{C : context, x : idx}: `%|-%:_OK`(C, START(x)) - -- if ((x : uN(32) <: nat) < |C.FUNC_context|) - -- Expand: `%~~%`(C.FUNC_context[(x : uN(32) <: nat)], FUNC_comptype(`%->%`([], []))) + -- if (x.`%`.0 < |C.FUNC_context|) + -- Expand: `%~~%`(C.FUNC_context[x.`%`.0], FUNC_comptype(`%->%`(`%`([]), `%`([])))) ;; 6-typing.watsup relation Import_ok: `%|-%:%`(context, import, externtype) @@ -31463,26 +31475,26 @@ relation Externidx_ok: `%|-%:%`(context, externidx, externtype) ;; 6-typing.watsup rule func{C : context, x : idx, dt : deftype}: `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) - -- if ((x : uN(32) <: nat) < |C.FUNC_context|) - -- where dt = C.FUNC_context[(x : uN(32) <: nat)] + -- if (x.`%`.0 < |C.FUNC_context|) + -- where dt = C.FUNC_context[x.`%`.0] ;; 6-typing.watsup rule global{C : context, x : idx, gt : globaltype}: `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) - -- if ((x : uN(32) <: nat) < |C.GLOBAL_context|) - -- where gt = C.GLOBAL_context[(x : uN(32) <: nat)] + -- if (x.`%`.0 < |C.GLOBAL_context|) + -- where gt = C.GLOBAL_context[x.`%`.0] ;; 6-typing.watsup rule table{C : context, x : idx, tt : tabletype}: `%|-%:%`(C, TABLE_externidx(x), TABLE_externtype(tt)) - -- if ((x : uN(32) <: nat) < |C.TABLE_context|) - -- where tt = C.TABLE_context[(x : uN(32) <: nat)] + -- if (x.`%`.0 < |C.TABLE_context|) + -- where tt = C.TABLE_context[x.`%`.0] ;; 6-typing.watsup rule mem{C : context, x : idx, mt : memtype}: `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) - -- if ((x : uN(32) <: nat) < |C.MEM_context|) - -- where mt = C.MEM_context[(x : uN(32) <: nat)] + -- if (x.`%`.0 < |C.MEM_context|) + -- where mt = C.MEM_context[x.`%`.0] ;; 6-typing.watsup relation Export_ok: `%|-%:%`(context, export, externtype) @@ -31495,61 +31507,61 @@ 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}) + `%|-%:%`(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 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}, dt_1*{} :: dt*{dt}) - -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) - -- Types_ok: `%|-%*_:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, 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 : 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) @@ -31559,7 +31571,7 @@ relation Ref_ok: `%|-%:%`(store, ref, reftype) ;; 7-runtime-typing.watsup rule i31{s : store, i : nat}: - `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) + `%|-%:%`(s, REF.I31_NUM_ref(`%`(i)), REF_reftype(`NULL%?`(?()), I31_heaptype)) ;; 7-runtime-typing.watsup rule struct{s : store, a : addr, dt : deftype}: @@ -31588,545 +31600,544 @@ 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}?{t})], [(val_1 : val <: admininstr)]) - -- if (c =/= 0) + `%~>%`([(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)]) - -- if (c = 0) + `%~>%`([(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})]) - -- if (c =/= 0) + `%~>%`([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})]) - -- if (c = 0) + `%~>%`([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 : uN(32) <: nat) + 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}: - `%*_~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) - -- if (c =/= 0) + `%~>%`([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)], []) - -- if (c = 0) + `%~>%`([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}, 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}: - `%*_~>%*`([(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 <: 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)}: - `%*_~>%*`([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})], [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}: - `%*_~>%*`([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), o0 : N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VVTESTOP_admininstr(V128_vectype, ANY_TRUE_vvtestop)], [CONST_admininstr(I32_numtype, c)]) - -- where ?(o0) = $size(V128_valtype) - -- where c = $ine(o0, c_1, 0) + 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)]) + -- where c = $ine($vsize(V128_vectype), c_1, `%`(0)) ;; 8-reduction.watsup - rule vswizzle{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), pnn : pnn, N : N, c' : vec_(V128_vnn), c : iN($lsize((pnn : pnn <: lanetype))), ci* : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), N)))*, k^N : nat^N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((pnn : pnn <: imm), N))], [VCONST_admininstr(V128_vectype, c')]) - -- where c*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_1) :: 0^(256 - N){} - -- where ci*{ci} = $lanes_(`%X%`((pnn : pnn <: lanetype), N), c_2) - -- (if ((ci*{ci}[k] : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), N))) <: nat) < |c*{}|))^(k%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSWIZZLE_admininstr(`%X%`((pnn : pnn <: imm), `%`(N)))], [VCONST_admininstr(V128_vectype, c')]) + -- where c*{} = $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_1) :: `%`(0)^(256 - N){} + -- where ci*{ci : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), `%`(N))))} = $lanes_(`%X%`((pnn : pnn <: lanetype), `%`(N)), c_2) + -- (if (ci*{ci : lane_($lanetype(`%X%`((pnn : pnn <: lanetype), `%`(N))))}[k].`%`.0 < |c*{}|))^(k%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VSHUFFLE_admininstr(`%X%`((pnn : pnn <: 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%`((pnn : pnn <: imm), `%`(N)), `%`(i)*{i : nat})], [VCONST_admininstr(V128_vectype, c)]) + -- (if (k < |i*{i : nat}|))^(k%*`([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{}) + `%~>%`([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)]) - -- if (i < |$lanes_(`%X%`((nt : numtype <: lanetype), N), c_1)|) - -- where c_2 = $lanes_(`%X%`((nt : numtype <: lanetype), N), c_1)[i] + `%~>%`([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)]) - -- 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]) + `%~>%`([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)]) - -- where c = $invlanes_(`%X%`(lnn, N), $lanes_(`%X%`(lnn, N), c_1)[[i] = $packnum(lnn, c_2)]) + `%~>%`([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)]) - -- 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'}) + 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' : 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), imm : imm, N : N, ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), N)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), N), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), N)))], [CONST_admininstr(I32_numtype, 1)]) - -- where ci_1*{ci_1} = $lanes_(`%X%`((imm : imm <: lanetype), N), c) - -- (if (ci_1 =/= (0 : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), N))))))*{ci_1} + rule vtestop-true{c : vec_(V128_vnn), imm : imm, N : N, ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(1))]) + -- where ci_1*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c) + -- (if (ci_1 =/= `%`(0)))*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} ;; 8-reduction.watsup rule vtestop-false{c : vec_(V128_vnn), imm : imm, N : N}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), N), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), N)))], [CONST_admininstr(I32_numtype, 0)]) + `%~>%`([VCONST_admininstr(V128_vectype, c) VTESTOP_admininstr(`%X%`((imm : imm <: lanetype), `%`(N)), ALL_TRUE_vtestop_(`%X%`((imm : imm <: lanetype), `%`(N))))], [CONST_admininstr(I32_numtype, `%`(0))]) -- otherwise ;; 8-reduction.watsup - rule vbitmask{c : vec_(V128_vnn), imm : imm, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), N)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`(imm, N))], [CONST_admininstr(I32_numtype, ci)]) - -- where ci_1*{ci_1} = $lanes_(`%X%`((imm : imm <: lanetype), N), c) - -- where $ibits(32, ci) = $ilt($lsize((imm : imm <: lanetype)), S_sx, ci_1, 0)*{ci_1} + rule vbitmask{c : vec_(V128_vnn), imm : imm, N : N, ci : num_(I32_numtype), ci_1* : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c) VBITMASK_admininstr(`%X%`(imm, `%`(N)))], [CONST_admininstr(I32_numtype, ci)]) + -- where ci_1*{ci_1 : lane_($lanetype(`%X%`((imm : imm <: lanetype), `%`(N))))} = $lanes_(`%X%`((imm : imm <: lanetype), `%`(N)), c) + -- where $ibits(32, ci) = `%`($ilt($lsize((imm : imm <: lanetype)), S_sx, ci_1, `%`(0)).`%`.0)*{ci_1 : iN($lsize((imm : imm <: lanetype)))} ;; 8-reduction.watsup - rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*, ci_2* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*, cj_1* : iN($lsize((imm_2 : imm <: lanetype)))*, cj_2* : iN($lsize((imm_2 : imm <: lanetype)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`(imm_1, N_1), `%X%`(imm_2, N_2), sx)], [VCONST_admininstr(V128_vectype, c)]) - -- where ci_1*{ci_1} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_1) - -- where ci_2*{ci_2} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_2) - -- where cj_1*{cj_1} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_1)*{ci_1} - -- where cj_2*{cj_2} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_2)*{ci_2} - -- where c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), N_2), cj_1*{cj_1} :: cj_2*{cj_2}) + rule vnarrow{c_1 : vec_(V128_vnn), c_2 : vec_(V128_vnn), imm_1 : imm, N_1 : N, imm_2 : imm, N_2 : N, sx : sx, c : vec_(V128_vnn), ci_1* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*, ci_2* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*, cj_1* : iN($lsize((imm_2 : imm <: lanetype)))*, cj_2* : iN($lsize((imm_2 : imm <: lanetype)))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCONST_admininstr(V128_vectype, c_2) VNARROW_admininstr(`%X%`(imm_1, `%`(N_1)), `%X%`(imm_2, `%`(N_2)), sx)], [VCONST_admininstr(V128_vectype, c)]) + -- where ci_1*{ci_1 : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_1) + -- where ci_2*{ci_2 : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_2) + -- where cj_1*{cj_1 : iN($lsize((imm_2 : imm <: lanetype)))} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_1)*{ci_1 : iN($lsize((imm_1 : imm <: lanetype)))} + -- where cj_2*{cj_2 : iN($lsize((imm_2 : imm <: lanetype)))} = $narrow($lsize((imm_1 : imm <: lanetype)), $lsize((imm_2 : imm <: lanetype)), sx, ci_2)*{ci_2 : iN($lsize((imm_1 : imm <: lanetype)))} + -- where c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), cj_1*{cj_1 : lane_($lanetype(`%X%`((imm_2 : imm <: lanetype), `%`(N_2))))} :: cj_2*{cj_2 : lane_($lanetype(`%X%`((imm_2 : imm <: 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'}) + 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' : 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), imm_2 : imm, N_2 : N, vcvtop : vcvtop, hf : half, imm_1 : imm, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), N_1)))*}: - `%*_~>%*`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((imm_2 : imm <: lanetype), N_2), vcvtop, ?(hf), `%X%`((imm_1 : imm <: lanetype), N_1), sx?{sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) - -- where ci*{ci} = $lanes_(`%X%`((imm_1 : imm <: lanetype), N_1), c_1)[$halfop(hf, 0, N_2) : N_2] - -- where c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), N_2), $vcvtop(`%X%`((imm_1 : imm <: lanetype), N_1), `%X%`((imm_2 : imm <: lanetype), N_2), vcvtop, sx?{sx}, ci)*{ci}) + rule vcvtop-half{c_1 : vec_(V128_vnn), imm_2 : imm, N_2 : N, vcvtop : vcvtop, hf : half, imm_1 : imm, N_1 : N, sx? : sx?, c : vec_(V128_vnn), ci* : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))*}: + `%~>%`([VCONST_admininstr(V128_vectype, c_1) VCVTOP_admininstr(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), vcvtop, ?(hf), `%X%`((imm_1 : imm <: lanetype), `%`(N_1)), sx?{sx : sx}, `ZERO%?`(?()))], [VCONST_admininstr(V128_vectype, c)]) + -- where ci*{ci : lane_($lanetype(`%X%`((imm_1 : imm <: lanetype), `%`(N_1))))} = $lanes_(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), c_1)[$halfop(hf, 0, N_2) : N_2] + -- where c = $invlanes_(`%X%`((imm_2 : imm <: lanetype), `%`(N_2)), $vcvtop(`%X%`((imm_1 : imm <: lanetype), `%`(N_1)), `%X%`((imm_2 : imm <: lanetype), `%`(N_2)), vcvtop, sx?{sx : sx}, ci)*{ci : lane_($lanetype(`%X%`((imm_1 : imm <: 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 : nat <: lane_($lanetype(`%X%`((inn_2 : inn <: lanetype), N_2))))^N_1{}) + 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)]) + -- 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} :: [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}: - `%~>%*`(`%;%*`(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 : uN(32) <: nat)]) CALL_REF_admininstr(?())]) - -- if ((x : uN(32) <: nat) < |$funcaddr(z)|) + `%~>%`(`%;%`(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})]), [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}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[(x : uN(32) <: nat)]) RETURN_CALL_REF_admininstr(?())]) - -- if ((x : uN(32) <: nat) < |$funcaddr(z)|) + `%~>%`(`%;%`(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'}, (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}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[(x : uN(32) <: nat)])]) - -- if ((x : uN(32) <: nat) < |$funcaddr(z)|) + `%~>%`(`%;%`(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} :: [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}: - `%~>%*`(`%;%*`(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} :: [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}: - `%~>%*`(`%;%*`(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} :: [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] @@ -32134,129 +32145,129 @@ 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}, 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}: - `%~>%*`(`%;%*`(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) @@ -32265,7 +32276,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)] @@ -32274,247 +32285,239 @@ 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, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) - -- where ?(o0) = $size((nt : numtype <: valtype)) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + 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]) + -- 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), o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) - -- where ?(o0) = $size((nt : numtype <: valtype)) - -- where $nbytes(nt, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (o0 / 8)] + 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)]) + -- 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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (n / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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), o0 : N}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr((inn : inn <: numtype), ?((n, sx)), x, mo)]), [CONST_admininstr((inn : inn <: numtype), $ext(n, o0, sx, c))]) - -- where ?(o0) = $size((inn : inn <: valtype)) - -- where $ibytes(n, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (n / 8)] + 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))]) + -- 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, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VLOAD_admininstr(?(), x, mo)]), [TRAP_admininstr]) - -- where ?(o0) = $size(V128_valtype) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + rule vload-oob{z : state, i : nat, x : idx, mo : memop}: + `%~>%`(`%;%`(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), o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VLOAD_admininstr(?(), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) - -- where ?(o0) = $size(V128_valtype) - -- where $vbytes(V128_vectype, c) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (o0 / 8)] + 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)]) + -- 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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + ((M * N) / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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, o0 : nat, o1^N : N^N}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VLOAD_admininstr(?(SHAPE_vloadop(M, N, sx)), x, mo)]), [VCONST_admininstr(V128_vectype, c)]) - -- where o0 = (M * 2) - -- (where $ibytes(M, j) = $mem(z, x).DATA_meminst[((i + (mo.OFFSET_memop : uN(32) <: nat)) + ((k * M) / 8)) : (M / 8)])^(k%`(`%;%`(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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 : uN(32) <: nat)) : (N / 8)] - -- where c = $invlanes_(`%X%`((imm : imm <: lanetype), M), (j : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), M))))^M{}) + -- where $ibytes(N, `%`(j)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)] + -- where c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(M)), `%`(j)^M{}) ;; 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]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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)]) - -- where $ibytes(N, j) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)] - -- where c = $ext(N, 128, U_sx, j) + `%~>%`(`%;%`(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, c_1 : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, j)]), [TRAP_admininstr]) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (N / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, 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, c_1 : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, c : vec_(V128_vnn), k : nat, imm : imm, M : M, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, j)]), [VCONST_admininstr(V128_vectype, c)]) - -- where ?(o0) = $size(V128_valtype) + rule vload_lane-val{z : state, i : nat, c_1 : vec_(V128_vnn), N : N, x : idx, mo : memop, j : nat, c : vec_(V128_vnn), k : nat, imm : imm, M : M}: + `%~>%`(`%;%`(z, [CONST_admininstr(I32_numtype, `%`(i)) VCONST_admininstr(V128_vectype, c_1) VLOAD_LANE_admininstr(N, x, mo, `%`(j))]), [VCONST_admininstr(V128_vectype, c)]) + -- where M = ($vsize(V128_vectype) / N) -- where $lsize((imm : imm <: lanetype)) = N - -- where $ibytes(N, k) = $mem(z, x).DATA_meminst[(i + (mo.OFFSET_memop : uN(32) <: nat)) : (N / 8)] - -- where M = (o0 / N) - -- where c = $invlanes_(`%X%`((imm : imm <: lanetype), M), $lanes_(`%X%`((imm : imm <: lanetype), M), c_1)[[j] = (k : nat <: lane_($lanetype(`%X%`((imm : imm <: lanetype), M))))]) + -- where $ibytes(N, `%`(k)) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop.`%`.0) : (N / 8)] + -- where c = $invlanes_(`%X%`((imm : imm <: lanetype), `%`(M)), $lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c_1)[[j] = `%`(k)]) ;; 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]) 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|) @@ -32522,149 +32525,144 @@ 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}), `%;%*`(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}: - `%~>%`(`%;%*`(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 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}: - `%~>%`(`%;%*`(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, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- where ?(o0) = $size((nt : numtype <: valtype)) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + 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])) + -- 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*, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + (mo.OFFSET_memop : uN(32) <: nat)), (o0 / 8), b*{b}), [])) - -- where b*{b} = $nbytes(nt, c) - -- where ?(o0) = $size((nt : numtype <: valtype)) + 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}), [])) + -- 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])) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (n / 8)) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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*, o0 : M}: - `%~>%`(`%;%*`(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 : uN(32) <: nat)), (n / 8), b*{b}), [])) - -- where ?(o0) = $size((inn : inn <: valtype)) - -- where b*{b} = $ibytes(n, $wrap(o0, n, c)) + 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}), [])) + -- 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, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- where ?(o0) = $size(V128_valtype) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + 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])) + -- 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*, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) VCONST_admininstr(V128_vectype, c) VSTORE_admininstr(x, mo)]), `%;%*`($with_mem(z, x, (i + (mo.OFFSET_memop : uN(32) <: nat)), (o0 / 8), b*{b}), [])) - -- where b*{b} = $vbytes(V128_vectype, c) - -- where ?(o0) = $size(V128_valtype) + 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}), [])) + -- 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])) - -- if (((i + (mo.OFFSET_memop : uN(32) <: nat)) + N) > |$mem(z, x).DATA_meminst|) + `%~>%`(`%;%`(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 : uN(32) <: nat)), (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]) + -- if (j < |$lanes_(`%X%`((imm : imm <: lanetype), `%`(M)), c)|) + -- 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}: - `%~>%`(`%;%*`(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 { @@ -32673,21 +32671,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*) +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 { @@ -32697,19 +32695,19 @@ 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} - -- where 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} -- where TYPE(rectype) = 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 fi = {TYPE mm.TYPE_moduleinst[(x : uN(32) <: nat)], MODULE mm, CODE func} + -- where FUNC(x, local*{local : local}, expr) = func + -- where fi = {TYPE mm.TYPE_moduleinst[x.`%`.0], MODULE mm, CODE func} ;; 9-module.watsup rec { @@ -32719,9 +32717,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 @@ -32738,16 +32736,16 @@ 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 def $alloctable(store : store, tabletype : tabletype, ref : ref) : (store, tableaddr) ;; 9-module.watsup - def $alloctable{s : store, i : nat, j : nat, rt : reftype, ref : ref, ti : tableinst}(s, `%%`(`[%..%]`(i, j), rt), ref) = (s[TABLE_store =.. [ti]], |s.TABLE_store|) - -- where ti = {TYPE `%%`(`[%..%]`(i, j), rt), ELEM ref^i{}} + def $alloctable{s : store, i : nat, j : nat, rt : reftype, ref : ref, ti : tableinst}(s, `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ref) = (s[TABLE_store =.. [ti]], |s.TABLE_store|) + -- where ti = {TYPE `%%`(`[%..%]`(`%`(i), `%`(j)), rt), ELEM ref^i{}} ;; 9-module.watsup rec { @@ -32757,16 +32755,16 @@ 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 def $allocmem(store : store, memtype : memtype) : (store, memaddr) ;; 9-module.watsup - def $allocmem{s : store, i : nat, j : nat, mi : meminst}(s, `%I8`(`[%..%]`(i, j))) = (s[MEM_store =.. [mi]], |s.MEM_store|) - -- where mi = {TYPE `%I8`(`[%..%]`(i, j)), DATA 0^((i * 64) * $Ki){}} + def $allocmem{s : store, i : nat, j : nat, mi : meminst}(s, `%I8`(`[%..%]`(`%`(i), `%`(j)))) = (s[MEM_store =.. [mi]], |s.MEM_store|) + -- where mi = {TYPE `%I8`(`[%..%]`(`%`(i), `%`(j))), DATA `%`(0)^((i * 64) * $Ki){}} ;; 9-module.watsup rec { @@ -32776,16 +32774,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 { @@ -32795,16 +32793,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 { @@ -32814,119 +32812,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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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 : uN(32) <: nat)])} + 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 - -;; 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 : byte <: nat) = 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 : byte <: nat) - 192)) + ((b_2 : byte <: nat) - 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 : byte <: nat) - 224)) + ((2 ^ 6) * ((b_2 : byte <: nat) - 128))) + ((b_3 : byte <: nat) - 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 : byte <: nat) - 240)) + ((2 ^ 12) * ((b_2 : byte <: nat) - 128))) + ((2 ^ 6) * ((b_3 : byte <: nat) - 128))) + ((b_4 : byte <: nat) - 128)) = ch - ;; A-binary.watsup:54.1-54.44 - def $utf8{ch* : nat*}(ch*{ch}) = $concat_(syntax byte, $utf8([ch])*{ch}) -} + -- 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) @@ -32945,14 +32916,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 = `...` @@ -32960,21 +32931,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) +syntax recordeq = `%++%=%`{recordstar : recordstar}(recordstar : recordstar, recordstar, recordstar) ;; C-conventions.watsup syntax pth = @@ -33003,11 +32974,11 @@ $ (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}*{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... @@ -33016,11 +32987,11 @@ 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}*{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... @@ -33029,11 +33000,11 @@ 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}*{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... @@ -33042,11 +33013,11 @@ 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}*{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... @@ -33055,13 +33026,13 @@ 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}*{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... @@ -33070,13 +33041,13 @@ 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}*{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. diff --git a/spectec/test-prose/TEST.md b/spectec/test-prose/TEST.md index ca25e8cff3..2a07313cec 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) and the type of ch is byte), 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. @@ -928,18 +928,18 @@ execution_of_LABEL_ 3. Exit current context. 4. Push val* to the stack. -execution_of_BR label_u0 +execution_of_BR n_u0 1. Let L be the current label. 2. Let n be the arity of L. 3. Let instr'* be the continuation of L. 4. Pop all values admin_u1* from the stack. 5. Exit current context. -6. If ((label_u0 is 0) and (|admin_u1*| ≥ n)), then: +6. If ((n_u0 is 0) and (|admin_u1*| ≥ n)), then: a. Let val'* ++ val^n be admin_u1*. b. Push val^n to the stack. c. Execute the sequence (instr'*). -7. If (label_u0 ≥ 1), then: - a. Let l be (label_u0 - 1). +7. If (n_u0 ≥ 1), then: + a. Let l be (n_u0 - 1). b. Let val* be admin_u1*. c. Push val* to the stack. d. Execute (BR l). @@ -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) and the type of ch is byte), 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. @@ -2471,18 +2471,18 @@ execution_of_LABEL_ 3. Exit current context. 4. Push val* to the stack. -execution_of_BR label_u0 +execution_of_BR n_u0 1. Let L be the current label. 2. Let n be the arity of L. 3. Let instr'* be the continuation of L. 4. Pop all values admin_u1* from the stack. 5. Exit current context. -6. If ((label_u0 is 0) and (|admin_u1*| ≥ n)), then: +6. If ((n_u0 is 0) and (|admin_u1*| ≥ n)), then: a. Let val'* ++ val^n be admin_u1*. b. Push val^n to the stack. c. Execute the sequence (instr'*). -7. If (label_u0 ≥ 1), then: - a. Let l be (label_u0 - 1). +7. If (n_u0 ≥ 1), then: + a. Let l be (n_u0 - 1). b. Let val* be admin_u1*. c. Push val* to the stack. d. Execute (BR l). @@ -3732,7 +3732,7 @@ validation_of_VLOAD_LANE n x { ALIGN: n_A; OFFSET: n_O; } laneidx validation_of_VSTORE x { ALIGN: n_A; OFFSET: n_O; } - |C.MEM| must be greater than x. -- (2 ^ n_A) must be less than or equal to ($size(V128) / 8). +- (2 ^ n_A) must be less than or equal to ($vsize(V128) / 8). - Let mt be C.MEM[x]. - The instruction is valid with type ([I32, V128] -> []). @@ -3796,17 +3796,36 @@ fone N canon_ N 1. Return (2 ^ ($signif(N) - 1)). -size valty_u0 -1. If (valty_u0 is I32), then: +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. -2. If (valty_u0 is I64), then: +2. If (numty_u0 is I64), then: a. Return 64. -3. If (valty_u0 is F32), then: +3. If (numty_u0 is F32), then: a. Return 32. -4. If (valty_u0 is F64), then: - a. Return 64. -5. If (valty_u0 is V128), then: - a. Return 128. +4. Assert: Due to validation, (numty_u0 is F64). +5. Return 64. + +vsize V128 +1. Return 128. psize packt_u0 1. If (packt_u0 is I8), then: @@ -3823,18 +3842,21 @@ lsize lanet_u0 4. Return $psize(packtype). zsize stora_u0 -1. If the type of stora_u0 is valtype, then: - a. Let valtype be stora_u0. - b. Return $size(valtype). -2. Assert: Due to validation, the type of stora_u0 is packtype. -3. Let packtype be stora_u0. -4. Return $psize(packtype). +1. If the type of stora_u0 is numtype, then: + a. Let numtype be stora_u0. + b. Return $size(numtype). +2. If the type of stora_u0 is vectype, then: + a. Let vectype be stora_u0. + b. Return $vsize(vectype). +3. Assert: Due to validation, the type of stora_u0 is packtype. +4. Let packtype be stora_u0. +5. Return $psize(packtype). lanetype (lnn X N) 1. Return lnn. -sizenn t -1. Return $size(t). +sizenn nt +1. Return $size(nt). dim (lnn X N) 1. Return N. @@ -4035,10 +4057,10 @@ subst_externtype exter_u0 xx* ht* 6. Return (MEM $subst_memtype(mt, xx*, ht*)). subst_all_reftype rt ht^n -1. Return $subst_reftype(rt, $idx(x)^(x |$mem(x).DATA|) and vload_u0? is not defined), then: +3. If ((((i + mo.OFFSET) + ($vsize(V128) / 8)) > |$mem(x).DATA|) and vload_u0? is not defined), then: a. Trap. 4. If vload_u0? is not defined, then: - a. Let c be $inverse_of_vbytes(V128, $mem(x).DATA[(i + mo.OFFSET) : ($size(V128) / 8)]). + a. Let c be $inverse_of_vbytes(V128, $mem(x).DATA[(i + mo.OFFSET) : ($vsize(V128) / 8)]). b. Push (V128.CONST c) to the stack. 5. Else: a. Let ?(y_0) be vload_u0?. @@ -6284,7 +6288,7 @@ execution_of_VLOAD_LANE N x mo j 4. Pop (I32.CONST i) from the stack. 5. If (((i + mo.OFFSET) + (N / 8)) > |$mem(x).DATA|), then: a. Trap. -6. Let M be ($size(V128) / N). +6. Let M be ($vsize(V128) / N). 7. If the type of $inverse_of_lsize(N) is imm, then: a. Let imm be $inverse_of_lsize(N). b. Let k be $inverse_of_ibytes(N, $mem(x).DATA[(i + mo.OFFSET) : (N / 8)]). @@ -6486,10 +6490,10 @@ execution_of_VSTORE x mo 2. Pop (V128.CONST c) from the stack. 3. Assert: Due to validation, a value of value type I32 is on the top of the stack. 4. Pop (I32.CONST i) from the stack. -5. If (((i + mo.OFFSET) + ($size(V128) / 8)) > |$mem(x).DATA|), then: +5. If (((i + mo.OFFSET) + ($vsize(V128) / 8)) > |$mem(x).DATA|), then: a. Trap. 6. Let b* be $vbytes(V128, c). -7. Perform $with_mem(x, (i + mo.OFFSET), ($size(V128) / 8), b*). +7. Perform $with_mem(x, (i + mo.OFFSET), ($vsize(V128) / 8), b*). execution_of_VSTORE_LANE N x mo j 1. Assert: Due to validation, a value is on the top of the stack. diff --git a/spectec/test-splice/TEST.md b/spectec/test-splice/TEST.md index 2170739650..7e79f417af 100644 --- a/spectec/test-splice/TEST.md +++ b/spectec/test-splice/TEST.md @@ -58,7 +58,6 @@ $$ {|\mathsf{i{\scriptstyle64}}|} &=& 64 & \\ {|\mathsf{f{\scriptstyle32}}|} &=& 32 & \\ {|\mathsf{f{\scriptstyle64}}|} &=& 64 & \\ -{|\mathsf{v{\scriptstyle128}}|} &=& 128 & \\ \end{array} $$ @@ -1252,6 +1251,7 @@ warning: definition `vextbinop` was never spliced warning: definition `vextunop` was never spliced warning: definition `vishiftop` was never spliced warning: definition `vrelop` was never spliced +warning: definition `vsize` was never spliced warning: definition `vunop` was never spliced warning: definition `vunpack` was never spliced warning: definition `vvbinop` was never spliced @@ -1610,6 +1610,7 @@ warning: definition prose `vcvtop` was never spliced warning: definition prose `vextbinop` was never spliced warning: definition prose `vishiftop` was never spliced warning: definition prose `vrelop` was never spliced +warning: definition prose `vsize` was never spliced warning: definition prose `vunop` was never spliced warning: definition prose `vunpack` was never spliced warning: definition prose `vvbinop` was never spliced