From ed31b05c2a6aa4a3b62f5a88d0df1577fd326260 Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Sun, 10 Sep 2023 08:05:57 -0700 Subject: [PATCH] A bit more structure in definition files --- spectec/spec/2-aux.watsup | 11 + spectec/spec/3-typing.watsup | 47 + spectec/spec/4-runtime.watsup | 62 +- spectec/spec/6-reduction.watsup | 28 +- spectec/spec/7-module.watsup | 49 +- spectec/test-frontend/TEST.md | 843 ++--- spectec/test-latex/TEST.md | 4 +- spectec/test-middlend/TEST.md | 5320 +++++++++++++++---------------- 8 files changed, 3249 insertions(+), 3115 deletions(-) diff --git a/spectec/spec/2-aux.watsup b/spectec/spec/2-aux.watsup index 37cce32e8a..5b5f5b09f1 100644 --- a/spectec/spec/2-aux.watsup +++ b/spectec/spec/2-aux.watsup @@ -1,3 +1,7 @@ +;; +;; General definitions +;; + ;; General constants def $Ki : nat @@ -12,7 +16,11 @@ def $min(i, 0) = 0 def $min($(i+1), $(j+1)) = $min(i, j) +;; ;; Auxiliary Definitions on Types +;; + +;; Size ;; def |I n| = |F n| = |V n| = n ;; ???? @@ -24,7 +32,10 @@ def $size(F64) = 64 def $size(V128) = 128 +;; ;; Some notation tests +;; TODO: remove +;; def $test_sub_ATOM_22(n_3_ATOM_y) : nat def $test_sub_ATOM_22(n_3_ATOM_y) = 0 diff --git a/spectec/spec/3-typing.watsup b/spectec/spec/3-typing.watsup index f4a79988c9..4c341cba5f 100644 --- a/spectec/spec/3-typing.watsup +++ b/spectec/spec/3-typing.watsup @@ -1,4 +1,6 @@ +;; ;; Contexts +;; syntax context hint(desc "context") = { FUNC functype*, GLOBAL globaltype*, TABLE tabletype*, MEM memtype*, @@ -9,7 +11,9 @@ var C : context +;; ;; Types +;; relation Limits_ok: |- limits : nat hint(show "K-limits") relation Functype_ok: |- functype : OK hint(show "K-func") @@ -56,7 +60,11 @@ rule Externtype_ok/mem: +;; ;; Subtyping +;; + +;; Value types relation Valtype_sub: |- valtype <: valtype hint(show "S") relation Resulttype_sub: |- valtype* <: valtype* hint(show "S-result") @@ -72,6 +80,8 @@ rule Resulttype_sub: -- (Valtype_sub: |- t_1 <: t_2)* +;; External types + relation Limits_sub: |- limits <: limits hint(show "S-limits") relation Functype_sub: |- functype <: functype hint(show "S-func") relation Globaltype_sub: |- globaltype <: globaltype hint(show "S-global") @@ -118,18 +128,24 @@ rule Externtype_sub/mem: +;; ;; Instructions +;; relation Instr_ok: context |- instr : functype hint(show "T") relation InstrSeq_ok: context |- instr* : functype hint(show "T*") relation Expr_ok: context |- expr : resulttype hint(show "T-expr") +;; Expressions + rule Expr_ok: C |- instr* : t* -- InstrSeq_ok: C |- instr* : epsilon -> t* +;; Instruction sequences + rule InstrSeq_ok/empty: C |- epsilon : epsilon -> epsilon @@ -150,6 +166,8 @@ rule InstrSeq_ok/frame: -- InstrSeq_ok: C |- instr* : t_1* -> t_2* +;; Polymorphic instructions + rule Instr_ok/unreachable: C |- UNREACHABLE : t_1* -> t_2* @@ -169,6 +187,8 @@ rule Instr_ok/select-impl: -- if t' = numtype \/ t' = vectype +;; Block instructions + relation Blocktype_ok: context |- blocktype : functype hint(show "K-block") rule Blocktype_ok: @@ -192,6 +212,8 @@ rule Instr_ok/if: -- InstrSeq_ok: C, LABEL (t_2*) |- instr_2* : t_1* -> t_2* +;; Branch instructions + rule Instr_ok/br: C |- BR l : t_1* t* -> t_2* -- if C.LABEL[l] = t* @@ -205,6 +227,9 @@ rule Instr_ok/br_table: -- (Resulttype_sub: |- t* <: C.LABEL[l])* -- Resulttype_sub: |- t* <: C.LABEL[l'] + +;; Function instructions + rule Instr_ok/return: C |- RETURN : t_1* t* -> t_2* -- if C.RETURN = (t*) @@ -219,6 +244,8 @@ rule Instr_ok/call_indirect: -- if ft = t_1* -> t_2* +;; Numeric instructions + rule Instr_ok/const: C |- CONST nt c_nt : epsilon -> nt @@ -254,6 +281,8 @@ rule Instr_ok/convert-f: -- if fn_1 =/= fn_2 +;; Reference instructions + rule Instr_ok/ref.null: C |- REF.NULL rt : epsilon -> rt @@ -265,6 +294,8 @@ rule Instr_ok/ref.is_null: C |- REF.IS_NULL : rt -> I32 +;; Local instructions + rule Instr_ok/local.get: C |- LOCAL.GET x : epsilon -> t -- if C.LOCAL[x] = t @@ -278,6 +309,8 @@ rule Instr_ok/local.tee: -- if C.LOCAL[x] = t +;; Global instructions + rule Instr_ok/global.get: C |- GLOBAL.GET x : epsilon -> t -- if C.GLOBAL[x] = MUT? t @@ -287,6 +320,8 @@ rule Instr_ok/global.set: -- if C.GLOBAL[x] = MUT t +;; Table instructions + rule Instr_ok/table.get: C |- TABLE.GET x : I32 -> rt -- if C.TABLE[x] = lim rt @@ -322,6 +357,8 @@ rule Instr_ok/elem.drop: -- if C.ELEM[x] = rt +;; Memory instructions + rule Instr_ok/memory.size: C |- MEMORY.SIZE : epsilon -> I32 -- if C.MEM[0] = mt @@ -362,7 +399,9 @@ rule Instr_ok/store: -- if n? = epsilon \/ nt = in +;; ;; Constant Expressions +;; relation Instr_const: context |- instr CONST hint(show "C-instr") relation Expr_const: context |- expr CONST hint(show "C-expr") @@ -392,7 +431,9 @@ rule Expr_ok_const: -- Expr_const: C |- expr CONST +;; ;; Modules +;; relation Func_ok: context |- func : functype hint(show "T-func") relation Global_ok: context |- global : globaltype hint(show "T-global") @@ -405,6 +446,8 @@ relation Datamode_ok: context |- datamode : OK hint(show "T-datamode") relation Start_ok: context |- start : OK hint(show "T-start") +;; Module definitions + rule Func_ok: C |- FUNC ft t* expr : ft -- if ft = t_1* -> t_2* @@ -452,6 +495,8 @@ rule Start_ok: -- if C.FUNC[x] = epsilon -> epsilon +;; Module im/exports + relation Import_ok: context |- import : externtype hint(show "T-import") relation Export_ok: context |- export : externtype hint(show "T-export") relation Externuse_ok: context |- externuse : externtype hint(show "T-externuse") @@ -481,6 +526,8 @@ rule Externuse_ok/mem: -- if C.MEM[x] = mt +;; Modules proper + relation Module_ok: |- module : OK hint(show "T-module") rule Module_ok: diff --git a/spectec/spec/4-runtime.watsup b/spectec/spec/4-runtime.watsup index 8d6d7af442..3ca4fd26d2 100644 --- a/spectec/spec/4-runtime.watsup +++ b/spectec/spec/4-runtime.watsup @@ -1,4 +1,6 @@ +;; ;; Addresses +;; syntax addr hint(desc "address") = nat syntax funcaddr hint(desc "function address") = addr @@ -19,7 +21,11 @@ var ea : elemaddr var da : dataaddr +;; ;; Values +;; + +;; Basic values syntax num hint(desc "number") = | CONST numtype c_numtype @@ -35,12 +41,17 @@ var r : ref var v : val var res : result + +;; External values + syntax externval hint(desc "external value") = | FUNC funcaddr | GLOBAL globaladdr | TABLE tableaddr | MEM memaddr var xv : externval +;; Auxiliary definition: default values + def $default_(valtype) : val hint(partial) def $default_(I32) = (CONST I32 0) def $default_(I64) = (CONST I64 0) @@ -50,7 +61,11 @@ def $default_(FUNCREF) = (REF.NULL FUNCREF) def $default_(EXTERNREF) = (REF.NULL EXTERNREF) ;; TODO: All reference types should be caught by one pattern. +;; ;; Configurations +;; + +;; Instances syntax funcinst hint(desc "function instance") = { MODULE moduleinst, @@ -73,14 +88,6 @@ syntax exportinst hint(desc "export instance") = { NAME name, VALUE externval } -syntax store hint(desc "store") = - { FUNC funcinst*, - GLOBAL globalinst*, - TABLE tableinst*, - MEM meminst*, - ELEM eleminst*, - DATA datainst* } - syntax moduleinst hint(desc "module instance") = { FUNC funcaddr*, GLOBAL globaladdr*, @@ -90,9 +97,30 @@ syntax moduleinst hint(desc "module instance") = DATA dataaddr*, EXPORT exportinst* } +var m : moduleinst +var fi : funcinst +var gi : globalinst +var ti : tableinst +var mi : meminst +var ei : eleminst +var di : datainst +var xi : exportinst + + +;; Configurations proper + +syntax store hint(desc "store") = + { FUNC funcinst*, + GLOBAL globalinst*, + TABLE tableinst*, + MEM meminst*, + ELEM eleminst*, + DATA datainst* } + syntax frame hint(desc "frame") = { LOCAL val*, MODULE moduleinst } + syntax state hint(desc "state") = store; frame syntax config hint(desc "configuration") = state; admininstr* @@ -100,17 +128,8 @@ var s : store var f : frame var z : state -var m : moduleinst -var fi : funcinst -var gi : globalinst -var ti : tableinst -var mi : meminst -var ei : eleminst -var di : datainst -var xi : exportinst - -;; Auxiliary notation +;; Auxiliary notation: short-hands def $funcaddr(state) : funcaddr* hint(show %.MODULE.FUNC) def $funcaddr((s; f)) = f.MODULE.FUNC @@ -164,6 +183,9 @@ def $with_meminst((s; f), x, mi) = s[.MEM[f.MODULE.MEM[x]] = mi]; f def $with_elem((s; f), x, r*) = s[.ELEM[f.MODULE.ELEM[x]].ELEM = r*]; f def $with_data((s; f), x, b*) = s[.DATA[f.MODULE.DATA[x]].DATA = b*]; f + +;; Auxiliary definitions: Growing store objects + def $grow_table(tableinst, nat, ref) : tableinst hint(partial) def $grow_memory(meminst, nat) : meminst hint(partial) @@ -172,13 +194,17 @@ def $grow_table(ti, n, r) = ti' -- if i' = $(|r'*| + n) -- if ti' = { TYPE `[i' .. j] rt, ELEM r'* r^n } -- Tabletype_ok: |- ti'.TYPE : OK + def $grow_memory(mi, n) = mi' -- if mi = { TYPE (`[i .. j] I8), DATA b* } -- if i' = $(|b*| / (64 * $Ki) + n) -- if mi' = { TYPE (`[i' .. j] I8), DATA b* 0^(n * 64 * $Ki) } -- Memtype_ok: |- mi'.TYPE : OK + +;; ;; Administrative Instructions +;; syntax admininstr hint(show instr) hint(desc "administrative instruction") = | instr diff --git a/spectec/spec/6-reduction.watsup b/spectec/spec/6-reduction.watsup index b09ba8abaa..90f5842fdc 100644 --- a/spectec/spec/6-reduction.watsup +++ b/spectec/spec/6-reduction.watsup @@ -1,4 +1,6 @@ -;; Instructions +;; +;; Configurations +;; relation Step: config ~> config hint(show "E") relation Step_pure: admininstr* ~> admininstr* hint(show "E") @@ -13,6 +15,12 @@ rule Step/read: -- Step_read: z; instr* ~> instr'* +;; +;; Instructions +;; + +;; Polymorphic instructions + rule Step_pure/unreachable: UNREACHABLE ~> TRAP @@ -32,6 +40,8 @@ rule Step_pure/select-false: -- if c = 0 +;; Block instructions + rule Step_pure/block: val^k (BLOCK bt instr*) ~> (LABEL_ n `{epsilon} val^k instr*) -- if bt = t_1^k -> t_2^n @@ -53,6 +63,8 @@ rule Step_pure/label-vals: (LABEL_ n `{instr*} val*) ~> val* +;; Branch instructions + ;; TODO: may want a label context instead of bubbling up rule Step_pure/br-zero: (LABEL_ n `{instr'*} val'* val^n (BR 0) instr*) ~> val^n instr'* @@ -79,6 +91,8 @@ rule Step_pure/br_table-ge: -- if i >= |l*| +;; Function instructions + rule Step_read/call: z; (CALL x) ~> (CALL_ADDR $funcaddr(z)[x]) ;; TODO @@ -109,6 +123,8 @@ rule Step_pure/return-label: (LABEL_ k `{instr'*} val* RETURN instr*) ~> val* RETURN +;; Numeric instructions + rule Step_pure/unop-val: (CONST nt c_1) (UNOP nt unop) ~> (CONST nt c) -- if $unop(unop, nt, c_1) = c ;; TODO @@ -149,6 +165,8 @@ rule Step_pure/cvtop-trap: -- if $cvtop(nt_1, cvtop, nt_2, sx?, c_1) = epsilon ;; TODO +;; Reference instructions + rule Step_read/ref.func: z; (REF.FUNC x) ~> (REF.FUNC_ADDR $funcaddr(z)[x]) @@ -162,6 +180,8 @@ rule Step_pure/ref.is_null-false: -- otherwise +;; Local instructions + rule Step_read/local.get: z; (LOCAL.GET x) ~> $local(z, x) @@ -172,6 +192,8 @@ rule Step_pure/local.tee: val (LOCAL.TEE x) ~> val val (LOCAL.SET x) +;; Global instructions + rule Step_read/global.get: z; (GLOBAL.GET x) ~> $global(z, x).VALUE @@ -179,6 +201,8 @@ rule Step/global.set: z; val (GLOBAL.SET x) ~> $with_global(z, x, val); epsilon +;; Table instructions + rule Step_read/table.get-trap: z; (CONST I32 i) (TABLE.GET x) ~> TRAP -- if i >= |$table(z, x).ELEM| @@ -268,6 +292,8 @@ rule Step/elem.drop: z; (ELEM.DROP x) ~> $with_elem(z, x, epsilon); epsilon +;; Memory instructions + rule Step_read/load-num-trap: z; (CONST I32 i) (LOAD nt n_A n_O) ~> TRAP -- if $(i + n_O + $size(nt)/8 > |$mem(z, 0).DATA|) diff --git a/spectec/spec/7-module.watsup b/spectec/spec/7-module.watsup index 72e8027d6a..b1148dfbce 100644 --- a/spectec/spec/7-module.watsup +++ b/spectec/spec/7-module.watsup @@ -1,5 +1,6 @@ -;; Allocation - +;; +;; Projections +;; def $funcs(externval*) : funcaddr* def $funcs(epsilon) = epsilon @@ -26,12 +27,11 @@ def $mems(externval externval'*) = $mems(externval'*) -- otherwise -def $instexport(funcaddr*, globaladdr*, tableaddr*, memaddr*, export) : exportinst -def $instexport(fa*, ga*, ta*, ma*, EXPORT name (FUNC x)) = { NAME name, VALUE (FUNC fa*[x]) } -def $instexport(fa*, ga*, ta*, ma*, EXPORT name (GLOBAL x)) = { NAME name, VALUE (GLOBAL ga*[x]) } -def $instexport(fa*, ga*, ta*, ma*, EXPORT name (TABLE x)) = { NAME name, VALUE (TABLE ta*[x]) } -def $instexport(fa*, ga*, ta*, ma*, EXPORT name (MEM x)) = { NAME name, VALUE (MEM ma*[x]) } +;; +;; Allocation +;; +;; Definitions def $allocfunc(store, moduleinst, func) : (store, funcaddr) def $allocfunc(s, m, func) = (s[.FUNC =.. fi], |s.FUNC|) @@ -94,6 +94,15 @@ def $allocdatas(s, byte* byte'**) = (s_2, da da'*) -- if (s_2, da'*) = $allocdatas(s_1, byte'**) +;; Modules + +def $instexport(funcaddr*, globaladdr*, tableaddr*, memaddr*, export) : exportinst +def $instexport(fa*, ga*, ta*, ma*, EXPORT name (FUNC x)) = { NAME name, VALUE (FUNC fa*[x]) } +def $instexport(fa*, ga*, ta*, ma*, EXPORT name (GLOBAL x)) = { NAME name, VALUE (GLOBAL ga*[x]) } +def $instexport(fa*, ga*, ta*, ma*, EXPORT name (TABLE x)) = { NAME name, VALUE (TABLE ta*[x]) } +def $instexport(fa*, ga*, ta*, ma*, EXPORT name (MEM x)) = { NAME name, VALUE (MEM ma*[x]) } + + def $allocmodule(store, module, externval*, val*, (ref*)*) : (store, moduleinst) def $allocmodule(s, module, externval*, val*, (ref*)*) = (s_6, m) -- if module = @@ -135,6 +144,14 @@ def $allocmodule(s, module, externval*, val*, (ref*)*) = (s_6, m) -- if (s_6, da*) = $allocdatas(s_5, (byte*)^n_data) +;; +;; Instantiation +;; + +def $concat_instr(instr**) : instr* +def $concat_instr(epsilon) = epsilon +def $concat_instr(instr* instr'**) = instr* $concat_instr(instr'**) + def $runelem(elem, idx) : instr* def $runelem(ELEM reftype expr*, i) = epsilon def $runelem(ELEM reftype expr* (DECLARE), i) = (ELEM.DROP i) @@ -148,14 +165,8 @@ def $rundata(DATA byte* (MEMORY 0 instr*), i) = instr* (CONST I32 0) (CONST I32 n) (MEMORY.INIT i) (DATA.DROP i) -- if n = |byte*| - -def $concat_instr(instr**) : instr* -def $concat_instr(epsilon) = epsilon -def $concat_instr(instr* instr'**) = instr* $concat_instr(instr'**) - - -def $instantiation(store, module, externval*) : config -def $instantiation(s, module, externval*) = s'; f; instr_elem* instr_data* (CALL x)? +def $instantiate(store, module, externval*) : config +def $instantiate(s, module, externval*) = s'; f; instr_elem* instr_data* (CALL x)? -- if module = MODULE import* func* global* table* mem* elem* data* start? export* -- if m_init = { FUNC $funcs(externval*), @@ -180,8 +191,12 @@ def $instantiation(s, module, externval*) = s'; f; instr_elem* instr_data* (CALL -- if start? = (START x)? -def $invocation(store, funcaddr, val*) : config -def $invocation(s, fa, val^n) = s; f; val^n (CALL_ADDR fa) +;; +;; Invocation +;; + +def $invoke(store, funcaddr, val*) : config +def $invoke(s, fa, val^n) = s; f; val^n (CALL_ADDR fa) -- if m = { FUNC epsilon, GLOBAL epsilon, diff --git a/spectec/test-frontend/TEST.md b/spectec/test-frontend/TEST.md index 146a82ac48..151493f85f 100644 --- a/spectec/test-frontend/TEST.md +++ b/spectec/test-frontend/TEST.md @@ -319,48 +319,48 @@ syntax import = IMPORT(name, name, externtype) ;; 1-syntax.watsup:212.1-213.70 syntax module = `MODULE%*%*%*%*%*%*%*%?%*`(import*, func*, global*, table*, mem*, elem*, data*, start?, export*) -;; 2-aux.watsup:3.1-3.14 +;; 2-aux.watsup:7.1-7.14 def Ki : nat - ;; 2-aux.watsup:4.1-4.15 + ;; 2-aux.watsup:8.1-8.15 def Ki = 1024 -;; 2-aux.watsup:9.1-9.25 +;; 2-aux.watsup:13.1-13.25 rec { -;; 2-aux.watsup:9.1-9.25 +;; 2-aux.watsup:13.1-13.25 def min : (nat, nat) -> nat - ;; 2-aux.watsup:10.1-10.19 + ;; 2-aux.watsup:14.1-14.19 def {j : nat} min(0, j) = 0 - ;; 2-aux.watsup:11.1-11.19 + ;; 2-aux.watsup:15.1-15.19 def {i : nat} min(i, 0) = 0 - ;; 2-aux.watsup:12.1-12.38 + ;; 2-aux.watsup:16.1-16.38 def {i : nat, j : nat} min((i + 1), (j + 1)) = $min(i, j) } -;; 2-aux.watsup:19.1-19.55 +;; 2-aux.watsup:27.1-27.55 def size : valtype -> nat - ;; 2-aux.watsup:20.1-20.20 + ;; 2-aux.watsup:28.1-28.20 def size(I32_valtype) = 32 - ;; 2-aux.watsup:21.1-21.20 + ;; 2-aux.watsup:29.1-29.20 def size(I64_valtype) = 64 - ;; 2-aux.watsup:22.1-22.20 + ;; 2-aux.watsup:30.1-30.20 def size(F32_valtype) = 32 - ;; 2-aux.watsup:23.1-23.20 + ;; 2-aux.watsup:31.1-31.20 def size(F64_valtype) = 64 - ;; 2-aux.watsup:24.1-24.22 + ;; 2-aux.watsup:32.1-32.22 def size(V128_valtype) = 128 -;; 2-aux.watsup:29.1-29.40 +;; 2-aux.watsup:40.1-40.40 def test_sub_ATOM_22 : n -> nat - ;; 2-aux.watsup:30.1-30.38 + ;; 2-aux.watsup:41.1-41.38 def {n_3_ATOM_y : n} test_sub_ATOM_22(n_3_ATOM_y) = 0 -;; 2-aux.watsup:32.1-32.26 +;; 2-aux.watsup:43.1-43.26 def curried_ : (n, n) -> nat - ;; 2-aux.watsup:33.1-33.39 + ;; 2-aux.watsup:44.1-44.39 def {n_1 : n, n_2 : n} curried_(n_1, n_2) = (n_1 + n_2) -;; 2-aux.watsup:35.1-44.39 +;; 2-aux.watsup:46.1-55.39 syntax testfuse = | AB_(nat, nat, nat) | CD(nat, nat, nat) @@ -372,376 +372,376 @@ syntax testfuse = | OP(nat, nat, nat) | QR(nat, nat, nat) -;; 3-typing.watsup:3.1-6.60 +;; 3-typing.watsup:5.1-8.60 syntax context = {FUNC functype*, GLOBAL globaltype*, TABLE tabletype*, MEM memtype*, ELEM elemtype*, DATA datatype*, LOCAL valtype*, LABEL resulttype*, RETURN resulttype?} -;; 3-typing.watsup:14.1-14.66 +;; 3-typing.watsup:18.1-18.66 relation Limits_ok: `|-%:%`(limits, nat) - ;; 3-typing.watsup:22.1-24.24 + ;; 3-typing.watsup:26.1-28.24 rule _ {k : nat, n_1 : n, n_2 : n}: `|-%:%`(`[%..%]`(n_1, n_2), k) -- if ((n_1 <= n_2) /\ (n_2 <= k)) -;; 3-typing.watsup:15.1-15.64 +;; 3-typing.watsup:19.1-19.64 relation Functype_ok: `|-%:OK`(functype) - ;; 3-typing.watsup:26.1-27.13 + ;; 3-typing.watsup:30.1-31.13 rule _ {ft : functype}: `|-%:OK`(ft) -;; 3-typing.watsup:16.1-16.66 +;; 3-typing.watsup:20.1-20.66 relation Globaltype_ok: `|-%:OK`(globaltype) - ;; 3-typing.watsup:29.1-30.13 + ;; 3-typing.watsup:33.1-34.13 rule _ {gt : globaltype}: `|-%:OK`(gt) -;; 3-typing.watsup:17.1-17.65 +;; 3-typing.watsup:21.1-21.65 relation Tabletype_ok: `|-%:OK`(tabletype) - ;; 3-typing.watsup:32.1-34.35 + ;; 3-typing.watsup:36.1-38.35 rule _ {lim : limits, rt : reftype}: `|-%:OK`(`%%`(lim, rt)) -- Limits_ok: `|-%:%`(lim, ((2 ^ 32) - 1)) -;; 3-typing.watsup:18.1-18.63 +;; 3-typing.watsup:22.1-22.63 relation Memtype_ok: `|-%:OK`(memtype) - ;; 3-typing.watsup:36.1-38.33 + ;; 3-typing.watsup:40.1-42.33 rule _ {lim : limits}: `|-%:OK`(`%I8`(lim)) -- Limits_ok: `|-%:%`(lim, (2 ^ 16)) -;; 3-typing.watsup:19.1-19.66 +;; 3-typing.watsup:23.1-23.66 relation Externtype_ok: `|-%:OK`(externtype) - ;; 3-typing.watsup:41.1-43.35 + ;; 3-typing.watsup:45.1-47.35 rule func {functype : functype}: `|-%:OK`(FUNC_externtype(functype)) -- Functype_ok: `|-%:OK`(functype) - ;; 3-typing.watsup:45.1-47.39 + ;; 3-typing.watsup:49.1-51.39 rule global {globaltype : globaltype}: `|-%:OK`(GLOBAL_externtype(globaltype)) -- Globaltype_ok: `|-%:OK`(globaltype) - ;; 3-typing.watsup:49.1-51.37 + ;; 3-typing.watsup:53.1-55.37 rule table {tabletype : tabletype}: `|-%:OK`(TABLE_externtype(tabletype)) -- Tabletype_ok: `|-%:OK`(tabletype) - ;; 3-typing.watsup:53.1-55.33 + ;; 3-typing.watsup:57.1-59.33 rule mem {memtype : memtype}: `|-%:OK`(MEM_externtype(memtype)) -- Memtype_ok: `|-%:OK`(memtype) -;; 3-typing.watsup:61.1-61.65 +;; 3-typing.watsup:69.1-69.65 relation Valtype_sub: `|-%<:%`(valtype, valtype) - ;; 3-typing.watsup:64.1-65.12 + ;; 3-typing.watsup:72.1-73.12 rule refl {t : valtype}: `|-%<:%`(t, t) - ;; 3-typing.watsup:67.1-68.14 + ;; 3-typing.watsup:75.1-76.14 rule bot {t : valtype}: `|-%<:%`(BOT_valtype, t) -;; 3-typing.watsup:62.1-62.72 +;; 3-typing.watsup:70.1-70.72 relation Resulttype_sub: `|-%*<:%*`(valtype*, valtype*) - ;; 3-typing.watsup:70.1-72.35 + ;; 3-typing.watsup:78.1-80.35 rule _ {t_1* : valtype*, t_2* : valtype*}: `|-%*<:%*`(t_1*{t_1}, t_2*{t_2}) -- (Valtype_sub: `|-%<:%`(t_1, t_2))*{t_1 t_2} -;; 3-typing.watsup:75.1-75.75 +;; 3-typing.watsup:85.1-85.75 relation Limits_sub: `|-%<:%`(limits, limits) - ;; 3-typing.watsup:83.1-86.21 + ;; 3-typing.watsup:93.1-96.21 rule _ {n_11 : n, n_12 : n, n_21 : n, n_22 : n}: `|-%<:%`(`[%..%]`(n_11, n_12), `[%..%]`(n_21, n_22)) -- if (n_11 >= n_21) -- if (n_12 <= n_22) -;; 3-typing.watsup:76.1-76.73 +;; 3-typing.watsup:86.1-86.73 relation Functype_sub: `|-%<:%`(functype, functype) - ;; 3-typing.watsup:88.1-89.14 + ;; 3-typing.watsup:98.1-99.14 rule _ {ft : functype}: `|-%<:%`(ft, ft) -;; 3-typing.watsup:77.1-77.75 +;; 3-typing.watsup:87.1-87.75 relation Globaltype_sub: `|-%<:%`(globaltype, globaltype) - ;; 3-typing.watsup:91.1-92.14 + ;; 3-typing.watsup:101.1-102.14 rule _ {gt : globaltype}: `|-%<:%`(gt, gt) -;; 3-typing.watsup:78.1-78.74 +;; 3-typing.watsup:88.1-88.74 relation Tabletype_sub: `|-%<:%`(tabletype, tabletype) - ;; 3-typing.watsup:94.1-96.35 + ;; 3-typing.watsup:104.1-106.35 rule _ {lim_1 : limits, lim_2 : limits, rt : reftype}: `|-%<:%`(`%%`(lim_1, rt), `%%`(lim_2, rt)) -- Limits_sub: `|-%<:%`(lim_1, lim_2) -;; 3-typing.watsup:79.1-79.72 +;; 3-typing.watsup:89.1-89.72 relation Memtype_sub: `|-%<:%`(memtype, memtype) - ;; 3-typing.watsup:98.1-100.35 + ;; 3-typing.watsup:108.1-110.35 rule _ {lim_1 : limits, lim_2 : limits}: `|-%<:%`(`%I8`(lim_1), `%I8`(lim_2)) -- Limits_sub: `|-%<:%`(lim_1, lim_2) -;; 3-typing.watsup:80.1-80.75 +;; 3-typing.watsup:90.1-90.75 relation Externtype_sub: `|-%<:%`(externtype, externtype) - ;; 3-typing.watsup:103.1-105.35 + ;; 3-typing.watsup:113.1-115.35 rule func {ft_1 : functype, ft_2 : functype}: `|-%<:%`(FUNC_externtype(ft_1), FUNC_externtype(ft_2)) -- Functype_sub: `|-%<:%`(ft_1, ft_2) - ;; 3-typing.watsup:107.1-109.37 + ;; 3-typing.watsup:117.1-119.37 rule global {gt_1 : globaltype, gt_2 : globaltype}: `|-%<:%`(GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) -- Globaltype_sub: `|-%<:%`(gt_1, gt_2) - ;; 3-typing.watsup:111.1-113.36 + ;; 3-typing.watsup:121.1-123.36 rule table {tt_1 : tabletype, tt_2 : tabletype}: `|-%<:%`(TABLE_externtype(tt_1), TABLE_externtype(tt_2)) -- Tabletype_sub: `|-%<:%`(tt_1, tt_2) - ;; 3-typing.watsup:115.1-117.34 + ;; 3-typing.watsup:125.1-127.34 rule mem {mt_1 : memtype, mt_2 : memtype}: `|-%<:%`(MEM_externtype(mt_1), MEM_externtype(mt_2)) -- Memtype_sub: `|-%<:%`(mt_1, mt_2) -;; 3-typing.watsup:172.1-172.76 +;; 3-typing.watsup:192.1-192.76 relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) - ;; 3-typing.watsup:174.1-176.29 + ;; 3-typing.watsup:194.1-196.29 rule _ {C : context, ft : functype}: `%|-%:%`(C, ft, ft) -- Functype_ok: `|-%:OK`(ft) -;; 3-typing.watsup:123.1-124.67 +;; 3-typing.watsup:135.1-136.67 rec { -;; 3-typing.watsup:123.1-123.66 +;; 3-typing.watsup:135.1-135.66 relation Instr_ok: `%|-%:%`(context, instr, functype) - ;; 3-typing.watsup:153.1-154.34 + ;; 3-typing.watsup:171.1-172.34 rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:156.1-157.32 + ;; 3-typing.watsup:174.1-175.32 rule nop {C : context}: `%|-%:%`(C, NOP_instr, `%->%`([], [])) - ;; 3-typing.watsup:159.1-160.27 + ;; 3-typing.watsup:177.1-178.27 rule drop {C : context, t : valtype}: `%|-%:%`(C, DROP_instr, `%->%`([t], [])) - ;; 3-typing.watsup:163.1-164.31 + ;; 3-typing.watsup:181.1-182.31 rule select-expl {C : context, t : valtype}: `%|-%:%`(C, SELECT_instr(?(t)), `%->%`([t t I32_valtype], [t])) - ;; 3-typing.watsup:166.1-169.37 + ;; 3-typing.watsup:184.1-187.37 rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) -- Valtype_sub: `|-%<:%`(t, t') -- if ((t' = (numtype <: valtype)) \/ (t' = (vectype <: valtype))) - ;; 3-typing.watsup:178.1-181.59 + ;; 3-typing.watsup:198.1-201.59 rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:183.1-186.59 + ;; 3-typing.watsup:203.1-206.59 rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:188.1-192.61 + ;; 3-typing.watsup:208.1-212.61 rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%`(t_1*{t_1}, t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:195.1-197.24 + ;; 3-typing.watsup:217.1-219.24 rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- if (C.LABEL_context[l] = t*{t}) - ;; 3-typing.watsup:199.1-201.24 + ;; 3-typing.watsup:221.1-223.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] = t*{t}) - ;; 3-typing.watsup:203.1-206.42 + ;; 3-typing.watsup:225.1-228.42 rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- (Resulttype_sub: `|-%*<:%*`(t*{t}, C.LABEL_context[l]))*{l} -- Resulttype_sub: `|-%*<:%*`(t*{t}, C.LABEL_context[l']) - ;; 3-typing.watsup:208.1-210.24 + ;; 3-typing.watsup:233.1-235.24 rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- if (C.RETURN_context = ?(t*{t})) - ;; 3-typing.watsup:212.1-214.33 + ;; 3-typing.watsup:237.1-239.33 rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) -- if (C.FUNC_context[x] = `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:216.1-219.26 + ;; 3-typing.watsup:241.1-244.26 rule call_indirect {C : context, ft : functype, lim : limits, t_1* : valtype*, t_2* : valtype*, x : idx}: `%|-%:%`(C, CALL_INDIRECT_instr(x, ft), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) -- if (C.TABLE_context[x] = `%%`(lim, FUNCREF_reftype)) -- if (ft = `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:222.1-223.37 + ;; 3-typing.watsup:249.1-250.37 rule const {C : context, c_nt : c_numtype, nt : numtype}: `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [(nt <: valtype)])) - ;; 3-typing.watsup:225.1-226.31 + ;; 3-typing.watsup:252.1-253.31 rule unop {C : context, nt : numtype, unop : unop_numtype}: `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([(nt <: valtype)], [(nt <: valtype)])) - ;; 3-typing.watsup:228.1-229.36 + ;; 3-typing.watsup:255.1-256.36 rule binop {C : context, binop : binop_numtype, nt : numtype}: `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([(nt <: valtype) (nt <: valtype)], [(nt <: valtype)])) - ;; 3-typing.watsup:231.1-232.36 + ;; 3-typing.watsup:258.1-259.36 rule testop {C : context, nt : numtype, testop : testop_numtype}: `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([(nt <: valtype)], [I32_valtype])) - ;; 3-typing.watsup:234.1-235.37 + ;; 3-typing.watsup:261.1-262.37 rule relop {C : context, nt : numtype, relop : relop_numtype}: `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([(nt <: valtype) (nt <: valtype)], [I32_valtype])) - ;; 3-typing.watsup:238.1-240.23 + ;; 3-typing.watsup:265.1-267.23 rule extend {C : context, n : n, nt : numtype}: `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([(nt <: valtype)], [(nt <: valtype)])) -- if (n <= $size(nt <: valtype)) - ;; 3-typing.watsup:242.1-245.34 + ;; 3-typing.watsup:269.1-272.34 rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype}: `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([(nt_2 <: valtype)], [(nt_1 <: valtype)])) -- if (nt_1 =/= nt_2) -- if ($size(nt_1 <: valtype) = $size(nt_2 <: valtype)) - ;; 3-typing.watsup:247.1-250.52 + ;; 3-typing.watsup:274.1-277.52 rule convert-i {C : context, in_1 : in, in_2 : in, sx? : sx?}: `%|-%:%`(C, CVTOP_instr((in_1 <: numtype), CONVERT_cvtop, (in_2 <: numtype), sx?{sx}), `%->%`([(in_2 <: valtype)], [(in_1 <: valtype)])) -- if (in_1 =/= in_2) -- if ((sx?{sx} = ?()) <=> ($size(in_1 <: valtype) > $size(in_2 <: valtype))) - ;; 3-typing.watsup:252.1-254.22 + ;; 3-typing.watsup:279.1-281.22 rule convert-f {C : context, fn_1 : fn, fn_2 : fn}: `%|-%:%`(C, CVTOP_instr((fn_1 <: numtype), CONVERT_cvtop, (fn_2 <: numtype), ?()), `%->%`([(fn_2 <: valtype)], [(fn_1 <: valtype)])) -- if (fn_1 =/= fn_2) - ;; 3-typing.watsup:257.1-258.35 + ;; 3-typing.watsup:286.1-287.35 rule ref.null {C : context, rt : reftype}: `%|-%:%`(C, REF.NULL_instr(rt), `%->%`([], [(rt <: valtype)])) - ;; 3-typing.watsup:260.1-262.23 + ;; 3-typing.watsup:289.1-291.23 rule ref.func {C : context, ft : functype, x : idx}: `%|-%:%`(C, REF.FUNC_instr(x), `%->%`([], [FUNCREF_valtype])) -- if (C.FUNC_context[x] = ft) - ;; 3-typing.watsup:264.1-265.31 + ;; 3-typing.watsup:293.1-294.31 rule ref.is_null {C : context, rt : reftype}: `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([(rt <: valtype)], [I32_valtype])) - ;; 3-typing.watsup:268.1-270.23 + ;; 3-typing.watsup:299.1-301.23 rule local.get {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:272.1-274.23 + ;; 3-typing.watsup:303.1-305.23 rule local.set {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->%`([t], [])) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:276.1-278.23 + ;; 3-typing.watsup:307.1-309.23 rule local.tee {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%`([t], [t])) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:281.1-283.29 + ;; 3-typing.watsup:314.1-316.29 rule global.get {C : context, t : valtype, x : idx}: `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) -- if (C.GLOBAL_context[x] = `MUT%?%`(()?{}, t)) - ;; 3-typing.watsup:285.1-287.28 + ;; 3-typing.watsup:318.1-320.28 rule global.set {C : context, t : valtype, x : idx}: `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) -- if (C.GLOBAL_context[x] = `MUT%?%`(?(()), t)) - ;; 3-typing.watsup:290.1-292.28 + ;; 3-typing.watsup:325.1-327.28 rule table.get {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [(rt <: valtype)])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:294.1-296.28 + ;; 3-typing.watsup:329.1-331.28 rule table.set {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype (rt <: valtype)], [])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:298.1-300.24 + ;; 3-typing.watsup:333.1-335.24 rule table.size {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) -- if (C.TABLE_context[x] = tt) - ;; 3-typing.watsup:302.1-304.28 + ;; 3-typing.watsup:337.1-339.28 rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([(rt <: valtype) I32_valtype], [I32_valtype])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:306.1-308.28 + ;; 3-typing.watsup:341.1-343.28 rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype (rt <: valtype) I32_valtype], [])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:310.1-313.32 + ;; 3-typing.watsup:345.1-348.32 rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt : reftype, x_1 : idx, x_2 : idx}: `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt)) -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt)) - ;; 3-typing.watsup:315.1-318.25 + ;; 3-typing.watsup:350.1-353.25 rule table.init {C : context, lim : limits, rt : reftype, x_1 : idx, x_2 : idx}: `%|-%:%`(C, TABLE.INIT_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.TABLE_context[x_1] = `%%`(lim, rt)) -- if (C.ELEM_context[x_2] = rt) - ;; 3-typing.watsup:320.1-322.23 + ;; 3-typing.watsup:355.1-357.23 rule elem.drop {C : context, rt : reftype, x : idx}: `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) -- if (C.ELEM_context[x] = rt) - ;; 3-typing.watsup:325.1-327.22 + ;; 3-typing.watsup:362.1-364.22 rule memory.size {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.SIZE_instr, `%->%`([], [I32_valtype])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:329.1-331.22 + ;; 3-typing.watsup:366.1-368.22 rule memory.grow {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.GROW_instr, `%->%`([I32_valtype], [I32_valtype])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:333.1-335.22 + ;; 3-typing.watsup:370.1-372.22 rule memory.fill {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.FILL_instr, `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:337.1-339.22 + ;; 3-typing.watsup:374.1-376.22 rule memory.copy {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.COPY_instr, `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:341.1-344.23 + ;; 3-typing.watsup:378.1-381.23 rule memory.init {C : context, mt : memtype, x : idx}: `%|-%:%`(C, MEMORY.INIT_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.MEM_context[0] = mt) -- if (C.DATA_context[x] = OK) - ;; 3-typing.watsup:346.1-348.23 + ;; 3-typing.watsup:383.1-385.23 rule data.drop {C : context, x : idx}: `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) -- if (C.DATA_context[x] = OK) - ;; 3-typing.watsup:350.1-355.32 + ;; 3-typing.watsup:387.1-392.32 rule load {C : context, in : in, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?}: `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, n_A, n_O), `%->%`([I32_valtype], [(nt <: valtype)])) -- if (C.MEM_context[0] = mt) @@ -749,7 +749,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt <: valtype) / 8))))?{n} -- if ((n?{n} = ?()) \/ (nt = (in <: numtype))) - ;; 3-typing.watsup:357.1-362.32 + ;; 3-typing.watsup:394.1-399.32 rule store {C : context, in : in, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype}: `%|-%:%`(C, STORE_instr(nt, n?{n}, n_A, n_O), `%->%`([I32_valtype (nt <: valtype)], [])) -- if (C.MEM_context[0] = mt) @@ -757,185 +757,185 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt <: valtype) / 8))))?{n} -- if ((n?{n} = ?()) \/ (nt = (in <: numtype))) -;; 3-typing.watsup:124.1-124.67 +;; 3-typing.watsup:136.1-136.67 relation InstrSeq_ok: `%|-%*:%`(context, instr*, functype) - ;; 3-typing.watsup:133.1-134.36 + ;; 3-typing.watsup:149.1-150.36 rule empty {C : context}: `%|-%*:%`(C, [], `%->%`([], [])) - ;; 3-typing.watsup:136.1-139.46 + ;; 3-typing.watsup:152.1-155.46 rule seq {C : context, instr_1 : instr, instr_2 : instr, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*}: `%|-%*:%`(C, [instr_1] :: instr_2*{}, `%->%`(t_1*{t_1}, t_3*{t_3})) -- Instr_ok: `%|-%:%`(C, instr_1, `%->%`(t_1*{t_1}, t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C, [instr_2], `%->%`(t_2*{t_2}, t_3*{t_3})) - ;; 3-typing.watsup:141.1-146.38 + ;; 3-typing.watsup:157.1-162.38 rule weak {C : context, instr* : instr*, t'_1* : valtype*, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%*:%`(C, instr*{instr}, `%->%`(t'_1*{t'_1}, t'_2*{t'_2})) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) -- Resulttype_sub: `|-%*<:%*`(t'_1*{t'_1}, t_1*{t_1}) -- Resulttype_sub: `|-%*<:%*`(t_2*{t_2}, t'_2*{t'_2}) - ;; 3-typing.watsup:148.1-150.45 + ;; 3-typing.watsup:164.1-166.45 rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%*:%`(C, instr*{instr}, `%->%`(t*{t} :: t_1*{t_1}, t*{t} :: t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) } -;; 3-typing.watsup:125.1-125.71 +;; 3-typing.watsup:137.1-137.71 relation Expr_ok: `%|-%:%`(context, expr, resulttype) - ;; 3-typing.watsup:128.1-130.46 + ;; 3-typing.watsup:142.1-144.46 rule _ {C : context, instr* : instr*, t* : valtype*}: `%|-%:%`(C, instr*{instr}, t*{t}) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`([], t*{t})) -;; 3-typing.watsup:367.1-367.78 +;; 3-typing.watsup:406.1-406.78 relation Instr_const: `%|-%CONST`(context, instr) - ;; 3-typing.watsup:371.1-372.26 + ;; 3-typing.watsup:410.1-411.26 rule const {C : context, c : c_numtype, nt : numtype}: `%|-%CONST`(C, CONST_instr(nt, c)) - ;; 3-typing.watsup:374.1-375.27 + ;; 3-typing.watsup:413.1-414.27 rule ref.null {C : context, rt : reftype}: `%|-%CONST`(C, REF.NULL_instr(rt)) - ;; 3-typing.watsup:377.1-378.26 + ;; 3-typing.watsup:416.1-417.26 rule ref.func {C : context, x : idx}: `%|-%CONST`(C, REF.FUNC_instr(x)) - ;; 3-typing.watsup:380.1-382.32 + ;; 3-typing.watsup:419.1-421.32 rule global.get {C : context, t : valtype, x : idx}: `%|-%CONST`(C, GLOBAL.GET_instr(x)) -- if (C.GLOBAL_context[x] = `MUT%?%`(?(), t)) -;; 3-typing.watsup:368.1-368.77 +;; 3-typing.watsup:407.1-407.77 relation Expr_const: `%|-%CONST`(context, expr) - ;; 3-typing.watsup:385.1-386.38 + ;; 3-typing.watsup:424.1-425.38 rule _ {C : context, instr* : instr*}: `%|-%CONST`(C, instr*{instr}) -- (Instr_const: `%|-%CONST`(C, instr))*{instr} -;; 3-typing.watsup:369.1-369.78 +;; 3-typing.watsup:408.1-408.78 relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) - ;; 3-typing.watsup:389.1-392.33 + ;; 3-typing.watsup:428.1-431.33 rule _ {C : context, expr : expr, t : valtype}: `%|-%:%CONST`(C, expr, t) -- Expr_ok: `%|-%:%`(C, expr, [t]) -- Expr_const: `%|-%CONST`(C, expr) -;; 3-typing.watsup:397.1-397.73 +;; 3-typing.watsup:438.1-438.73 relation Func_ok: `%|-%:%`(context, func, functype) - ;; 3-typing.watsup:408.1-412.75 + ;; 3-typing.watsup:451.1-455.75 rule _ {C : context, expr : expr, ft : functype, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, `FUNC%%*%`(ft, t*{t}, expr), ft) -- if (ft = `%->%`(t_1*{t_1}, t_2*{t_2})) -- Functype_ok: `|-%:OK`(ft) -- Expr_ok: `%|-%:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL t_1*{t_1} :: t*{t}, LABEL [], RETURN ?()} ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()} ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2})}, expr, t_2*{t_2}) -;; 3-typing.watsup:398.1-398.75 +;; 3-typing.watsup:439.1-439.75 relation Global_ok: `%|-%:%`(context, global, globaltype) - ;; 3-typing.watsup:414.1-418.40 + ;; 3-typing.watsup:457.1-461.40 rule _ {C : context, expr : expr, gt : globaltype, t : valtype}: `%|-%:%`(C, GLOBAL(gt, expr), gt) -- Globaltype_ok: `|-%:OK`(gt) -- if (gt = `MUT%?%`(()?{}, t)) -- Expr_ok_const: `%|-%:%CONST`(C, expr, t) -;; 3-typing.watsup:399.1-399.74 +;; 3-typing.watsup:440.1-440.74 relation Table_ok: `%|-%:%`(context, table, tabletype) - ;; 3-typing.watsup:420.1-422.30 + ;; 3-typing.watsup:463.1-465.30 rule _ {C : context, tt : tabletype}: `%|-%:%`(C, TABLE(tt), tt) -- Tabletype_ok: `|-%:OK`(tt) -;; 3-typing.watsup:400.1-400.72 +;; 3-typing.watsup:441.1-441.72 relation Mem_ok: `%|-%:%`(context, mem, memtype) - ;; 3-typing.watsup:424.1-426.28 + ;; 3-typing.watsup:467.1-469.28 rule _ {C : context, mt : memtype}: `%|-%:%`(C, MEMORY(mt), mt) -- Memtype_ok: `|-%:OK`(mt) -;; 3-typing.watsup:403.1-403.77 +;; 3-typing.watsup:444.1-444.77 relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) - ;; 3-typing.watsup:437.1-440.45 + ;; 3-typing.watsup:480.1-483.45 rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE_elemmode(x, expr), rt) -- if (C.TABLE_context[x] = `%%`(lim, rt)) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} - ;; 3-typing.watsup:442.1-443.20 + ;; 3-typing.watsup:485.1-486.20 rule declare {C : context, rt : reftype}: `%|-%:%`(C, DECLARE_elemmode, rt) -;; 3-typing.watsup:401.1-401.73 +;; 3-typing.watsup:442.1-442.73 relation Elem_ok: `%|-%:%`(context, elem, reftype) - ;; 3-typing.watsup:428.1-431.40 + ;; 3-typing.watsup:471.1-474.40 rule _ {C : context, elemmode? : elemmode?, expr* : expr*, rt : reftype}: `%|-%:%`(C, `ELEM%%*%?`(rt, expr*{expr}, elemmode?{elemmode}), rt) -- (Expr_ok: `%|-%:%`(C, expr, [(rt <: valtype)]))*{expr} -- (Elemmode_ok: `%|-%:%`(C, elemmode, rt))?{elemmode} -;; 3-typing.watsup:404.1-404.77 +;; 3-typing.watsup:445.1-445.77 relation Datamode_ok: `%|-%:OK`(context, datamode) - ;; 3-typing.watsup:445.1-448.45 + ;; 3-typing.watsup:488.1-491.45 rule _ {C : context, expr : expr, mt : memtype}: `%|-%:OK`(C, MEMORY_datamode(0, expr)) -- if (C.MEM_context[0] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} -;; 3-typing.watsup:402.1-402.73 +;; 3-typing.watsup:443.1-443.73 relation Data_ok: `%|-%:OK`(context, data) - ;; 3-typing.watsup:433.1-435.40 + ;; 3-typing.watsup:476.1-478.40 rule _ {C : context, b* : byte*, datamode? : datamode?}: `%|-%:OK`(C, `DATA%*%?`(b*{b}, datamode?{datamode})) -- (Datamode_ok: `%|-%:OK`(C, datamode))?{datamode} -;; 3-typing.watsup:405.1-405.74 +;; 3-typing.watsup:446.1-446.74 relation Start_ok: `%|-%:OK`(context, start) - ;; 3-typing.watsup:450.1-452.39 + ;; 3-typing.watsup:493.1-495.39 rule _ {C : context, x : idx}: `%|-%:OK`(C, START(x)) -- if (C.FUNC_context[x] = `%->%`([], [])) -;; 3-typing.watsup:455.1-455.80 +;; 3-typing.watsup:500.1-500.80 relation Import_ok: `%|-%:%`(context, import, externtype) - ;; 3-typing.watsup:459.1-461.31 + ;; 3-typing.watsup:504.1-506.31 rule _ {C : context, name_1 : name, name_2 : name, xt : externtype}: `%|-%:%`(C, IMPORT(name_1, name_2, xt), xt) -- Externtype_ok: `|-%:OK`(xt) -;; 3-typing.watsup:457.1-457.83 +;; 3-typing.watsup:502.1-502.83 relation Externuse_ok: `%|-%:%`(context, externuse, externtype) - ;; 3-typing.watsup:467.1-469.23 + ;; 3-typing.watsup:512.1-514.23 rule func {C : context, ft : functype, x : idx}: `%|-%:%`(C, FUNC_externuse(x), FUNC_externtype(ft)) -- if (C.FUNC_context[x] = ft) - ;; 3-typing.watsup:471.1-473.25 + ;; 3-typing.watsup:516.1-518.25 rule global {C : context, gt : globaltype, x : idx}: `%|-%:%`(C, GLOBAL_externuse(x), GLOBAL_externtype(gt)) -- if (C.GLOBAL_context[x] = gt) - ;; 3-typing.watsup:475.1-477.24 + ;; 3-typing.watsup:520.1-522.24 rule table {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE_externuse(x), TABLE_externtype(tt)) -- if (C.TABLE_context[x] = tt) - ;; 3-typing.watsup:479.1-481.22 + ;; 3-typing.watsup:524.1-526.22 rule mem {C : context, mt : memtype, x : idx}: `%|-%:%`(C, MEM_externuse(x), MEM_externtype(mt)) -- if (C.MEM_context[x] = mt) -;; 3-typing.watsup:456.1-456.80 +;; 3-typing.watsup:501.1-501.80 relation Export_ok: `%|-%:%`(context, export, externtype) - ;; 3-typing.watsup:463.1-465.39 + ;; 3-typing.watsup:508.1-510.39 rule _ {C : context, externuse : externuse, name : name, xt : externtype}: `%|-%:%`(C, EXPORT(name, externuse), xt) -- Externuse_ok: `%|-%:%`(C, externuse, xt) -;; 3-typing.watsup:484.1-484.62 +;; 3-typing.watsup:531.1-531.62 relation Module_ok: `|-%:OK`(module) - ;; 3-typing.watsup:486.1-500.16 + ;; 3-typing.watsup:533.1-547.16 rule _ {C : context, data^n : data^n, elem* : elem*, export* : export*, ft* : functype*, func* : func*, global* : global*, gt* : globaltype*, import* : import*, mem* : mem*, mt* : memtype*, n : n, rt* : reftype*, start? : start?, table* : table*, tt* : tabletype*}: `|-%:OK`(`MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data^n{data}, start?{start}, export*{export})) -- if (C = {FUNC ft*{ft}, GLOBAL gt*{gt}, TABLE tt*{tt}, MEM mt*{mt}, ELEM rt*{rt}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) @@ -948,114 +948,114 @@ relation Module_ok: `|-%:OK`(module) -- (Start_ok: `%|-%:OK`(C, start))?{start} -- if (|mem*{mem}| <= 1) -;; 4-runtime.watsup:3.1-3.39 +;; 4-runtime.watsup:5.1-5.39 syntax addr = nat -;; 4-runtime.watsup:4.1-4.53 +;; 4-runtime.watsup:6.1-6.53 syntax funcaddr = addr -;; 4-runtime.watsup:5.1-5.53 +;; 4-runtime.watsup:7.1-7.53 syntax globaladdr = addr -;; 4-runtime.watsup:6.1-6.51 +;; 4-runtime.watsup:8.1-8.51 syntax tableaddr = addr -;; 4-runtime.watsup:7.1-7.50 +;; 4-runtime.watsup:9.1-9.50 syntax memaddr = addr -;; 4-runtime.watsup:8.1-8.49 +;; 4-runtime.watsup:10.1-10.49 syntax elemaddr = addr -;; 4-runtime.watsup:9.1-9.49 +;; 4-runtime.watsup:11.1-11.49 syntax dataaddr = addr -;; 4-runtime.watsup:10.1-10.51 +;; 4-runtime.watsup:12.1-12.51 syntax labeladdr = addr -;; 4-runtime.watsup:11.1-11.49 +;; 4-runtime.watsup:13.1-13.49 syntax hostaddr = addr -;; 4-runtime.watsup:24.1-25.24 +;; 4-runtime.watsup:30.1-31.24 syntax num = | CONST(numtype, c_numtype) -;; 4-runtime.watsup:26.1-27.67 +;; 4-runtime.watsup:32.1-33.67 syntax ref = | REF.NULL(reftype) | REF.FUNC_ADDR(funcaddr) | REF.HOST_ADDR(hostaddr) -;; 4-runtime.watsup:28.1-29.10 +;; 4-runtime.watsup:34.1-35.10 syntax val = | CONST(numtype, c_numtype) | REF.NULL(reftype) | REF.FUNC_ADDR(funcaddr) | REF.HOST_ADDR(hostaddr) -;; 4-runtime.watsup:31.1-32.18 +;; 4-runtime.watsup:37.1-38.18 syntax result = | _VALS(val*) | TRAP -;; 4-runtime.watsup:38.1-39.66 +;; 4-runtime.watsup:47.1-48.66 syntax externval = | FUNC(funcaddr) | GLOBAL(globaladdr) | TABLE(tableaddr) | MEM(memaddr) -;; 4-runtime.watsup:44.1-44.44 +;; 4-runtime.watsup:55.1-55.44 def default_ : valtype -> val - ;; 4-runtime.watsup:45.1-45.35 + ;; 4-runtime.watsup:56.1-56.35 def default_(I32_valtype) = CONST_val(I32_numtype, 0) - ;; 4-runtime.watsup:46.1-46.35 + ;; 4-runtime.watsup:57.1-57.35 def default_(I64_valtype) = CONST_val(I64_numtype, 0) - ;; 4-runtime.watsup:47.1-47.35 + ;; 4-runtime.watsup:58.1-58.35 def default_(F32_valtype) = CONST_val(F32_numtype, 0) - ;; 4-runtime.watsup:48.1-48.35 + ;; 4-runtime.watsup:59.1-59.35 def default_(F64_valtype) = CONST_val(F64_numtype, 0) - ;; 4-runtime.watsup:49.1-49.44 + ;; 4-runtime.watsup:60.1-60.44 def default_(FUNCREF_valtype) = REF.NULL_val(FUNCREF_reftype) - ;; 4-runtime.watsup:50.1-50.48 + ;; 4-runtime.watsup:61.1-61.48 def default_(EXTERNREF_valtype) = REF.NULL_val(EXTERNREF_reftype) -;; 4-runtime.watsup:72.1-74.22 +;; 4-runtime.watsup:87.1-89.22 syntax exportinst = {NAME name, VALUE externval} -;; 4-runtime.watsup:84.1-91.25 +;; 4-runtime.watsup:91.1-98.25 syntax moduleinst = {FUNC funcaddr*, GLOBAL globaladdr*, TABLE tableaddr*, MEM memaddr*, ELEM elemaddr*, DATA dataaddr*, EXPORT exportinst*} -;; 4-runtime.watsup:55.1-57.16 +;; 4-runtime.watsup:70.1-72.16 syntax funcinst = {MODULE moduleinst, CODE func} -;; 4-runtime.watsup:58.1-60.16 +;; 4-runtime.watsup:73.1-75.16 syntax globalinst = {TYPE globaltype, VALUE val} -;; 4-runtime.watsup:61.1-63.16 +;; 4-runtime.watsup:76.1-78.16 syntax tableinst = {TYPE tabletype, ELEM ref*} -;; 4-runtime.watsup:64.1-66.17 +;; 4-runtime.watsup:79.1-81.17 syntax meminst = {TYPE memtype, DATA byte*} -;; 4-runtime.watsup:67.1-69.16 +;; 4-runtime.watsup:82.1-84.16 syntax eleminst = {TYPE elemtype, ELEM ref*} -;; 4-runtime.watsup:70.1-71.17 +;; 4-runtime.watsup:85.1-86.17 syntax datainst = {DATA byte*} -;; 4-runtime.watsup:76.1-82.21 +;; 4-runtime.watsup:112.1-118.21 syntax store = {FUNC funcinst*, GLOBAL globalinst*, TABLE tableinst*, MEM meminst*, ELEM eleminst*, DATA datainst*} -;; 4-runtime.watsup:93.1-95.24 +;; 4-runtime.watsup:120.1-122.24 syntax frame = {LOCAL val*, MODULE moduleinst} -;; 4-runtime.watsup:96.1-96.47 +;; 4-runtime.watsup:124.1-124.47 syntax state = `%;%`(store, frame) -;; 4-runtime.watsup:183.1-190.5 +;; 4-runtime.watsup:209.1-216.5 rec { -;; 4-runtime.watsup:183.1-190.5 +;; 4-runtime.watsup:209.1-216.5 syntax admininstr = | UNREACHABLE | NOP @@ -1109,141 +1109,141 @@ syntax admininstr = | TRAP } -;; 4-runtime.watsup:97.1-97.62 +;; 4-runtime.watsup:125.1-125.62 syntax config = `%;%*`(state, admininstr*) -;; 4-runtime.watsup:115.1-115.59 +;; 4-runtime.watsup:134.1-134.59 def funcaddr : state -> funcaddr* - ;; 4-runtime.watsup:116.1-116.38 + ;; 4-runtime.watsup:135.1-135.38 def {f : frame, s : store} funcaddr(`%;%`(s, f)) = f.MODULE_frame.FUNC_moduleinst -;; 4-runtime.watsup:118.1-118.52 +;; 4-runtime.watsup:137.1-137.52 def funcinst : state -> funcinst* - ;; 4-runtime.watsup:125.1-125.31 + ;; 4-runtime.watsup:144.1-144.31 def {f : frame, s : store} funcinst(`%;%`(s, f)) = s.FUNC_store -;; 4-runtime.watsup:119.1-119.58 +;; 4-runtime.watsup:138.1-138.58 def globalinst : state -> globalinst* - ;; 4-runtime.watsup:126.1-126.35 + ;; 4-runtime.watsup:145.1-145.35 def {f : frame, s : store} globalinst(`%;%`(s, f)) = s.GLOBAL_store -;; 4-runtime.watsup:120.1-120.55 +;; 4-runtime.watsup:139.1-139.55 def tableinst : state -> tableinst* - ;; 4-runtime.watsup:127.1-127.33 + ;; 4-runtime.watsup:146.1-146.33 def {f : frame, s : store} tableinst(`%;%`(s, f)) = s.TABLE_store -;; 4-runtime.watsup:121.1-121.49 +;; 4-runtime.watsup:140.1-140.49 def meminst : state -> meminst* - ;; 4-runtime.watsup:128.1-128.29 + ;; 4-runtime.watsup:147.1-147.29 def {f : frame, s : store} meminst(`%;%`(s, f)) = s.MEM_store -;; 4-runtime.watsup:122.1-122.52 +;; 4-runtime.watsup:141.1-141.52 def eleminst : state -> eleminst* - ;; 4-runtime.watsup:129.1-129.31 + ;; 4-runtime.watsup:148.1-148.31 def {f : frame, s : store} eleminst(`%;%`(s, f)) = s.ELEM_store -;; 4-runtime.watsup:123.1-123.52 +;; 4-runtime.watsup:142.1-142.52 def datainst : state -> datainst* - ;; 4-runtime.watsup:130.1-130.31 + ;; 4-runtime.watsup:149.1-149.31 def {f : frame, s : store} datainst(`%;%`(s, f)) = s.DATA_store -;; 4-runtime.watsup:132.1-132.67 +;; 4-runtime.watsup:151.1-151.67 def func : (state, funcidx) -> funcinst - ;; 4-runtime.watsup:140.1-140.48 + ;; 4-runtime.watsup:159.1-159.48 def {f : frame, s : store, x : idx} func(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[x]] -;; 4-runtime.watsup:133.1-133.69 +;; 4-runtime.watsup:152.1-152.69 def global : (state, globalidx) -> globalinst - ;; 4-runtime.watsup:141.1-141.54 + ;; 4-runtime.watsup:160.1-160.54 def {f : frame, s : store, x : idx} global(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x]] -;; 4-runtime.watsup:134.1-134.68 +;; 4-runtime.watsup:153.1-153.68 def table : (state, tableidx) -> tableinst - ;; 4-runtime.watsup:142.1-142.51 + ;; 4-runtime.watsup:161.1-161.51 def {f : frame, s : store, x : idx} table(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]] -;; 4-runtime.watsup:135.1-135.66 +;; 4-runtime.watsup:154.1-154.66 def mem : (state, memidx) -> meminst - ;; 4-runtime.watsup:143.1-143.45 + ;; 4-runtime.watsup:162.1-162.45 def {f : frame, s : store, x : idx} mem(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[x]] -;; 4-runtime.watsup:136.1-136.67 +;; 4-runtime.watsup:155.1-155.67 def elem : (state, tableidx) -> eleminst - ;; 4-runtime.watsup:144.1-144.48 + ;; 4-runtime.watsup:163.1-163.48 def {f : frame, s : store, x : idx} elem(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[x]] -;; 4-runtime.watsup:137.1-137.67 +;; 4-runtime.watsup:156.1-156.67 def data : (state, dataidx) -> datainst - ;; 4-runtime.watsup:145.1-145.48 + ;; 4-runtime.watsup:164.1-164.48 def {f : frame, s : store, x : idx} data(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[x]] -;; 4-runtime.watsup:138.1-138.68 +;; 4-runtime.watsup:157.1-157.68 def local : (state, localidx) -> val - ;; 4-runtime.watsup:146.1-146.35 + ;; 4-runtime.watsup:165.1-165.35 def {f : frame, s : store, x : idx} local(`%;%`(s, f), x) = f.LOCAL_frame[x] -;; 4-runtime.watsup:149.1-149.78 +;; 4-runtime.watsup:168.1-168.78 def with_local : (state, localidx, val) -> state - ;; 4-runtime.watsup:158.1-158.52 + ;; 4-runtime.watsup:177.1-177.52 def {f : frame, s : store, v : val, x : idx} with_local(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[x] = v]) -;; 4-runtime.watsup:150.1-150.85 +;; 4-runtime.watsup:169.1-169.85 def with_global : (state, globalidx, val) -> state - ;; 4-runtime.watsup:159.1-159.77 + ;; 4-runtime.watsup:178.1-178.77 def {f : frame, s : store, v : val, x : idx} with_global(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x]].VALUE_globalinst = v], f) -;; 4-runtime.watsup:151.1-151.88 +;; 4-runtime.watsup:170.1-170.88 def with_table : (state, tableidx, nat, ref) -> state - ;; 4-runtime.watsup:160.1-160.79 + ;; 4-runtime.watsup:179.1-179.79 def {f : frame, i : nat, r : ref, s : store, x : idx} with_table(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]].ELEM_tableinst[i] = r], f) -;; 4-runtime.watsup:152.1-152.84 +;; 4-runtime.watsup:171.1-171.84 def with_tableinst : (state, tableidx, tableinst) -> state - ;; 4-runtime.watsup:161.1-161.74 + ;; 4-runtime.watsup:180.1-180.74 def {f : frame, s : store, ti : tableinst, x : idx} with_tableinst(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]] = ti], f) -;; 4-runtime.watsup:153.1-153.93 +;; 4-runtime.watsup:172.1-172.93 def with_mem : (state, memidx, nat, nat, byte*) -> state - ;; 4-runtime.watsup:162.1-162.82 + ;; 4-runtime.watsup:181.1-181.82 def {b* : byte*, f : frame, i : nat, j : nat, s : store, x : idx} with_mem(`%;%`(s, f), x, i, j, b*{b}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x]].DATA_meminst[i : j] = b*{b}], f) -;; 4-runtime.watsup:154.1-154.77 +;; 4-runtime.watsup:173.1-173.77 def with_meminst : (state, memidx, meminst) -> state - ;; 4-runtime.watsup:163.1-163.68 + ;; 4-runtime.watsup:182.1-182.68 def {f : frame, mi : meminst, s : store, x : idx} with_meminst(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x]] = mi], f) -;; 4-runtime.watsup:155.1-155.82 +;; 4-runtime.watsup:174.1-174.82 def with_elem : (state, elemidx, ref*) -> state - ;; 4-runtime.watsup:164.1-164.72 + ;; 4-runtime.watsup:183.1-183.72 def {f : frame, r* : ref*, s : store, x : idx} with_elem(`%;%`(s, f), x, r*{r}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x]].ELEM_eleminst = r*{r}], f) -;; 4-runtime.watsup:156.1-156.82 +;; 4-runtime.watsup:175.1-175.82 def with_data : (state, dataidx, byte*) -> state - ;; 4-runtime.watsup:165.1-165.72 + ;; 4-runtime.watsup:184.1-184.72 def {b* : byte*, f : frame, s : store, x : idx} with_data(`%;%`(s, f), x, b*{b}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x]].DATA_datainst = b*{b}], f) -;; 4-runtime.watsup:167.1-167.63 +;; 4-runtime.watsup:189.1-189.63 def grow_table : (tableinst, nat, ref) -> tableinst - ;; 4-runtime.watsup:170.1-174.36 + ;; 4-runtime.watsup:192.1-196.36 def {i : nat, i' : nat, j : nat, n : n, r : ref, r'* : ref*, rt : reftype, ti : tableinst, ti' : tableinst} grow_table(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{}}) -- Tabletype_ok: `|-%:OK`(ti'.TYPE_tableinst) -;; 4-runtime.watsup:168.1-168.55 +;; 4-runtime.watsup:190.1-190.55 def grow_memory : (meminst, nat) -> meminst - ;; 4-runtime.watsup:175.1-179.34 + ;; 4-runtime.watsup:198.1-202.34 def {b* : byte*, i : nat, i' : nat, j : nat, mi : meminst, mi' : meminst, n : n} grow_memory(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){}}) -- Memtype_ok: `|-%:OK`(mi'.TYPE_meminst) -;; 4-runtime.watsup:192.1-195.21 +;; 4-runtime.watsup:218.1-221.21 rec { -;; 4-runtime.watsup:192.1-195.21 +;; 4-runtime.watsup:218.1-221.21 syntax E = | _HOLE | _SEQ(val*, E, instr*) @@ -1274,480 +1274,469 @@ def wrap_ : ((nat, nat), c_numtype) -> nat ;; 5-numerics.watsup:13.1-13.28 def bytes_ : (nat, c_numtype) -> byte* -;; 6-reduction.watsup:4.1-4.63 +;; 6-reduction.watsup:6.1-6.63 relation Step_pure: `%*~>%*`(admininstr*, admininstr*) - ;; 6-reduction.watsup:16.1-17.24 + ;; 6-reduction.watsup:24.1-25.24 rule unreachable: `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) - ;; 6-reduction.watsup:19.1-20.19 + ;; 6-reduction.watsup:27.1-28.19 rule nop: `%*~>%*`([NOP_admininstr], []) - ;; 6-reduction.watsup:22.1-23.24 + ;; 6-reduction.watsup:30.1-31.24 rule drop {val : val}: `%*~>%*`([(val <: admininstr) DROP_admininstr], []) - ;; 6-reduction.watsup:26.1-28.16 + ;; 6-reduction.watsup:34.1-36.16 rule select-true {c : c_numtype, t? : valtype?, val_1 : val, val_2 : val}: `%*~>%*`([(val_1 <: admininstr) (val_2 <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t?{t})], [(val_1 <: admininstr)]) -- if (c =/= 0) - ;; 6-reduction.watsup:30.1-32.14 + ;; 6-reduction.watsup:38.1-40.14 rule select-false {c : c_numtype, t? : valtype?, val_1 : val, val_2 : val}: `%*~>%*`([(val_1 <: admininstr) (val_2 <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t?{t})], [(val_2 <: admininstr)]) -- if (c = 0) - ;; 6-reduction.watsup:35.1-37.28 + ;; 6-reduction.watsup:45.1-47.28 rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k}: `%*~>%*`((val <: admininstr)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})], [LABEL__admininstr(n, [], (val <: admininstr)^k{val} :: (instr <: admininstr)*{instr})]) -- if (bt = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 6-reduction.watsup:39.1-41.28 + ;; 6-reduction.watsup:49.1-51.28 rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k}: `%*~>%*`((val <: admininstr)^k{val} :: [LOOP_admininstr(bt, instr*{instr})], [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], (val <: admininstr)^k{val} :: (instr <: admininstr)*{instr})]) -- if (bt = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 6-reduction.watsup:43.1-45.16 + ;; 6-reduction.watsup:53.1-55.16 rule if-true {bt : blocktype, c : c_numtype, 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) - ;; 6-reduction.watsup:47.1-49.14 + ;; 6-reduction.watsup:57.1-59.14 rule if-false {bt : blocktype, c : c_numtype, 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) - ;; 6-reduction.watsup:52.1-53.38 + ;; 6-reduction.watsup:62.1-63.38 rule label-vals {instr* : instr*, n : n, val* : val*}: `%*~>%*`([LABEL__admininstr(n, instr*{instr}, (val <: admininstr)*{val})], (val <: admininstr)*{val}) - ;; 6-reduction.watsup:57.1-58.69 + ;; 6-reduction.watsup:69.1-70.69 rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val' <: admininstr)*{val'} :: (val <: admininstr)^n{val} :: [BR_admininstr(0)] :: (instr <: admininstr)*{instr})], (val <: admininstr)^n{val} :: (instr' <: admininstr)*{instr'}) - ;; 6-reduction.watsup:60.1-61.65 + ;; 6-reduction.watsup:72.1-73.65 rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val <: admininstr)*{val} :: [BR_admininstr(l + 1)] :: (instr <: admininstr)*{instr})], (val <: admininstr)*{val} :: [BR_admininstr(l)]) - ;; 6-reduction.watsup:64.1-66.16 + ;; 6-reduction.watsup:76.1-78.16 rule br_if-true {c : c_numtype, l : labelidx}: `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) -- if (c =/= 0) - ;; 6-reduction.watsup:68.1-70.14 + ;; 6-reduction.watsup:80.1-82.14 rule br_if-false {c : c_numtype, l : labelidx}: `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) -- if (c = 0) - ;; 6-reduction.watsup:73.1-75.17 + ;; 6-reduction.watsup:85.1-87.17 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}|) - ;; 6-reduction.watsup:77.1-79.18 + ;; 6-reduction.watsup:89.1-91.18 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}|) - ;; 6-reduction.watsup:102.1-103.35 + ;; 6-reduction.watsup:116.1-117.35 rule frame-vals {f : frame, n : n, val^n : val^n}: `%*~>%*`([FRAME__admininstr(n, f, (val <: admininstr)^n{val})], (val <: admininstr)^n{val}) - ;; 6-reduction.watsup:105.1-106.55 + ;; 6-reduction.watsup:119.1-120.55 rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: `%*~>%*`([FRAME__admininstr(n, f, (val' <: admininstr)*{val'} :: (val <: admininstr)^n{val} :: [RETURN_admininstr] :: (instr <: admininstr)*{instr})], (val <: admininstr)^n{val}) - ;; 6-reduction.watsup:108.1-109.60 + ;; 6-reduction.watsup:122.1-123.60 rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, (val <: admininstr)*{val} :: [RETURN_admininstr] :: (instr <: admininstr)*{instr})], (val <: admininstr)*{val} :: [RETURN_admininstr]) - ;; 6-reduction.watsup:112.1-114.33 + ;; 6-reduction.watsup:128.1-130.33 rule unop-val {c : c_numtype, c_1 : c_numtype, nt : numtype, unop : unop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) -- if ($unop(unop, nt, c_1) = [c]) - ;; 6-reduction.watsup:116.1-118.39 + ;; 6-reduction.watsup:132.1-134.39 rule unop-trap {c_1 : c_numtype, nt : numtype, unop : unop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) -- if ($unop(unop, nt, c_1) = []) - ;; 6-reduction.watsup:121.1-123.40 + ;; 6-reduction.watsup:137.1-139.40 rule binop-val {binop : binop_numtype, c : c_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- if ($binop(binop, nt, c_1, c_2) = [c]) - ;; 6-reduction.watsup:125.1-127.46 + ;; 6-reduction.watsup:141.1-143.46 rule binop-trap {binop : binop_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) -- if ($binop(binop, nt, c_1, c_2) = []) - ;; 6-reduction.watsup:130.1-132.37 + ;; 6-reduction.watsup:146.1-148.37 rule testop {c : c_numtype, c_1 : c_numtype, nt : numtype, testop : testop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $testop(testop, nt, c_1)) - ;; 6-reduction.watsup:134.1-136.40 + ;; 6-reduction.watsup:150.1-152.40 rule relop {c : c_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype, relop : relop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $relop(relop, nt, c_1, c_2)) - ;; 6-reduction.watsup:139.1-140.70 + ;; 6-reduction.watsup:155.1-156.70 rule extend {c : c_numtype, n : n, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, $size(nt <: valtype), S_sx, c))]) - ;; 6-reduction.watsup:143.1-145.48 + ;; 6-reduction.watsup:159.1-161.48 rule cvtop-val {c : c_numtype, c_1 : c_numtype, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) -- if ($cvtop(nt_1, cvtop, nt_2, sx?{sx}, c_1) = [c]) - ;; 6-reduction.watsup:147.1-149.54 + ;; 6-reduction.watsup:163.1-165.54 rule cvtop-trap {c_1 : c_numtype, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) -- if ($cvtop(nt_1, cvtop, nt_2, sx?{sx}, c_1) = []) - ;; 6-reduction.watsup:156.1-158.28 + ;; 6-reduction.watsup:174.1-176.28 rule ref.is_null-true {rt : reftype, val : val}: `%*~>%*`([(val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) -- if (val = REF.NULL_val(rt)) - ;; 6-reduction.watsup:160.1-162.15 + ;; 6-reduction.watsup:178.1-180.15 rule ref.is_null-false {val : val}: `%*~>%*`([(val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 6-reduction.watsup:171.1-172.47 + ;; 6-reduction.watsup:191.1-192.47 rule local.tee {val : val, x : idx}: `%*~>%*`([(val <: admininstr) LOCAL.TEE_admininstr(x)], [(val <: admininstr) (val <: admininstr) LOCAL.SET_admininstr(x)]) -;; 6-reduction.watsup:5.1-5.63 +;; 6-reduction.watsup:7.1-7.63 relation Step_read: `%~>%*`(config, admininstr*) - ;; 6-reduction.watsup:82.1-83.47 + ;; 6-reduction.watsup:96.1-97.47 rule call {x : idx, z : state}: `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [CALL_ADDR_admininstr($funcaddr(z)[x])]) - ;; 6-reduction.watsup:85.1-89.17 + ;; 6-reduction.watsup:99.1-103.17 rule call_indirect-call {a : addr, ft : functype, ft' : functype, i : nat, instr* : instr*, t* : valtype*, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CALL_INDIRECT_admininstr(x, ft)]), [CALL_ADDR_admininstr(a)]) -- if ($table(z, x).ELEM_tableinst[i] = REF.FUNC_ADDR_ref(a)) -- if ($funcinst(z)[a].CODE_funcinst = `FUNC%%*%`(ft', t*{t}, instr*{instr})) -- if (ft = ft') - ;; 6-reduction.watsup:91.1-93.15 + ;; 6-reduction.watsup:105.1-107.15 rule call_indirect-trap {ft : functype, i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CALL_INDIRECT_admininstr(x, ft)]), [TRAP_admininstr]) -- otherwise - ;; 6-reduction.watsup:95.1-99.52 + ;; 6-reduction.watsup:109.1-113.52 rule call_addr {a : addr, f : frame, func : func, instr* : instr*, k : nat, m : moduleinst, n : n, t* : valtype*, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: `%~>%*`(`%;%*`(z, (val <: admininstr)^k{val} :: [CALL_ADDR_admininstr(a)]), [FRAME__admininstr(n, f, [LABEL__admininstr(n, [], (instr <: admininstr)*{instr})])]) -- if ($funcinst(z)[a] = {MODULE m, CODE func}) -- if (func = `FUNC%%*%`(`%->%`(t_1^k{t_1}, t_2^n{t_2}), t*{t}, instr*{instr})) -- if (f = {LOCAL val^k{val} :: $default_(t)*{t}, MODULE m}) - ;; 6-reduction.watsup:152.1-153.53 + ;; 6-reduction.watsup:170.1-171.53 rule ref.func {x : idx, z : state}: `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) - ;; 6-reduction.watsup:165.1-166.37 + ;; 6-reduction.watsup:185.1-186.37 rule local.get {x : idx, z : state}: `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [($local(z, x) <: admininstr)]) - ;; 6-reduction.watsup:175.1-176.45 + ;; 6-reduction.watsup:197.1-198.45 rule global.get {x : idx, z : state}: `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst <: admininstr)]) - ;; 6-reduction.watsup:182.1-184.33 + ;; 6-reduction.watsup:206.1-208.33 rule table.get-trap {i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:186.1-188.32 + ;; 6-reduction.watsup:210.1-212.32 rule table.get-val {i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] <: admininstr)]) -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:199.1-201.32 + ;; 6-reduction.watsup:223.1-225.32 rule table.size {n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) -- if (|$table(z, x).ELEM_tableinst| = n) - ;; 6-reduction.watsup:212.1-214.39 + ;; 6-reduction.watsup:236.1-238.39 rule table.fill-trap {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:216.1-219.14 + ;; 6-reduction.watsup:240.1-243.14 rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:221.1-225.15 + ;; 6-reduction.watsup:245.1-249.15 rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) (val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) (val <: admininstr) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) -- otherwise - ;; 6-reduction.watsup:228.1-230.73 + ;; 6-reduction.watsup:252.1-254.73 rule table.copy-trap {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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|)) - ;; 6-reduction.watsup:232.1-235.14 + ;; 6-reduction.watsup:256.1-259.14 rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:237.1-242.15 + ;; 6-reduction.watsup:261.1-266.15 rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:244.1-248.15 + ;; 6-reduction.watsup:268.1-272.15 rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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 - ;; 6-reduction.watsup:251.1-253.72 + ;; 6-reduction.watsup:275.1-277.72 rule table.init-trap {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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|)) - ;; 6-reduction.watsup:255.1-258.14 + ;; 6-reduction.watsup:279.1-282.14 rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:260.1-264.15 + ;; 6-reduction.watsup:284.1-288.15 rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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] <: 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 - ;; 6-reduction.watsup:271.1-273.53 + ;; 6-reduction.watsup:297.1-299.53 rule load-num-trap {i : nat, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), n_A, n_O)]), [TRAP_admininstr]) -- if (((i + n_O) + ($size(nt <: valtype) / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:275.1-277.71 + ;; 6-reduction.watsup:301.1-303.71 rule load-num-val {c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), n_A, n_O)]), [CONST_admininstr(nt, c)]) -- if ($bytes_($size(nt <: valtype), c) = $mem(z, 0).DATA_meminst[(i + n_O) : ($size(nt <: valtype) / 8)]) - ;; 6-reduction.watsup:279.1-281.45 + ;; 6-reduction.watsup:305.1-307.45 rule load-pack-trap {i : nat, n : n, n_A : n, n_O : n, nt : numtype, sx : sx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), n_A, n_O)]), [TRAP_admininstr]) -- if (((i + n_O) + (n / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:283.1-285.55 + ;; 6-reduction.watsup:309.1-311.55 rule load-pack-val {c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, sx : sx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), n_A, n_O)]), [CONST_admininstr(nt, $ext(n, $size(nt <: valtype), sx, c))]) -- if ($bytes_(n, c) = $mem(z, 0).DATA_meminst[(i + n_O) : (n / 8)]) - ;; 6-reduction.watsup:305.1-307.44 + ;; 6-reduction.watsup:331.1-333.44 rule memory.size {n : n, z : state}: `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr]), [CONST_admininstr(I32_numtype, n)]) -- if (((n * 64) * $Ki) = |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:318.1-320.37 + ;; 6-reduction.watsup:344.1-346.37 rule memory.fill-trap {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), [TRAP_admininstr]) -- if ((i + n) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:322.1-325.14 + ;; 6-reduction.watsup:348.1-351.14 rule memory.fill-zero {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:327.1-331.15 + ;; 6-reduction.watsup:353.1-357.15 rule memory.fill-succ {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), [CONST_admininstr(I32_numtype, i) (val <: admininstr) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (i + 1)) (val <: admininstr) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr]) -- otherwise - ;; 6-reduction.watsup:334.1-336.69 + ;; 6-reduction.watsup:360.1-362.69 rule memory.copy-trap {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [TRAP_admininstr]) -- if (((i + n) > |$mem(z, 0).DATA_meminst|) \/ ((j + n) > |$mem(z, 0).DATA_meminst|)) - ;; 6-reduction.watsup:338.1-341.14 + ;; 6-reduction.watsup:364.1-367.14 rule memory.copy-zero {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:343.1-348.15 + ;; 6-reduction.watsup:369.1-374.15 rule memory.copy-le {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) LOAD_admininstr(I32_numtype, ?((8, U_sx)), 0, 0) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr]) -- otherwise -- if (j <= i) - ;; 6-reduction.watsup:350.1-354.15 + ;; 6-reduction.watsup:376.1-380.15 rule memory.copy-gt {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), 0, 0) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr]) -- otherwise - ;; 6-reduction.watsup:357.1-359.70 + ;; 6-reduction.watsup:383.1-385.70 rule memory.init-trap {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), [TRAP_admininstr]) -- if (((i + n) > |$data(z, x).DATA_datainst|) \/ ((j + n) > |$mem(z, 0).DATA_meminst|)) - ;; 6-reduction.watsup:361.1-364.14 + ;; 6-reduction.watsup:387.1-390.14 rule memory.init-zero {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:366.1-370.15 + ;; 6-reduction.watsup:392.1-396.15 rule memory.init-succ {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, x).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x)]) -- otherwise -;; 6-reduction.watsup:3.1-3.63 +;; 6-reduction.watsup:5.1-5.63 relation Step: `%~>%`(config, config) - ;; 6-reduction.watsup:7.1-9.34 + ;; 6-reduction.watsup:9.1-11.34 rule pure {instr* : instr*, instr'* : instr*, z : state}: `%~>%`(`%;%*`(z, (instr <: admininstr)*{instr}), `%;%*`(z, (instr' <: admininstr)*{instr'})) -- Step_pure: `%*~>%*`((instr <: admininstr)*{instr}, (instr' <: admininstr)*{instr'}) - ;; 6-reduction.watsup:11.1-13.37 + ;; 6-reduction.watsup:13.1-15.37 rule read {instr* : instr*, instr'* : instr*, z : state}: `%~>%`(`%;%*`(z, (instr <: admininstr)*{instr}), `%;%*`(z, (instr' <: admininstr)*{instr'})) -- Step_read: `%~>%*`(`%;%*`(z, (instr <: admininstr)*{instr}), (instr' <: admininstr)*{instr'}) - ;; 6-reduction.watsup:168.1-169.60 + ;; 6-reduction.watsup:188.1-189.60 rule local.set {val : val, x : idx, z : state}: `%~>%`(`%;%*`(z, [(val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) - ;; 6-reduction.watsup:178.1-179.62 + ;; 6-reduction.watsup:200.1-201.62 rule global.set {val : val, x : idx, z : state}: `%~>%`(`%;%*`(z, [(val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) - ;; 6-reduction.watsup:190.1-192.33 + ;; 6-reduction.watsup:214.1-216.33 rule table.set-trap {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:194.1-196.32 + ;; 6-reduction.watsup:218.1-220.32 rule table.set-val {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:204.1-206.47 + ;; 6-reduction.watsup:228.1-230.47 rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state}: `%~>%`(`%;%*`(z, [(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 ($grow_table($table(z, x), n, ref) = ti) - ;; 6-reduction.watsup:208.1-209.64 + ;; 6-reduction.watsup:232.1-233.64 rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [(ref <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, - 1)])) - ;; 6-reduction.watsup:267.1-268.59 + ;; 6-reduction.watsup:291.1-292.59 rule elem.drop {x : idx, z : state}: `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) - ;; 6-reduction.watsup:288.1-290.53 + ;; 6-reduction.watsup:314.1-316.53 rule store-num-trap {c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), n_A, n_O)]), `%;%*`(z, [TRAP_admininstr])) -- if (((i + n_O) + ($size(nt <: valtype) / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:292.1-294.35 + ;; 6-reduction.watsup:318.1-320.35 rule store-num-val {b* : byte*, c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), n_A, n_O)]), `%;%*`($with_mem(z, 0, (i + n_O), ($size(nt <: valtype) / 8), b*{b}), [])) -- if (b*{b} = $bytes_($size(nt <: valtype), c)) - ;; 6-reduction.watsup:296.1-298.45 + ;; 6-reduction.watsup:322.1-324.45 rule store-pack-trap {c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), n_A, n_O)]), `%;%*`(z, [TRAP_admininstr])) -- if (((i + n_O) + (n / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:300.1-302.50 + ;; 6-reduction.watsup:326.1-328.50 rule store-pack-val {b* : byte*, c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), n_A, n_O)]), `%;%*`($with_mem(z, 0, (i + n_O), (n / 8), b*{b}), [])) -- if (b*{b} = $bytes_(n, $wrap_(($size(nt <: valtype), n), c))) - ;; 6-reduction.watsup:310.1-312.41 + ;; 6-reduction.watsup:336.1-338.41 rule memory.grow-succeed {mi : meminst, n : n, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr]), `%;%*`($with_meminst(z, 0, mi), [CONST_admininstr(I32_numtype, (|$mem(z, 0).DATA_meminst| / (64 * $Ki)))])) -- if ($grow_memory($mem(z, 0), n) = mi) - ;; 6-reduction.watsup:314.1-315.59 + ;; 6-reduction.watsup:340.1-341.59 rule memory.grow-fail {n : n, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr]), `%;%*`(z, [CONST_admininstr(I32_numtype, - 1)])) - ;; 6-reduction.watsup:373.1-374.59 + ;; 6-reduction.watsup:399.1-400.59 rule data.drop {x : idx, z : state}: `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) -;; 7-module.watsup:4.1-4.35 +;; 7-module.watsup:5.1-5.35 rec { -;; 7-module.watsup:4.1-4.35 +;; 7-module.watsup:5.1-5.35 def funcs : externval* -> funcaddr* - ;; 7-module.watsup:5.1-5.30 + ;; 7-module.watsup:6.1-6.30 def funcs([]) = [] - ;; 7-module.watsup:6.1-6.59 + ;; 7-module.watsup:7.1-7.59 def {externval'* : externval*, fa : funcaddr} funcs([FUNC_externval(fa)] :: externval'*{externval'}) = [fa] :: $funcs(externval'*{externval'}) - ;; 7-module.watsup:7.1-8.15 + ;; 7-module.watsup:8.1-9.15 def {externval : externval, externval'* : externval*} funcs([externval] :: externval'*{externval'}) = $funcs(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:10.1-10.39 +;; 7-module.watsup:11.1-11.39 rec { -;; 7-module.watsup:10.1-10.39 +;; 7-module.watsup:11.1-11.39 def globals : externval* -> globaladdr* - ;; 7-module.watsup:11.1-11.32 + ;; 7-module.watsup:12.1-12.32 def globals([]) = [] - ;; 7-module.watsup:12.1-12.65 + ;; 7-module.watsup:13.1-13.65 def {externval'* : externval*, ga : globaladdr} globals([GLOBAL_externval(ga)] :: externval'*{externval'}) = [ga] :: $globals(externval'*{externval'}) - ;; 7-module.watsup:13.1-14.15 + ;; 7-module.watsup:14.1-15.15 def {externval : externval, externval'* : externval*} globals([externval] :: externval'*{externval'}) = $globals(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:16.1-16.37 +;; 7-module.watsup:17.1-17.37 rec { -;; 7-module.watsup:16.1-16.37 +;; 7-module.watsup:17.1-17.37 def tables : externval* -> tableaddr* - ;; 7-module.watsup:17.1-17.31 + ;; 7-module.watsup:18.1-18.31 def tables([]) = [] - ;; 7-module.watsup:18.1-18.62 + ;; 7-module.watsup:19.1-19.62 def {externval'* : externval*, ta : tableaddr} tables([TABLE_externval(ta)] :: externval'*{externval'}) = [ta] :: $tables(externval'*{externval'}) - ;; 7-module.watsup:19.1-20.15 + ;; 7-module.watsup:20.1-21.15 def {externval : externval, externval'* : externval*} tables([externval] :: externval'*{externval'}) = $tables(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:22.1-22.33 +;; 7-module.watsup:23.1-23.33 rec { -;; 7-module.watsup:22.1-22.33 +;; 7-module.watsup:23.1-23.33 def mems : externval* -> memaddr* - ;; 7-module.watsup:23.1-23.29 + ;; 7-module.watsup:24.1-24.29 def mems([]) = [] - ;; 7-module.watsup:24.1-24.56 + ;; 7-module.watsup:25.1-25.56 def {externval'* : externval*, ma : memaddr} mems([MEM_externval(ma)] :: externval'*{externval'}) = [ma] :: $mems(externval'*{externval'}) - ;; 7-module.watsup:25.1-26.15 + ;; 7-module.watsup:26.1-27.15 def {externval : externval, externval'* : externval*} mems([externval] :: externval'*{externval'}) = $mems(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:29.1-29.83 -def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst - ;; 7-module.watsup:30.1-30.95 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externuse(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} - ;; 7-module.watsup:31.1-31.99 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externuse(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} - ;; 7-module.watsup:32.1-32.97 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externuse(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} - ;; 7-module.watsup:33.1-33.93 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externuse(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} - ;; 7-module.watsup:36.1-36.60 def allocfunc : (store, moduleinst, func) -> (store, funcaddr) ;; 7-module.watsup:37.1-38.37 @@ -1862,9 +1851,20 @@ def allocdatas : (store, byte**) -> (store, dataaddr*) -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) } -;; 7-module.watsup:97.1-97.81 +;; 7-module.watsup:99.1-99.83 +def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst + ;; 7-module.watsup:100.1-100.95 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externuse(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} + ;; 7-module.watsup:101.1-101.99 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externuse(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} + ;; 7-module.watsup:102.1-102.97 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externuse(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} + ;; 7-module.watsup:103.1-103.93 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externuse(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} + +;; 7-module.watsup:106.1-106.81 def allocmodule : (store, module, externval*, val*, ref**) -> (store, moduleinst) - ;; 7-module.watsup:98.1-135.54 + ;; 7-module.watsup:107.1-144.54 def {byte*^n_data : byte*^n_data, da* : dataaddr*, datamode?^n_data : datamode?^n_data, ea* : elemaddr*, elemmode?^n_elem : elemmode?^n_elem, export* : export*, expr_1^n_global : expr^n_global, expr_2*^n_elem : expr*^n_elem, externval* : externval*, fa* : funcaddr*, fa_ex* : funcaddr*, func^n_func : func^n_func, ga* : globaladdr*, ga_ex* : globaladdr*, globaltype^n_global : globaltype^n_global, i_data^n_data : nat^n_data, i_elem^n_elem : nat^n_elem, i_func^n_func : nat^n_func, i_global^n_global : nat^n_global, i_mem^n_mem : nat^n_mem, i_table^n_table : nat^n_table, import* : import*, m : moduleinst, ma* : memaddr*, ma_ex* : memaddr*, memtype^n_mem : memtype^n_mem, module : module, n_data : n, n_elem : n, n_func : n, n_global : n, n_mem : n, n_table : n, ref** : ref**, rt^n_elem : reftype^n_elem, s : store, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store, s_6 : store, start? : start?, ta* : tableaddr*, ta_ex* : tableaddr*, tabletype^n_table : tabletype^n_table, val* : val*, xi* : exportinst*} allocmodule(s, module, externval*{externval}, val*{val}, ref*{ref}*{ref}) = (s_6, m) -- if (module = `MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func^n_func{func}, GLOBAL(globaltype, expr_1)^n_global{expr_1 globaltype}, TABLE(tabletype)^n_table{tabletype}, MEMORY(memtype)^n_mem{memtype}, `ELEM%%*%?`(rt, expr_2*{expr_2}, elemmode?{elemmode})^n_elem{elemmode expr_2 rt}, `DATA%*%?`(byte*{byte}, datamode?{datamode})^n_data{byte datamode}, start?{start}, export*{export})) -- if (fa_ex*{fa_ex} = $funcs(externval*{externval})) @@ -1886,39 +1886,39 @@ def allocmodule : (store, module, externval*, val*, ref**) -> (store, moduleinst -- if ((s_5, ea*{ea}) = $allocelems(s_4, rt^n_elem{rt}, ref*{ref}*{ref})) -- if ((s_6, da*{da}) = $allocdatas(s_5, byte*{byte}^n_data{byte})) -;; 7-module.watsup:138.1-138.33 +;; 7-module.watsup:151.1-151.36 +rec { + +;; 7-module.watsup:151.1-151.36 +def concat_instr : instr** -> instr* + ;; 7-module.watsup:152.1-152.37 + def concat_instr([]) = [] + ;; 7-module.watsup:153.1-153.68 + def {instr* : instr*, instr'** : instr**} concat_instr([instr]*{instr} :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) +} + +;; 7-module.watsup:155.1-155.33 def runelem : (elem, idx) -> instr* - ;; 7-module.watsup:139.1-139.46 + ;; 7-module.watsup:156.1-156.46 def {expr* : expr*, i : nat, reftype : reftype} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?()), i) = [] - ;; 7-module.watsup:140.1-140.62 + ;; 7-module.watsup:157.1-157.62 def {expr* : expr*, i : nat, reftype : reftype} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?(DECLARE_elemmode)), i) = [ELEM.DROP_instr(i)] - ;; 7-module.watsup:141.1-143.20 + ;; 7-module.watsup:158.1-160.20 def {expr* : expr*, i : nat, instr* : instr*, n : n, reftype : reftype, x : idx} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?(TABLE_elemmode(x, instr*{instr}))), i) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, n) TABLE.INIT_instr(x, i) ELEM.DROP_instr(i)] -- if (n = |expr*{expr}|) -;; 7-module.watsup:145.1-145.33 +;; 7-module.watsup:162.1-162.33 def rundata : (data, idx) -> instr* - ;; 7-module.watsup:146.1-146.38 + ;; 7-module.watsup:163.1-163.38 def {byte* : byte*, i : nat} rundata(`DATA%*%?`(byte*{byte}, ?()), i) = [] - ;; 7-module.watsup:147.1-149.20 + ;; 7-module.watsup:164.1-166.20 def {byte* : byte*, i : nat, instr* : instr*, n : n} rundata(`DATA%*%?`(byte*{byte}, ?(MEMORY_datamode(0, instr*{instr}))), i) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, n) MEMORY.INIT_instr(i) DATA.DROP_instr(i)] -- if (n = |byte*{byte}|) -;; 7-module.watsup:152.1-152.36 -rec { - -;; 7-module.watsup:152.1-152.36 -def concat_instr : instr** -> instr* - ;; 7-module.watsup:153.1-153.37 - def concat_instr([]) = [] - ;; 7-module.watsup:154.1-154.68 - def {instr* : instr*, instr'** : instr**} concat_instr([instr]*{instr} :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) -} - -;; 7-module.watsup:157.1-157.55 -def instantiation : (store, module, externval*) -> config - ;; 7-module.watsup:158.1-180.28 - def {data* : data*, elem* : elem*, elemmode?* : elemmode?*, export* : export*, externval* : externval*, f : frame, f_init : frame, func* : func*, global* : global*, globaltype* : globaltype*, i^n_elem : nat^n_elem, import* : import*, instr_1** : instr**, instr_2*** : instr***, instr_data* : instr*, instr_elem* : instr*, j^n_data : nat^n_data, m : moduleinst, m_init : moduleinst, mem* : mem*, module : module, n_data : n, n_elem : n, ref** : ref**, reftype* : reftype*, s : store, s' : store, start? : start?, table* : table*, val* : val*, x? : idx?} instantiation(s, module, externval*{externval}) = `%;%*`(`%;%`(s', f), (instr_elem <: admininstr)*{instr_elem} :: (instr_data <: admininstr)*{instr_data} :: CALL_admininstr(x)?{x}) +;; 7-module.watsup:168.1-168.53 +def instantiate : (store, module, externval*) -> config + ;; 7-module.watsup:169.1-191.28 + def {data* : data*, elem* : elem*, elemmode?* : elemmode?*, export* : export*, externval* : externval*, f : frame, f_init : frame, func* : func*, global* : global*, globaltype* : globaltype*, i^n_elem : nat^n_elem, import* : import*, instr_1** : instr**, instr_2*** : instr***, instr_data* : instr*, instr_elem* : instr*, j^n_data : nat^n_data, m : moduleinst, m_init : moduleinst, mem* : mem*, module : module, n_data : n, n_elem : n, ref** : ref**, reftype* : reftype*, s : store, s' : store, start? : start?, table* : table*, val* : val*, x? : idx?} instantiate(s, module, externval*{externval}) = `%;%*`(`%;%`(s', f), (instr_elem <: admininstr)*{instr_elem} :: (instr_data <: admininstr)*{instr_data} :: CALL_admininstr(x)?{x}) -- if (module = `MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data*{data}, start?{start}, export*{export})) -- if (m_init = {FUNC $funcs(externval*{externval}), GLOBAL $globals(externval*{externval}), TABLE [], MEM [], ELEM [], DATA [], EXPORT []}) -- if (f_init = {LOCAL [], MODULE m_init}) @@ -1934,10 +1934,10 @@ def instantiation : (store, module, externval*) -> config -- if (instr_data*{instr_data} = $concat_instr($rundata(data*{data}[j], j)^(j config - ;; 7-module.watsup:184.1-196.52 - def {expr : expr, f : frame, fa : funcaddr, functype : functype, k : nat, m : moduleinst, n : n, s : store, val^n : val^n, valtype* : valtype*, valtype_param^n : valtype^n, valtype_res^k : valtype^k} invocation(s, fa, val^n{val}) = `%;%*`(`%;%`(s, f), (val <: admininstr)^n{val} :: [CALL_ADDR_admininstr(fa)]) +;; 7-module.watsup:198.1-198.44 +def invoke : (store, funcaddr, val*) -> config + ;; 7-module.watsup:199.1-211.52 + def {expr : expr, f : frame, fa : funcaddr, functype : functype, k : nat, m : moduleinst, n : n, s : store, val^n : val^n, valtype* : valtype*, valtype_param^n : valtype^n, valtype_res^k : valtype^k} invoke(s, fa, val^n{val}) = `%;%*`(`%;%`(s, f), (val <: admininstr)^n{val} :: [CALL_ADDR_admininstr(fa)]) -- if (m = {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], EXPORT []}) -- if (f = {LOCAL [], MODULE m}) -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = `FUNC%%*%`(functype, valtype*{valtype}, expr)) @@ -2669,6 +2669,8 @@ $$ \end{array} $$ +\vspace{1ex} + $$ \begin{array}{@{}c@{}}\displaystyle \frac{ @@ -3451,6 +3453,8 @@ $$ \end{array} $$ +\vspace{1ex} + $$ \begin{array}{@{}lrrl@{}} \mbox{(external value)} & \mathit{externval} &::=& \mathsf{func}~\mathit{funcaddr} ~|~ \mathsf{global}~\mathit{globaladdr} ~|~ \mathsf{table}~\mathit{tableaddr} ~|~ \mathsf{mem}~\mathit{memaddr} \\ @@ -3494,13 +3498,6 @@ $$ \mbox{(export instance)} & \mathit{exportinst} &::=& \{\; \begin{array}[t]{@{}l@{}} \mathsf{name}~\mathit{name},\; \\ \mathsf{value}~\mathit{externval} \;\}\end{array} \\ -\mbox{(store)} & \mathit{store} &::=& \{\; \begin{array}[t]{@{}l@{}} -\mathsf{func}~{\mathit{funcinst}^\ast},\; \\ - \mathsf{global}~{\mathit{globalinst}^\ast},\; \\ - \mathsf{table}~{\mathit{tableinst}^\ast},\; \\ - \mathsf{mem}~{\mathit{meminst}^\ast},\; \\ - \mathsf{elem}~{\mathit{eleminst}^\ast},\; \\ - \mathsf{data}~{\mathit{datainst}^\ast} \;\}\end{array} \\ \mbox{(module instance)} & \mathit{moduleinst} &::=& \{\; \begin{array}[t]{@{}l@{}} \mathsf{func}~{\mathit{funcaddr}^\ast},\; \\ \mathsf{global}~{\mathit{globaladdr}^\ast},\; \\ @@ -3509,6 +3506,20 @@ $$ \mathsf{elem}~{\mathit{elemaddr}^\ast},\; \\ \mathsf{data}~{\mathit{dataaddr}^\ast},\; \\ \mathsf{export}~{\mathit{exportinst}^\ast} \;\}\end{array} \\ +\end{array} +$$ + +\vspace{1ex} + +$$ +\begin{array}{@{}lrrl@{}} +\mbox{(store)} & \mathit{store} &::=& \{\; \begin{array}[t]{@{}l@{}} +\mathsf{func}~{\mathit{funcinst}^\ast},\; \\ + \mathsf{global}~{\mathit{globalinst}^\ast},\; \\ + \mathsf{table}~{\mathit{tableinst}^\ast},\; \\ + \mathsf{mem}~{\mathit{meminst}^\ast},\; \\ + \mathsf{elem}~{\mathit{eleminst}^\ast},\; \\ + \mathsf{data}~{\mathit{datainst}^\ast} \;\}\end{array} \\ \mbox{(frame)} & \mathit{frame} &::=& \{\; \begin{array}[t]{@{}l@{}} \mathsf{local}~{\mathit{val}^\ast},\; \\ \mathsf{module}~\mathit{moduleinst} \;\}\end{array} \\ @@ -3653,6 +3664,8 @@ $$ \end{array} $$ +\vspace{1ex} + $$ \begin{array}{@{}lcl@{}l@{}} \mathrm{grow}_{\mathit{table}}(\mathit{ti},\, \mathit{n},\, \mathit{r}) &=& {\mathit{ti}'} &\quad @@ -3677,6 +3690,8 @@ $$ \end{array} $$ +\vspace{1ex} + $$ \begin{array}{@{}lrrl@{}} \mbox{(administrative instruction)} & \mathit{instr} &::=& \mathit{instr} \\ &&|& @@ -4103,8 +4118,6 @@ $$ \end{array} $$ -\vspace{1ex} - $$ \begin{array}{@{}lcl@{}l@{}} \mathrm{funcs}(\epsilon) &=& \epsilon & \\ @@ -4143,21 +4156,6 @@ $$ \vspace{1ex} -$$ -\begin{array}{@{}lcl@{}l@{}} -\mathrm{instexport}({\mathit{fa}^\ast},\, {\mathit{ga}^\ast},\, {\mathit{ta}^\ast},\, {\mathit{ma}^\ast},\, \mathsf{export}~\mathit{name}~(\mathsf{func}~\mathit{x})) &=& \{ \begin{array}[t]{@{}l@{}} -\mathsf{name}~\mathit{name},\; \mathsf{value}~(\mathsf{func}~{\mathit{fa}^\ast}[\mathit{x}]) \}\end{array} & \\ -\mathrm{instexport}({\mathit{fa}^\ast},\, {\mathit{ga}^\ast},\, {\mathit{ta}^\ast},\, {\mathit{ma}^\ast},\, \mathsf{export}~\mathit{name}~(\mathsf{global}~\mathit{x})) &=& \{ \begin{array}[t]{@{}l@{}} -\mathsf{name}~\mathit{name},\; \mathsf{value}~(\mathsf{global}~{\mathit{ga}^\ast}[\mathit{x}]) \}\end{array} & \\ -\mathrm{instexport}({\mathit{fa}^\ast},\, {\mathit{ga}^\ast},\, {\mathit{ta}^\ast},\, {\mathit{ma}^\ast},\, \mathsf{export}~\mathit{name}~(\mathsf{table}~\mathit{x})) &=& \{ \begin{array}[t]{@{}l@{}} -\mathsf{name}~\mathit{name},\; \mathsf{value}~(\mathsf{table}~{\mathit{ta}^\ast}[\mathit{x}]) \}\end{array} & \\ -\mathrm{instexport}({\mathit{fa}^\ast},\, {\mathit{ga}^\ast},\, {\mathit{ta}^\ast},\, {\mathit{ma}^\ast},\, \mathsf{export}~\mathit{name}~(\mathsf{mem}~\mathit{x})) &=& \{ \begin{array}[t]{@{}l@{}} -\mathsf{name}~\mathit{name},\; \mathsf{value}~(\mathsf{mem}~{\mathit{ma}^\ast}[\mathit{x}]) \}\end{array} & \\ -\end{array} -$$ - -\vspace{1ex} - $$ \begin{array}{@{}lcl@{}l@{}} \mathrm{allocfunc}(\mathit{s},\, \mathit{m},\, \mathit{func}) &=& (\mathit{s}[\mathsf{func} = ..\mathit{fi}],\, {|\mathit{s}.\mathsf{func}|}) &\quad @@ -4262,6 +4260,21 @@ $$ \vspace{1ex} +$$ +\begin{array}{@{}lcl@{}l@{}} +\mathrm{instexport}({\mathit{fa}^\ast},\, {\mathit{ga}^\ast},\, {\mathit{ta}^\ast},\, {\mathit{ma}^\ast},\, \mathsf{export}~\mathit{name}~(\mathsf{func}~\mathit{x})) &=& \{ \begin{array}[t]{@{}l@{}} +\mathsf{name}~\mathit{name},\; \mathsf{value}~(\mathsf{func}~{\mathit{fa}^\ast}[\mathit{x}]) \}\end{array} & \\ +\mathrm{instexport}({\mathit{fa}^\ast},\, {\mathit{ga}^\ast},\, {\mathit{ta}^\ast},\, {\mathit{ma}^\ast},\, \mathsf{export}~\mathit{name}~(\mathsf{global}~\mathit{x})) &=& \{ \begin{array}[t]{@{}l@{}} +\mathsf{name}~\mathit{name},\; \mathsf{value}~(\mathsf{global}~{\mathit{ga}^\ast}[\mathit{x}]) \}\end{array} & \\ +\mathrm{instexport}({\mathit{fa}^\ast},\, {\mathit{ga}^\ast},\, {\mathit{ta}^\ast},\, {\mathit{ma}^\ast},\, \mathsf{export}~\mathit{name}~(\mathsf{table}~\mathit{x})) &=& \{ \begin{array}[t]{@{}l@{}} +\mathsf{name}~\mathit{name},\; \mathsf{value}~(\mathsf{table}~{\mathit{ta}^\ast}[\mathit{x}]) \}\end{array} & \\ +\mathrm{instexport}({\mathit{fa}^\ast},\, {\mathit{ga}^\ast},\, {\mathit{ta}^\ast},\, {\mathit{ma}^\ast},\, \mathsf{export}~\mathit{name}~(\mathsf{mem}~\mathit{x})) &=& \{ \begin{array}[t]{@{}l@{}} +\mathsf{name}~\mathit{name},\; \mathsf{value}~(\mathsf{mem}~{\mathit{ma}^\ast}[\mathit{x}]) \}\end{array} & \\ +\end{array} +$$ + +\vspace{1ex} + $$ \begin{array}{@{}lcl@{}l@{}} \mathrm{allocmodule}(\mathit{s},\, \mathit{module},\, {\mathit{externval}^\ast},\, {\mathit{val}^\ast},\, {({\mathit{ref}^\ast})^\ast}) &=& (\mathit{s}_{6},\, \mathit{m}) &\quad @@ -4296,6 +4309,13 @@ $$ \vspace{1ex} +$$ +\begin{array}{@{}lcl@{}l@{}} +\mathrm{concat}_{\mathit{instr}}(\epsilon) &=& \epsilon & \\ +\mathrm{concat}_{\mathit{instr}}({\mathit{instr}^\ast}~{{{\mathit{instr}'}^\ast}^\ast}) &=& {\mathit{instr}^\ast}~\mathrm{concat}_{\mathit{instr}}({{{\mathit{instr}'}^\ast}^\ast}) & \\ +\end{array} +$$ + $$ \begin{array}{@{}lcl@{}l@{}} \mathrm{runelem}(\mathsf{elem}~\mathit{reftype}~{\mathit{expr}^\ast},\, \mathit{i}) &=& \epsilon & \\ @@ -4313,20 +4333,9 @@ $$ \end{array} $$ -\vspace{1ex} - -$$ -\begin{array}{@{}lcl@{}l@{}} -\mathrm{concat}_{\mathit{instr}}(\epsilon) &=& \epsilon & \\ -\mathrm{concat}_{\mathit{instr}}({\mathit{instr}^\ast}~{{{\mathit{instr}'}^\ast}^\ast}) &=& {\mathit{instr}^\ast}~\mathrm{concat}_{\mathit{instr}}({{{\mathit{instr}'}^\ast}^\ast}) & \\ -\end{array} -$$ - -\vspace{1ex} - $$ \begin{array}{@{}lcl@{}l@{}} -\mathrm{instantiation}(\mathit{s},\, \mathit{module},\, {\mathit{externval}^\ast}) &=& {\mathit{s}'} ; \mathit{f} ; {\mathit{instr}_{\mathit{elem}}^\ast}~{\mathit{instr}_{\mathit{data}}^\ast}~{(\mathsf{call}~\mathit{x})^?} &\quad +\mathrm{instantiate}(\mathit{s},\, \mathit{module},\, {\mathit{externval}^\ast}) &=& {\mathit{s}'} ; \mathit{f} ; {\mathit{instr}_{\mathit{elem}}^\ast}~{\mathit{instr}_{\mathit{data}}^\ast}~{(\mathsf{call}~\mathit{x})^?} &\quad \mbox{if}~\mathit{module} = \mathsf{module}~{\mathit{import}^\ast}~{\mathit{func}^\ast}~{\mathit{global}^\ast}~{\mathit{table}^\ast}~{\mathit{mem}^\ast}~{\mathit{elem}^\ast}~{\mathit{data}^\ast}~{\mathit{start}^?}~{\mathit{export}^\ast} \\ &&&\quad {\land}~\mathit{m}_{\mathit{init}} = \{ \begin{array}[t]{@{}l@{}} \mathsf{func}~\mathrm{funcs}({\mathit{externval}^\ast}),\; \\ @@ -4357,7 +4366,7 @@ $$ $$ \begin{array}{@{}lcl@{}l@{}} -\mathrm{invocation}(\mathit{s},\, \mathit{fa},\, {\mathit{val}^{\mathit{n}}}) &=& \mathit{s} ; \mathit{f} ; {\mathit{val}^{\mathit{n}}}~(\mathsf{call}~\mathit{fa}) &\quad +\mathrm{invoke}(\mathit{s},\, \mathit{fa},\, {\mathit{val}^{\mathit{n}}}) &=& \mathit{s} ; \mathit{f} ; {\mathit{val}^{\mathit{n}}}~(\mathsf{call}~\mathit{fa}) &\quad \mbox{if}~\mathit{m} = \{ \begin{array}[t]{@{}l@{}} \mathsf{func}~\epsilon,\; \\ \mathsf{global}~\epsilon,\; \\ diff --git a/spectec/test-latex/TEST.md b/spectec/test-latex/TEST.md index 590adcd858..9e9d397425 100644 --- a/spectec/test-latex/TEST.md +++ b/spectec/test-latex/TEST.md @@ -278,9 +278,9 @@ warning: definition `globalinst` was never spliced warning: definition `globals` was never spliced warning: definition `grow_memory` was never spliced warning: definition `grow_table` was never spliced -warning: definition `instantiation` was never spliced +warning: definition `instantiate` was never spliced warning: definition `instexport` was never spliced -warning: definition `invocation` was never spliced +warning: definition `invoke` was never spliced warning: definition `local` was never spliced warning: definition `mem` was never spliced warning: definition `meminst` was never spliced diff --git a/spectec/test-middlend/TEST.md b/spectec/test-middlend/TEST.md index d1f5f95297..ce079efcfe 100644 --- a/spectec/test-middlend/TEST.md +++ b/spectec/test-middlend/TEST.md @@ -318,48 +318,48 @@ syntax import = IMPORT(name, name, externtype) ;; 1-syntax.watsup:212.1-213.70 syntax module = `MODULE%*%*%*%*%*%*%*%?%*`(import*, func*, global*, table*, mem*, elem*, data*, start?, export*) -;; 2-aux.watsup:3.1-3.14 +;; 2-aux.watsup:7.1-7.14 def Ki : nat - ;; 2-aux.watsup:4.1-4.15 + ;; 2-aux.watsup:8.1-8.15 def Ki = 1024 -;; 2-aux.watsup:9.1-9.25 +;; 2-aux.watsup:13.1-13.25 rec { -;; 2-aux.watsup:9.1-9.25 +;; 2-aux.watsup:13.1-13.25 def min : (nat, nat) -> nat - ;; 2-aux.watsup:10.1-10.19 + ;; 2-aux.watsup:14.1-14.19 def {j : nat} min(0, j) = 0 - ;; 2-aux.watsup:11.1-11.19 + ;; 2-aux.watsup:15.1-15.19 def {i : nat} min(i, 0) = 0 - ;; 2-aux.watsup:12.1-12.38 + ;; 2-aux.watsup:16.1-16.38 def {i : nat, j : nat} min((i + 1), (j + 1)) = $min(i, j) } -;; 2-aux.watsup:19.1-19.55 +;; 2-aux.watsup:27.1-27.55 def size : valtype -> nat - ;; 2-aux.watsup:20.1-20.20 + ;; 2-aux.watsup:28.1-28.20 def size(I32_valtype) = 32 - ;; 2-aux.watsup:21.1-21.20 + ;; 2-aux.watsup:29.1-29.20 def size(I64_valtype) = 64 - ;; 2-aux.watsup:22.1-22.20 + ;; 2-aux.watsup:30.1-30.20 def size(F32_valtype) = 32 - ;; 2-aux.watsup:23.1-23.20 + ;; 2-aux.watsup:31.1-31.20 def size(F64_valtype) = 64 - ;; 2-aux.watsup:24.1-24.22 + ;; 2-aux.watsup:32.1-32.22 def size(V128_valtype) = 128 -;; 2-aux.watsup:29.1-29.40 +;; 2-aux.watsup:40.1-40.40 def test_sub_ATOM_22 : n -> nat - ;; 2-aux.watsup:30.1-30.38 + ;; 2-aux.watsup:41.1-41.38 def {n_3_ATOM_y : n} test_sub_ATOM_22(n_3_ATOM_y) = 0 -;; 2-aux.watsup:32.1-32.26 +;; 2-aux.watsup:43.1-43.26 def curried_ : (n, n) -> nat - ;; 2-aux.watsup:33.1-33.39 + ;; 2-aux.watsup:44.1-44.39 def {n_1 : n, n_2 : n} curried_(n_1, n_2) = (n_1 + n_2) -;; 2-aux.watsup:35.1-44.39 +;; 2-aux.watsup:46.1-55.39 syntax testfuse = | AB_(nat, nat, nat) | CD(nat, nat, nat) @@ -371,376 +371,376 @@ syntax testfuse = | OP(nat, nat, nat) | QR(nat, nat, nat) -;; 3-typing.watsup:3.1-6.60 +;; 3-typing.watsup:5.1-8.60 syntax context = {FUNC functype*, GLOBAL globaltype*, TABLE tabletype*, MEM memtype*, ELEM elemtype*, DATA datatype*, LOCAL valtype*, LABEL resulttype*, RETURN resulttype?} -;; 3-typing.watsup:14.1-14.66 +;; 3-typing.watsup:18.1-18.66 relation Limits_ok: `|-%:%`(limits, nat) - ;; 3-typing.watsup:22.1-24.24 + ;; 3-typing.watsup:26.1-28.24 rule _ {k : nat, n_1 : n, n_2 : n}: `|-%:%`(`[%..%]`(n_1, n_2), k) -- if ((n_1 <= n_2) /\ (n_2 <= k)) -;; 3-typing.watsup:15.1-15.64 +;; 3-typing.watsup:19.1-19.64 relation Functype_ok: `|-%:OK`(functype) - ;; 3-typing.watsup:26.1-27.13 + ;; 3-typing.watsup:30.1-31.13 rule _ {ft : functype}: `|-%:OK`(ft) -;; 3-typing.watsup:16.1-16.66 +;; 3-typing.watsup:20.1-20.66 relation Globaltype_ok: `|-%:OK`(globaltype) - ;; 3-typing.watsup:29.1-30.13 + ;; 3-typing.watsup:33.1-34.13 rule _ {gt : globaltype}: `|-%:OK`(gt) -;; 3-typing.watsup:17.1-17.65 +;; 3-typing.watsup:21.1-21.65 relation Tabletype_ok: `|-%:OK`(tabletype) - ;; 3-typing.watsup:32.1-34.35 + ;; 3-typing.watsup:36.1-38.35 rule _ {lim : limits, rt : reftype}: `|-%:OK`(`%%`(lim, rt)) -- Limits_ok: `|-%:%`(lim, ((2 ^ 32) - 1)) -;; 3-typing.watsup:18.1-18.63 +;; 3-typing.watsup:22.1-22.63 relation Memtype_ok: `|-%:OK`(memtype) - ;; 3-typing.watsup:36.1-38.33 + ;; 3-typing.watsup:40.1-42.33 rule _ {lim : limits}: `|-%:OK`(`%I8`(lim)) -- Limits_ok: `|-%:%`(lim, (2 ^ 16)) -;; 3-typing.watsup:19.1-19.66 +;; 3-typing.watsup:23.1-23.66 relation Externtype_ok: `|-%:OK`(externtype) - ;; 3-typing.watsup:41.1-43.35 + ;; 3-typing.watsup:45.1-47.35 rule func {functype : functype}: `|-%:OK`(FUNC_externtype(functype)) -- Functype_ok: `|-%:OK`(functype) - ;; 3-typing.watsup:45.1-47.39 + ;; 3-typing.watsup:49.1-51.39 rule global {globaltype : globaltype}: `|-%:OK`(GLOBAL_externtype(globaltype)) -- Globaltype_ok: `|-%:OK`(globaltype) - ;; 3-typing.watsup:49.1-51.37 + ;; 3-typing.watsup:53.1-55.37 rule table {tabletype : tabletype}: `|-%:OK`(TABLE_externtype(tabletype)) -- Tabletype_ok: `|-%:OK`(tabletype) - ;; 3-typing.watsup:53.1-55.33 + ;; 3-typing.watsup:57.1-59.33 rule mem {memtype : memtype}: `|-%:OK`(MEM_externtype(memtype)) -- Memtype_ok: `|-%:OK`(memtype) -;; 3-typing.watsup:61.1-61.65 +;; 3-typing.watsup:69.1-69.65 relation Valtype_sub: `|-%<:%`(valtype, valtype) - ;; 3-typing.watsup:64.1-65.12 + ;; 3-typing.watsup:72.1-73.12 rule refl {t : valtype}: `|-%<:%`(t, t) - ;; 3-typing.watsup:67.1-68.14 + ;; 3-typing.watsup:75.1-76.14 rule bot {t : valtype}: `|-%<:%`(BOT_valtype, t) -;; 3-typing.watsup:62.1-62.72 +;; 3-typing.watsup:70.1-70.72 relation Resulttype_sub: `|-%*<:%*`(valtype*, valtype*) - ;; 3-typing.watsup:70.1-72.35 + ;; 3-typing.watsup:78.1-80.35 rule _ {t_1* : valtype*, t_2* : valtype*}: `|-%*<:%*`(t_1*{t_1}, t_2*{t_2}) -- (Valtype_sub: `|-%<:%`(t_1, t_2))*{t_1 t_2} -;; 3-typing.watsup:75.1-75.75 +;; 3-typing.watsup:85.1-85.75 relation Limits_sub: `|-%<:%`(limits, limits) - ;; 3-typing.watsup:83.1-86.21 + ;; 3-typing.watsup:93.1-96.21 rule _ {n_11 : n, n_12 : n, n_21 : n, n_22 : n}: `|-%<:%`(`[%..%]`(n_11, n_12), `[%..%]`(n_21, n_22)) -- if (n_11 >= n_21) -- if (n_12 <= n_22) -;; 3-typing.watsup:76.1-76.73 +;; 3-typing.watsup:86.1-86.73 relation Functype_sub: `|-%<:%`(functype, functype) - ;; 3-typing.watsup:88.1-89.14 + ;; 3-typing.watsup:98.1-99.14 rule _ {ft : functype}: `|-%<:%`(ft, ft) -;; 3-typing.watsup:77.1-77.75 +;; 3-typing.watsup:87.1-87.75 relation Globaltype_sub: `|-%<:%`(globaltype, globaltype) - ;; 3-typing.watsup:91.1-92.14 + ;; 3-typing.watsup:101.1-102.14 rule _ {gt : globaltype}: `|-%<:%`(gt, gt) -;; 3-typing.watsup:78.1-78.74 +;; 3-typing.watsup:88.1-88.74 relation Tabletype_sub: `|-%<:%`(tabletype, tabletype) - ;; 3-typing.watsup:94.1-96.35 + ;; 3-typing.watsup:104.1-106.35 rule _ {lim_1 : limits, lim_2 : limits, rt : reftype}: `|-%<:%`(`%%`(lim_1, rt), `%%`(lim_2, rt)) -- Limits_sub: `|-%<:%`(lim_1, lim_2) -;; 3-typing.watsup:79.1-79.72 +;; 3-typing.watsup:89.1-89.72 relation Memtype_sub: `|-%<:%`(memtype, memtype) - ;; 3-typing.watsup:98.1-100.35 + ;; 3-typing.watsup:108.1-110.35 rule _ {lim_1 : limits, lim_2 : limits}: `|-%<:%`(`%I8`(lim_1), `%I8`(lim_2)) -- Limits_sub: `|-%<:%`(lim_1, lim_2) -;; 3-typing.watsup:80.1-80.75 +;; 3-typing.watsup:90.1-90.75 relation Externtype_sub: `|-%<:%`(externtype, externtype) - ;; 3-typing.watsup:103.1-105.35 + ;; 3-typing.watsup:113.1-115.35 rule func {ft_1 : functype, ft_2 : functype}: `|-%<:%`(FUNC_externtype(ft_1), FUNC_externtype(ft_2)) -- Functype_sub: `|-%<:%`(ft_1, ft_2) - ;; 3-typing.watsup:107.1-109.37 + ;; 3-typing.watsup:117.1-119.37 rule global {gt_1 : globaltype, gt_2 : globaltype}: `|-%<:%`(GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) -- Globaltype_sub: `|-%<:%`(gt_1, gt_2) - ;; 3-typing.watsup:111.1-113.36 + ;; 3-typing.watsup:121.1-123.36 rule table {tt_1 : tabletype, tt_2 : tabletype}: `|-%<:%`(TABLE_externtype(tt_1), TABLE_externtype(tt_2)) -- Tabletype_sub: `|-%<:%`(tt_1, tt_2) - ;; 3-typing.watsup:115.1-117.34 + ;; 3-typing.watsup:125.1-127.34 rule mem {mt_1 : memtype, mt_2 : memtype}: `|-%<:%`(MEM_externtype(mt_1), MEM_externtype(mt_2)) -- Memtype_sub: `|-%<:%`(mt_1, mt_2) -;; 3-typing.watsup:172.1-172.76 +;; 3-typing.watsup:192.1-192.76 relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) - ;; 3-typing.watsup:174.1-176.29 + ;; 3-typing.watsup:194.1-196.29 rule _ {C : context, ft : functype}: `%|-%:%`(C, ft, ft) -- Functype_ok: `|-%:OK`(ft) -;; 3-typing.watsup:123.1-124.67 +;; 3-typing.watsup:135.1-136.67 rec { -;; 3-typing.watsup:123.1-123.66 +;; 3-typing.watsup:135.1-135.66 relation Instr_ok: `%|-%:%`(context, instr, functype) - ;; 3-typing.watsup:153.1-154.34 + ;; 3-typing.watsup:171.1-172.34 rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:156.1-157.32 + ;; 3-typing.watsup:174.1-175.32 rule nop {C : context}: `%|-%:%`(C, NOP_instr, `%->%`([], [])) - ;; 3-typing.watsup:159.1-160.27 + ;; 3-typing.watsup:177.1-178.27 rule drop {C : context, t : valtype}: `%|-%:%`(C, DROP_instr, `%->%`([t], [])) - ;; 3-typing.watsup:163.1-164.31 + ;; 3-typing.watsup:181.1-182.31 rule select-expl {C : context, t : valtype}: `%|-%:%`(C, SELECT_instr(?(t)), `%->%`([t t I32_valtype], [t])) - ;; 3-typing.watsup:166.1-169.37 + ;; 3-typing.watsup:184.1-187.37 rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) -- Valtype_sub: `|-%<:%`(t, t') -- if ((t' = (numtype <: valtype)) \/ (t' = (vectype <: valtype))) - ;; 3-typing.watsup:178.1-181.59 + ;; 3-typing.watsup:198.1-201.59 rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:183.1-186.59 + ;; 3-typing.watsup:203.1-206.59 rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:188.1-192.61 + ;; 3-typing.watsup:208.1-212.61 rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%`(t_1*{t_1}, t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:195.1-197.24 + ;; 3-typing.watsup:217.1-219.24 rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- if (C.LABEL_context[l] = t*{t}) - ;; 3-typing.watsup:199.1-201.24 + ;; 3-typing.watsup:221.1-223.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] = t*{t}) - ;; 3-typing.watsup:203.1-206.42 + ;; 3-typing.watsup:225.1-228.42 rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- (Resulttype_sub: `|-%*<:%*`(t*{t}, C.LABEL_context[l]))*{l} -- Resulttype_sub: `|-%*<:%*`(t*{t}, C.LABEL_context[l']) - ;; 3-typing.watsup:208.1-210.24 + ;; 3-typing.watsup:233.1-235.24 rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- if (C.RETURN_context = ?(t*{t})) - ;; 3-typing.watsup:212.1-214.33 + ;; 3-typing.watsup:237.1-239.33 rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) -- if (C.FUNC_context[x] = `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:216.1-219.26 + ;; 3-typing.watsup:241.1-244.26 rule call_indirect {C : context, ft : functype, lim : limits, t_1* : valtype*, t_2* : valtype*, x : idx}: `%|-%:%`(C, CALL_INDIRECT_instr(x, ft), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) -- if (C.TABLE_context[x] = `%%`(lim, FUNCREF_reftype)) -- if (ft = `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:222.1-223.37 + ;; 3-typing.watsup:249.1-250.37 rule const {C : context, c_nt : c_numtype, nt : numtype}: `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [(nt <: valtype)])) - ;; 3-typing.watsup:225.1-226.31 + ;; 3-typing.watsup:252.1-253.31 rule unop {C : context, nt : numtype, unop : unop_numtype}: `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([(nt <: valtype)], [(nt <: valtype)])) - ;; 3-typing.watsup:228.1-229.36 + ;; 3-typing.watsup:255.1-256.36 rule binop {C : context, binop : binop_numtype, nt : numtype}: `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([(nt <: valtype) (nt <: valtype)], [(nt <: valtype)])) - ;; 3-typing.watsup:231.1-232.36 + ;; 3-typing.watsup:258.1-259.36 rule testop {C : context, nt : numtype, testop : testop_numtype}: `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([(nt <: valtype)], [I32_valtype])) - ;; 3-typing.watsup:234.1-235.37 + ;; 3-typing.watsup:261.1-262.37 rule relop {C : context, nt : numtype, relop : relop_numtype}: `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([(nt <: valtype) (nt <: valtype)], [I32_valtype])) - ;; 3-typing.watsup:238.1-240.23 + ;; 3-typing.watsup:265.1-267.23 rule extend {C : context, n : n, nt : numtype}: `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([(nt <: valtype)], [(nt <: valtype)])) -- if (n <= $size(nt <: valtype)) - ;; 3-typing.watsup:242.1-245.34 + ;; 3-typing.watsup:269.1-272.34 rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype}: `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([(nt_2 <: valtype)], [(nt_1 <: valtype)])) -- if (nt_1 =/= nt_2) -- if ($size(nt_1 <: valtype) = $size(nt_2 <: valtype)) - ;; 3-typing.watsup:247.1-250.52 + ;; 3-typing.watsup:274.1-277.52 rule convert-i {C : context, in_1 : in, in_2 : in, sx? : sx?}: `%|-%:%`(C, CVTOP_instr((in_1 <: numtype), CONVERT_cvtop, (in_2 <: numtype), sx?{sx}), `%->%`([(in_2 <: valtype)], [(in_1 <: valtype)])) -- if (in_1 =/= in_2) -- if ((sx?{sx} = ?()) <=> ($size(in_1 <: valtype) > $size(in_2 <: valtype))) - ;; 3-typing.watsup:252.1-254.22 + ;; 3-typing.watsup:279.1-281.22 rule convert-f {C : context, fn_1 : fn, fn_2 : fn}: `%|-%:%`(C, CVTOP_instr((fn_1 <: numtype), CONVERT_cvtop, (fn_2 <: numtype), ?()), `%->%`([(fn_2 <: valtype)], [(fn_1 <: valtype)])) -- if (fn_1 =/= fn_2) - ;; 3-typing.watsup:257.1-258.35 + ;; 3-typing.watsup:286.1-287.35 rule ref.null {C : context, rt : reftype}: `%|-%:%`(C, REF.NULL_instr(rt), `%->%`([], [(rt <: valtype)])) - ;; 3-typing.watsup:260.1-262.23 + ;; 3-typing.watsup:289.1-291.23 rule ref.func {C : context, ft : functype, x : idx}: `%|-%:%`(C, REF.FUNC_instr(x), `%->%`([], [FUNCREF_valtype])) -- if (C.FUNC_context[x] = ft) - ;; 3-typing.watsup:264.1-265.31 + ;; 3-typing.watsup:293.1-294.31 rule ref.is_null {C : context, rt : reftype}: `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([(rt <: valtype)], [I32_valtype])) - ;; 3-typing.watsup:268.1-270.23 + ;; 3-typing.watsup:299.1-301.23 rule local.get {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:272.1-274.23 + ;; 3-typing.watsup:303.1-305.23 rule local.set {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->%`([t], [])) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:276.1-278.23 + ;; 3-typing.watsup:307.1-309.23 rule local.tee {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%`([t], [t])) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:281.1-283.29 + ;; 3-typing.watsup:314.1-316.29 rule global.get {C : context, t : valtype, x : idx}: `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) -- if (C.GLOBAL_context[x] = `MUT%?%`(()?{}, t)) - ;; 3-typing.watsup:285.1-287.28 + ;; 3-typing.watsup:318.1-320.28 rule global.set {C : context, t : valtype, x : idx}: `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) -- if (C.GLOBAL_context[x] = `MUT%?%`(?(()), t)) - ;; 3-typing.watsup:290.1-292.28 + ;; 3-typing.watsup:325.1-327.28 rule table.get {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [(rt <: valtype)])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:294.1-296.28 + ;; 3-typing.watsup:329.1-331.28 rule table.set {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype (rt <: valtype)], [])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:298.1-300.24 + ;; 3-typing.watsup:333.1-335.24 rule table.size {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) -- if (C.TABLE_context[x] = tt) - ;; 3-typing.watsup:302.1-304.28 + ;; 3-typing.watsup:337.1-339.28 rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([(rt <: valtype) I32_valtype], [I32_valtype])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:306.1-308.28 + ;; 3-typing.watsup:341.1-343.28 rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype (rt <: valtype) I32_valtype], [])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:310.1-313.32 + ;; 3-typing.watsup:345.1-348.32 rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt : reftype, x_1 : idx, x_2 : idx}: `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt)) -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt)) - ;; 3-typing.watsup:315.1-318.25 + ;; 3-typing.watsup:350.1-353.25 rule table.init {C : context, lim : limits, rt : reftype, x_1 : idx, x_2 : idx}: `%|-%:%`(C, TABLE.INIT_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.TABLE_context[x_1] = `%%`(lim, rt)) -- if (C.ELEM_context[x_2] = rt) - ;; 3-typing.watsup:320.1-322.23 + ;; 3-typing.watsup:355.1-357.23 rule elem.drop {C : context, rt : reftype, x : idx}: `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) -- if (C.ELEM_context[x] = rt) - ;; 3-typing.watsup:325.1-327.22 + ;; 3-typing.watsup:362.1-364.22 rule memory.size {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.SIZE_instr, `%->%`([], [I32_valtype])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:329.1-331.22 + ;; 3-typing.watsup:366.1-368.22 rule memory.grow {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.GROW_instr, `%->%`([I32_valtype], [I32_valtype])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:333.1-335.22 + ;; 3-typing.watsup:370.1-372.22 rule memory.fill {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.FILL_instr, `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:337.1-339.22 + ;; 3-typing.watsup:374.1-376.22 rule memory.copy {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.COPY_instr, `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:341.1-344.23 + ;; 3-typing.watsup:378.1-381.23 rule memory.init {C : context, mt : memtype, x : idx}: `%|-%:%`(C, MEMORY.INIT_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.MEM_context[0] = mt) -- if (C.DATA_context[x] = OK) - ;; 3-typing.watsup:346.1-348.23 + ;; 3-typing.watsup:383.1-385.23 rule data.drop {C : context, x : idx}: `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) -- if (C.DATA_context[x] = OK) - ;; 3-typing.watsup:350.1-355.32 + ;; 3-typing.watsup:387.1-392.32 rule load {C : context, in : in, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?}: `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, n_A, n_O), `%->%`([I32_valtype], [(nt <: valtype)])) -- if (C.MEM_context[0] = mt) @@ -748,7 +748,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt <: valtype) / 8))))?{n} -- if ((n?{n} = ?()) \/ (nt = (in <: numtype))) - ;; 3-typing.watsup:357.1-362.32 + ;; 3-typing.watsup:394.1-399.32 rule store {C : context, in : in, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype}: `%|-%:%`(C, STORE_instr(nt, n?{n}, n_A, n_O), `%->%`([I32_valtype (nt <: valtype)], [])) -- if (C.MEM_context[0] = mt) @@ -756,185 +756,185 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt <: valtype) / 8))))?{n} -- if ((n?{n} = ?()) \/ (nt = (in <: numtype))) -;; 3-typing.watsup:124.1-124.67 +;; 3-typing.watsup:136.1-136.67 relation InstrSeq_ok: `%|-%*:%`(context, instr*, functype) - ;; 3-typing.watsup:133.1-134.36 + ;; 3-typing.watsup:149.1-150.36 rule empty {C : context}: `%|-%*:%`(C, [], `%->%`([], [])) - ;; 3-typing.watsup:136.1-139.46 + ;; 3-typing.watsup:152.1-155.46 rule seq {C : context, instr_1 : instr, instr_2 : instr, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*}: `%|-%*:%`(C, [instr_1] :: instr_2*{}, `%->%`(t_1*{t_1}, t_3*{t_3})) -- Instr_ok: `%|-%:%`(C, instr_1, `%->%`(t_1*{t_1}, t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C, [instr_2], `%->%`(t_2*{t_2}, t_3*{t_3})) - ;; 3-typing.watsup:141.1-146.38 + ;; 3-typing.watsup:157.1-162.38 rule weak {C : context, instr* : instr*, t'_1* : valtype*, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%*:%`(C, instr*{instr}, `%->%`(t'_1*{t'_1}, t'_2*{t'_2})) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) -- Resulttype_sub: `|-%*<:%*`(t'_1*{t'_1}, t_1*{t_1}) -- Resulttype_sub: `|-%*<:%*`(t_2*{t_2}, t'_2*{t'_2}) - ;; 3-typing.watsup:148.1-150.45 + ;; 3-typing.watsup:164.1-166.45 rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%*:%`(C, instr*{instr}, `%->%`(t*{t} :: t_1*{t_1}, t*{t} :: t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) } -;; 3-typing.watsup:125.1-125.71 +;; 3-typing.watsup:137.1-137.71 relation Expr_ok: `%|-%:%`(context, expr, resulttype) - ;; 3-typing.watsup:128.1-130.46 + ;; 3-typing.watsup:142.1-144.46 rule _ {C : context, instr* : instr*, t* : valtype*}: `%|-%:%`(C, instr*{instr}, t*{t}) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`([], t*{t})) -;; 3-typing.watsup:367.1-367.78 +;; 3-typing.watsup:406.1-406.78 relation Instr_const: `%|-%CONST`(context, instr) - ;; 3-typing.watsup:371.1-372.26 + ;; 3-typing.watsup:410.1-411.26 rule const {C : context, c : c_numtype, nt : numtype}: `%|-%CONST`(C, CONST_instr(nt, c)) - ;; 3-typing.watsup:374.1-375.27 + ;; 3-typing.watsup:413.1-414.27 rule ref.null {C : context, rt : reftype}: `%|-%CONST`(C, REF.NULL_instr(rt)) - ;; 3-typing.watsup:377.1-378.26 + ;; 3-typing.watsup:416.1-417.26 rule ref.func {C : context, x : idx}: `%|-%CONST`(C, REF.FUNC_instr(x)) - ;; 3-typing.watsup:380.1-382.32 + ;; 3-typing.watsup:419.1-421.32 rule global.get {C : context, t : valtype, x : idx}: `%|-%CONST`(C, GLOBAL.GET_instr(x)) -- if (C.GLOBAL_context[x] = `MUT%?%`(?(), t)) -;; 3-typing.watsup:368.1-368.77 +;; 3-typing.watsup:407.1-407.77 relation Expr_const: `%|-%CONST`(context, expr) - ;; 3-typing.watsup:385.1-386.38 + ;; 3-typing.watsup:424.1-425.38 rule _ {C : context, instr* : instr*}: `%|-%CONST`(C, instr*{instr}) -- (Instr_const: `%|-%CONST`(C, instr))*{instr} -;; 3-typing.watsup:369.1-369.78 +;; 3-typing.watsup:408.1-408.78 relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) - ;; 3-typing.watsup:389.1-392.33 + ;; 3-typing.watsup:428.1-431.33 rule _ {C : context, expr : expr, t : valtype}: `%|-%:%CONST`(C, expr, t) -- Expr_ok: `%|-%:%`(C, expr, [t]) -- Expr_const: `%|-%CONST`(C, expr) -;; 3-typing.watsup:397.1-397.73 +;; 3-typing.watsup:438.1-438.73 relation Func_ok: `%|-%:%`(context, func, functype) - ;; 3-typing.watsup:408.1-412.75 + ;; 3-typing.watsup:451.1-455.75 rule _ {C : context, expr : expr, ft : functype, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, `FUNC%%*%`(ft, t*{t}, expr), ft) -- if (ft = `%->%`(t_1*{t_1}, t_2*{t_2})) -- Functype_ok: `|-%:OK`(ft) -- Expr_ok: `%|-%:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL t_1*{t_1} :: t*{t}, LABEL [], RETURN ?()} ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()} ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2})}, expr, t_2*{t_2}) -;; 3-typing.watsup:398.1-398.75 +;; 3-typing.watsup:439.1-439.75 relation Global_ok: `%|-%:%`(context, global, globaltype) - ;; 3-typing.watsup:414.1-418.40 + ;; 3-typing.watsup:457.1-461.40 rule _ {C : context, expr : expr, gt : globaltype, t : valtype}: `%|-%:%`(C, GLOBAL(gt, expr), gt) -- Globaltype_ok: `|-%:OK`(gt) -- if (gt = `MUT%?%`(()?{}, t)) -- Expr_ok_const: `%|-%:%CONST`(C, expr, t) -;; 3-typing.watsup:399.1-399.74 +;; 3-typing.watsup:440.1-440.74 relation Table_ok: `%|-%:%`(context, table, tabletype) - ;; 3-typing.watsup:420.1-422.30 + ;; 3-typing.watsup:463.1-465.30 rule _ {C : context, tt : tabletype}: `%|-%:%`(C, TABLE(tt), tt) -- Tabletype_ok: `|-%:OK`(tt) -;; 3-typing.watsup:400.1-400.72 +;; 3-typing.watsup:441.1-441.72 relation Mem_ok: `%|-%:%`(context, mem, memtype) - ;; 3-typing.watsup:424.1-426.28 + ;; 3-typing.watsup:467.1-469.28 rule _ {C : context, mt : memtype}: `%|-%:%`(C, MEMORY(mt), mt) -- Memtype_ok: `|-%:OK`(mt) -;; 3-typing.watsup:403.1-403.77 +;; 3-typing.watsup:444.1-444.77 relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) - ;; 3-typing.watsup:437.1-440.45 + ;; 3-typing.watsup:480.1-483.45 rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE_elemmode(x, expr), rt) -- if (C.TABLE_context[x] = `%%`(lim, rt)) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} - ;; 3-typing.watsup:442.1-443.20 + ;; 3-typing.watsup:485.1-486.20 rule declare {C : context, rt : reftype}: `%|-%:%`(C, DECLARE_elemmode, rt) -;; 3-typing.watsup:401.1-401.73 +;; 3-typing.watsup:442.1-442.73 relation Elem_ok: `%|-%:%`(context, elem, reftype) - ;; 3-typing.watsup:428.1-431.40 + ;; 3-typing.watsup:471.1-474.40 rule _ {C : context, elemmode? : elemmode?, expr* : expr*, rt : reftype}: `%|-%:%`(C, `ELEM%%*%?`(rt, expr*{expr}, elemmode?{elemmode}), rt) -- (Expr_ok: `%|-%:%`(C, expr, [(rt <: valtype)]))*{expr} -- (Elemmode_ok: `%|-%:%`(C, elemmode, rt))?{elemmode} -;; 3-typing.watsup:404.1-404.77 +;; 3-typing.watsup:445.1-445.77 relation Datamode_ok: `%|-%:OK`(context, datamode) - ;; 3-typing.watsup:445.1-448.45 + ;; 3-typing.watsup:488.1-491.45 rule _ {C : context, expr : expr, mt : memtype}: `%|-%:OK`(C, MEMORY_datamode(0, expr)) -- if (C.MEM_context[0] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} -;; 3-typing.watsup:402.1-402.73 +;; 3-typing.watsup:443.1-443.73 relation Data_ok: `%|-%:OK`(context, data) - ;; 3-typing.watsup:433.1-435.40 + ;; 3-typing.watsup:476.1-478.40 rule _ {C : context, b* : byte*, datamode? : datamode?}: `%|-%:OK`(C, `DATA%*%?`(b*{b}, datamode?{datamode})) -- (Datamode_ok: `%|-%:OK`(C, datamode))?{datamode} -;; 3-typing.watsup:405.1-405.74 +;; 3-typing.watsup:446.1-446.74 relation Start_ok: `%|-%:OK`(context, start) - ;; 3-typing.watsup:450.1-452.39 + ;; 3-typing.watsup:493.1-495.39 rule _ {C : context, x : idx}: `%|-%:OK`(C, START(x)) -- if (C.FUNC_context[x] = `%->%`([], [])) -;; 3-typing.watsup:455.1-455.80 +;; 3-typing.watsup:500.1-500.80 relation Import_ok: `%|-%:%`(context, import, externtype) - ;; 3-typing.watsup:459.1-461.31 + ;; 3-typing.watsup:504.1-506.31 rule _ {C : context, name_1 : name, name_2 : name, xt : externtype}: `%|-%:%`(C, IMPORT(name_1, name_2, xt), xt) -- Externtype_ok: `|-%:OK`(xt) -;; 3-typing.watsup:457.1-457.83 +;; 3-typing.watsup:502.1-502.83 relation Externuse_ok: `%|-%:%`(context, externuse, externtype) - ;; 3-typing.watsup:467.1-469.23 + ;; 3-typing.watsup:512.1-514.23 rule func {C : context, ft : functype, x : idx}: `%|-%:%`(C, FUNC_externuse(x), FUNC_externtype(ft)) -- if (C.FUNC_context[x] = ft) - ;; 3-typing.watsup:471.1-473.25 + ;; 3-typing.watsup:516.1-518.25 rule global {C : context, gt : globaltype, x : idx}: `%|-%:%`(C, GLOBAL_externuse(x), GLOBAL_externtype(gt)) -- if (C.GLOBAL_context[x] = gt) - ;; 3-typing.watsup:475.1-477.24 + ;; 3-typing.watsup:520.1-522.24 rule table {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE_externuse(x), TABLE_externtype(tt)) -- if (C.TABLE_context[x] = tt) - ;; 3-typing.watsup:479.1-481.22 + ;; 3-typing.watsup:524.1-526.22 rule mem {C : context, mt : memtype, x : idx}: `%|-%:%`(C, MEM_externuse(x), MEM_externtype(mt)) -- if (C.MEM_context[x] = mt) -;; 3-typing.watsup:456.1-456.80 +;; 3-typing.watsup:501.1-501.80 relation Export_ok: `%|-%:%`(context, export, externtype) - ;; 3-typing.watsup:463.1-465.39 + ;; 3-typing.watsup:508.1-510.39 rule _ {C : context, externuse : externuse, name : name, xt : externtype}: `%|-%:%`(C, EXPORT(name, externuse), xt) -- Externuse_ok: `%|-%:%`(C, externuse, xt) -;; 3-typing.watsup:484.1-484.62 +;; 3-typing.watsup:531.1-531.62 relation Module_ok: `|-%:OK`(module) - ;; 3-typing.watsup:486.1-500.16 + ;; 3-typing.watsup:533.1-547.16 rule _ {C : context, data^n : data^n, elem* : elem*, export* : export*, ft* : functype*, func* : func*, global* : global*, gt* : globaltype*, import* : import*, mem* : mem*, mt* : memtype*, n : n, rt* : reftype*, start? : start?, table* : table*, tt* : tabletype*}: `|-%:OK`(`MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data^n{data}, start?{start}, export*{export})) -- if (C = {FUNC ft*{ft}, GLOBAL gt*{gt}, TABLE tt*{tt}, MEM mt*{mt}, ELEM rt*{rt}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) @@ -947,114 +947,114 @@ relation Module_ok: `|-%:OK`(module) -- (Start_ok: `%|-%:OK`(C, start))?{start} -- if (|mem*{mem}| <= 1) -;; 4-runtime.watsup:3.1-3.39 +;; 4-runtime.watsup:5.1-5.39 syntax addr = nat -;; 4-runtime.watsup:4.1-4.53 +;; 4-runtime.watsup:6.1-6.53 syntax funcaddr = addr -;; 4-runtime.watsup:5.1-5.53 +;; 4-runtime.watsup:7.1-7.53 syntax globaladdr = addr -;; 4-runtime.watsup:6.1-6.51 +;; 4-runtime.watsup:8.1-8.51 syntax tableaddr = addr -;; 4-runtime.watsup:7.1-7.50 +;; 4-runtime.watsup:9.1-9.50 syntax memaddr = addr -;; 4-runtime.watsup:8.1-8.49 +;; 4-runtime.watsup:10.1-10.49 syntax elemaddr = addr -;; 4-runtime.watsup:9.1-9.49 +;; 4-runtime.watsup:11.1-11.49 syntax dataaddr = addr -;; 4-runtime.watsup:10.1-10.51 +;; 4-runtime.watsup:12.1-12.51 syntax labeladdr = addr -;; 4-runtime.watsup:11.1-11.49 +;; 4-runtime.watsup:13.1-13.49 syntax hostaddr = addr -;; 4-runtime.watsup:24.1-25.24 +;; 4-runtime.watsup:30.1-31.24 syntax num = | CONST(numtype, c_numtype) -;; 4-runtime.watsup:26.1-27.67 +;; 4-runtime.watsup:32.1-33.67 syntax ref = | REF.NULL(reftype) | REF.FUNC_ADDR(funcaddr) | REF.HOST_ADDR(hostaddr) -;; 4-runtime.watsup:28.1-29.10 +;; 4-runtime.watsup:34.1-35.10 syntax val = | CONST(numtype, c_numtype) | REF.NULL(reftype) | REF.FUNC_ADDR(funcaddr) | REF.HOST_ADDR(hostaddr) -;; 4-runtime.watsup:31.1-32.18 +;; 4-runtime.watsup:37.1-38.18 syntax result = | _VALS(val*) | TRAP -;; 4-runtime.watsup:38.1-39.66 +;; 4-runtime.watsup:47.1-48.66 syntax externval = | FUNC(funcaddr) | GLOBAL(globaladdr) | TABLE(tableaddr) | MEM(memaddr) -;; 4-runtime.watsup:44.1-44.44 +;; 4-runtime.watsup:55.1-55.44 def default_ : valtype -> val - ;; 4-runtime.watsup:45.1-45.35 + ;; 4-runtime.watsup:56.1-56.35 def default_(I32_valtype) = CONST_val(I32_numtype, 0) - ;; 4-runtime.watsup:46.1-46.35 + ;; 4-runtime.watsup:57.1-57.35 def default_(I64_valtype) = CONST_val(I64_numtype, 0) - ;; 4-runtime.watsup:47.1-47.35 + ;; 4-runtime.watsup:58.1-58.35 def default_(F32_valtype) = CONST_val(F32_numtype, 0) - ;; 4-runtime.watsup:48.1-48.35 + ;; 4-runtime.watsup:59.1-59.35 def default_(F64_valtype) = CONST_val(F64_numtype, 0) - ;; 4-runtime.watsup:49.1-49.44 + ;; 4-runtime.watsup:60.1-60.44 def default_(FUNCREF_valtype) = REF.NULL_val(FUNCREF_reftype) - ;; 4-runtime.watsup:50.1-50.48 + ;; 4-runtime.watsup:61.1-61.48 def default_(EXTERNREF_valtype) = REF.NULL_val(EXTERNREF_reftype) -;; 4-runtime.watsup:72.1-74.22 +;; 4-runtime.watsup:87.1-89.22 syntax exportinst = {NAME name, VALUE externval} -;; 4-runtime.watsup:84.1-91.25 +;; 4-runtime.watsup:91.1-98.25 syntax moduleinst = {FUNC funcaddr*, GLOBAL globaladdr*, TABLE tableaddr*, MEM memaddr*, ELEM elemaddr*, DATA dataaddr*, EXPORT exportinst*} -;; 4-runtime.watsup:55.1-57.16 +;; 4-runtime.watsup:70.1-72.16 syntax funcinst = {MODULE moduleinst, CODE func} -;; 4-runtime.watsup:58.1-60.16 +;; 4-runtime.watsup:73.1-75.16 syntax globalinst = {TYPE globaltype, VALUE val} -;; 4-runtime.watsup:61.1-63.16 +;; 4-runtime.watsup:76.1-78.16 syntax tableinst = {TYPE tabletype, ELEM ref*} -;; 4-runtime.watsup:64.1-66.17 +;; 4-runtime.watsup:79.1-81.17 syntax meminst = {TYPE memtype, DATA byte*} -;; 4-runtime.watsup:67.1-69.16 +;; 4-runtime.watsup:82.1-84.16 syntax eleminst = {TYPE elemtype, ELEM ref*} -;; 4-runtime.watsup:70.1-71.17 +;; 4-runtime.watsup:85.1-86.17 syntax datainst = {DATA byte*} -;; 4-runtime.watsup:76.1-82.21 +;; 4-runtime.watsup:112.1-118.21 syntax store = {FUNC funcinst*, GLOBAL globalinst*, TABLE tableinst*, MEM meminst*, ELEM eleminst*, DATA datainst*} -;; 4-runtime.watsup:93.1-95.24 +;; 4-runtime.watsup:120.1-122.24 syntax frame = {LOCAL val*, MODULE moduleinst} -;; 4-runtime.watsup:96.1-96.47 +;; 4-runtime.watsup:124.1-124.47 syntax state = `%;%`(store, frame) -;; 4-runtime.watsup:183.1-190.5 +;; 4-runtime.watsup:209.1-216.5 rec { -;; 4-runtime.watsup:183.1-190.5 +;; 4-runtime.watsup:209.1-216.5 syntax admininstr = | UNREACHABLE | NOP @@ -1108,141 +1108,141 @@ syntax admininstr = | TRAP } -;; 4-runtime.watsup:97.1-97.62 +;; 4-runtime.watsup:125.1-125.62 syntax config = `%;%*`(state, admininstr*) -;; 4-runtime.watsup:115.1-115.59 +;; 4-runtime.watsup:134.1-134.59 def funcaddr : state -> funcaddr* - ;; 4-runtime.watsup:116.1-116.38 + ;; 4-runtime.watsup:135.1-135.38 def {f : frame, s : store} funcaddr(`%;%`(s, f)) = f.MODULE_frame.FUNC_moduleinst -;; 4-runtime.watsup:118.1-118.52 +;; 4-runtime.watsup:137.1-137.52 def funcinst : state -> funcinst* - ;; 4-runtime.watsup:125.1-125.31 + ;; 4-runtime.watsup:144.1-144.31 def {f : frame, s : store} funcinst(`%;%`(s, f)) = s.FUNC_store -;; 4-runtime.watsup:119.1-119.58 +;; 4-runtime.watsup:138.1-138.58 def globalinst : state -> globalinst* - ;; 4-runtime.watsup:126.1-126.35 + ;; 4-runtime.watsup:145.1-145.35 def {f : frame, s : store} globalinst(`%;%`(s, f)) = s.GLOBAL_store -;; 4-runtime.watsup:120.1-120.55 +;; 4-runtime.watsup:139.1-139.55 def tableinst : state -> tableinst* - ;; 4-runtime.watsup:127.1-127.33 + ;; 4-runtime.watsup:146.1-146.33 def {f : frame, s : store} tableinst(`%;%`(s, f)) = s.TABLE_store -;; 4-runtime.watsup:121.1-121.49 +;; 4-runtime.watsup:140.1-140.49 def meminst : state -> meminst* - ;; 4-runtime.watsup:128.1-128.29 + ;; 4-runtime.watsup:147.1-147.29 def {f : frame, s : store} meminst(`%;%`(s, f)) = s.MEM_store -;; 4-runtime.watsup:122.1-122.52 +;; 4-runtime.watsup:141.1-141.52 def eleminst : state -> eleminst* - ;; 4-runtime.watsup:129.1-129.31 + ;; 4-runtime.watsup:148.1-148.31 def {f : frame, s : store} eleminst(`%;%`(s, f)) = s.ELEM_store -;; 4-runtime.watsup:123.1-123.52 +;; 4-runtime.watsup:142.1-142.52 def datainst : state -> datainst* - ;; 4-runtime.watsup:130.1-130.31 + ;; 4-runtime.watsup:149.1-149.31 def {f : frame, s : store} datainst(`%;%`(s, f)) = s.DATA_store -;; 4-runtime.watsup:132.1-132.67 +;; 4-runtime.watsup:151.1-151.67 def func : (state, funcidx) -> funcinst - ;; 4-runtime.watsup:140.1-140.48 + ;; 4-runtime.watsup:159.1-159.48 def {f : frame, s : store, x : idx} func(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[x]] -;; 4-runtime.watsup:133.1-133.69 +;; 4-runtime.watsup:152.1-152.69 def global : (state, globalidx) -> globalinst - ;; 4-runtime.watsup:141.1-141.54 + ;; 4-runtime.watsup:160.1-160.54 def {f : frame, s : store, x : idx} global(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x]] -;; 4-runtime.watsup:134.1-134.68 +;; 4-runtime.watsup:153.1-153.68 def table : (state, tableidx) -> tableinst - ;; 4-runtime.watsup:142.1-142.51 + ;; 4-runtime.watsup:161.1-161.51 def {f : frame, s : store, x : idx} table(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]] -;; 4-runtime.watsup:135.1-135.66 +;; 4-runtime.watsup:154.1-154.66 def mem : (state, memidx) -> meminst - ;; 4-runtime.watsup:143.1-143.45 + ;; 4-runtime.watsup:162.1-162.45 def {f : frame, s : store, x : idx} mem(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[x]] -;; 4-runtime.watsup:136.1-136.67 +;; 4-runtime.watsup:155.1-155.67 def elem : (state, tableidx) -> eleminst - ;; 4-runtime.watsup:144.1-144.48 + ;; 4-runtime.watsup:163.1-163.48 def {f : frame, s : store, x : idx} elem(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[x]] -;; 4-runtime.watsup:137.1-137.67 +;; 4-runtime.watsup:156.1-156.67 def data : (state, dataidx) -> datainst - ;; 4-runtime.watsup:145.1-145.48 + ;; 4-runtime.watsup:164.1-164.48 def {f : frame, s : store, x : idx} data(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[x]] -;; 4-runtime.watsup:138.1-138.68 +;; 4-runtime.watsup:157.1-157.68 def local : (state, localidx) -> val - ;; 4-runtime.watsup:146.1-146.35 + ;; 4-runtime.watsup:165.1-165.35 def {f : frame, s : store, x : idx} local(`%;%`(s, f), x) = f.LOCAL_frame[x] -;; 4-runtime.watsup:149.1-149.78 +;; 4-runtime.watsup:168.1-168.78 def with_local : (state, localidx, val) -> state - ;; 4-runtime.watsup:158.1-158.52 + ;; 4-runtime.watsup:177.1-177.52 def {f : frame, s : store, v : val, x : idx} with_local(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[x] = v]) -;; 4-runtime.watsup:150.1-150.85 +;; 4-runtime.watsup:169.1-169.85 def with_global : (state, globalidx, val) -> state - ;; 4-runtime.watsup:159.1-159.77 + ;; 4-runtime.watsup:178.1-178.77 def {f : frame, s : store, v : val, x : idx} with_global(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x]].VALUE_globalinst = v], f) -;; 4-runtime.watsup:151.1-151.88 +;; 4-runtime.watsup:170.1-170.88 def with_table : (state, tableidx, nat, ref) -> state - ;; 4-runtime.watsup:160.1-160.79 + ;; 4-runtime.watsup:179.1-179.79 def {f : frame, i : nat, r : ref, s : store, x : idx} with_table(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]].ELEM_tableinst[i] = r], f) -;; 4-runtime.watsup:152.1-152.84 +;; 4-runtime.watsup:171.1-171.84 def with_tableinst : (state, tableidx, tableinst) -> state - ;; 4-runtime.watsup:161.1-161.74 + ;; 4-runtime.watsup:180.1-180.74 def {f : frame, s : store, ti : tableinst, x : idx} with_tableinst(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]] = ti], f) -;; 4-runtime.watsup:153.1-153.93 +;; 4-runtime.watsup:172.1-172.93 def with_mem : (state, memidx, nat, nat, byte*) -> state - ;; 4-runtime.watsup:162.1-162.82 + ;; 4-runtime.watsup:181.1-181.82 def {b* : byte*, f : frame, i : nat, j : nat, s : store, x : idx} with_mem(`%;%`(s, f), x, i, j, b*{b}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x]].DATA_meminst[i : j] = b*{b}], f) -;; 4-runtime.watsup:154.1-154.77 +;; 4-runtime.watsup:173.1-173.77 def with_meminst : (state, memidx, meminst) -> state - ;; 4-runtime.watsup:163.1-163.68 + ;; 4-runtime.watsup:182.1-182.68 def {f : frame, mi : meminst, s : store, x : idx} with_meminst(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x]] = mi], f) -;; 4-runtime.watsup:155.1-155.82 +;; 4-runtime.watsup:174.1-174.82 def with_elem : (state, elemidx, ref*) -> state - ;; 4-runtime.watsup:164.1-164.72 + ;; 4-runtime.watsup:183.1-183.72 def {f : frame, r* : ref*, s : store, x : idx} with_elem(`%;%`(s, f), x, r*{r}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x]].ELEM_eleminst = r*{r}], f) -;; 4-runtime.watsup:156.1-156.82 +;; 4-runtime.watsup:175.1-175.82 def with_data : (state, dataidx, byte*) -> state - ;; 4-runtime.watsup:165.1-165.72 + ;; 4-runtime.watsup:184.1-184.72 def {b* : byte*, f : frame, s : store, x : idx} with_data(`%;%`(s, f), x, b*{b}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x]].DATA_datainst = b*{b}], f) -;; 4-runtime.watsup:167.1-167.63 +;; 4-runtime.watsup:189.1-189.63 def grow_table : (tableinst, nat, ref) -> tableinst - ;; 4-runtime.watsup:170.1-174.36 + ;; 4-runtime.watsup:192.1-196.36 def {i : nat, i' : nat, j : nat, n : n, r : ref, r'* : ref*, rt : reftype, ti : tableinst, ti' : tableinst} grow_table(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{}}) -- Tabletype_ok: `|-%:OK`(ti'.TYPE_tableinst) -;; 4-runtime.watsup:168.1-168.55 +;; 4-runtime.watsup:190.1-190.55 def grow_memory : (meminst, nat) -> meminst - ;; 4-runtime.watsup:175.1-179.34 + ;; 4-runtime.watsup:198.1-202.34 def {b* : byte*, i : nat, i' : nat, j : nat, mi : meminst, mi' : meminst, n : n} grow_memory(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){}}) -- Memtype_ok: `|-%:OK`(mi'.TYPE_meminst) -;; 4-runtime.watsup:192.1-195.21 +;; 4-runtime.watsup:218.1-221.21 rec { -;; 4-runtime.watsup:192.1-195.21 +;; 4-runtime.watsup:218.1-221.21 syntax E = | _HOLE | _SEQ(val*, E, instr*) @@ -1273,480 +1273,469 @@ def wrap_ : ((nat, nat), c_numtype) -> nat ;; 5-numerics.watsup:13.1-13.28 def bytes_ : (nat, c_numtype) -> byte* -;; 6-reduction.watsup:4.1-4.63 +;; 6-reduction.watsup:6.1-6.63 relation Step_pure: `%*~>%*`(admininstr*, admininstr*) - ;; 6-reduction.watsup:16.1-17.24 + ;; 6-reduction.watsup:24.1-25.24 rule unreachable: `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) - ;; 6-reduction.watsup:19.1-20.19 + ;; 6-reduction.watsup:27.1-28.19 rule nop: `%*~>%*`([NOP_admininstr], []) - ;; 6-reduction.watsup:22.1-23.24 + ;; 6-reduction.watsup:30.1-31.24 rule drop {val : val}: `%*~>%*`([(val <: admininstr) DROP_admininstr], []) - ;; 6-reduction.watsup:26.1-28.16 + ;; 6-reduction.watsup:34.1-36.16 rule select-true {c : c_numtype, t? : valtype?, val_1 : val, val_2 : val}: `%*~>%*`([(val_1 <: admininstr) (val_2 <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t?{t})], [(val_1 <: admininstr)]) -- if (c =/= 0) - ;; 6-reduction.watsup:30.1-32.14 + ;; 6-reduction.watsup:38.1-40.14 rule select-false {c : c_numtype, t? : valtype?, val_1 : val, val_2 : val}: `%*~>%*`([(val_1 <: admininstr) (val_2 <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t?{t})], [(val_2 <: admininstr)]) -- if (c = 0) - ;; 6-reduction.watsup:35.1-37.28 + ;; 6-reduction.watsup:45.1-47.28 rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k}: `%*~>%*`((val <: admininstr)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})], [LABEL__admininstr(n, [], (val <: admininstr)^k{val} :: (instr <: admininstr)*{instr})]) -- if (bt = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 6-reduction.watsup:39.1-41.28 + ;; 6-reduction.watsup:49.1-51.28 rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k}: `%*~>%*`((val <: admininstr)^k{val} :: [LOOP_admininstr(bt, instr*{instr})], [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], (val <: admininstr)^k{val} :: (instr <: admininstr)*{instr})]) -- if (bt = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 6-reduction.watsup:43.1-45.16 + ;; 6-reduction.watsup:53.1-55.16 rule if-true {bt : blocktype, c : c_numtype, 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) - ;; 6-reduction.watsup:47.1-49.14 + ;; 6-reduction.watsup:57.1-59.14 rule if-false {bt : blocktype, c : c_numtype, 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) - ;; 6-reduction.watsup:52.1-53.38 + ;; 6-reduction.watsup:62.1-63.38 rule label-vals {instr* : instr*, n : n, val* : val*}: `%*~>%*`([LABEL__admininstr(n, instr*{instr}, (val <: admininstr)*{val})], (val <: admininstr)*{val}) - ;; 6-reduction.watsup:57.1-58.69 + ;; 6-reduction.watsup:69.1-70.69 rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val' <: admininstr)*{val'} :: (val <: admininstr)^n{val} :: [BR_admininstr(0)] :: (instr <: admininstr)*{instr})], (val <: admininstr)^n{val} :: (instr' <: admininstr)*{instr'}) - ;; 6-reduction.watsup:60.1-61.65 + ;; 6-reduction.watsup:72.1-73.65 rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val <: admininstr)*{val} :: [BR_admininstr(l + 1)] :: (instr <: admininstr)*{instr})], (val <: admininstr)*{val} :: [BR_admininstr(l)]) - ;; 6-reduction.watsup:64.1-66.16 + ;; 6-reduction.watsup:76.1-78.16 rule br_if-true {c : c_numtype, l : labelidx}: `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) -- if (c =/= 0) - ;; 6-reduction.watsup:68.1-70.14 + ;; 6-reduction.watsup:80.1-82.14 rule br_if-false {c : c_numtype, l : labelidx}: `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) -- if (c = 0) - ;; 6-reduction.watsup:73.1-75.17 + ;; 6-reduction.watsup:85.1-87.17 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}|) - ;; 6-reduction.watsup:77.1-79.18 + ;; 6-reduction.watsup:89.1-91.18 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}|) - ;; 6-reduction.watsup:102.1-103.35 + ;; 6-reduction.watsup:116.1-117.35 rule frame-vals {f : frame, n : n, val^n : val^n}: `%*~>%*`([FRAME__admininstr(n, f, (val <: admininstr)^n{val})], (val <: admininstr)^n{val}) - ;; 6-reduction.watsup:105.1-106.55 + ;; 6-reduction.watsup:119.1-120.55 rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: `%*~>%*`([FRAME__admininstr(n, f, (val' <: admininstr)*{val'} :: (val <: admininstr)^n{val} :: [RETURN_admininstr] :: (instr <: admininstr)*{instr})], (val <: admininstr)^n{val}) - ;; 6-reduction.watsup:108.1-109.60 + ;; 6-reduction.watsup:122.1-123.60 rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, (val <: admininstr)*{val} :: [RETURN_admininstr] :: (instr <: admininstr)*{instr})], (val <: admininstr)*{val} :: [RETURN_admininstr]) - ;; 6-reduction.watsup:112.1-114.33 + ;; 6-reduction.watsup:128.1-130.33 rule unop-val {c : c_numtype, c_1 : c_numtype, nt : numtype, unop : unop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) -- if ($unop(unop, nt, c_1) = [c]) - ;; 6-reduction.watsup:116.1-118.39 + ;; 6-reduction.watsup:132.1-134.39 rule unop-trap {c_1 : c_numtype, nt : numtype, unop : unop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) -- if ($unop(unop, nt, c_1) = []) - ;; 6-reduction.watsup:121.1-123.40 + ;; 6-reduction.watsup:137.1-139.40 rule binop-val {binop : binop_numtype, c : c_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- if ($binop(binop, nt, c_1, c_2) = [c]) - ;; 6-reduction.watsup:125.1-127.46 + ;; 6-reduction.watsup:141.1-143.46 rule binop-trap {binop : binop_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) -- if ($binop(binop, nt, c_1, c_2) = []) - ;; 6-reduction.watsup:130.1-132.37 + ;; 6-reduction.watsup:146.1-148.37 rule testop {c : c_numtype, c_1 : c_numtype, nt : numtype, testop : testop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $testop(testop, nt, c_1)) - ;; 6-reduction.watsup:134.1-136.40 + ;; 6-reduction.watsup:150.1-152.40 rule relop {c : c_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype, relop : relop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $relop(relop, nt, c_1, c_2)) - ;; 6-reduction.watsup:139.1-140.70 + ;; 6-reduction.watsup:155.1-156.70 rule extend {c : c_numtype, n : n, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, $size(nt <: valtype), S_sx, c))]) - ;; 6-reduction.watsup:143.1-145.48 + ;; 6-reduction.watsup:159.1-161.48 rule cvtop-val {c : c_numtype, c_1 : c_numtype, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) -- if ($cvtop(nt_1, cvtop, nt_2, sx?{sx}, c_1) = [c]) - ;; 6-reduction.watsup:147.1-149.54 + ;; 6-reduction.watsup:163.1-165.54 rule cvtop-trap {c_1 : c_numtype, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) -- if ($cvtop(nt_1, cvtop, nt_2, sx?{sx}, c_1) = []) - ;; 6-reduction.watsup:156.1-158.28 + ;; 6-reduction.watsup:174.1-176.28 rule ref.is_null-true {rt : reftype, val : val}: `%*~>%*`([(val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) -- if (val = REF.NULL_val(rt)) - ;; 6-reduction.watsup:160.1-162.15 + ;; 6-reduction.watsup:178.1-180.15 rule ref.is_null-false {val : val}: `%*~>%*`([(val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 6-reduction.watsup:171.1-172.47 + ;; 6-reduction.watsup:191.1-192.47 rule local.tee {val : val, x : idx}: `%*~>%*`([(val <: admininstr) LOCAL.TEE_admininstr(x)], [(val <: admininstr) (val <: admininstr) LOCAL.SET_admininstr(x)]) -;; 6-reduction.watsup:5.1-5.63 +;; 6-reduction.watsup:7.1-7.63 relation Step_read: `%~>%*`(config, admininstr*) - ;; 6-reduction.watsup:82.1-83.47 + ;; 6-reduction.watsup:96.1-97.47 rule call {x : idx, z : state}: `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [CALL_ADDR_admininstr($funcaddr(z)[x])]) - ;; 6-reduction.watsup:85.1-89.17 + ;; 6-reduction.watsup:99.1-103.17 rule call_indirect-call {a : addr, ft : functype, ft' : functype, i : nat, instr* : instr*, t* : valtype*, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CALL_INDIRECT_admininstr(x, ft)]), [CALL_ADDR_admininstr(a)]) -- if ($table(z, x).ELEM_tableinst[i] = REF.FUNC_ADDR_ref(a)) -- if ($funcinst(z)[a].CODE_funcinst = `FUNC%%*%`(ft', t*{t}, instr*{instr})) -- if (ft = ft') - ;; 6-reduction.watsup:91.1-93.15 + ;; 6-reduction.watsup:105.1-107.15 rule call_indirect-trap {ft : functype, i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CALL_INDIRECT_admininstr(x, ft)]), [TRAP_admininstr]) -- otherwise - ;; 6-reduction.watsup:95.1-99.52 + ;; 6-reduction.watsup:109.1-113.52 rule call_addr {a : addr, f : frame, func : func, instr* : instr*, k : nat, m : moduleinst, n : n, t* : valtype*, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: `%~>%*`(`%;%*`(z, (val <: admininstr)^k{val} :: [CALL_ADDR_admininstr(a)]), [FRAME__admininstr(n, f, [LABEL__admininstr(n, [], (instr <: admininstr)*{instr})])]) -- if ($funcinst(z)[a] = {MODULE m, CODE func}) -- if (func = `FUNC%%*%`(`%->%`(t_1^k{t_1}, t_2^n{t_2}), t*{t}, instr*{instr})) -- if (f = {LOCAL val^k{val} :: $default_(t)*{t}, MODULE m}) - ;; 6-reduction.watsup:152.1-153.53 + ;; 6-reduction.watsup:170.1-171.53 rule ref.func {x : idx, z : state}: `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) - ;; 6-reduction.watsup:165.1-166.37 + ;; 6-reduction.watsup:185.1-186.37 rule local.get {x : idx, z : state}: `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [($local(z, x) <: admininstr)]) - ;; 6-reduction.watsup:175.1-176.45 + ;; 6-reduction.watsup:197.1-198.45 rule global.get {x : idx, z : state}: `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst <: admininstr)]) - ;; 6-reduction.watsup:182.1-184.33 + ;; 6-reduction.watsup:206.1-208.33 rule table.get-trap {i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:186.1-188.32 + ;; 6-reduction.watsup:210.1-212.32 rule table.get-val {i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] <: admininstr)]) -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:199.1-201.32 + ;; 6-reduction.watsup:223.1-225.32 rule table.size {n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) -- if (|$table(z, x).ELEM_tableinst| = n) - ;; 6-reduction.watsup:212.1-214.39 + ;; 6-reduction.watsup:236.1-238.39 rule table.fill-trap {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:216.1-219.14 + ;; 6-reduction.watsup:240.1-243.14 rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:221.1-225.15 + ;; 6-reduction.watsup:245.1-249.15 rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) (val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) (val <: admininstr) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) -- otherwise - ;; 6-reduction.watsup:228.1-230.73 + ;; 6-reduction.watsup:252.1-254.73 rule table.copy-trap {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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|)) - ;; 6-reduction.watsup:232.1-235.14 + ;; 6-reduction.watsup:256.1-259.14 rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:237.1-242.15 + ;; 6-reduction.watsup:261.1-266.15 rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:244.1-248.15 + ;; 6-reduction.watsup:268.1-272.15 rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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 - ;; 6-reduction.watsup:251.1-253.72 + ;; 6-reduction.watsup:275.1-277.72 rule table.init-trap {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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|)) - ;; 6-reduction.watsup:255.1-258.14 + ;; 6-reduction.watsup:279.1-282.14 rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:260.1-264.15 + ;; 6-reduction.watsup:284.1-288.15 rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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] <: 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 - ;; 6-reduction.watsup:271.1-273.53 + ;; 6-reduction.watsup:297.1-299.53 rule load-num-trap {i : nat, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), n_A, n_O)]), [TRAP_admininstr]) -- if (((i + n_O) + ($size(nt <: valtype) / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:275.1-277.71 + ;; 6-reduction.watsup:301.1-303.71 rule load-num-val {c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), n_A, n_O)]), [CONST_admininstr(nt, c)]) -- if ($bytes_($size(nt <: valtype), c) = $mem(z, 0).DATA_meminst[(i + n_O) : ($size(nt <: valtype) / 8)]) - ;; 6-reduction.watsup:279.1-281.45 + ;; 6-reduction.watsup:305.1-307.45 rule load-pack-trap {i : nat, n : n, n_A : n, n_O : n, nt : numtype, sx : sx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), n_A, n_O)]), [TRAP_admininstr]) -- if (((i + n_O) + (n / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:283.1-285.55 + ;; 6-reduction.watsup:309.1-311.55 rule load-pack-val {c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, sx : sx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), n_A, n_O)]), [CONST_admininstr(nt, $ext(n, $size(nt <: valtype), sx, c))]) -- if ($bytes_(n, c) = $mem(z, 0).DATA_meminst[(i + n_O) : (n / 8)]) - ;; 6-reduction.watsup:305.1-307.44 + ;; 6-reduction.watsup:331.1-333.44 rule memory.size {n : n, z : state}: `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr]), [CONST_admininstr(I32_numtype, n)]) -- if (((n * 64) * $Ki) = |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:318.1-320.37 + ;; 6-reduction.watsup:344.1-346.37 rule memory.fill-trap {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), [TRAP_admininstr]) -- if ((i + n) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:322.1-325.14 + ;; 6-reduction.watsup:348.1-351.14 rule memory.fill-zero {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:327.1-331.15 + ;; 6-reduction.watsup:353.1-357.15 rule memory.fill-succ {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), [CONST_admininstr(I32_numtype, i) (val <: admininstr) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (i + 1)) (val <: admininstr) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr]) -- otherwise - ;; 6-reduction.watsup:334.1-336.69 + ;; 6-reduction.watsup:360.1-362.69 rule memory.copy-trap {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [TRAP_admininstr]) -- if (((i + n) > |$mem(z, 0).DATA_meminst|) \/ ((j + n) > |$mem(z, 0).DATA_meminst|)) - ;; 6-reduction.watsup:338.1-341.14 + ;; 6-reduction.watsup:364.1-367.14 rule memory.copy-zero {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:343.1-348.15 + ;; 6-reduction.watsup:369.1-374.15 rule memory.copy-le {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) LOAD_admininstr(I32_numtype, ?((8, U_sx)), 0, 0) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr]) -- otherwise -- if (j <= i) - ;; 6-reduction.watsup:350.1-354.15 + ;; 6-reduction.watsup:376.1-380.15 rule memory.copy-gt {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), 0, 0) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr]) -- otherwise - ;; 6-reduction.watsup:357.1-359.70 + ;; 6-reduction.watsup:383.1-385.70 rule memory.init-trap {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), [TRAP_admininstr]) -- if (((i + n) > |$data(z, x).DATA_datainst|) \/ ((j + n) > |$mem(z, 0).DATA_meminst|)) - ;; 6-reduction.watsup:361.1-364.14 + ;; 6-reduction.watsup:387.1-390.14 rule memory.init-zero {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:366.1-370.15 + ;; 6-reduction.watsup:392.1-396.15 rule memory.init-succ {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, x).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x)]) -- otherwise -;; 6-reduction.watsup:3.1-3.63 +;; 6-reduction.watsup:5.1-5.63 relation Step: `%~>%`(config, config) - ;; 6-reduction.watsup:7.1-9.34 + ;; 6-reduction.watsup:9.1-11.34 rule pure {instr* : instr*, instr'* : instr*, z : state}: `%~>%`(`%;%*`(z, (instr <: admininstr)*{instr}), `%;%*`(z, (instr' <: admininstr)*{instr'})) -- Step_pure: `%*~>%*`((instr <: admininstr)*{instr}, (instr' <: admininstr)*{instr'}) - ;; 6-reduction.watsup:11.1-13.37 + ;; 6-reduction.watsup:13.1-15.37 rule read {instr* : instr*, instr'* : instr*, z : state}: `%~>%`(`%;%*`(z, (instr <: admininstr)*{instr}), `%;%*`(z, (instr' <: admininstr)*{instr'})) -- Step_read: `%~>%*`(`%;%*`(z, (instr <: admininstr)*{instr}), (instr' <: admininstr)*{instr'}) - ;; 6-reduction.watsup:168.1-169.60 + ;; 6-reduction.watsup:188.1-189.60 rule local.set {val : val, x : idx, z : state}: `%~>%`(`%;%*`(z, [(val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) - ;; 6-reduction.watsup:178.1-179.62 + ;; 6-reduction.watsup:200.1-201.62 rule global.set {val : val, x : idx, z : state}: `%~>%`(`%;%*`(z, [(val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) - ;; 6-reduction.watsup:190.1-192.33 + ;; 6-reduction.watsup:214.1-216.33 rule table.set-trap {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:194.1-196.32 + ;; 6-reduction.watsup:218.1-220.32 rule table.set-val {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:204.1-206.47 + ;; 6-reduction.watsup:228.1-230.47 rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state}: `%~>%`(`%;%*`(z, [(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 ($grow_table($table(z, x), n, ref) = ti) - ;; 6-reduction.watsup:208.1-209.64 + ;; 6-reduction.watsup:232.1-233.64 rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [(ref <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, - 1)])) - ;; 6-reduction.watsup:267.1-268.59 + ;; 6-reduction.watsup:291.1-292.59 rule elem.drop {x : idx, z : state}: `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) - ;; 6-reduction.watsup:288.1-290.53 + ;; 6-reduction.watsup:314.1-316.53 rule store-num-trap {c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), n_A, n_O)]), `%;%*`(z, [TRAP_admininstr])) -- if (((i + n_O) + ($size(nt <: valtype) / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:292.1-294.35 + ;; 6-reduction.watsup:318.1-320.35 rule store-num-val {b* : byte*, c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), n_A, n_O)]), `%;%*`($with_mem(z, 0, (i + n_O), ($size(nt <: valtype) / 8), b*{b}), [])) -- if (b*{b} = $bytes_($size(nt <: valtype), c)) - ;; 6-reduction.watsup:296.1-298.45 + ;; 6-reduction.watsup:322.1-324.45 rule store-pack-trap {c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), n_A, n_O)]), `%;%*`(z, [TRAP_admininstr])) -- if (((i + n_O) + (n / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:300.1-302.50 + ;; 6-reduction.watsup:326.1-328.50 rule store-pack-val {b* : byte*, c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), n_A, n_O)]), `%;%*`($with_mem(z, 0, (i + n_O), (n / 8), b*{b}), [])) -- if (b*{b} = $bytes_(n, $wrap_(($size(nt <: valtype), n), c))) - ;; 6-reduction.watsup:310.1-312.41 + ;; 6-reduction.watsup:336.1-338.41 rule memory.grow-succeed {mi : meminst, n : n, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr]), `%;%*`($with_meminst(z, 0, mi), [CONST_admininstr(I32_numtype, (|$mem(z, 0).DATA_meminst| / (64 * $Ki)))])) -- if ($grow_memory($mem(z, 0), n) = mi) - ;; 6-reduction.watsup:314.1-315.59 + ;; 6-reduction.watsup:340.1-341.59 rule memory.grow-fail {n : n, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr]), `%;%*`(z, [CONST_admininstr(I32_numtype, - 1)])) - ;; 6-reduction.watsup:373.1-374.59 + ;; 6-reduction.watsup:399.1-400.59 rule data.drop {x : idx, z : state}: `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) -;; 7-module.watsup:4.1-4.35 +;; 7-module.watsup:5.1-5.35 rec { -;; 7-module.watsup:4.1-4.35 +;; 7-module.watsup:5.1-5.35 def funcs : externval* -> funcaddr* - ;; 7-module.watsup:5.1-5.30 + ;; 7-module.watsup:6.1-6.30 def funcs([]) = [] - ;; 7-module.watsup:6.1-6.59 + ;; 7-module.watsup:7.1-7.59 def {externval'* : externval*, fa : funcaddr} funcs([FUNC_externval(fa)] :: externval'*{externval'}) = [fa] :: $funcs(externval'*{externval'}) - ;; 7-module.watsup:7.1-8.15 + ;; 7-module.watsup:8.1-9.15 def {externval : externval, externval'* : externval*} funcs([externval] :: externval'*{externval'}) = $funcs(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:10.1-10.39 +;; 7-module.watsup:11.1-11.39 rec { -;; 7-module.watsup:10.1-10.39 +;; 7-module.watsup:11.1-11.39 def globals : externval* -> globaladdr* - ;; 7-module.watsup:11.1-11.32 + ;; 7-module.watsup:12.1-12.32 def globals([]) = [] - ;; 7-module.watsup:12.1-12.65 + ;; 7-module.watsup:13.1-13.65 def {externval'* : externval*, ga : globaladdr} globals([GLOBAL_externval(ga)] :: externval'*{externval'}) = [ga] :: $globals(externval'*{externval'}) - ;; 7-module.watsup:13.1-14.15 + ;; 7-module.watsup:14.1-15.15 def {externval : externval, externval'* : externval*} globals([externval] :: externval'*{externval'}) = $globals(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:16.1-16.37 +;; 7-module.watsup:17.1-17.37 rec { -;; 7-module.watsup:16.1-16.37 +;; 7-module.watsup:17.1-17.37 def tables : externval* -> tableaddr* - ;; 7-module.watsup:17.1-17.31 + ;; 7-module.watsup:18.1-18.31 def tables([]) = [] - ;; 7-module.watsup:18.1-18.62 + ;; 7-module.watsup:19.1-19.62 def {externval'* : externval*, ta : tableaddr} tables([TABLE_externval(ta)] :: externval'*{externval'}) = [ta] :: $tables(externval'*{externval'}) - ;; 7-module.watsup:19.1-20.15 + ;; 7-module.watsup:20.1-21.15 def {externval : externval, externval'* : externval*} tables([externval] :: externval'*{externval'}) = $tables(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:22.1-22.33 +;; 7-module.watsup:23.1-23.33 rec { -;; 7-module.watsup:22.1-22.33 +;; 7-module.watsup:23.1-23.33 def mems : externval* -> memaddr* - ;; 7-module.watsup:23.1-23.29 + ;; 7-module.watsup:24.1-24.29 def mems([]) = [] - ;; 7-module.watsup:24.1-24.56 + ;; 7-module.watsup:25.1-25.56 def {externval'* : externval*, ma : memaddr} mems([MEM_externval(ma)] :: externval'*{externval'}) = [ma] :: $mems(externval'*{externval'}) - ;; 7-module.watsup:25.1-26.15 + ;; 7-module.watsup:26.1-27.15 def {externval : externval, externval'* : externval*} mems([externval] :: externval'*{externval'}) = $mems(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:29.1-29.83 -def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst - ;; 7-module.watsup:30.1-30.95 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externuse(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} - ;; 7-module.watsup:31.1-31.99 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externuse(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} - ;; 7-module.watsup:32.1-32.97 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externuse(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} - ;; 7-module.watsup:33.1-33.93 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externuse(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} - ;; 7-module.watsup:36.1-36.60 def allocfunc : (store, moduleinst, func) -> (store, funcaddr) ;; 7-module.watsup:37.1-38.37 @@ -1861,9 +1850,20 @@ def allocdatas : (store, byte**) -> (store, dataaddr*) -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) } -;; 7-module.watsup:97.1-97.81 +;; 7-module.watsup:99.1-99.83 +def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst + ;; 7-module.watsup:100.1-100.95 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externuse(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} + ;; 7-module.watsup:101.1-101.99 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externuse(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} + ;; 7-module.watsup:102.1-102.97 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externuse(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} + ;; 7-module.watsup:103.1-103.93 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externuse(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} + +;; 7-module.watsup:106.1-106.81 def allocmodule : (store, module, externval*, val*, ref**) -> (store, moduleinst) - ;; 7-module.watsup:98.1-135.54 + ;; 7-module.watsup:107.1-144.54 def {byte*^n_data : byte*^n_data, da* : dataaddr*, datamode?^n_data : datamode?^n_data, ea* : elemaddr*, elemmode?^n_elem : elemmode?^n_elem, export* : export*, expr_1^n_global : expr^n_global, expr_2*^n_elem : expr*^n_elem, externval* : externval*, fa* : funcaddr*, fa_ex* : funcaddr*, func^n_func : func^n_func, ga* : globaladdr*, ga_ex* : globaladdr*, globaltype^n_global : globaltype^n_global, i_data^n_data : nat^n_data, i_elem^n_elem : nat^n_elem, i_func^n_func : nat^n_func, i_global^n_global : nat^n_global, i_mem^n_mem : nat^n_mem, i_table^n_table : nat^n_table, import* : import*, m : moduleinst, ma* : memaddr*, ma_ex* : memaddr*, memtype^n_mem : memtype^n_mem, module : module, n_data : n, n_elem : n, n_func : n, n_global : n, n_mem : n, n_table : n, ref** : ref**, rt^n_elem : reftype^n_elem, s : store, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store, s_6 : store, start? : start?, ta* : tableaddr*, ta_ex* : tableaddr*, tabletype^n_table : tabletype^n_table, val* : val*, xi* : exportinst*} allocmodule(s, module, externval*{externval}, val*{val}, ref*{ref}*{ref}) = (s_6, m) -- if (module = `MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func^n_func{func}, GLOBAL(globaltype, expr_1)^n_global{expr_1 globaltype}, TABLE(tabletype)^n_table{tabletype}, MEMORY(memtype)^n_mem{memtype}, `ELEM%%*%?`(rt, expr_2*{expr_2}, elemmode?{elemmode})^n_elem{elemmode expr_2 rt}, `DATA%*%?`(byte*{byte}, datamode?{datamode})^n_data{byte datamode}, start?{start}, export*{export})) -- if (fa_ex*{fa_ex} = $funcs(externval*{externval})) @@ -1885,39 +1885,39 @@ def allocmodule : (store, module, externval*, val*, ref**) -> (store, moduleinst -- if ((s_5, ea*{ea}) = $allocelems(s_4, rt^n_elem{rt}, ref*{ref}*{ref})) -- if ((s_6, da*{da}) = $allocdatas(s_5, byte*{byte}^n_data{byte})) -;; 7-module.watsup:138.1-138.33 +;; 7-module.watsup:151.1-151.36 +rec { + +;; 7-module.watsup:151.1-151.36 +def concat_instr : instr** -> instr* + ;; 7-module.watsup:152.1-152.37 + def concat_instr([]) = [] + ;; 7-module.watsup:153.1-153.68 + def {instr* : instr*, instr'** : instr**} concat_instr([instr]*{instr} :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) +} + +;; 7-module.watsup:155.1-155.33 def runelem : (elem, idx) -> instr* - ;; 7-module.watsup:139.1-139.46 + ;; 7-module.watsup:156.1-156.46 def {expr* : expr*, i : nat, reftype : reftype} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?()), i) = [] - ;; 7-module.watsup:140.1-140.62 + ;; 7-module.watsup:157.1-157.62 def {expr* : expr*, i : nat, reftype : reftype} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?(DECLARE_elemmode)), i) = [ELEM.DROP_instr(i)] - ;; 7-module.watsup:141.1-143.20 + ;; 7-module.watsup:158.1-160.20 def {expr* : expr*, i : nat, instr* : instr*, n : n, reftype : reftype, x : idx} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?(TABLE_elemmode(x, instr*{instr}))), i) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, n) TABLE.INIT_instr(x, i) ELEM.DROP_instr(i)] -- if (n = |expr*{expr}|) -;; 7-module.watsup:145.1-145.33 +;; 7-module.watsup:162.1-162.33 def rundata : (data, idx) -> instr* - ;; 7-module.watsup:146.1-146.38 + ;; 7-module.watsup:163.1-163.38 def {byte* : byte*, i : nat} rundata(`DATA%*%?`(byte*{byte}, ?()), i) = [] - ;; 7-module.watsup:147.1-149.20 + ;; 7-module.watsup:164.1-166.20 def {byte* : byte*, i : nat, instr* : instr*, n : n} rundata(`DATA%*%?`(byte*{byte}, ?(MEMORY_datamode(0, instr*{instr}))), i) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, n) MEMORY.INIT_instr(i) DATA.DROP_instr(i)] -- if (n = |byte*{byte}|) -;; 7-module.watsup:152.1-152.36 -rec { - -;; 7-module.watsup:152.1-152.36 -def concat_instr : instr** -> instr* - ;; 7-module.watsup:153.1-153.37 - def concat_instr([]) = [] - ;; 7-module.watsup:154.1-154.68 - def {instr* : instr*, instr'** : instr**} concat_instr([instr]*{instr} :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) -} - -;; 7-module.watsup:157.1-157.55 -def instantiation : (store, module, externval*) -> config - ;; 7-module.watsup:158.1-180.28 - def {data* : data*, elem* : elem*, elemmode?* : elemmode?*, export* : export*, externval* : externval*, f : frame, f_init : frame, func* : func*, global* : global*, globaltype* : globaltype*, i^n_elem : nat^n_elem, import* : import*, instr_1** : instr**, instr_2*** : instr***, instr_data* : instr*, instr_elem* : instr*, j^n_data : nat^n_data, m : moduleinst, m_init : moduleinst, mem* : mem*, module : module, n_data : n, n_elem : n, ref** : ref**, reftype* : reftype*, s : store, s' : store, start? : start?, table* : table*, val* : val*, x? : idx?} instantiation(s, module, externval*{externval}) = `%;%*`(`%;%`(s', f), (instr_elem <: admininstr)*{instr_elem} :: (instr_data <: admininstr)*{instr_data} :: CALL_admininstr(x)?{x}) +;; 7-module.watsup:168.1-168.53 +def instantiate : (store, module, externval*) -> config + ;; 7-module.watsup:169.1-191.28 + def {data* : data*, elem* : elem*, elemmode?* : elemmode?*, export* : export*, externval* : externval*, f : frame, f_init : frame, func* : func*, global* : global*, globaltype* : globaltype*, i^n_elem : nat^n_elem, import* : import*, instr_1** : instr**, instr_2*** : instr***, instr_data* : instr*, instr_elem* : instr*, j^n_data : nat^n_data, m : moduleinst, m_init : moduleinst, mem* : mem*, module : module, n_data : n, n_elem : n, ref** : ref**, reftype* : reftype*, s : store, s' : store, start? : start?, table* : table*, val* : val*, x? : idx?} instantiate(s, module, externval*{externval}) = `%;%*`(`%;%`(s', f), (instr_elem <: admininstr)*{instr_elem} :: (instr_data <: admininstr)*{instr_data} :: CALL_admininstr(x)?{x}) -- if (module = `MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data*{data}, start?{start}, export*{export})) -- if (m_init = {FUNC $funcs(externval*{externval}), GLOBAL $globals(externval*{externval}), TABLE [], MEM [], ELEM [], DATA [], EXPORT []}) -- if (f_init = {LOCAL [], MODULE m_init}) @@ -1933,10 +1933,10 @@ def instantiation : (store, module, externval*) -> config -- if (instr_data*{instr_data} = $concat_instr($rundata(data*{data}[j], j)^(j config - ;; 7-module.watsup:184.1-196.52 - def {expr : expr, f : frame, fa : funcaddr, functype : functype, k : nat, m : moduleinst, n : n, s : store, val^n : val^n, valtype* : valtype*, valtype_param^n : valtype^n, valtype_res^k : valtype^k} invocation(s, fa, val^n{val}) = `%;%*`(`%;%`(s, f), (val <: admininstr)^n{val} :: [CALL_ADDR_admininstr(fa)]) +;; 7-module.watsup:198.1-198.44 +def invoke : (store, funcaddr, val*) -> config + ;; 7-module.watsup:199.1-211.52 + def {expr : expr, f : frame, fa : funcaddr, functype : functype, k : nat, m : moduleinst, n : n, s : store, val^n : val^n, valtype* : valtype*, valtype_param^n : valtype^n, valtype_res^k : valtype^k} invoke(s, fa, val^n{val}) = `%;%*`(`%;%`(s, f), (val <: admininstr)^n{val} :: [CALL_ADDR_admininstr(fa)]) -- if (m = {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], EXPORT []}) -- if (f = {LOCAL [], MODULE m}) -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = `FUNC%%*%`(functype, valtype*{valtype}, expr)) @@ -2287,48 +2287,48 @@ syntax import = IMPORT(name, name, externtype) ;; 1-syntax.watsup:212.1-213.70 syntax module = `MODULE%*%*%*%*%*%*%*%?%*`(import*, func*, global*, table*, mem*, elem*, data*, start?, export*) -;; 2-aux.watsup:3.1-3.14 +;; 2-aux.watsup:7.1-7.14 def Ki : nat - ;; 2-aux.watsup:4.1-4.15 + ;; 2-aux.watsup:8.1-8.15 def Ki = 1024 -;; 2-aux.watsup:9.1-9.25 +;; 2-aux.watsup:13.1-13.25 rec { -;; 2-aux.watsup:9.1-9.25 +;; 2-aux.watsup:13.1-13.25 def min : (nat, nat) -> nat - ;; 2-aux.watsup:10.1-10.19 + ;; 2-aux.watsup:14.1-14.19 def {j : nat} min(0, j) = 0 - ;; 2-aux.watsup:11.1-11.19 + ;; 2-aux.watsup:15.1-15.19 def {i : nat} min(i, 0) = 0 - ;; 2-aux.watsup:12.1-12.38 + ;; 2-aux.watsup:16.1-16.38 def {i : nat, j : nat} min((i + 1), (j + 1)) = $min(i, j) } -;; 2-aux.watsup:19.1-19.55 +;; 2-aux.watsup:27.1-27.55 def size : valtype -> nat - ;; 2-aux.watsup:20.1-20.20 + ;; 2-aux.watsup:28.1-28.20 def size(I32_valtype) = 32 - ;; 2-aux.watsup:21.1-21.20 + ;; 2-aux.watsup:29.1-29.20 def size(I64_valtype) = 64 - ;; 2-aux.watsup:22.1-22.20 + ;; 2-aux.watsup:30.1-30.20 def size(F32_valtype) = 32 - ;; 2-aux.watsup:23.1-23.20 + ;; 2-aux.watsup:31.1-31.20 def size(F64_valtype) = 64 - ;; 2-aux.watsup:24.1-24.22 + ;; 2-aux.watsup:32.1-32.22 def size(V128_valtype) = 128 -;; 2-aux.watsup:29.1-29.40 +;; 2-aux.watsup:40.1-40.40 def test_sub_ATOM_22 : n -> nat - ;; 2-aux.watsup:30.1-30.38 + ;; 2-aux.watsup:41.1-41.38 def {n_3_ATOM_y : n} test_sub_ATOM_22(n_3_ATOM_y) = 0 -;; 2-aux.watsup:32.1-32.26 +;; 2-aux.watsup:43.1-43.26 def curried_ : (n, n) -> nat - ;; 2-aux.watsup:33.1-33.39 + ;; 2-aux.watsup:44.1-44.39 def {n_1 : n, n_2 : n} curried_(n_1, n_2) = (n_1 + n_2) -;; 2-aux.watsup:35.1-44.39 +;; 2-aux.watsup:46.1-55.39 syntax testfuse = | AB_(nat, nat, nat) | CD(nat, nat, nat) @@ -2340,376 +2340,376 @@ syntax testfuse = | OP(nat, nat, nat) | QR(nat, nat, nat) -;; 3-typing.watsup:3.1-6.60 +;; 3-typing.watsup:5.1-8.60 syntax context = {FUNC functype*, GLOBAL globaltype*, TABLE tabletype*, MEM memtype*, ELEM elemtype*, DATA datatype*, LOCAL valtype*, LABEL resulttype*, RETURN resulttype?} -;; 3-typing.watsup:14.1-14.66 +;; 3-typing.watsup:18.1-18.66 relation Limits_ok: `|-%:%`(limits, nat) - ;; 3-typing.watsup:22.1-24.24 + ;; 3-typing.watsup:26.1-28.24 rule _ {k : nat, n_1 : n, n_2 : n}: `|-%:%`(`[%..%]`(n_1, n_2), k) -- if ((n_1 <= n_2) /\ (n_2 <= k)) -;; 3-typing.watsup:15.1-15.64 +;; 3-typing.watsup:19.1-19.64 relation Functype_ok: `|-%:OK`(functype) - ;; 3-typing.watsup:26.1-27.13 + ;; 3-typing.watsup:30.1-31.13 rule _ {ft : functype}: `|-%:OK`(ft) -;; 3-typing.watsup:16.1-16.66 +;; 3-typing.watsup:20.1-20.66 relation Globaltype_ok: `|-%:OK`(globaltype) - ;; 3-typing.watsup:29.1-30.13 + ;; 3-typing.watsup:33.1-34.13 rule _ {gt : globaltype}: `|-%:OK`(gt) -;; 3-typing.watsup:17.1-17.65 +;; 3-typing.watsup:21.1-21.65 relation Tabletype_ok: `|-%:OK`(tabletype) - ;; 3-typing.watsup:32.1-34.35 + ;; 3-typing.watsup:36.1-38.35 rule _ {lim : limits, rt : reftype}: `|-%:OK`(`%%`(lim, rt)) -- Limits_ok: `|-%:%`(lim, ((2 ^ 32) - 1)) -;; 3-typing.watsup:18.1-18.63 +;; 3-typing.watsup:22.1-22.63 relation Memtype_ok: `|-%:OK`(memtype) - ;; 3-typing.watsup:36.1-38.33 + ;; 3-typing.watsup:40.1-42.33 rule _ {lim : limits}: `|-%:OK`(`%I8`(lim)) -- Limits_ok: `|-%:%`(lim, (2 ^ 16)) -;; 3-typing.watsup:19.1-19.66 +;; 3-typing.watsup:23.1-23.66 relation Externtype_ok: `|-%:OK`(externtype) - ;; 3-typing.watsup:41.1-43.35 + ;; 3-typing.watsup:45.1-47.35 rule func {functype : functype}: `|-%:OK`(FUNC_externtype(functype)) -- Functype_ok: `|-%:OK`(functype) - ;; 3-typing.watsup:45.1-47.39 + ;; 3-typing.watsup:49.1-51.39 rule global {globaltype : globaltype}: `|-%:OK`(GLOBAL_externtype(globaltype)) -- Globaltype_ok: `|-%:OK`(globaltype) - ;; 3-typing.watsup:49.1-51.37 + ;; 3-typing.watsup:53.1-55.37 rule table {tabletype : tabletype}: `|-%:OK`(TABLE_externtype(tabletype)) -- Tabletype_ok: `|-%:OK`(tabletype) - ;; 3-typing.watsup:53.1-55.33 + ;; 3-typing.watsup:57.1-59.33 rule mem {memtype : memtype}: `|-%:OK`(MEM_externtype(memtype)) -- Memtype_ok: `|-%:OK`(memtype) -;; 3-typing.watsup:61.1-61.65 +;; 3-typing.watsup:69.1-69.65 relation Valtype_sub: `|-%<:%`(valtype, valtype) - ;; 3-typing.watsup:64.1-65.12 + ;; 3-typing.watsup:72.1-73.12 rule refl {t : valtype}: `|-%<:%`(t, t) - ;; 3-typing.watsup:67.1-68.14 + ;; 3-typing.watsup:75.1-76.14 rule bot {t : valtype}: `|-%<:%`(BOT_valtype, t) -;; 3-typing.watsup:62.1-62.72 +;; 3-typing.watsup:70.1-70.72 relation Resulttype_sub: `|-%*<:%*`(valtype*, valtype*) - ;; 3-typing.watsup:70.1-72.35 + ;; 3-typing.watsup:78.1-80.35 rule _ {t_1* : valtype*, t_2* : valtype*}: `|-%*<:%*`(t_1*{t_1}, t_2*{t_2}) -- (Valtype_sub: `|-%<:%`(t_1, t_2))*{t_1 t_2} -;; 3-typing.watsup:75.1-75.75 +;; 3-typing.watsup:85.1-85.75 relation Limits_sub: `|-%<:%`(limits, limits) - ;; 3-typing.watsup:83.1-86.21 + ;; 3-typing.watsup:93.1-96.21 rule _ {n_11 : n, n_12 : n, n_21 : n, n_22 : n}: `|-%<:%`(`[%..%]`(n_11, n_12), `[%..%]`(n_21, n_22)) -- if (n_11 >= n_21) -- if (n_12 <= n_22) -;; 3-typing.watsup:76.1-76.73 +;; 3-typing.watsup:86.1-86.73 relation Functype_sub: `|-%<:%`(functype, functype) - ;; 3-typing.watsup:88.1-89.14 + ;; 3-typing.watsup:98.1-99.14 rule _ {ft : functype}: `|-%<:%`(ft, ft) -;; 3-typing.watsup:77.1-77.75 +;; 3-typing.watsup:87.1-87.75 relation Globaltype_sub: `|-%<:%`(globaltype, globaltype) - ;; 3-typing.watsup:91.1-92.14 + ;; 3-typing.watsup:101.1-102.14 rule _ {gt : globaltype}: `|-%<:%`(gt, gt) -;; 3-typing.watsup:78.1-78.74 +;; 3-typing.watsup:88.1-88.74 relation Tabletype_sub: `|-%<:%`(tabletype, tabletype) - ;; 3-typing.watsup:94.1-96.35 + ;; 3-typing.watsup:104.1-106.35 rule _ {lim_1 : limits, lim_2 : limits, rt : reftype}: `|-%<:%`(`%%`(lim_1, rt), `%%`(lim_2, rt)) -- Limits_sub: `|-%<:%`(lim_1, lim_2) -;; 3-typing.watsup:79.1-79.72 +;; 3-typing.watsup:89.1-89.72 relation Memtype_sub: `|-%<:%`(memtype, memtype) - ;; 3-typing.watsup:98.1-100.35 + ;; 3-typing.watsup:108.1-110.35 rule _ {lim_1 : limits, lim_2 : limits}: `|-%<:%`(`%I8`(lim_1), `%I8`(lim_2)) -- Limits_sub: `|-%<:%`(lim_1, lim_2) -;; 3-typing.watsup:80.1-80.75 +;; 3-typing.watsup:90.1-90.75 relation Externtype_sub: `|-%<:%`(externtype, externtype) - ;; 3-typing.watsup:103.1-105.35 + ;; 3-typing.watsup:113.1-115.35 rule func {ft_1 : functype, ft_2 : functype}: `|-%<:%`(FUNC_externtype(ft_1), FUNC_externtype(ft_2)) -- Functype_sub: `|-%<:%`(ft_1, ft_2) - ;; 3-typing.watsup:107.1-109.37 + ;; 3-typing.watsup:117.1-119.37 rule global {gt_1 : globaltype, gt_2 : globaltype}: `|-%<:%`(GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) -- Globaltype_sub: `|-%<:%`(gt_1, gt_2) - ;; 3-typing.watsup:111.1-113.36 + ;; 3-typing.watsup:121.1-123.36 rule table {tt_1 : tabletype, tt_2 : tabletype}: `|-%<:%`(TABLE_externtype(tt_1), TABLE_externtype(tt_2)) -- Tabletype_sub: `|-%<:%`(tt_1, tt_2) - ;; 3-typing.watsup:115.1-117.34 + ;; 3-typing.watsup:125.1-127.34 rule mem {mt_1 : memtype, mt_2 : memtype}: `|-%<:%`(MEM_externtype(mt_1), MEM_externtype(mt_2)) -- Memtype_sub: `|-%<:%`(mt_1, mt_2) -;; 3-typing.watsup:172.1-172.76 +;; 3-typing.watsup:192.1-192.76 relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) - ;; 3-typing.watsup:174.1-176.29 + ;; 3-typing.watsup:194.1-196.29 rule _ {C : context, ft : functype}: `%|-%:%`(C, ft, ft) -- Functype_ok: `|-%:OK`(ft) -;; 3-typing.watsup:123.1-124.67 +;; 3-typing.watsup:135.1-136.67 rec { -;; 3-typing.watsup:123.1-123.66 +;; 3-typing.watsup:135.1-135.66 relation Instr_ok: `%|-%:%`(context, instr, functype) - ;; 3-typing.watsup:153.1-154.34 + ;; 3-typing.watsup:171.1-172.34 rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:156.1-157.32 + ;; 3-typing.watsup:174.1-175.32 rule nop {C : context}: `%|-%:%`(C, NOP_instr, `%->%`([], [])) - ;; 3-typing.watsup:159.1-160.27 + ;; 3-typing.watsup:177.1-178.27 rule drop {C : context, t : valtype}: `%|-%:%`(C, DROP_instr, `%->%`([t], [])) - ;; 3-typing.watsup:163.1-164.31 + ;; 3-typing.watsup:181.1-182.31 rule select-expl {C : context, t : valtype}: `%|-%:%`(C, SELECT_instr(?(t)), `%->%`([t t I32_valtype], [t])) - ;; 3-typing.watsup:166.1-169.37 + ;; 3-typing.watsup:184.1-187.37 rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) -- Valtype_sub: `|-%<:%`(t, t') -- if ((t' = $valtype_numtype(numtype)) \/ (t' = $valtype_vectype(vectype))) - ;; 3-typing.watsup:178.1-181.59 + ;; 3-typing.watsup:198.1-201.59 rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:183.1-186.59 + ;; 3-typing.watsup:203.1-206.59 rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:188.1-192.61 + ;; 3-typing.watsup:208.1-212.61 rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%`(t_1*{t_1}, t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:195.1-197.24 + ;; 3-typing.watsup:217.1-219.24 rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- if (C.LABEL_context[l] = t*{t}) - ;; 3-typing.watsup:199.1-201.24 + ;; 3-typing.watsup:221.1-223.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] = t*{t}) - ;; 3-typing.watsup:203.1-206.42 + ;; 3-typing.watsup:225.1-228.42 rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- (Resulttype_sub: `|-%*<:%*`(t*{t}, C.LABEL_context[l]))*{l} -- Resulttype_sub: `|-%*<:%*`(t*{t}, C.LABEL_context[l']) - ;; 3-typing.watsup:208.1-210.24 + ;; 3-typing.watsup:233.1-235.24 rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- if (C.RETURN_context = ?(t*{t})) - ;; 3-typing.watsup:212.1-214.33 + ;; 3-typing.watsup:237.1-239.33 rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) -- if (C.FUNC_context[x] = `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:216.1-219.26 + ;; 3-typing.watsup:241.1-244.26 rule call_indirect {C : context, ft : functype, lim : limits, t_1* : valtype*, t_2* : valtype*, x : idx}: `%|-%:%`(C, CALL_INDIRECT_instr(x, ft), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) -- if (C.TABLE_context[x] = `%%`(lim, FUNCREF_reftype)) -- if (ft = `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:222.1-223.37 + ;; 3-typing.watsup:249.1-250.37 rule const {C : context, c_nt : c_numtype, nt : numtype}: `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [$valtype_numtype(nt)])) - ;; 3-typing.watsup:225.1-226.31 + ;; 3-typing.watsup:252.1-253.31 rule unop {C : context, nt : numtype, unop : unop_numtype}: `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 3-typing.watsup:228.1-229.36 + ;; 3-typing.watsup:255.1-256.36 rule binop {C : context, binop : binop_numtype, nt : numtype}: `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 3-typing.watsup:231.1-232.36 + ;; 3-typing.watsup:258.1-259.36 rule testop {C : context, nt : numtype, testop : testop_numtype}: `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([$valtype_numtype(nt)], [I32_valtype])) - ;; 3-typing.watsup:234.1-235.37 + ;; 3-typing.watsup:261.1-262.37 rule relop {C : context, nt : numtype, relop : relop_numtype}: `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [I32_valtype])) - ;; 3-typing.watsup:238.1-240.23 + ;; 3-typing.watsup:265.1-267.23 rule extend {C : context, n : n, nt : numtype}: `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) -- if (n <= $size($valtype_numtype(nt))) - ;; 3-typing.watsup:242.1-245.34 + ;; 3-typing.watsup:269.1-272.34 rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype}: `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([$valtype_numtype(nt_2)], [$valtype_numtype(nt_1)])) -- if (nt_1 =/= nt_2) -- if ($size($valtype_numtype(nt_1)) = $size($valtype_numtype(nt_2))) - ;; 3-typing.watsup:247.1-250.52 + ;; 3-typing.watsup:274.1-277.52 rule convert-i {C : context, in_1 : in, in_2 : in, sx? : sx?}: `%|-%:%`(C, CVTOP_instr($numtype_in(in_1), CONVERT_cvtop, $numtype_in(in_2), sx?{sx}), `%->%`([$valtype_in(in_2)], [$valtype_in(in_1)])) -- if (in_1 =/= in_2) -- if ((sx?{sx} = ?()) <=> ($size($valtype_in(in_1)) > $size($valtype_in(in_2)))) - ;; 3-typing.watsup:252.1-254.22 + ;; 3-typing.watsup:279.1-281.22 rule convert-f {C : context, fn_1 : fn, fn_2 : fn}: `%|-%:%`(C, CVTOP_instr($numtype_fn(fn_1), CONVERT_cvtop, $numtype_fn(fn_2), ?()), `%->%`([$valtype_fn(fn_2)], [$valtype_fn(fn_1)])) -- if (fn_1 =/= fn_2) - ;; 3-typing.watsup:257.1-258.35 + ;; 3-typing.watsup:286.1-287.35 rule ref.null {C : context, rt : reftype}: `%|-%:%`(C, REF.NULL_instr(rt), `%->%`([], [$valtype_reftype(rt)])) - ;; 3-typing.watsup:260.1-262.23 + ;; 3-typing.watsup:289.1-291.23 rule ref.func {C : context, ft : functype, x : idx}: `%|-%:%`(C, REF.FUNC_instr(x), `%->%`([], [FUNCREF_valtype])) -- if (C.FUNC_context[x] = ft) - ;; 3-typing.watsup:264.1-265.31 + ;; 3-typing.watsup:293.1-294.31 rule ref.is_null {C : context, rt : reftype}: `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([$valtype_reftype(rt)], [I32_valtype])) - ;; 3-typing.watsup:268.1-270.23 + ;; 3-typing.watsup:299.1-301.23 rule local.get {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:272.1-274.23 + ;; 3-typing.watsup:303.1-305.23 rule local.set {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->%`([t], [])) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:276.1-278.23 + ;; 3-typing.watsup:307.1-309.23 rule local.tee {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%`([t], [t])) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:281.1-283.29 + ;; 3-typing.watsup:314.1-316.29 rule global.get {C : context, t : valtype, x : idx}: `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) -- if (C.GLOBAL_context[x] = `MUT%?%`(()?{}, t)) - ;; 3-typing.watsup:285.1-287.28 + ;; 3-typing.watsup:318.1-320.28 rule global.set {C : context, t : valtype, x : idx}: `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) -- if (C.GLOBAL_context[x] = `MUT%?%`(?(()), t)) - ;; 3-typing.watsup:290.1-292.28 + ;; 3-typing.watsup:325.1-327.28 rule table.get {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [$valtype_reftype(rt)])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:294.1-296.28 + ;; 3-typing.watsup:329.1-331.28 rule table.set {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype $valtype_reftype(rt)], [])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:298.1-300.24 + ;; 3-typing.watsup:333.1-335.24 rule table.size {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) -- if (C.TABLE_context[x] = tt) - ;; 3-typing.watsup:302.1-304.28 + ;; 3-typing.watsup:337.1-339.28 rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([$valtype_reftype(rt) I32_valtype], [I32_valtype])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:306.1-308.28 + ;; 3-typing.watsup:341.1-343.28 rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype $valtype_reftype(rt) I32_valtype], [])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:310.1-313.32 + ;; 3-typing.watsup:345.1-348.32 rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt : reftype, x_1 : idx, x_2 : idx}: `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt)) -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt)) - ;; 3-typing.watsup:315.1-318.25 + ;; 3-typing.watsup:350.1-353.25 rule table.init {C : context, lim : limits, rt : reftype, x_1 : idx, x_2 : idx}: `%|-%:%`(C, TABLE.INIT_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.TABLE_context[x_1] = `%%`(lim, rt)) -- if (C.ELEM_context[x_2] = rt) - ;; 3-typing.watsup:320.1-322.23 + ;; 3-typing.watsup:355.1-357.23 rule elem.drop {C : context, rt : reftype, x : idx}: `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) -- if (C.ELEM_context[x] = rt) - ;; 3-typing.watsup:325.1-327.22 + ;; 3-typing.watsup:362.1-364.22 rule memory.size {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.SIZE_instr, `%->%`([], [I32_valtype])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:329.1-331.22 + ;; 3-typing.watsup:366.1-368.22 rule memory.grow {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.GROW_instr, `%->%`([I32_valtype], [I32_valtype])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:333.1-335.22 + ;; 3-typing.watsup:370.1-372.22 rule memory.fill {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.FILL_instr, `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:337.1-339.22 + ;; 3-typing.watsup:374.1-376.22 rule memory.copy {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.COPY_instr, `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:341.1-344.23 + ;; 3-typing.watsup:378.1-381.23 rule memory.init {C : context, mt : memtype, x : idx}: `%|-%:%`(C, MEMORY.INIT_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.MEM_context[0] = mt) -- if (C.DATA_context[x] = OK) - ;; 3-typing.watsup:346.1-348.23 + ;; 3-typing.watsup:383.1-385.23 rule data.drop {C : context, x : idx}: `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) -- if (C.DATA_context[x] = OK) - ;; 3-typing.watsup:350.1-355.32 + ;; 3-typing.watsup:387.1-392.32 rule load {C : context, in : in, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?}: `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, n_A, n_O), `%->%`([I32_valtype], [$valtype_numtype(nt)])) -- if (C.MEM_context[0] = mt) @@ -2717,7 +2717,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size($valtype_numtype(nt)) / 8))))?{n} -- if ((n?{n} = ?()) \/ (nt = $numtype_in(in))) - ;; 3-typing.watsup:357.1-362.32 + ;; 3-typing.watsup:394.1-399.32 rule store {C : context, in : in, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype}: `%|-%:%`(C, STORE_instr(nt, n?{n}, n_A, n_O), `%->%`([I32_valtype $valtype_numtype(nt)], [])) -- if (C.MEM_context[0] = mt) @@ -2725,185 +2725,185 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size($valtype_numtype(nt)) / 8))))?{n} -- if ((n?{n} = ?()) \/ (nt = $numtype_in(in))) -;; 3-typing.watsup:124.1-124.67 +;; 3-typing.watsup:136.1-136.67 relation InstrSeq_ok: `%|-%*:%`(context, instr*, functype) - ;; 3-typing.watsup:133.1-134.36 + ;; 3-typing.watsup:149.1-150.36 rule empty {C : context}: `%|-%*:%`(C, [], `%->%`([], [])) - ;; 3-typing.watsup:136.1-139.46 + ;; 3-typing.watsup:152.1-155.46 rule seq {C : context, instr_1 : instr, instr_2 : instr, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*}: `%|-%*:%`(C, [instr_1] :: instr_2*{}, `%->%`(t_1*{t_1}, t_3*{t_3})) -- Instr_ok: `%|-%:%`(C, instr_1, `%->%`(t_1*{t_1}, t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C, [instr_2], `%->%`(t_2*{t_2}, t_3*{t_3})) - ;; 3-typing.watsup:141.1-146.38 + ;; 3-typing.watsup:157.1-162.38 rule weak {C : context, instr* : instr*, t'_1* : valtype*, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%*:%`(C, instr*{instr}, `%->%`(t'_1*{t'_1}, t'_2*{t'_2})) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) -- Resulttype_sub: `|-%*<:%*`(t'_1*{t'_1}, t_1*{t_1}) -- Resulttype_sub: `|-%*<:%*`(t_2*{t_2}, t'_2*{t'_2}) - ;; 3-typing.watsup:148.1-150.45 + ;; 3-typing.watsup:164.1-166.45 rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%*:%`(C, instr*{instr}, `%->%`(t*{t} :: t_1*{t_1}, t*{t} :: t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) } -;; 3-typing.watsup:125.1-125.71 +;; 3-typing.watsup:137.1-137.71 relation Expr_ok: `%|-%:%`(context, expr, resulttype) - ;; 3-typing.watsup:128.1-130.46 + ;; 3-typing.watsup:142.1-144.46 rule _ {C : context, instr* : instr*, t* : valtype*}: `%|-%:%`(C, instr*{instr}, t*{t}) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`([], t*{t})) -;; 3-typing.watsup:367.1-367.78 +;; 3-typing.watsup:406.1-406.78 relation Instr_const: `%|-%CONST`(context, instr) - ;; 3-typing.watsup:371.1-372.26 + ;; 3-typing.watsup:410.1-411.26 rule const {C : context, c : c_numtype, nt : numtype}: `%|-%CONST`(C, CONST_instr(nt, c)) - ;; 3-typing.watsup:374.1-375.27 + ;; 3-typing.watsup:413.1-414.27 rule ref.null {C : context, rt : reftype}: `%|-%CONST`(C, REF.NULL_instr(rt)) - ;; 3-typing.watsup:377.1-378.26 + ;; 3-typing.watsup:416.1-417.26 rule ref.func {C : context, x : idx}: `%|-%CONST`(C, REF.FUNC_instr(x)) - ;; 3-typing.watsup:380.1-382.32 + ;; 3-typing.watsup:419.1-421.32 rule global.get {C : context, t : valtype, x : idx}: `%|-%CONST`(C, GLOBAL.GET_instr(x)) -- if (C.GLOBAL_context[x] = `MUT%?%`(?(), t)) -;; 3-typing.watsup:368.1-368.77 +;; 3-typing.watsup:407.1-407.77 relation Expr_const: `%|-%CONST`(context, expr) - ;; 3-typing.watsup:385.1-386.38 + ;; 3-typing.watsup:424.1-425.38 rule _ {C : context, instr* : instr*}: `%|-%CONST`(C, instr*{instr}) -- (Instr_const: `%|-%CONST`(C, instr))*{instr} -;; 3-typing.watsup:369.1-369.78 +;; 3-typing.watsup:408.1-408.78 relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) - ;; 3-typing.watsup:389.1-392.33 + ;; 3-typing.watsup:428.1-431.33 rule _ {C : context, expr : expr, t : valtype}: `%|-%:%CONST`(C, expr, t) -- Expr_ok: `%|-%:%`(C, expr, [t]) -- Expr_const: `%|-%CONST`(C, expr) -;; 3-typing.watsup:397.1-397.73 +;; 3-typing.watsup:438.1-438.73 relation Func_ok: `%|-%:%`(context, func, functype) - ;; 3-typing.watsup:408.1-412.75 + ;; 3-typing.watsup:451.1-455.75 rule _ {C : context, expr : expr, ft : functype, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, `FUNC%%*%`(ft, t*{t}, expr), ft) -- if (ft = `%->%`(t_1*{t_1}, t_2*{t_2})) -- Functype_ok: `|-%:OK`(ft) -- Expr_ok: `%|-%:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL t_1*{t_1} :: t*{t}, LABEL [], RETURN ?()} ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()} ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2})}, expr, t_2*{t_2}) -;; 3-typing.watsup:398.1-398.75 +;; 3-typing.watsup:439.1-439.75 relation Global_ok: `%|-%:%`(context, global, globaltype) - ;; 3-typing.watsup:414.1-418.40 + ;; 3-typing.watsup:457.1-461.40 rule _ {C : context, expr : expr, gt : globaltype, t : valtype}: `%|-%:%`(C, GLOBAL(gt, expr), gt) -- Globaltype_ok: `|-%:OK`(gt) -- if (gt = `MUT%?%`(()?{}, t)) -- Expr_ok_const: `%|-%:%CONST`(C, expr, t) -;; 3-typing.watsup:399.1-399.74 +;; 3-typing.watsup:440.1-440.74 relation Table_ok: `%|-%:%`(context, table, tabletype) - ;; 3-typing.watsup:420.1-422.30 + ;; 3-typing.watsup:463.1-465.30 rule _ {C : context, tt : tabletype}: `%|-%:%`(C, TABLE(tt), tt) -- Tabletype_ok: `|-%:OK`(tt) -;; 3-typing.watsup:400.1-400.72 +;; 3-typing.watsup:441.1-441.72 relation Mem_ok: `%|-%:%`(context, mem, memtype) - ;; 3-typing.watsup:424.1-426.28 + ;; 3-typing.watsup:467.1-469.28 rule _ {C : context, mt : memtype}: `%|-%:%`(C, MEMORY(mt), mt) -- Memtype_ok: `|-%:OK`(mt) -;; 3-typing.watsup:403.1-403.77 +;; 3-typing.watsup:444.1-444.77 relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) - ;; 3-typing.watsup:437.1-440.45 + ;; 3-typing.watsup:480.1-483.45 rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE_elemmode(x, expr), rt) -- if (C.TABLE_context[x] = `%%`(lim, rt)) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} - ;; 3-typing.watsup:442.1-443.20 + ;; 3-typing.watsup:485.1-486.20 rule declare {C : context, rt : reftype}: `%|-%:%`(C, DECLARE_elemmode, rt) -;; 3-typing.watsup:401.1-401.73 +;; 3-typing.watsup:442.1-442.73 relation Elem_ok: `%|-%:%`(context, elem, reftype) - ;; 3-typing.watsup:428.1-431.40 + ;; 3-typing.watsup:471.1-474.40 rule _ {C : context, elemmode? : elemmode?, expr* : expr*, rt : reftype}: `%|-%:%`(C, `ELEM%%*%?`(rt, expr*{expr}, elemmode?{elemmode}), rt) -- (Expr_ok: `%|-%:%`(C, expr, [$valtype_reftype(rt)]))*{expr} -- (Elemmode_ok: `%|-%:%`(C, elemmode, rt))?{elemmode} -;; 3-typing.watsup:404.1-404.77 +;; 3-typing.watsup:445.1-445.77 relation Datamode_ok: `%|-%:OK`(context, datamode) - ;; 3-typing.watsup:445.1-448.45 + ;; 3-typing.watsup:488.1-491.45 rule _ {C : context, expr : expr, mt : memtype}: `%|-%:OK`(C, MEMORY_datamode(0, expr)) -- if (C.MEM_context[0] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} -;; 3-typing.watsup:402.1-402.73 +;; 3-typing.watsup:443.1-443.73 relation Data_ok: `%|-%:OK`(context, data) - ;; 3-typing.watsup:433.1-435.40 + ;; 3-typing.watsup:476.1-478.40 rule _ {C : context, b* : byte*, datamode? : datamode?}: `%|-%:OK`(C, `DATA%*%?`(b*{b}, datamode?{datamode})) -- (Datamode_ok: `%|-%:OK`(C, datamode))?{datamode} -;; 3-typing.watsup:405.1-405.74 +;; 3-typing.watsup:446.1-446.74 relation Start_ok: `%|-%:OK`(context, start) - ;; 3-typing.watsup:450.1-452.39 + ;; 3-typing.watsup:493.1-495.39 rule _ {C : context, x : idx}: `%|-%:OK`(C, START(x)) -- if (C.FUNC_context[x] = `%->%`([], [])) -;; 3-typing.watsup:455.1-455.80 +;; 3-typing.watsup:500.1-500.80 relation Import_ok: `%|-%:%`(context, import, externtype) - ;; 3-typing.watsup:459.1-461.31 + ;; 3-typing.watsup:504.1-506.31 rule _ {C : context, name_1 : name, name_2 : name, xt : externtype}: `%|-%:%`(C, IMPORT(name_1, name_2, xt), xt) -- Externtype_ok: `|-%:OK`(xt) -;; 3-typing.watsup:457.1-457.83 +;; 3-typing.watsup:502.1-502.83 relation Externuse_ok: `%|-%:%`(context, externuse, externtype) - ;; 3-typing.watsup:467.1-469.23 + ;; 3-typing.watsup:512.1-514.23 rule func {C : context, ft : functype, x : idx}: `%|-%:%`(C, FUNC_externuse(x), FUNC_externtype(ft)) -- if (C.FUNC_context[x] = ft) - ;; 3-typing.watsup:471.1-473.25 + ;; 3-typing.watsup:516.1-518.25 rule global {C : context, gt : globaltype, x : idx}: `%|-%:%`(C, GLOBAL_externuse(x), GLOBAL_externtype(gt)) -- if (C.GLOBAL_context[x] = gt) - ;; 3-typing.watsup:475.1-477.24 + ;; 3-typing.watsup:520.1-522.24 rule table {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE_externuse(x), TABLE_externtype(tt)) -- if (C.TABLE_context[x] = tt) - ;; 3-typing.watsup:479.1-481.22 + ;; 3-typing.watsup:524.1-526.22 rule mem {C : context, mt : memtype, x : idx}: `%|-%:%`(C, MEM_externuse(x), MEM_externtype(mt)) -- if (C.MEM_context[x] = mt) -;; 3-typing.watsup:456.1-456.80 +;; 3-typing.watsup:501.1-501.80 relation Export_ok: `%|-%:%`(context, export, externtype) - ;; 3-typing.watsup:463.1-465.39 + ;; 3-typing.watsup:508.1-510.39 rule _ {C : context, externuse : externuse, name : name, xt : externtype}: `%|-%:%`(C, EXPORT(name, externuse), xt) -- Externuse_ok: `%|-%:%`(C, externuse, xt) -;; 3-typing.watsup:484.1-484.62 +;; 3-typing.watsup:531.1-531.62 relation Module_ok: `|-%:OK`(module) - ;; 3-typing.watsup:486.1-500.16 + ;; 3-typing.watsup:533.1-547.16 rule _ {C : context, data^n : data^n, elem* : elem*, export* : export*, ft* : functype*, func* : func*, global* : global*, gt* : globaltype*, import* : import*, mem* : mem*, mt* : memtype*, n : n, rt* : reftype*, start? : start?, table* : table*, tt* : tabletype*}: `|-%:OK`(`MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data^n{data}, start?{start}, export*{export})) -- if (C = {FUNC ft*{ft}, GLOBAL gt*{gt}, TABLE tt*{tt}, MEM mt*{mt}, ELEM rt*{rt}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) @@ -2916,114 +2916,114 @@ relation Module_ok: `|-%:OK`(module) -- (Start_ok: `%|-%:OK`(C, start))?{start} -- if (|mem*{mem}| <= 1) -;; 4-runtime.watsup:3.1-3.39 +;; 4-runtime.watsup:5.1-5.39 syntax addr = nat -;; 4-runtime.watsup:4.1-4.53 +;; 4-runtime.watsup:6.1-6.53 syntax funcaddr = addr -;; 4-runtime.watsup:5.1-5.53 +;; 4-runtime.watsup:7.1-7.53 syntax globaladdr = addr -;; 4-runtime.watsup:6.1-6.51 +;; 4-runtime.watsup:8.1-8.51 syntax tableaddr = addr -;; 4-runtime.watsup:7.1-7.50 +;; 4-runtime.watsup:9.1-9.50 syntax memaddr = addr -;; 4-runtime.watsup:8.1-8.49 +;; 4-runtime.watsup:10.1-10.49 syntax elemaddr = addr -;; 4-runtime.watsup:9.1-9.49 +;; 4-runtime.watsup:11.1-11.49 syntax dataaddr = addr -;; 4-runtime.watsup:10.1-10.51 +;; 4-runtime.watsup:12.1-12.51 syntax labeladdr = addr -;; 4-runtime.watsup:11.1-11.49 +;; 4-runtime.watsup:13.1-13.49 syntax hostaddr = addr -;; 4-runtime.watsup:24.1-25.24 +;; 4-runtime.watsup:30.1-31.24 syntax num = | CONST(numtype, c_numtype) -;; 4-runtime.watsup:26.1-27.67 +;; 4-runtime.watsup:32.1-33.67 syntax ref = | REF.NULL(reftype) | REF.FUNC_ADDR(funcaddr) | REF.HOST_ADDR(hostaddr) -;; 4-runtime.watsup:28.1-29.10 +;; 4-runtime.watsup:34.1-35.10 syntax val = | CONST(numtype, c_numtype) | REF.NULL(reftype) | REF.FUNC_ADDR(funcaddr) | REF.HOST_ADDR(hostaddr) -;; 4-runtime.watsup:31.1-32.18 +;; 4-runtime.watsup:37.1-38.18 syntax result = | _VALS(val*) | TRAP -;; 4-runtime.watsup:38.1-39.66 +;; 4-runtime.watsup:47.1-48.66 syntax externval = | FUNC(funcaddr) | GLOBAL(globaladdr) | TABLE(tableaddr) | MEM(memaddr) -;; 4-runtime.watsup:44.1-44.44 +;; 4-runtime.watsup:55.1-55.44 def default_ : valtype -> val - ;; 4-runtime.watsup:45.1-45.35 + ;; 4-runtime.watsup:56.1-56.35 def default_(I32_valtype) = CONST_val(I32_numtype, 0) - ;; 4-runtime.watsup:46.1-46.35 + ;; 4-runtime.watsup:57.1-57.35 def default_(I64_valtype) = CONST_val(I64_numtype, 0) - ;; 4-runtime.watsup:47.1-47.35 + ;; 4-runtime.watsup:58.1-58.35 def default_(F32_valtype) = CONST_val(F32_numtype, 0) - ;; 4-runtime.watsup:48.1-48.35 + ;; 4-runtime.watsup:59.1-59.35 def default_(F64_valtype) = CONST_val(F64_numtype, 0) - ;; 4-runtime.watsup:49.1-49.44 + ;; 4-runtime.watsup:60.1-60.44 def default_(FUNCREF_valtype) = REF.NULL_val(FUNCREF_reftype) - ;; 4-runtime.watsup:50.1-50.48 + ;; 4-runtime.watsup:61.1-61.48 def default_(EXTERNREF_valtype) = REF.NULL_val(EXTERNREF_reftype) -;; 4-runtime.watsup:72.1-74.22 +;; 4-runtime.watsup:87.1-89.22 syntax exportinst = {NAME name, VALUE externval} -;; 4-runtime.watsup:84.1-91.25 +;; 4-runtime.watsup:91.1-98.25 syntax moduleinst = {FUNC funcaddr*, GLOBAL globaladdr*, TABLE tableaddr*, MEM memaddr*, ELEM elemaddr*, DATA dataaddr*, EXPORT exportinst*} -;; 4-runtime.watsup:55.1-57.16 +;; 4-runtime.watsup:70.1-72.16 syntax funcinst = {MODULE moduleinst, CODE func} -;; 4-runtime.watsup:58.1-60.16 +;; 4-runtime.watsup:73.1-75.16 syntax globalinst = {TYPE globaltype, VALUE val} -;; 4-runtime.watsup:61.1-63.16 +;; 4-runtime.watsup:76.1-78.16 syntax tableinst = {TYPE tabletype, ELEM ref*} -;; 4-runtime.watsup:64.1-66.17 +;; 4-runtime.watsup:79.1-81.17 syntax meminst = {TYPE memtype, DATA byte*} -;; 4-runtime.watsup:67.1-69.16 +;; 4-runtime.watsup:82.1-84.16 syntax eleminst = {TYPE elemtype, ELEM ref*} -;; 4-runtime.watsup:70.1-71.17 +;; 4-runtime.watsup:85.1-86.17 syntax datainst = {DATA byte*} -;; 4-runtime.watsup:76.1-82.21 +;; 4-runtime.watsup:112.1-118.21 syntax store = {FUNC funcinst*, GLOBAL globalinst*, TABLE tableinst*, MEM meminst*, ELEM eleminst*, DATA datainst*} -;; 4-runtime.watsup:93.1-95.24 +;; 4-runtime.watsup:120.1-122.24 syntax frame = {LOCAL val*, MODULE moduleinst} -;; 4-runtime.watsup:96.1-96.47 +;; 4-runtime.watsup:124.1-124.47 syntax state = `%;%`(store, frame) -;; 4-runtime.watsup:183.1-190.5 +;; 4-runtime.watsup:209.1-216.5 rec { -;; 4-runtime.watsup:183.1-190.5 +;; 4-runtime.watsup:209.1-216.5 syntax admininstr = | UNREACHABLE | NOP @@ -3134,141 +3134,141 @@ def admininstr_val : val -> admininstr def {x : funcaddr} admininstr_val(REF.FUNC_ADDR_val(x)) = REF.FUNC_ADDR_admininstr(x) def {x : hostaddr} admininstr_val(REF.HOST_ADDR_val(x)) = REF.HOST_ADDR_admininstr(x) -;; 4-runtime.watsup:97.1-97.62 +;; 4-runtime.watsup:125.1-125.62 syntax config = `%;%*`(state, admininstr*) -;; 4-runtime.watsup:115.1-115.59 +;; 4-runtime.watsup:134.1-134.59 def funcaddr : state -> funcaddr* - ;; 4-runtime.watsup:116.1-116.38 + ;; 4-runtime.watsup:135.1-135.38 def {f : frame, s : store} funcaddr(`%;%`(s, f)) = f.MODULE_frame.FUNC_moduleinst -;; 4-runtime.watsup:118.1-118.52 +;; 4-runtime.watsup:137.1-137.52 def funcinst : state -> funcinst* - ;; 4-runtime.watsup:125.1-125.31 + ;; 4-runtime.watsup:144.1-144.31 def {f : frame, s : store} funcinst(`%;%`(s, f)) = s.FUNC_store -;; 4-runtime.watsup:119.1-119.58 +;; 4-runtime.watsup:138.1-138.58 def globalinst : state -> globalinst* - ;; 4-runtime.watsup:126.1-126.35 + ;; 4-runtime.watsup:145.1-145.35 def {f : frame, s : store} globalinst(`%;%`(s, f)) = s.GLOBAL_store -;; 4-runtime.watsup:120.1-120.55 +;; 4-runtime.watsup:139.1-139.55 def tableinst : state -> tableinst* - ;; 4-runtime.watsup:127.1-127.33 + ;; 4-runtime.watsup:146.1-146.33 def {f : frame, s : store} tableinst(`%;%`(s, f)) = s.TABLE_store -;; 4-runtime.watsup:121.1-121.49 +;; 4-runtime.watsup:140.1-140.49 def meminst : state -> meminst* - ;; 4-runtime.watsup:128.1-128.29 + ;; 4-runtime.watsup:147.1-147.29 def {f : frame, s : store} meminst(`%;%`(s, f)) = s.MEM_store -;; 4-runtime.watsup:122.1-122.52 +;; 4-runtime.watsup:141.1-141.52 def eleminst : state -> eleminst* - ;; 4-runtime.watsup:129.1-129.31 + ;; 4-runtime.watsup:148.1-148.31 def {f : frame, s : store} eleminst(`%;%`(s, f)) = s.ELEM_store -;; 4-runtime.watsup:123.1-123.52 +;; 4-runtime.watsup:142.1-142.52 def datainst : state -> datainst* - ;; 4-runtime.watsup:130.1-130.31 + ;; 4-runtime.watsup:149.1-149.31 def {f : frame, s : store} datainst(`%;%`(s, f)) = s.DATA_store -;; 4-runtime.watsup:132.1-132.67 +;; 4-runtime.watsup:151.1-151.67 def func : (state, funcidx) -> funcinst - ;; 4-runtime.watsup:140.1-140.48 + ;; 4-runtime.watsup:159.1-159.48 def {f : frame, s : store, x : idx} func(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[x]] -;; 4-runtime.watsup:133.1-133.69 +;; 4-runtime.watsup:152.1-152.69 def global : (state, globalidx) -> globalinst - ;; 4-runtime.watsup:141.1-141.54 + ;; 4-runtime.watsup:160.1-160.54 def {f : frame, s : store, x : idx} global(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x]] -;; 4-runtime.watsup:134.1-134.68 +;; 4-runtime.watsup:153.1-153.68 def table : (state, tableidx) -> tableinst - ;; 4-runtime.watsup:142.1-142.51 + ;; 4-runtime.watsup:161.1-161.51 def {f : frame, s : store, x : idx} table(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]] -;; 4-runtime.watsup:135.1-135.66 +;; 4-runtime.watsup:154.1-154.66 def mem : (state, memidx) -> meminst - ;; 4-runtime.watsup:143.1-143.45 + ;; 4-runtime.watsup:162.1-162.45 def {f : frame, s : store, x : idx} mem(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[x]] -;; 4-runtime.watsup:136.1-136.67 +;; 4-runtime.watsup:155.1-155.67 def elem : (state, tableidx) -> eleminst - ;; 4-runtime.watsup:144.1-144.48 + ;; 4-runtime.watsup:163.1-163.48 def {f : frame, s : store, x : idx} elem(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[x]] -;; 4-runtime.watsup:137.1-137.67 +;; 4-runtime.watsup:156.1-156.67 def data : (state, dataidx) -> datainst - ;; 4-runtime.watsup:145.1-145.48 + ;; 4-runtime.watsup:164.1-164.48 def {f : frame, s : store, x : idx} data(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[x]] -;; 4-runtime.watsup:138.1-138.68 +;; 4-runtime.watsup:157.1-157.68 def local : (state, localidx) -> val - ;; 4-runtime.watsup:146.1-146.35 + ;; 4-runtime.watsup:165.1-165.35 def {f : frame, s : store, x : idx} local(`%;%`(s, f), x) = f.LOCAL_frame[x] -;; 4-runtime.watsup:149.1-149.78 +;; 4-runtime.watsup:168.1-168.78 def with_local : (state, localidx, val) -> state - ;; 4-runtime.watsup:158.1-158.52 + ;; 4-runtime.watsup:177.1-177.52 def {f : frame, s : store, v : val, x : idx} with_local(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[x] = v]) -;; 4-runtime.watsup:150.1-150.85 +;; 4-runtime.watsup:169.1-169.85 def with_global : (state, globalidx, val) -> state - ;; 4-runtime.watsup:159.1-159.77 + ;; 4-runtime.watsup:178.1-178.77 def {f : frame, s : store, v : val, x : idx} with_global(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x]].VALUE_globalinst = v], f) -;; 4-runtime.watsup:151.1-151.88 +;; 4-runtime.watsup:170.1-170.88 def with_table : (state, tableidx, nat, ref) -> state - ;; 4-runtime.watsup:160.1-160.79 + ;; 4-runtime.watsup:179.1-179.79 def {f : frame, i : nat, r : ref, s : store, x : idx} with_table(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]].ELEM_tableinst[i] = r], f) -;; 4-runtime.watsup:152.1-152.84 +;; 4-runtime.watsup:171.1-171.84 def with_tableinst : (state, tableidx, tableinst) -> state - ;; 4-runtime.watsup:161.1-161.74 + ;; 4-runtime.watsup:180.1-180.74 def {f : frame, s : store, ti : tableinst, x : idx} with_tableinst(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]] = ti], f) -;; 4-runtime.watsup:153.1-153.93 +;; 4-runtime.watsup:172.1-172.93 def with_mem : (state, memidx, nat, nat, byte*) -> state - ;; 4-runtime.watsup:162.1-162.82 + ;; 4-runtime.watsup:181.1-181.82 def {b* : byte*, f : frame, i : nat, j : nat, s : store, x : idx} with_mem(`%;%`(s, f), x, i, j, b*{b}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x]].DATA_meminst[i : j] = b*{b}], f) -;; 4-runtime.watsup:154.1-154.77 +;; 4-runtime.watsup:173.1-173.77 def with_meminst : (state, memidx, meminst) -> state - ;; 4-runtime.watsup:163.1-163.68 + ;; 4-runtime.watsup:182.1-182.68 def {f : frame, mi : meminst, s : store, x : idx} with_meminst(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x]] = mi], f) -;; 4-runtime.watsup:155.1-155.82 +;; 4-runtime.watsup:174.1-174.82 def with_elem : (state, elemidx, ref*) -> state - ;; 4-runtime.watsup:164.1-164.72 + ;; 4-runtime.watsup:183.1-183.72 def {f : frame, r* : ref*, s : store, x : idx} with_elem(`%;%`(s, f), x, r*{r}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x]].ELEM_eleminst = r*{r}], f) -;; 4-runtime.watsup:156.1-156.82 +;; 4-runtime.watsup:175.1-175.82 def with_data : (state, dataidx, byte*) -> state - ;; 4-runtime.watsup:165.1-165.72 + ;; 4-runtime.watsup:184.1-184.72 def {b* : byte*, f : frame, s : store, x : idx} with_data(`%;%`(s, f), x, b*{b}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x]].DATA_datainst = b*{b}], f) -;; 4-runtime.watsup:167.1-167.63 +;; 4-runtime.watsup:189.1-189.63 def grow_table : (tableinst, nat, ref) -> tableinst - ;; 4-runtime.watsup:170.1-174.36 + ;; 4-runtime.watsup:192.1-196.36 def {i : nat, i' : nat, j : nat, n : n, r : ref, r'* : ref*, rt : reftype, ti : tableinst, ti' : tableinst} grow_table(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{}}) -- Tabletype_ok: `|-%:OK`(ti'.TYPE_tableinst) -;; 4-runtime.watsup:168.1-168.55 +;; 4-runtime.watsup:190.1-190.55 def grow_memory : (meminst, nat) -> meminst - ;; 4-runtime.watsup:175.1-179.34 + ;; 4-runtime.watsup:198.1-202.34 def {b* : byte*, i : nat, i' : nat, j : nat, mi : meminst, mi' : meminst, n : n} grow_memory(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){}}) -- Memtype_ok: `|-%:OK`(mi'.TYPE_meminst) -;; 4-runtime.watsup:192.1-195.21 +;; 4-runtime.watsup:218.1-221.21 rec { -;; 4-runtime.watsup:192.1-195.21 +;; 4-runtime.watsup:218.1-221.21 syntax E = | _HOLE | _SEQ(val*, E, instr*) @@ -3299,480 +3299,469 @@ def wrap_ : ((nat, nat), c_numtype) -> nat ;; 5-numerics.watsup:13.1-13.28 def bytes_ : (nat, c_numtype) -> byte* -;; 6-reduction.watsup:4.1-4.63 +;; 6-reduction.watsup:6.1-6.63 relation Step_pure: `%*~>%*`(admininstr*, admininstr*) - ;; 6-reduction.watsup:16.1-17.24 + ;; 6-reduction.watsup:24.1-25.24 rule unreachable: `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) - ;; 6-reduction.watsup:19.1-20.19 + ;; 6-reduction.watsup:27.1-28.19 rule nop: `%*~>%*`([NOP_admininstr], []) - ;; 6-reduction.watsup:22.1-23.24 + ;; 6-reduction.watsup:30.1-31.24 rule drop {val : val}: `%*~>%*`([$admininstr_val(val) DROP_admininstr], []) - ;; 6-reduction.watsup:26.1-28.16 + ;; 6-reduction.watsup:34.1-36.16 rule select-true {c : c_numtype, t? : valtype?, val_1 : val, val_2 : val}: `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t?{t})], [$admininstr_val(val_1)]) -- if (c =/= 0) - ;; 6-reduction.watsup:30.1-32.14 + ;; 6-reduction.watsup:38.1-40.14 rule select-false {c : c_numtype, t? : valtype?, val_1 : val, val_2 : val}: `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t?{t})], [$admininstr_val(val_2)]) -- if (c = 0) - ;; 6-reduction.watsup:35.1-37.28 + ;; 6-reduction.watsup:45.1-47.28 rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k}: `%*~>%*`($admininstr_val(val)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})], [LABEL__admininstr(n, [], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) -- if (bt = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 6-reduction.watsup:39.1-41.28 + ;; 6-reduction.watsup:49.1-51.28 rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k}: `%*~>%*`($admininstr_val(val)^k{val} :: [LOOP_admininstr(bt, instr*{instr})], [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) -- if (bt = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 6-reduction.watsup:43.1-45.16 + ;; 6-reduction.watsup:53.1-55.16 rule if-true {bt : blocktype, c : c_numtype, 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) - ;; 6-reduction.watsup:47.1-49.14 + ;; 6-reduction.watsup:57.1-59.14 rule if-false {bt : blocktype, c : c_numtype, 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) - ;; 6-reduction.watsup:52.1-53.38 + ;; 6-reduction.watsup:62.1-63.38 rule label-vals {instr* : instr*, n : n, val* : val*}: `%*~>%*`([LABEL__admininstr(n, instr*{instr}, $admininstr_val(val)*{val})], $admininstr_val(val)*{val}) - ;; 6-reduction.watsup:57.1-58.69 + ;; 6-reduction.watsup:69.1-70.69 rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [BR_admininstr(0)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val} :: $admininstr_instr(instr')*{instr'}) - ;; 6-reduction.watsup:60.1-61.65 + ;; 6-reduction.watsup:72.1-73.65 rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val)*{val} :: [BR_admininstr(l + 1)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [BR_admininstr(l)]) - ;; 6-reduction.watsup:64.1-66.16 + ;; 6-reduction.watsup:76.1-78.16 rule br_if-true {c : c_numtype, l : labelidx}: `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) -- if (c =/= 0) - ;; 6-reduction.watsup:68.1-70.14 + ;; 6-reduction.watsup:80.1-82.14 rule br_if-false {c : c_numtype, l : labelidx}: `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) -- if (c = 0) - ;; 6-reduction.watsup:73.1-75.17 + ;; 6-reduction.watsup:85.1-87.17 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}|) - ;; 6-reduction.watsup:77.1-79.18 + ;; 6-reduction.watsup:89.1-91.18 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}|) - ;; 6-reduction.watsup:102.1-103.35 + ;; 6-reduction.watsup:116.1-117.35 rule frame-vals {f : frame, n : n, val^n : val^n}: `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val)^n{val})], $admininstr_val(val)^n{val}) - ;; 6-reduction.watsup:105.1-106.55 + ;; 6-reduction.watsup:119.1-120.55 rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val}) - ;; 6-reduction.watsup:108.1-109.60 + ;; 6-reduction.watsup:122.1-123.60 rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [RETURN_admininstr]) - ;; 6-reduction.watsup:112.1-114.33 + ;; 6-reduction.watsup:128.1-130.33 rule unop-val {c : c_numtype, c_1 : c_numtype, nt : numtype, unop : unop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) -- if ($unop(unop, nt, c_1) = [c]) - ;; 6-reduction.watsup:116.1-118.39 + ;; 6-reduction.watsup:132.1-134.39 rule unop-trap {c_1 : c_numtype, nt : numtype, unop : unop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) -- if ($unop(unop, nt, c_1) = []) - ;; 6-reduction.watsup:121.1-123.40 + ;; 6-reduction.watsup:137.1-139.40 rule binop-val {binop : binop_numtype, c : c_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- if ($binop(binop, nt, c_1, c_2) = [c]) - ;; 6-reduction.watsup:125.1-127.46 + ;; 6-reduction.watsup:141.1-143.46 rule binop-trap {binop : binop_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) -- if ($binop(binop, nt, c_1, c_2) = []) - ;; 6-reduction.watsup:130.1-132.37 + ;; 6-reduction.watsup:146.1-148.37 rule testop {c : c_numtype, c_1 : c_numtype, nt : numtype, testop : testop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $testop(testop, nt, c_1)) - ;; 6-reduction.watsup:134.1-136.40 + ;; 6-reduction.watsup:150.1-152.40 rule relop {c : c_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype, relop : relop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $relop(relop, nt, c_1, c_2)) - ;; 6-reduction.watsup:139.1-140.70 + ;; 6-reduction.watsup:155.1-156.70 rule extend {c : c_numtype, n : n, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, $size($valtype_numtype(nt)), S_sx, c))]) - ;; 6-reduction.watsup:143.1-145.48 + ;; 6-reduction.watsup:159.1-161.48 rule cvtop-val {c : c_numtype, c_1 : c_numtype, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) -- if ($cvtop(nt_1, cvtop, nt_2, sx?{sx}, c_1) = [c]) - ;; 6-reduction.watsup:147.1-149.54 + ;; 6-reduction.watsup:163.1-165.54 rule cvtop-trap {c_1 : c_numtype, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) -- if ($cvtop(nt_1, cvtop, nt_2, sx?{sx}, c_1) = []) - ;; 6-reduction.watsup:156.1-158.28 + ;; 6-reduction.watsup:174.1-176.28 rule ref.is_null-true {rt : reftype, val : val}: `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) -- if (val = REF.NULL_val(rt)) - ;; 6-reduction.watsup:160.1-162.15 + ;; 6-reduction.watsup:178.1-180.15 rule ref.is_null-false {val : val}: `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 6-reduction.watsup:171.1-172.47 + ;; 6-reduction.watsup:191.1-192.47 rule local.tee {val : val, x : idx}: `%*~>%*`([$admininstr_val(val) LOCAL.TEE_admininstr(x)], [$admininstr_val(val) $admininstr_val(val) LOCAL.SET_admininstr(x)]) -;; 6-reduction.watsup:5.1-5.63 +;; 6-reduction.watsup:7.1-7.63 relation Step_read: `%~>%*`(config, admininstr*) - ;; 6-reduction.watsup:82.1-83.47 + ;; 6-reduction.watsup:96.1-97.47 rule call {x : idx, z : state}: `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [CALL_ADDR_admininstr($funcaddr(z)[x])]) - ;; 6-reduction.watsup:85.1-89.17 + ;; 6-reduction.watsup:99.1-103.17 rule call_indirect-call {a : addr, ft : functype, ft' : functype, i : nat, instr* : instr*, t* : valtype*, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CALL_INDIRECT_admininstr(x, ft)]), [CALL_ADDR_admininstr(a)]) -- if ($table(z, x).ELEM_tableinst[i] = REF.FUNC_ADDR_ref(a)) -- if ($funcinst(z)[a].CODE_funcinst = `FUNC%%*%`(ft', t*{t}, instr*{instr})) -- if (ft = ft') - ;; 6-reduction.watsup:91.1-93.15 + ;; 6-reduction.watsup:105.1-107.15 rule call_indirect-trap {ft : functype, i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CALL_INDIRECT_admininstr(x, ft)]), [TRAP_admininstr]) -- otherwise - ;; 6-reduction.watsup:95.1-99.52 + ;; 6-reduction.watsup:109.1-113.52 rule call_addr {a : addr, f : frame, func : func, instr* : instr*, k : nat, m : moduleinst, n : n, t* : valtype*, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [CALL_ADDR_admininstr(a)]), [FRAME__admininstr(n, f, [LABEL__admininstr(n, [], $admininstr_instr(instr)*{instr})])]) -- if ($funcinst(z)[a] = {MODULE m, CODE func}) -- if (func = `FUNC%%*%`(`%->%`(t_1^k{t_1}, t_2^n{t_2}), t*{t}, instr*{instr})) -- if (f = {LOCAL val^k{val} :: $default_(t)*{t}, MODULE m}) - ;; 6-reduction.watsup:152.1-153.53 + ;; 6-reduction.watsup:170.1-171.53 rule ref.func {x : idx, z : state}: `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) - ;; 6-reduction.watsup:165.1-166.37 + ;; 6-reduction.watsup:185.1-186.37 rule local.get {x : idx, z : state}: `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [$admininstr_val($local(z, x))]) - ;; 6-reduction.watsup:175.1-176.45 + ;; 6-reduction.watsup:197.1-198.45 rule global.get {x : idx, z : state}: `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [$admininstr_val($global(z, x).VALUE_globalinst)]) - ;; 6-reduction.watsup:182.1-184.33 + ;; 6-reduction.watsup:206.1-208.33 rule table.get-trap {i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:186.1-188.32 + ;; 6-reduction.watsup:210.1-212.32 rule table.get-val {i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [$admininstr_ref($table(z, x).ELEM_tableinst[i])]) -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:199.1-201.32 + ;; 6-reduction.watsup:223.1-225.32 rule table.size {n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) -- if (|$table(z, x).ELEM_tableinst| = n) - ;; 6-reduction.watsup:212.1-214.39 + ;; 6-reduction.watsup:236.1-238.39 rule table.fill-trap {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:216.1-219.14 + ;; 6-reduction.watsup:240.1-243.14 rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:221.1-225.15 + ;; 6-reduction.watsup:245.1-249.15 rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) -- otherwise - ;; 6-reduction.watsup:228.1-230.73 + ;; 6-reduction.watsup:252.1-254.73 rule table.copy-trap {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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|)) - ;; 6-reduction.watsup:232.1-235.14 + ;; 6-reduction.watsup:256.1-259.14 rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:237.1-242.15 + ;; 6-reduction.watsup:261.1-266.15 rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:244.1-248.15 + ;; 6-reduction.watsup:268.1-272.15 rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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 - ;; 6-reduction.watsup:251.1-253.72 + ;; 6-reduction.watsup:275.1-277.72 rule table.init-trap {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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|)) - ;; 6-reduction.watsup:255.1-258.14 + ;; 6-reduction.watsup:279.1-282.14 rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:260.1-264.15 + ;; 6-reduction.watsup:284.1-288.15 rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) $admininstr_ref($elem(z, y).ELEM_eleminst[i]) 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 - ;; 6-reduction.watsup:271.1-273.53 + ;; 6-reduction.watsup:297.1-299.53 rule load-num-trap {i : nat, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), n_A, n_O)]), [TRAP_admininstr]) -- if (((i + n_O) + ($size($valtype_numtype(nt)) / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:275.1-277.71 + ;; 6-reduction.watsup:301.1-303.71 rule load-num-val {c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), n_A, n_O)]), [CONST_admininstr(nt, c)]) -- if ($bytes_($size($valtype_numtype(nt)), c) = $mem(z, 0).DATA_meminst[(i + n_O) : ($size($valtype_numtype(nt)) / 8)]) - ;; 6-reduction.watsup:279.1-281.45 + ;; 6-reduction.watsup:305.1-307.45 rule load-pack-trap {i : nat, n : n, n_A : n, n_O : n, nt : numtype, sx : sx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), n_A, n_O)]), [TRAP_admininstr]) -- if (((i + n_O) + (n / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:283.1-285.55 + ;; 6-reduction.watsup:309.1-311.55 rule load-pack-val {c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, sx : sx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), n_A, n_O)]), [CONST_admininstr(nt, $ext(n, $size($valtype_numtype(nt)), sx, c))]) -- if ($bytes_(n, c) = $mem(z, 0).DATA_meminst[(i + n_O) : (n / 8)]) - ;; 6-reduction.watsup:305.1-307.44 + ;; 6-reduction.watsup:331.1-333.44 rule memory.size {n : n, z : state}: `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr]), [CONST_admininstr(I32_numtype, n)]) -- if (((n * 64) * $Ki) = |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:318.1-320.37 + ;; 6-reduction.watsup:344.1-346.37 rule memory.fill-trap {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), [TRAP_admininstr]) -- if ((i + n) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:322.1-325.14 + ;; 6-reduction.watsup:348.1-351.14 rule memory.fill-zero {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:327.1-331.15 + ;; 6-reduction.watsup:353.1-357.15 rule memory.fill-succ {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr]) -- otherwise - ;; 6-reduction.watsup:334.1-336.69 + ;; 6-reduction.watsup:360.1-362.69 rule memory.copy-trap {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [TRAP_admininstr]) -- if (((i + n) > |$mem(z, 0).DATA_meminst|) \/ ((j + n) > |$mem(z, 0).DATA_meminst|)) - ;; 6-reduction.watsup:338.1-341.14 + ;; 6-reduction.watsup:364.1-367.14 rule memory.copy-zero {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:343.1-348.15 + ;; 6-reduction.watsup:369.1-374.15 rule memory.copy-le {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) LOAD_admininstr(I32_numtype, ?((8, U_sx)), 0, 0) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr]) -- otherwise -- if (j <= i) - ;; 6-reduction.watsup:350.1-354.15 + ;; 6-reduction.watsup:376.1-380.15 rule memory.copy-gt {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), 0, 0) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr]) -- otherwise - ;; 6-reduction.watsup:357.1-359.70 + ;; 6-reduction.watsup:383.1-385.70 rule memory.init-trap {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), [TRAP_admininstr]) -- if (((i + n) > |$data(z, x).DATA_datainst|) \/ ((j + n) > |$mem(z, 0).DATA_meminst|)) - ;; 6-reduction.watsup:361.1-364.14 + ;; 6-reduction.watsup:387.1-390.14 rule memory.init-zero {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:366.1-370.15 + ;; 6-reduction.watsup:392.1-396.15 rule memory.init-succ {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, x).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x)]) -- otherwise -;; 6-reduction.watsup:3.1-3.63 +;; 6-reduction.watsup:5.1-5.63 relation Step: `%~>%`(config, config) - ;; 6-reduction.watsup:7.1-9.34 + ;; 6-reduction.watsup:9.1-11.34 rule pure {instr* : instr*, instr'* : instr*, z : state}: `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) -- Step_pure: `%*~>%*`($admininstr_instr(instr)*{instr}, $admininstr_instr(instr')*{instr'}) - ;; 6-reduction.watsup:11.1-13.37 + ;; 6-reduction.watsup:13.1-15.37 rule read {instr* : instr*, instr'* : instr*, z : state}: `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) -- Step_read: `%~>%*`(`%;%*`(z, $admininstr_instr(instr)*{instr}), $admininstr_instr(instr')*{instr'}) - ;; 6-reduction.watsup:168.1-169.60 + ;; 6-reduction.watsup:188.1-189.60 rule local.set {val : val, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_val(val) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) - ;; 6-reduction.watsup:178.1-179.62 + ;; 6-reduction.watsup:200.1-201.62 rule global.set {val : val, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_val(val) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) - ;; 6-reduction.watsup:190.1-192.33 + ;; 6-reduction.watsup:214.1-216.33 rule table.set-trap {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:194.1-196.32 + ;; 6-reduction.watsup:218.1-220.32 rule table.set-val {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:204.1-206.47 + ;; 6-reduction.watsup:228.1-230.47 rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) -- if ($grow_table($table(z, x), n, ref) = ti) - ;; 6-reduction.watsup:208.1-209.64 + ;; 6-reduction.watsup:232.1-233.64 rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, - 1)])) - ;; 6-reduction.watsup:267.1-268.59 + ;; 6-reduction.watsup:291.1-292.59 rule elem.drop {x : idx, z : state}: `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) - ;; 6-reduction.watsup:288.1-290.53 + ;; 6-reduction.watsup:314.1-316.53 rule store-num-trap {c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), n_A, n_O)]), `%;%*`(z, [TRAP_admininstr])) -- if (((i + n_O) + ($size($valtype_numtype(nt)) / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:292.1-294.35 + ;; 6-reduction.watsup:318.1-320.35 rule store-num-val {b* : byte*, c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), n_A, n_O)]), `%;%*`($with_mem(z, 0, (i + n_O), ($size($valtype_numtype(nt)) / 8), b*{b}), [])) -- if (b*{b} = $bytes_($size($valtype_numtype(nt)), c)) - ;; 6-reduction.watsup:296.1-298.45 + ;; 6-reduction.watsup:322.1-324.45 rule store-pack-trap {c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), n_A, n_O)]), `%;%*`(z, [TRAP_admininstr])) -- if (((i + n_O) + (n / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:300.1-302.50 + ;; 6-reduction.watsup:326.1-328.50 rule store-pack-val {b* : byte*, c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), n_A, n_O)]), `%;%*`($with_mem(z, 0, (i + n_O), (n / 8), b*{b}), [])) -- if (b*{b} = $bytes_(n, $wrap_(($size($valtype_numtype(nt)), n), c))) - ;; 6-reduction.watsup:310.1-312.41 + ;; 6-reduction.watsup:336.1-338.41 rule memory.grow-succeed {mi : meminst, n : n, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr]), `%;%*`($with_meminst(z, 0, mi), [CONST_admininstr(I32_numtype, (|$mem(z, 0).DATA_meminst| / (64 * $Ki)))])) -- if ($grow_memory($mem(z, 0), n) = mi) - ;; 6-reduction.watsup:314.1-315.59 + ;; 6-reduction.watsup:340.1-341.59 rule memory.grow-fail {n : n, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr]), `%;%*`(z, [CONST_admininstr(I32_numtype, - 1)])) - ;; 6-reduction.watsup:373.1-374.59 + ;; 6-reduction.watsup:399.1-400.59 rule data.drop {x : idx, z : state}: `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) -;; 7-module.watsup:4.1-4.35 +;; 7-module.watsup:5.1-5.35 rec { -;; 7-module.watsup:4.1-4.35 +;; 7-module.watsup:5.1-5.35 def funcs : externval* -> funcaddr* - ;; 7-module.watsup:5.1-5.30 + ;; 7-module.watsup:6.1-6.30 def funcs([]) = [] - ;; 7-module.watsup:6.1-6.59 + ;; 7-module.watsup:7.1-7.59 def {externval'* : externval*, fa : funcaddr} funcs([FUNC_externval(fa)] :: externval'*{externval'}) = [fa] :: $funcs(externval'*{externval'}) - ;; 7-module.watsup:7.1-8.15 + ;; 7-module.watsup:8.1-9.15 def {externval : externval, externval'* : externval*} funcs([externval] :: externval'*{externval'}) = $funcs(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:10.1-10.39 +;; 7-module.watsup:11.1-11.39 rec { -;; 7-module.watsup:10.1-10.39 +;; 7-module.watsup:11.1-11.39 def globals : externval* -> globaladdr* - ;; 7-module.watsup:11.1-11.32 + ;; 7-module.watsup:12.1-12.32 def globals([]) = [] - ;; 7-module.watsup:12.1-12.65 + ;; 7-module.watsup:13.1-13.65 def {externval'* : externval*, ga : globaladdr} globals([GLOBAL_externval(ga)] :: externval'*{externval'}) = [ga] :: $globals(externval'*{externval'}) - ;; 7-module.watsup:13.1-14.15 + ;; 7-module.watsup:14.1-15.15 def {externval : externval, externval'* : externval*} globals([externval] :: externval'*{externval'}) = $globals(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:16.1-16.37 +;; 7-module.watsup:17.1-17.37 rec { -;; 7-module.watsup:16.1-16.37 +;; 7-module.watsup:17.1-17.37 def tables : externval* -> tableaddr* - ;; 7-module.watsup:17.1-17.31 + ;; 7-module.watsup:18.1-18.31 def tables([]) = [] - ;; 7-module.watsup:18.1-18.62 + ;; 7-module.watsup:19.1-19.62 def {externval'* : externval*, ta : tableaddr} tables([TABLE_externval(ta)] :: externval'*{externval'}) = [ta] :: $tables(externval'*{externval'}) - ;; 7-module.watsup:19.1-20.15 + ;; 7-module.watsup:20.1-21.15 def {externval : externval, externval'* : externval*} tables([externval] :: externval'*{externval'}) = $tables(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:22.1-22.33 +;; 7-module.watsup:23.1-23.33 rec { -;; 7-module.watsup:22.1-22.33 +;; 7-module.watsup:23.1-23.33 def mems : externval* -> memaddr* - ;; 7-module.watsup:23.1-23.29 + ;; 7-module.watsup:24.1-24.29 def mems([]) = [] - ;; 7-module.watsup:24.1-24.56 + ;; 7-module.watsup:25.1-25.56 def {externval'* : externval*, ma : memaddr} mems([MEM_externval(ma)] :: externval'*{externval'}) = [ma] :: $mems(externval'*{externval'}) - ;; 7-module.watsup:25.1-26.15 + ;; 7-module.watsup:26.1-27.15 def {externval : externval, externval'* : externval*} mems([externval] :: externval'*{externval'}) = $mems(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:29.1-29.83 -def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst - ;; 7-module.watsup:30.1-30.95 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externuse(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} - ;; 7-module.watsup:31.1-31.99 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externuse(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} - ;; 7-module.watsup:32.1-32.97 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externuse(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} - ;; 7-module.watsup:33.1-33.93 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externuse(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} - ;; 7-module.watsup:36.1-36.60 def allocfunc : (store, moduleinst, func) -> (store, funcaddr) ;; 7-module.watsup:37.1-38.37 @@ -3887,9 +3876,20 @@ def allocdatas : (store, byte**) -> (store, dataaddr*) -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) } -;; 7-module.watsup:97.1-97.81 +;; 7-module.watsup:99.1-99.83 +def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst + ;; 7-module.watsup:100.1-100.95 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externuse(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} + ;; 7-module.watsup:101.1-101.99 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externuse(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} + ;; 7-module.watsup:102.1-102.97 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externuse(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} + ;; 7-module.watsup:103.1-103.93 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externuse(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} + +;; 7-module.watsup:106.1-106.81 def allocmodule : (store, module, externval*, val*, ref**) -> (store, moduleinst) - ;; 7-module.watsup:98.1-135.54 + ;; 7-module.watsup:107.1-144.54 def {byte*^n_data : byte*^n_data, da* : dataaddr*, datamode?^n_data : datamode?^n_data, ea* : elemaddr*, elemmode?^n_elem : elemmode?^n_elem, export* : export*, expr_1^n_global : expr^n_global, expr_2*^n_elem : expr*^n_elem, externval* : externval*, fa* : funcaddr*, fa_ex* : funcaddr*, func^n_func : func^n_func, ga* : globaladdr*, ga_ex* : globaladdr*, globaltype^n_global : globaltype^n_global, i_data^n_data : nat^n_data, i_elem^n_elem : nat^n_elem, i_func^n_func : nat^n_func, i_global^n_global : nat^n_global, i_mem^n_mem : nat^n_mem, i_table^n_table : nat^n_table, import* : import*, m : moduleinst, ma* : memaddr*, ma_ex* : memaddr*, memtype^n_mem : memtype^n_mem, module : module, n_data : n, n_elem : n, n_func : n, n_global : n, n_mem : n, n_table : n, ref** : ref**, rt^n_elem : reftype^n_elem, s : store, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store, s_6 : store, start? : start?, ta* : tableaddr*, ta_ex* : tableaddr*, tabletype^n_table : tabletype^n_table, val* : val*, xi* : exportinst*} allocmodule(s, module, externval*{externval}, val*{val}, ref*{ref}*{ref}) = (s_6, m) -- if (module = `MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func^n_func{func}, GLOBAL(globaltype, expr_1)^n_global{expr_1 globaltype}, TABLE(tabletype)^n_table{tabletype}, MEMORY(memtype)^n_mem{memtype}, `ELEM%%*%?`(rt, expr_2*{expr_2}, elemmode?{elemmode})^n_elem{elemmode expr_2 rt}, `DATA%*%?`(byte*{byte}, datamode?{datamode})^n_data{byte datamode}, start?{start}, export*{export})) -- if (fa_ex*{fa_ex} = $funcs(externval*{externval})) @@ -3911,39 +3911,39 @@ def allocmodule : (store, module, externval*, val*, ref**) -> (store, moduleinst -- if ((s_5, ea*{ea}) = $allocelems(s_4, rt^n_elem{rt}, ref*{ref}*{ref})) -- if ((s_6, da*{da}) = $allocdatas(s_5, byte*{byte}^n_data{byte})) -;; 7-module.watsup:138.1-138.33 +;; 7-module.watsup:151.1-151.36 +rec { + +;; 7-module.watsup:151.1-151.36 +def concat_instr : instr** -> instr* + ;; 7-module.watsup:152.1-152.37 + def concat_instr([]) = [] + ;; 7-module.watsup:153.1-153.68 + def {instr* : instr*, instr'** : instr**} concat_instr([instr]*{instr} :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) +} + +;; 7-module.watsup:155.1-155.33 def runelem : (elem, idx) -> instr* - ;; 7-module.watsup:139.1-139.46 + ;; 7-module.watsup:156.1-156.46 def {expr* : expr*, i : nat, reftype : reftype} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?()), i) = [] - ;; 7-module.watsup:140.1-140.62 + ;; 7-module.watsup:157.1-157.62 def {expr* : expr*, i : nat, reftype : reftype} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?(DECLARE_elemmode)), i) = [ELEM.DROP_instr(i)] - ;; 7-module.watsup:141.1-143.20 + ;; 7-module.watsup:158.1-160.20 def {expr* : expr*, i : nat, instr* : instr*, n : n, reftype : reftype, x : idx} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?(TABLE_elemmode(x, instr*{instr}))), i) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, n) TABLE.INIT_instr(x, i) ELEM.DROP_instr(i)] -- if (n = |expr*{expr}|) -;; 7-module.watsup:145.1-145.33 +;; 7-module.watsup:162.1-162.33 def rundata : (data, idx) -> instr* - ;; 7-module.watsup:146.1-146.38 + ;; 7-module.watsup:163.1-163.38 def {byte* : byte*, i : nat} rundata(`DATA%*%?`(byte*{byte}, ?()), i) = [] - ;; 7-module.watsup:147.1-149.20 + ;; 7-module.watsup:164.1-166.20 def {byte* : byte*, i : nat, instr* : instr*, n : n} rundata(`DATA%*%?`(byte*{byte}, ?(MEMORY_datamode(0, instr*{instr}))), i) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, n) MEMORY.INIT_instr(i) DATA.DROP_instr(i)] -- if (n = |byte*{byte}|) -;; 7-module.watsup:152.1-152.36 -rec { - -;; 7-module.watsup:152.1-152.36 -def concat_instr : instr** -> instr* - ;; 7-module.watsup:153.1-153.37 - def concat_instr([]) = [] - ;; 7-module.watsup:154.1-154.68 - def {instr* : instr*, instr'** : instr**} concat_instr([instr]*{instr} :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) -} - -;; 7-module.watsup:157.1-157.55 -def instantiation : (store, module, externval*) -> config - ;; 7-module.watsup:158.1-180.28 - def {data* : data*, elem* : elem*, elemmode?* : elemmode?*, export* : export*, externval* : externval*, f : frame, f_init : frame, func* : func*, global* : global*, globaltype* : globaltype*, i^n_elem : nat^n_elem, import* : import*, instr_1** : instr**, instr_2*** : instr***, instr_data* : instr*, instr_elem* : instr*, j^n_data : nat^n_data, m : moduleinst, m_init : moduleinst, mem* : mem*, module : module, n_data : n, n_elem : n, ref** : ref**, reftype* : reftype*, s : store, s' : store, start? : start?, table* : table*, val* : val*, x? : idx?} instantiation(s, module, externval*{externval}) = `%;%*`(`%;%`(s', f), $admininstr_instr(instr_elem)*{instr_elem} :: $admininstr_instr(instr_data)*{instr_data} :: CALL_admininstr(x)?{x}) +;; 7-module.watsup:168.1-168.53 +def instantiate : (store, module, externval*) -> config + ;; 7-module.watsup:169.1-191.28 + def {data* : data*, elem* : elem*, elemmode?* : elemmode?*, export* : export*, externval* : externval*, f : frame, f_init : frame, func* : func*, global* : global*, globaltype* : globaltype*, i^n_elem : nat^n_elem, import* : import*, instr_1** : instr**, instr_2*** : instr***, instr_data* : instr*, instr_elem* : instr*, j^n_data : nat^n_data, m : moduleinst, m_init : moduleinst, mem* : mem*, module : module, n_data : n, n_elem : n, ref** : ref**, reftype* : reftype*, s : store, s' : store, start? : start?, table* : table*, val* : val*, x? : idx?} instantiate(s, module, externval*{externval}) = `%;%*`(`%;%`(s', f), $admininstr_instr(instr_elem)*{instr_elem} :: $admininstr_instr(instr_data)*{instr_data} :: CALL_admininstr(x)?{x}) -- if (module = `MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data*{data}, start?{start}, export*{export})) -- if (m_init = {FUNC $funcs(externval*{externval}), GLOBAL $globals(externval*{externval}), TABLE [], MEM [], ELEM [], DATA [], EXPORT []}) -- if (f_init = {LOCAL [], MODULE m_init}) @@ -3959,10 +3959,10 @@ def instantiation : (store, module, externval*) -> config -- if (instr_data*{instr_data} = $concat_instr($rundata(data*{data}[j], j)^(j config - ;; 7-module.watsup:184.1-196.52 - def {expr : expr, f : frame, fa : funcaddr, functype : functype, k : nat, m : moduleinst, n : n, s : store, val^n : val^n, valtype* : valtype*, valtype_param^n : valtype^n, valtype_res^k : valtype^k} invocation(s, fa, val^n{val}) = `%;%*`(`%;%`(s, f), $admininstr_val(val)^n{val} :: [CALL_ADDR_admininstr(fa)]) +;; 7-module.watsup:198.1-198.44 +def invoke : (store, funcaddr, val*) -> config + ;; 7-module.watsup:199.1-211.52 + def {expr : expr, f : frame, fa : funcaddr, functype : functype, k : nat, m : moduleinst, n : n, s : store, val^n : val^n, valtype* : valtype*, valtype_param^n : valtype^n, valtype_res^k : valtype^k} invoke(s, fa, val^n{val}) = `%;%*`(`%;%`(s, f), $admininstr_val(val)^n{val} :: [CALL_ADDR_admininstr(fa)]) -- if (m = {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], EXPORT []}) -- if (f = {LOCAL [], MODULE m}) -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = `FUNC%%*%`(functype, valtype*{valtype}, expr)) @@ -4313,49 +4313,49 @@ syntax import = IMPORT(name, name, externtype) ;; 1-syntax.watsup:212.1-213.70 syntax module = `MODULE%*%*%*%*%*%*%*%?%*`(import*, func*, global*, table*, mem*, elem*, data*, start?, export*) -;; 2-aux.watsup:3.1-3.14 +;; 2-aux.watsup:7.1-7.14 def Ki : nat - ;; 2-aux.watsup:4.1-4.15 + ;; 2-aux.watsup:8.1-8.15 def Ki = 1024 -;; 2-aux.watsup:9.1-9.25 +;; 2-aux.watsup:13.1-13.25 rec { -;; 2-aux.watsup:9.1-9.25 +;; 2-aux.watsup:13.1-13.25 def min : (nat, nat) -> nat - ;; 2-aux.watsup:10.1-10.19 + ;; 2-aux.watsup:14.1-14.19 def {j : nat} min(0, j) = 0 - ;; 2-aux.watsup:11.1-11.19 + ;; 2-aux.watsup:15.1-15.19 def {i : nat} min(i, 0) = 0 - ;; 2-aux.watsup:12.1-12.38 + ;; 2-aux.watsup:16.1-16.38 def {i : nat, j : nat} min((i + 1), (j + 1)) = $min(i, j) } -;; 2-aux.watsup:19.1-19.55 +;; 2-aux.watsup:27.1-27.55 def size : valtype -> nat? - ;; 2-aux.watsup:20.1-20.20 + ;; 2-aux.watsup:28.1-28.20 def size(I32_valtype) = ?(32) - ;; 2-aux.watsup:21.1-21.20 + ;; 2-aux.watsup:29.1-29.20 def size(I64_valtype) = ?(64) - ;; 2-aux.watsup:22.1-22.20 + ;; 2-aux.watsup:30.1-30.20 def size(F32_valtype) = ?(32) - ;; 2-aux.watsup:23.1-23.20 + ;; 2-aux.watsup:31.1-31.20 def size(F64_valtype) = ?(64) - ;; 2-aux.watsup:24.1-24.22 + ;; 2-aux.watsup:32.1-32.22 def size(V128_valtype) = ?(128) def {x : valtype} size(x) = ?() -;; 2-aux.watsup:29.1-29.40 +;; 2-aux.watsup:40.1-40.40 def test_sub_ATOM_22 : n -> nat - ;; 2-aux.watsup:30.1-30.38 + ;; 2-aux.watsup:41.1-41.38 def {n_3_ATOM_y : n} test_sub_ATOM_22(n_3_ATOM_y) = 0 -;; 2-aux.watsup:32.1-32.26 +;; 2-aux.watsup:43.1-43.26 def curried_ : (n, n) -> nat - ;; 2-aux.watsup:33.1-33.39 + ;; 2-aux.watsup:44.1-44.39 def {n_1 : n, n_2 : n} curried_(n_1, n_2) = (n_1 + n_2) -;; 2-aux.watsup:35.1-44.39 +;; 2-aux.watsup:46.1-55.39 syntax testfuse = | AB_(nat, nat, nat) | CD(nat, nat, nat) @@ -4367,376 +4367,376 @@ syntax testfuse = | OP(nat, nat, nat) | QR(nat, nat, nat) -;; 3-typing.watsup:3.1-6.60 +;; 3-typing.watsup:5.1-8.60 syntax context = {FUNC functype*, GLOBAL globaltype*, TABLE tabletype*, MEM memtype*, ELEM elemtype*, DATA datatype*, LOCAL valtype*, LABEL resulttype*, RETURN resulttype?} -;; 3-typing.watsup:14.1-14.66 +;; 3-typing.watsup:18.1-18.66 relation Limits_ok: `|-%:%`(limits, nat) - ;; 3-typing.watsup:22.1-24.24 + ;; 3-typing.watsup:26.1-28.24 rule _ {k : nat, n_1 : n, n_2 : n}: `|-%:%`(`[%..%]`(n_1, n_2), k) -- if ((n_1 <= n_2) /\ (n_2 <= k)) -;; 3-typing.watsup:15.1-15.64 +;; 3-typing.watsup:19.1-19.64 relation Functype_ok: `|-%:OK`(functype) - ;; 3-typing.watsup:26.1-27.13 + ;; 3-typing.watsup:30.1-31.13 rule _ {ft : functype}: `|-%:OK`(ft) -;; 3-typing.watsup:16.1-16.66 +;; 3-typing.watsup:20.1-20.66 relation Globaltype_ok: `|-%:OK`(globaltype) - ;; 3-typing.watsup:29.1-30.13 + ;; 3-typing.watsup:33.1-34.13 rule _ {gt : globaltype}: `|-%:OK`(gt) -;; 3-typing.watsup:17.1-17.65 +;; 3-typing.watsup:21.1-21.65 relation Tabletype_ok: `|-%:OK`(tabletype) - ;; 3-typing.watsup:32.1-34.35 + ;; 3-typing.watsup:36.1-38.35 rule _ {lim : limits, rt : reftype}: `|-%:OK`(`%%`(lim, rt)) -- Limits_ok: `|-%:%`(lim, ((2 ^ 32) - 1)) -;; 3-typing.watsup:18.1-18.63 +;; 3-typing.watsup:22.1-22.63 relation Memtype_ok: `|-%:OK`(memtype) - ;; 3-typing.watsup:36.1-38.33 + ;; 3-typing.watsup:40.1-42.33 rule _ {lim : limits}: `|-%:OK`(`%I8`(lim)) -- Limits_ok: `|-%:%`(lim, (2 ^ 16)) -;; 3-typing.watsup:19.1-19.66 +;; 3-typing.watsup:23.1-23.66 relation Externtype_ok: `|-%:OK`(externtype) - ;; 3-typing.watsup:41.1-43.35 + ;; 3-typing.watsup:45.1-47.35 rule func {functype : functype}: `|-%:OK`(FUNC_externtype(functype)) -- Functype_ok: `|-%:OK`(functype) - ;; 3-typing.watsup:45.1-47.39 + ;; 3-typing.watsup:49.1-51.39 rule global {globaltype : globaltype}: `|-%:OK`(GLOBAL_externtype(globaltype)) -- Globaltype_ok: `|-%:OK`(globaltype) - ;; 3-typing.watsup:49.1-51.37 + ;; 3-typing.watsup:53.1-55.37 rule table {tabletype : tabletype}: `|-%:OK`(TABLE_externtype(tabletype)) -- Tabletype_ok: `|-%:OK`(tabletype) - ;; 3-typing.watsup:53.1-55.33 + ;; 3-typing.watsup:57.1-59.33 rule mem {memtype : memtype}: `|-%:OK`(MEM_externtype(memtype)) -- Memtype_ok: `|-%:OK`(memtype) -;; 3-typing.watsup:61.1-61.65 +;; 3-typing.watsup:69.1-69.65 relation Valtype_sub: `|-%<:%`(valtype, valtype) - ;; 3-typing.watsup:64.1-65.12 + ;; 3-typing.watsup:72.1-73.12 rule refl {t : valtype}: `|-%<:%`(t, t) - ;; 3-typing.watsup:67.1-68.14 + ;; 3-typing.watsup:75.1-76.14 rule bot {t : valtype}: `|-%<:%`(BOT_valtype, t) -;; 3-typing.watsup:62.1-62.72 +;; 3-typing.watsup:70.1-70.72 relation Resulttype_sub: `|-%*<:%*`(valtype*, valtype*) - ;; 3-typing.watsup:70.1-72.35 + ;; 3-typing.watsup:78.1-80.35 rule _ {t_1* : valtype*, t_2* : valtype*}: `|-%*<:%*`(t_1*{t_1}, t_2*{t_2}) -- (Valtype_sub: `|-%<:%`(t_1, t_2))*{t_1 t_2} -;; 3-typing.watsup:75.1-75.75 +;; 3-typing.watsup:85.1-85.75 relation Limits_sub: `|-%<:%`(limits, limits) - ;; 3-typing.watsup:83.1-86.21 + ;; 3-typing.watsup:93.1-96.21 rule _ {n_11 : n, n_12 : n, n_21 : n, n_22 : n}: `|-%<:%`(`[%..%]`(n_11, n_12), `[%..%]`(n_21, n_22)) -- if (n_11 >= n_21) -- if (n_12 <= n_22) -;; 3-typing.watsup:76.1-76.73 +;; 3-typing.watsup:86.1-86.73 relation Functype_sub: `|-%<:%`(functype, functype) - ;; 3-typing.watsup:88.1-89.14 + ;; 3-typing.watsup:98.1-99.14 rule _ {ft : functype}: `|-%<:%`(ft, ft) -;; 3-typing.watsup:77.1-77.75 +;; 3-typing.watsup:87.1-87.75 relation Globaltype_sub: `|-%<:%`(globaltype, globaltype) - ;; 3-typing.watsup:91.1-92.14 + ;; 3-typing.watsup:101.1-102.14 rule _ {gt : globaltype}: `|-%<:%`(gt, gt) -;; 3-typing.watsup:78.1-78.74 +;; 3-typing.watsup:88.1-88.74 relation Tabletype_sub: `|-%<:%`(tabletype, tabletype) - ;; 3-typing.watsup:94.1-96.35 + ;; 3-typing.watsup:104.1-106.35 rule _ {lim_1 : limits, lim_2 : limits, rt : reftype}: `|-%<:%`(`%%`(lim_1, rt), `%%`(lim_2, rt)) -- Limits_sub: `|-%<:%`(lim_1, lim_2) -;; 3-typing.watsup:79.1-79.72 +;; 3-typing.watsup:89.1-89.72 relation Memtype_sub: `|-%<:%`(memtype, memtype) - ;; 3-typing.watsup:98.1-100.35 + ;; 3-typing.watsup:108.1-110.35 rule _ {lim_1 : limits, lim_2 : limits}: `|-%<:%`(`%I8`(lim_1), `%I8`(lim_2)) -- Limits_sub: `|-%<:%`(lim_1, lim_2) -;; 3-typing.watsup:80.1-80.75 +;; 3-typing.watsup:90.1-90.75 relation Externtype_sub: `|-%<:%`(externtype, externtype) - ;; 3-typing.watsup:103.1-105.35 + ;; 3-typing.watsup:113.1-115.35 rule func {ft_1 : functype, ft_2 : functype}: `|-%<:%`(FUNC_externtype(ft_1), FUNC_externtype(ft_2)) -- Functype_sub: `|-%<:%`(ft_1, ft_2) - ;; 3-typing.watsup:107.1-109.37 + ;; 3-typing.watsup:117.1-119.37 rule global {gt_1 : globaltype, gt_2 : globaltype}: `|-%<:%`(GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) -- Globaltype_sub: `|-%<:%`(gt_1, gt_2) - ;; 3-typing.watsup:111.1-113.36 + ;; 3-typing.watsup:121.1-123.36 rule table {tt_1 : tabletype, tt_2 : tabletype}: `|-%<:%`(TABLE_externtype(tt_1), TABLE_externtype(tt_2)) -- Tabletype_sub: `|-%<:%`(tt_1, tt_2) - ;; 3-typing.watsup:115.1-117.34 + ;; 3-typing.watsup:125.1-127.34 rule mem {mt_1 : memtype, mt_2 : memtype}: `|-%<:%`(MEM_externtype(mt_1), MEM_externtype(mt_2)) -- Memtype_sub: `|-%<:%`(mt_1, mt_2) -;; 3-typing.watsup:172.1-172.76 +;; 3-typing.watsup:192.1-192.76 relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) - ;; 3-typing.watsup:174.1-176.29 + ;; 3-typing.watsup:194.1-196.29 rule _ {C : context, ft : functype}: `%|-%:%`(C, ft, ft) -- Functype_ok: `|-%:OK`(ft) -;; 3-typing.watsup:123.1-124.67 +;; 3-typing.watsup:135.1-136.67 rec { -;; 3-typing.watsup:123.1-123.66 +;; 3-typing.watsup:135.1-135.66 relation Instr_ok: `%|-%:%`(context, instr, functype) - ;; 3-typing.watsup:153.1-154.34 + ;; 3-typing.watsup:171.1-172.34 rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:156.1-157.32 + ;; 3-typing.watsup:174.1-175.32 rule nop {C : context}: `%|-%:%`(C, NOP_instr, `%->%`([], [])) - ;; 3-typing.watsup:159.1-160.27 + ;; 3-typing.watsup:177.1-178.27 rule drop {C : context, t : valtype}: `%|-%:%`(C, DROP_instr, `%->%`([t], [])) - ;; 3-typing.watsup:163.1-164.31 + ;; 3-typing.watsup:181.1-182.31 rule select-expl {C : context, t : valtype}: `%|-%:%`(C, SELECT_instr(?(t)), `%->%`([t t I32_valtype], [t])) - ;; 3-typing.watsup:166.1-169.37 + ;; 3-typing.watsup:184.1-187.37 rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) -- Valtype_sub: `|-%<:%`(t, t') -- if ((t' = $valtype_numtype(numtype)) \/ (t' = $valtype_vectype(vectype))) - ;; 3-typing.watsup:178.1-181.59 + ;; 3-typing.watsup:198.1-201.59 rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:183.1-186.59 + ;; 3-typing.watsup:203.1-206.59 rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:188.1-192.61 + ;; 3-typing.watsup:208.1-212.61 rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%`(t_1*{t_1}, t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:195.1-197.24 + ;; 3-typing.watsup:217.1-219.24 rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- if (C.LABEL_context[l] = t*{t}) - ;; 3-typing.watsup:199.1-201.24 + ;; 3-typing.watsup:221.1-223.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] = t*{t}) - ;; 3-typing.watsup:203.1-206.42 + ;; 3-typing.watsup:225.1-228.42 rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- (Resulttype_sub: `|-%*<:%*`(t*{t}, C.LABEL_context[l]))*{l} -- Resulttype_sub: `|-%*<:%*`(t*{t}, C.LABEL_context[l']) - ;; 3-typing.watsup:208.1-210.24 + ;; 3-typing.watsup:233.1-235.24 rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- if (C.RETURN_context = ?(t*{t})) - ;; 3-typing.watsup:212.1-214.33 + ;; 3-typing.watsup:237.1-239.33 rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) -- if (C.FUNC_context[x] = `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:216.1-219.26 + ;; 3-typing.watsup:241.1-244.26 rule call_indirect {C : context, ft : functype, lim : limits, t_1* : valtype*, t_2* : valtype*, x : idx}: `%|-%:%`(C, CALL_INDIRECT_instr(x, ft), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) -- if (C.TABLE_context[x] = `%%`(lim, FUNCREF_reftype)) -- if (ft = `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:222.1-223.37 + ;; 3-typing.watsup:249.1-250.37 rule const {C : context, c_nt : c_numtype, nt : numtype}: `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [$valtype_numtype(nt)])) - ;; 3-typing.watsup:225.1-226.31 + ;; 3-typing.watsup:252.1-253.31 rule unop {C : context, nt : numtype, unop : unop_numtype}: `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 3-typing.watsup:228.1-229.36 + ;; 3-typing.watsup:255.1-256.36 rule binop {C : context, binop : binop_numtype, nt : numtype}: `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 3-typing.watsup:231.1-232.36 + ;; 3-typing.watsup:258.1-259.36 rule testop {C : context, nt : numtype, testop : testop_numtype}: `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([$valtype_numtype(nt)], [I32_valtype])) - ;; 3-typing.watsup:234.1-235.37 + ;; 3-typing.watsup:261.1-262.37 rule relop {C : context, nt : numtype, relop : relop_numtype}: `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [I32_valtype])) - ;; 3-typing.watsup:238.1-240.23 + ;; 3-typing.watsup:265.1-267.23 rule extend {C : context, n : n, nt : numtype}: `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) -- if (n <= !($size($valtype_numtype(nt)))) - ;; 3-typing.watsup:242.1-245.34 + ;; 3-typing.watsup:269.1-272.34 rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype}: `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([$valtype_numtype(nt_2)], [$valtype_numtype(nt_1)])) -- if (nt_1 =/= nt_2) -- if (!($size($valtype_numtype(nt_1))) = !($size($valtype_numtype(nt_2)))) - ;; 3-typing.watsup:247.1-250.52 + ;; 3-typing.watsup:274.1-277.52 rule convert-i {C : context, in_1 : in, in_2 : in, sx? : sx?}: `%|-%:%`(C, CVTOP_instr($numtype_in(in_1), CONVERT_cvtop, $numtype_in(in_2), sx?{sx}), `%->%`([$valtype_in(in_2)], [$valtype_in(in_1)])) -- if (in_1 =/= in_2) -- if ((sx?{sx} = ?()) <=> (!($size($valtype_in(in_1))) > !($size($valtype_in(in_2))))) - ;; 3-typing.watsup:252.1-254.22 + ;; 3-typing.watsup:279.1-281.22 rule convert-f {C : context, fn_1 : fn, fn_2 : fn}: `%|-%:%`(C, CVTOP_instr($numtype_fn(fn_1), CONVERT_cvtop, $numtype_fn(fn_2), ?()), `%->%`([$valtype_fn(fn_2)], [$valtype_fn(fn_1)])) -- if (fn_1 =/= fn_2) - ;; 3-typing.watsup:257.1-258.35 + ;; 3-typing.watsup:286.1-287.35 rule ref.null {C : context, rt : reftype}: `%|-%:%`(C, REF.NULL_instr(rt), `%->%`([], [$valtype_reftype(rt)])) - ;; 3-typing.watsup:260.1-262.23 + ;; 3-typing.watsup:289.1-291.23 rule ref.func {C : context, ft : functype, x : idx}: `%|-%:%`(C, REF.FUNC_instr(x), `%->%`([], [FUNCREF_valtype])) -- if (C.FUNC_context[x] = ft) - ;; 3-typing.watsup:264.1-265.31 + ;; 3-typing.watsup:293.1-294.31 rule ref.is_null {C : context, rt : reftype}: `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([$valtype_reftype(rt)], [I32_valtype])) - ;; 3-typing.watsup:268.1-270.23 + ;; 3-typing.watsup:299.1-301.23 rule local.get {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:272.1-274.23 + ;; 3-typing.watsup:303.1-305.23 rule local.set {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->%`([t], [])) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:276.1-278.23 + ;; 3-typing.watsup:307.1-309.23 rule local.tee {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%`([t], [t])) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:281.1-283.29 + ;; 3-typing.watsup:314.1-316.29 rule global.get {C : context, t : valtype, x : idx}: `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) -- if (C.GLOBAL_context[x] = `MUT%?%`(()?{}, t)) - ;; 3-typing.watsup:285.1-287.28 + ;; 3-typing.watsup:318.1-320.28 rule global.set {C : context, t : valtype, x : idx}: `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) -- if (C.GLOBAL_context[x] = `MUT%?%`(?(()), t)) - ;; 3-typing.watsup:290.1-292.28 + ;; 3-typing.watsup:325.1-327.28 rule table.get {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [$valtype_reftype(rt)])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:294.1-296.28 + ;; 3-typing.watsup:329.1-331.28 rule table.set {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype $valtype_reftype(rt)], [])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:298.1-300.24 + ;; 3-typing.watsup:333.1-335.24 rule table.size {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) -- if (C.TABLE_context[x] = tt) - ;; 3-typing.watsup:302.1-304.28 + ;; 3-typing.watsup:337.1-339.28 rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([$valtype_reftype(rt) I32_valtype], [I32_valtype])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:306.1-308.28 + ;; 3-typing.watsup:341.1-343.28 rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype $valtype_reftype(rt) I32_valtype], [])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:310.1-313.32 + ;; 3-typing.watsup:345.1-348.32 rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt : reftype, x_1 : idx, x_2 : idx}: `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt)) -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt)) - ;; 3-typing.watsup:315.1-318.25 + ;; 3-typing.watsup:350.1-353.25 rule table.init {C : context, lim : limits, rt : reftype, x_1 : idx, x_2 : idx}: `%|-%:%`(C, TABLE.INIT_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.TABLE_context[x_1] = `%%`(lim, rt)) -- if (C.ELEM_context[x_2] = rt) - ;; 3-typing.watsup:320.1-322.23 + ;; 3-typing.watsup:355.1-357.23 rule elem.drop {C : context, rt : reftype, x : idx}: `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) -- if (C.ELEM_context[x] = rt) - ;; 3-typing.watsup:325.1-327.22 + ;; 3-typing.watsup:362.1-364.22 rule memory.size {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.SIZE_instr, `%->%`([], [I32_valtype])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:329.1-331.22 + ;; 3-typing.watsup:366.1-368.22 rule memory.grow {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.GROW_instr, `%->%`([I32_valtype], [I32_valtype])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:333.1-335.22 + ;; 3-typing.watsup:370.1-372.22 rule memory.fill {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.FILL_instr, `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:337.1-339.22 + ;; 3-typing.watsup:374.1-376.22 rule memory.copy {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.COPY_instr, `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:341.1-344.23 + ;; 3-typing.watsup:378.1-381.23 rule memory.init {C : context, mt : memtype, x : idx}: `%|-%:%`(C, MEMORY.INIT_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.MEM_context[0] = mt) -- if (C.DATA_context[x] = OK) - ;; 3-typing.watsup:346.1-348.23 + ;; 3-typing.watsup:383.1-385.23 rule data.drop {C : context, x : idx}: `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) -- if (C.DATA_context[x] = OK) - ;; 3-typing.watsup:350.1-355.32 + ;; 3-typing.watsup:387.1-392.32 rule load {C : context, in : in, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?}: `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, n_A, n_O), `%->%`([I32_valtype], [$valtype_numtype(nt)])) -- if (C.MEM_context[0] = mt) @@ -4744,7 +4744,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (!($size($valtype_numtype(nt))) / 8))))?{n} -- if ((n?{n} = ?()) \/ (nt = $numtype_in(in))) - ;; 3-typing.watsup:357.1-362.32 + ;; 3-typing.watsup:394.1-399.32 rule store {C : context, in : in, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype}: `%|-%:%`(C, STORE_instr(nt, n?{n}, n_A, n_O), `%->%`([I32_valtype $valtype_numtype(nt)], [])) -- if (C.MEM_context[0] = mt) @@ -4752,185 +4752,185 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (!($size($valtype_numtype(nt))) / 8))))?{n} -- if ((n?{n} = ?()) \/ (nt = $numtype_in(in))) -;; 3-typing.watsup:124.1-124.67 +;; 3-typing.watsup:136.1-136.67 relation InstrSeq_ok: `%|-%*:%`(context, instr*, functype) - ;; 3-typing.watsup:133.1-134.36 + ;; 3-typing.watsup:149.1-150.36 rule empty {C : context}: `%|-%*:%`(C, [], `%->%`([], [])) - ;; 3-typing.watsup:136.1-139.46 + ;; 3-typing.watsup:152.1-155.46 rule seq {C : context, instr_1 : instr, instr_2 : instr, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*}: `%|-%*:%`(C, [instr_1] :: instr_2*{}, `%->%`(t_1*{t_1}, t_3*{t_3})) -- Instr_ok: `%|-%:%`(C, instr_1, `%->%`(t_1*{t_1}, t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C, [instr_2], `%->%`(t_2*{t_2}, t_3*{t_3})) - ;; 3-typing.watsup:141.1-146.38 + ;; 3-typing.watsup:157.1-162.38 rule weak {C : context, instr* : instr*, t'_1* : valtype*, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%*:%`(C, instr*{instr}, `%->%`(t'_1*{t'_1}, t'_2*{t'_2})) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) -- Resulttype_sub: `|-%*<:%*`(t'_1*{t'_1}, t_1*{t_1}) -- Resulttype_sub: `|-%*<:%*`(t_2*{t_2}, t'_2*{t'_2}) - ;; 3-typing.watsup:148.1-150.45 + ;; 3-typing.watsup:164.1-166.45 rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%*:%`(C, instr*{instr}, `%->%`(t*{t} :: t_1*{t_1}, t*{t} :: t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) } -;; 3-typing.watsup:125.1-125.71 +;; 3-typing.watsup:137.1-137.71 relation Expr_ok: `%|-%:%`(context, expr, resulttype) - ;; 3-typing.watsup:128.1-130.46 + ;; 3-typing.watsup:142.1-144.46 rule _ {C : context, instr* : instr*, t* : valtype*}: `%|-%:%`(C, instr*{instr}, t*{t}) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`([], t*{t})) -;; 3-typing.watsup:367.1-367.78 +;; 3-typing.watsup:406.1-406.78 relation Instr_const: `%|-%CONST`(context, instr) - ;; 3-typing.watsup:371.1-372.26 + ;; 3-typing.watsup:410.1-411.26 rule const {C : context, c : c_numtype, nt : numtype}: `%|-%CONST`(C, CONST_instr(nt, c)) - ;; 3-typing.watsup:374.1-375.27 + ;; 3-typing.watsup:413.1-414.27 rule ref.null {C : context, rt : reftype}: `%|-%CONST`(C, REF.NULL_instr(rt)) - ;; 3-typing.watsup:377.1-378.26 + ;; 3-typing.watsup:416.1-417.26 rule ref.func {C : context, x : idx}: `%|-%CONST`(C, REF.FUNC_instr(x)) - ;; 3-typing.watsup:380.1-382.32 + ;; 3-typing.watsup:419.1-421.32 rule global.get {C : context, t : valtype, x : idx}: `%|-%CONST`(C, GLOBAL.GET_instr(x)) -- if (C.GLOBAL_context[x] = `MUT%?%`(?(), t)) -;; 3-typing.watsup:368.1-368.77 +;; 3-typing.watsup:407.1-407.77 relation Expr_const: `%|-%CONST`(context, expr) - ;; 3-typing.watsup:385.1-386.38 + ;; 3-typing.watsup:424.1-425.38 rule _ {C : context, instr* : instr*}: `%|-%CONST`(C, instr*{instr}) -- (Instr_const: `%|-%CONST`(C, instr))*{instr} -;; 3-typing.watsup:369.1-369.78 +;; 3-typing.watsup:408.1-408.78 relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) - ;; 3-typing.watsup:389.1-392.33 + ;; 3-typing.watsup:428.1-431.33 rule _ {C : context, expr : expr, t : valtype}: `%|-%:%CONST`(C, expr, t) -- Expr_ok: `%|-%:%`(C, expr, [t]) -- Expr_const: `%|-%CONST`(C, expr) -;; 3-typing.watsup:397.1-397.73 +;; 3-typing.watsup:438.1-438.73 relation Func_ok: `%|-%:%`(context, func, functype) - ;; 3-typing.watsup:408.1-412.75 + ;; 3-typing.watsup:451.1-455.75 rule _ {C : context, expr : expr, ft : functype, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, `FUNC%%*%`(ft, t*{t}, expr), ft) -- if (ft = `%->%`(t_1*{t_1}, t_2*{t_2})) -- Functype_ok: `|-%:OK`(ft) -- Expr_ok: `%|-%:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL t_1*{t_1} :: t*{t}, LABEL [], RETURN ?()} ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()} ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2})}, expr, t_2*{t_2}) -;; 3-typing.watsup:398.1-398.75 +;; 3-typing.watsup:439.1-439.75 relation Global_ok: `%|-%:%`(context, global, globaltype) - ;; 3-typing.watsup:414.1-418.40 + ;; 3-typing.watsup:457.1-461.40 rule _ {C : context, expr : expr, gt : globaltype, t : valtype}: `%|-%:%`(C, GLOBAL(gt, expr), gt) -- Globaltype_ok: `|-%:OK`(gt) -- if (gt = `MUT%?%`(()?{}, t)) -- Expr_ok_const: `%|-%:%CONST`(C, expr, t) -;; 3-typing.watsup:399.1-399.74 +;; 3-typing.watsup:440.1-440.74 relation Table_ok: `%|-%:%`(context, table, tabletype) - ;; 3-typing.watsup:420.1-422.30 + ;; 3-typing.watsup:463.1-465.30 rule _ {C : context, tt : tabletype}: `%|-%:%`(C, TABLE(tt), tt) -- Tabletype_ok: `|-%:OK`(tt) -;; 3-typing.watsup:400.1-400.72 +;; 3-typing.watsup:441.1-441.72 relation Mem_ok: `%|-%:%`(context, mem, memtype) - ;; 3-typing.watsup:424.1-426.28 + ;; 3-typing.watsup:467.1-469.28 rule _ {C : context, mt : memtype}: `%|-%:%`(C, MEMORY(mt), mt) -- Memtype_ok: `|-%:OK`(mt) -;; 3-typing.watsup:403.1-403.77 +;; 3-typing.watsup:444.1-444.77 relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) - ;; 3-typing.watsup:437.1-440.45 + ;; 3-typing.watsup:480.1-483.45 rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE_elemmode(x, expr), rt) -- if (C.TABLE_context[x] = `%%`(lim, rt)) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} - ;; 3-typing.watsup:442.1-443.20 + ;; 3-typing.watsup:485.1-486.20 rule declare {C : context, rt : reftype}: `%|-%:%`(C, DECLARE_elemmode, rt) -;; 3-typing.watsup:401.1-401.73 +;; 3-typing.watsup:442.1-442.73 relation Elem_ok: `%|-%:%`(context, elem, reftype) - ;; 3-typing.watsup:428.1-431.40 + ;; 3-typing.watsup:471.1-474.40 rule _ {C : context, elemmode? : elemmode?, expr* : expr*, rt : reftype}: `%|-%:%`(C, `ELEM%%*%?`(rt, expr*{expr}, elemmode?{elemmode}), rt) -- (Expr_ok: `%|-%:%`(C, expr, [$valtype_reftype(rt)]))*{expr} -- (Elemmode_ok: `%|-%:%`(C, elemmode, rt))?{elemmode} -;; 3-typing.watsup:404.1-404.77 +;; 3-typing.watsup:445.1-445.77 relation Datamode_ok: `%|-%:OK`(context, datamode) - ;; 3-typing.watsup:445.1-448.45 + ;; 3-typing.watsup:488.1-491.45 rule _ {C : context, expr : expr, mt : memtype}: `%|-%:OK`(C, MEMORY_datamode(0, expr)) -- if (C.MEM_context[0] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} -;; 3-typing.watsup:402.1-402.73 +;; 3-typing.watsup:443.1-443.73 relation Data_ok: `%|-%:OK`(context, data) - ;; 3-typing.watsup:433.1-435.40 + ;; 3-typing.watsup:476.1-478.40 rule _ {C : context, b* : byte*, datamode? : datamode?}: `%|-%:OK`(C, `DATA%*%?`(b*{b}, datamode?{datamode})) -- (Datamode_ok: `%|-%:OK`(C, datamode))?{datamode} -;; 3-typing.watsup:405.1-405.74 +;; 3-typing.watsup:446.1-446.74 relation Start_ok: `%|-%:OK`(context, start) - ;; 3-typing.watsup:450.1-452.39 + ;; 3-typing.watsup:493.1-495.39 rule _ {C : context, x : idx}: `%|-%:OK`(C, START(x)) -- if (C.FUNC_context[x] = `%->%`([], [])) -;; 3-typing.watsup:455.1-455.80 +;; 3-typing.watsup:500.1-500.80 relation Import_ok: `%|-%:%`(context, import, externtype) - ;; 3-typing.watsup:459.1-461.31 + ;; 3-typing.watsup:504.1-506.31 rule _ {C : context, name_1 : name, name_2 : name, xt : externtype}: `%|-%:%`(C, IMPORT(name_1, name_2, xt), xt) -- Externtype_ok: `|-%:OK`(xt) -;; 3-typing.watsup:457.1-457.83 +;; 3-typing.watsup:502.1-502.83 relation Externuse_ok: `%|-%:%`(context, externuse, externtype) - ;; 3-typing.watsup:467.1-469.23 + ;; 3-typing.watsup:512.1-514.23 rule func {C : context, ft : functype, x : idx}: `%|-%:%`(C, FUNC_externuse(x), FUNC_externtype(ft)) -- if (C.FUNC_context[x] = ft) - ;; 3-typing.watsup:471.1-473.25 + ;; 3-typing.watsup:516.1-518.25 rule global {C : context, gt : globaltype, x : idx}: `%|-%:%`(C, GLOBAL_externuse(x), GLOBAL_externtype(gt)) -- if (C.GLOBAL_context[x] = gt) - ;; 3-typing.watsup:475.1-477.24 + ;; 3-typing.watsup:520.1-522.24 rule table {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE_externuse(x), TABLE_externtype(tt)) -- if (C.TABLE_context[x] = tt) - ;; 3-typing.watsup:479.1-481.22 + ;; 3-typing.watsup:524.1-526.22 rule mem {C : context, mt : memtype, x : idx}: `%|-%:%`(C, MEM_externuse(x), MEM_externtype(mt)) -- if (C.MEM_context[x] = mt) -;; 3-typing.watsup:456.1-456.80 +;; 3-typing.watsup:501.1-501.80 relation Export_ok: `%|-%:%`(context, export, externtype) - ;; 3-typing.watsup:463.1-465.39 + ;; 3-typing.watsup:508.1-510.39 rule _ {C : context, externuse : externuse, name : name, xt : externtype}: `%|-%:%`(C, EXPORT(name, externuse), xt) -- Externuse_ok: `%|-%:%`(C, externuse, xt) -;; 3-typing.watsup:484.1-484.62 +;; 3-typing.watsup:531.1-531.62 relation Module_ok: `|-%:OK`(module) - ;; 3-typing.watsup:486.1-500.16 + ;; 3-typing.watsup:533.1-547.16 rule _ {C : context, data^n : data^n, elem* : elem*, export* : export*, ft* : functype*, func* : func*, global* : global*, gt* : globaltype*, import* : import*, mem* : mem*, mt* : memtype*, n : n, rt* : reftype*, start? : start?, table* : table*, tt* : tabletype*}: `|-%:OK`(`MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data^n{data}, start?{start}, export*{export})) -- if (C = {FUNC ft*{ft}, GLOBAL gt*{gt}, TABLE tt*{tt}, MEM mt*{mt}, ELEM rt*{rt}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) @@ -4943,115 +4943,115 @@ relation Module_ok: `|-%:OK`(module) -- (Start_ok: `%|-%:OK`(C, start))?{start} -- if (|mem*{mem}| <= 1) -;; 4-runtime.watsup:3.1-3.39 +;; 4-runtime.watsup:5.1-5.39 syntax addr = nat -;; 4-runtime.watsup:4.1-4.53 +;; 4-runtime.watsup:6.1-6.53 syntax funcaddr = addr -;; 4-runtime.watsup:5.1-5.53 +;; 4-runtime.watsup:7.1-7.53 syntax globaladdr = addr -;; 4-runtime.watsup:6.1-6.51 +;; 4-runtime.watsup:8.1-8.51 syntax tableaddr = addr -;; 4-runtime.watsup:7.1-7.50 +;; 4-runtime.watsup:9.1-9.50 syntax memaddr = addr -;; 4-runtime.watsup:8.1-8.49 +;; 4-runtime.watsup:10.1-10.49 syntax elemaddr = addr -;; 4-runtime.watsup:9.1-9.49 +;; 4-runtime.watsup:11.1-11.49 syntax dataaddr = addr -;; 4-runtime.watsup:10.1-10.51 +;; 4-runtime.watsup:12.1-12.51 syntax labeladdr = addr -;; 4-runtime.watsup:11.1-11.49 +;; 4-runtime.watsup:13.1-13.49 syntax hostaddr = addr -;; 4-runtime.watsup:24.1-25.24 +;; 4-runtime.watsup:30.1-31.24 syntax num = | CONST(numtype, c_numtype) -;; 4-runtime.watsup:26.1-27.67 +;; 4-runtime.watsup:32.1-33.67 syntax ref = | REF.NULL(reftype) | REF.FUNC_ADDR(funcaddr) | REF.HOST_ADDR(hostaddr) -;; 4-runtime.watsup:28.1-29.10 +;; 4-runtime.watsup:34.1-35.10 syntax val = | CONST(numtype, c_numtype) | REF.NULL(reftype) | REF.FUNC_ADDR(funcaddr) | REF.HOST_ADDR(hostaddr) -;; 4-runtime.watsup:31.1-32.18 +;; 4-runtime.watsup:37.1-38.18 syntax result = | _VALS(val*) | TRAP -;; 4-runtime.watsup:38.1-39.66 +;; 4-runtime.watsup:47.1-48.66 syntax externval = | FUNC(funcaddr) | GLOBAL(globaladdr) | TABLE(tableaddr) | MEM(memaddr) -;; 4-runtime.watsup:44.1-44.44 +;; 4-runtime.watsup:55.1-55.44 def default_ : valtype -> val? - ;; 4-runtime.watsup:45.1-45.35 + ;; 4-runtime.watsup:56.1-56.35 def default_(I32_valtype) = ?(CONST_val(I32_numtype, 0)) - ;; 4-runtime.watsup:46.1-46.35 + ;; 4-runtime.watsup:57.1-57.35 def default_(I64_valtype) = ?(CONST_val(I64_numtype, 0)) - ;; 4-runtime.watsup:47.1-47.35 + ;; 4-runtime.watsup:58.1-58.35 def default_(F32_valtype) = ?(CONST_val(F32_numtype, 0)) - ;; 4-runtime.watsup:48.1-48.35 + ;; 4-runtime.watsup:59.1-59.35 def default_(F64_valtype) = ?(CONST_val(F64_numtype, 0)) - ;; 4-runtime.watsup:49.1-49.44 + ;; 4-runtime.watsup:60.1-60.44 def default_(FUNCREF_valtype) = ?(REF.NULL_val(FUNCREF_reftype)) - ;; 4-runtime.watsup:50.1-50.48 + ;; 4-runtime.watsup:61.1-61.48 def default_(EXTERNREF_valtype) = ?(REF.NULL_val(EXTERNREF_reftype)) def {x : valtype} default_(x) = ?() -;; 4-runtime.watsup:72.1-74.22 +;; 4-runtime.watsup:87.1-89.22 syntax exportinst = {NAME name, VALUE externval} -;; 4-runtime.watsup:84.1-91.25 +;; 4-runtime.watsup:91.1-98.25 syntax moduleinst = {FUNC funcaddr*, GLOBAL globaladdr*, TABLE tableaddr*, MEM memaddr*, ELEM elemaddr*, DATA dataaddr*, EXPORT exportinst*} -;; 4-runtime.watsup:55.1-57.16 +;; 4-runtime.watsup:70.1-72.16 syntax funcinst = {MODULE moduleinst, CODE func} -;; 4-runtime.watsup:58.1-60.16 +;; 4-runtime.watsup:73.1-75.16 syntax globalinst = {TYPE globaltype, VALUE val} -;; 4-runtime.watsup:61.1-63.16 +;; 4-runtime.watsup:76.1-78.16 syntax tableinst = {TYPE tabletype, ELEM ref*} -;; 4-runtime.watsup:64.1-66.17 +;; 4-runtime.watsup:79.1-81.17 syntax meminst = {TYPE memtype, DATA byte*} -;; 4-runtime.watsup:67.1-69.16 +;; 4-runtime.watsup:82.1-84.16 syntax eleminst = {TYPE elemtype, ELEM ref*} -;; 4-runtime.watsup:70.1-71.17 +;; 4-runtime.watsup:85.1-86.17 syntax datainst = {DATA byte*} -;; 4-runtime.watsup:76.1-82.21 +;; 4-runtime.watsup:112.1-118.21 syntax store = {FUNC funcinst*, GLOBAL globalinst*, TABLE tableinst*, MEM meminst*, ELEM eleminst*, DATA datainst*} -;; 4-runtime.watsup:93.1-95.24 +;; 4-runtime.watsup:120.1-122.24 syntax frame = {LOCAL val*, MODULE moduleinst} -;; 4-runtime.watsup:96.1-96.47 +;; 4-runtime.watsup:124.1-124.47 syntax state = `%;%`(store, frame) -;; 4-runtime.watsup:183.1-190.5 +;; 4-runtime.watsup:209.1-216.5 rec { -;; 4-runtime.watsup:183.1-190.5 +;; 4-runtime.watsup:209.1-216.5 syntax admininstr = | UNREACHABLE | NOP @@ -5162,122 +5162,122 @@ def admininstr_val : val -> admininstr def {x : funcaddr} admininstr_val(REF.FUNC_ADDR_val(x)) = REF.FUNC_ADDR_admininstr(x) def {x : hostaddr} admininstr_val(REF.HOST_ADDR_val(x)) = REF.HOST_ADDR_admininstr(x) -;; 4-runtime.watsup:97.1-97.62 +;; 4-runtime.watsup:125.1-125.62 syntax config = `%;%*`(state, admininstr*) -;; 4-runtime.watsup:115.1-115.59 +;; 4-runtime.watsup:134.1-134.59 def funcaddr : state -> funcaddr* - ;; 4-runtime.watsup:116.1-116.38 + ;; 4-runtime.watsup:135.1-135.38 def {f : frame, s : store} funcaddr(`%;%`(s, f)) = f.MODULE_frame.FUNC_moduleinst -;; 4-runtime.watsup:118.1-118.52 +;; 4-runtime.watsup:137.1-137.52 def funcinst : state -> funcinst* - ;; 4-runtime.watsup:125.1-125.31 + ;; 4-runtime.watsup:144.1-144.31 def {f : frame, s : store} funcinst(`%;%`(s, f)) = s.FUNC_store -;; 4-runtime.watsup:119.1-119.58 +;; 4-runtime.watsup:138.1-138.58 def globalinst : state -> globalinst* - ;; 4-runtime.watsup:126.1-126.35 + ;; 4-runtime.watsup:145.1-145.35 def {f : frame, s : store} globalinst(`%;%`(s, f)) = s.GLOBAL_store -;; 4-runtime.watsup:120.1-120.55 +;; 4-runtime.watsup:139.1-139.55 def tableinst : state -> tableinst* - ;; 4-runtime.watsup:127.1-127.33 + ;; 4-runtime.watsup:146.1-146.33 def {f : frame, s : store} tableinst(`%;%`(s, f)) = s.TABLE_store -;; 4-runtime.watsup:121.1-121.49 +;; 4-runtime.watsup:140.1-140.49 def meminst : state -> meminst* - ;; 4-runtime.watsup:128.1-128.29 + ;; 4-runtime.watsup:147.1-147.29 def {f : frame, s : store} meminst(`%;%`(s, f)) = s.MEM_store -;; 4-runtime.watsup:122.1-122.52 +;; 4-runtime.watsup:141.1-141.52 def eleminst : state -> eleminst* - ;; 4-runtime.watsup:129.1-129.31 + ;; 4-runtime.watsup:148.1-148.31 def {f : frame, s : store} eleminst(`%;%`(s, f)) = s.ELEM_store -;; 4-runtime.watsup:123.1-123.52 +;; 4-runtime.watsup:142.1-142.52 def datainst : state -> datainst* - ;; 4-runtime.watsup:130.1-130.31 + ;; 4-runtime.watsup:149.1-149.31 def {f : frame, s : store} datainst(`%;%`(s, f)) = s.DATA_store -;; 4-runtime.watsup:132.1-132.67 +;; 4-runtime.watsup:151.1-151.67 def func : (state, funcidx) -> funcinst - ;; 4-runtime.watsup:140.1-140.48 + ;; 4-runtime.watsup:159.1-159.48 def {f : frame, s : store, x : idx} func(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[x]] -;; 4-runtime.watsup:133.1-133.69 +;; 4-runtime.watsup:152.1-152.69 def global : (state, globalidx) -> globalinst - ;; 4-runtime.watsup:141.1-141.54 + ;; 4-runtime.watsup:160.1-160.54 def {f : frame, s : store, x : idx} global(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x]] -;; 4-runtime.watsup:134.1-134.68 +;; 4-runtime.watsup:153.1-153.68 def table : (state, tableidx) -> tableinst - ;; 4-runtime.watsup:142.1-142.51 + ;; 4-runtime.watsup:161.1-161.51 def {f : frame, s : store, x : idx} table(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]] -;; 4-runtime.watsup:135.1-135.66 +;; 4-runtime.watsup:154.1-154.66 def mem : (state, memidx) -> meminst - ;; 4-runtime.watsup:143.1-143.45 + ;; 4-runtime.watsup:162.1-162.45 def {f : frame, s : store, x : idx} mem(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[x]] -;; 4-runtime.watsup:136.1-136.67 +;; 4-runtime.watsup:155.1-155.67 def elem : (state, tableidx) -> eleminst - ;; 4-runtime.watsup:144.1-144.48 + ;; 4-runtime.watsup:163.1-163.48 def {f : frame, s : store, x : idx} elem(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[x]] -;; 4-runtime.watsup:137.1-137.67 +;; 4-runtime.watsup:156.1-156.67 def data : (state, dataidx) -> datainst - ;; 4-runtime.watsup:145.1-145.48 + ;; 4-runtime.watsup:164.1-164.48 def {f : frame, s : store, x : idx} data(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[x]] -;; 4-runtime.watsup:138.1-138.68 +;; 4-runtime.watsup:157.1-157.68 def local : (state, localidx) -> val - ;; 4-runtime.watsup:146.1-146.35 + ;; 4-runtime.watsup:165.1-165.35 def {f : frame, s : store, x : idx} local(`%;%`(s, f), x) = f.LOCAL_frame[x] -;; 4-runtime.watsup:149.1-149.78 +;; 4-runtime.watsup:168.1-168.78 def with_local : (state, localidx, val) -> state - ;; 4-runtime.watsup:158.1-158.52 + ;; 4-runtime.watsup:177.1-177.52 def {f : frame, s : store, v : val, x : idx} with_local(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[x] = v]) -;; 4-runtime.watsup:150.1-150.85 +;; 4-runtime.watsup:169.1-169.85 def with_global : (state, globalidx, val) -> state - ;; 4-runtime.watsup:159.1-159.77 + ;; 4-runtime.watsup:178.1-178.77 def {f : frame, s : store, v : val, x : idx} with_global(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x]].VALUE_globalinst = v], f) -;; 4-runtime.watsup:151.1-151.88 +;; 4-runtime.watsup:170.1-170.88 def with_table : (state, tableidx, nat, ref) -> state - ;; 4-runtime.watsup:160.1-160.79 + ;; 4-runtime.watsup:179.1-179.79 def {f : frame, i : nat, r : ref, s : store, x : idx} with_table(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]].ELEM_tableinst[i] = r], f) -;; 4-runtime.watsup:152.1-152.84 +;; 4-runtime.watsup:171.1-171.84 def with_tableinst : (state, tableidx, tableinst) -> state - ;; 4-runtime.watsup:161.1-161.74 + ;; 4-runtime.watsup:180.1-180.74 def {f : frame, s : store, ti : tableinst, x : idx} with_tableinst(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]] = ti], f) -;; 4-runtime.watsup:153.1-153.93 +;; 4-runtime.watsup:172.1-172.93 def with_mem : (state, memidx, nat, nat, byte*) -> state - ;; 4-runtime.watsup:162.1-162.82 + ;; 4-runtime.watsup:181.1-181.82 def {b* : byte*, f : frame, i : nat, j : nat, s : store, x : idx} with_mem(`%;%`(s, f), x, i, j, b*{b}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x]].DATA_meminst[i : j] = b*{b}], f) -;; 4-runtime.watsup:154.1-154.77 +;; 4-runtime.watsup:173.1-173.77 def with_meminst : (state, memidx, meminst) -> state - ;; 4-runtime.watsup:163.1-163.68 + ;; 4-runtime.watsup:182.1-182.68 def {f : frame, mi : meminst, s : store, x : idx} with_meminst(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x]] = mi], f) -;; 4-runtime.watsup:155.1-155.82 +;; 4-runtime.watsup:174.1-174.82 def with_elem : (state, elemidx, ref*) -> state - ;; 4-runtime.watsup:164.1-164.72 + ;; 4-runtime.watsup:183.1-183.72 def {f : frame, r* : ref*, s : store, x : idx} with_elem(`%;%`(s, f), x, r*{r}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x]].ELEM_eleminst = r*{r}], f) -;; 4-runtime.watsup:156.1-156.82 +;; 4-runtime.watsup:175.1-175.82 def with_data : (state, dataidx, byte*) -> state - ;; 4-runtime.watsup:165.1-165.72 + ;; 4-runtime.watsup:184.1-184.72 def {b* : byte*, f : frame, s : store, x : idx} with_data(`%;%`(s, f), x, b*{b}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x]].DATA_datainst = b*{b}], f) -;; 4-runtime.watsup:167.1-167.63 +;; 4-runtime.watsup:189.1-189.63 def grow_table : (tableinst, nat, ref) -> tableinst? - ;; 4-runtime.watsup:170.1-174.36 + ;; 4-runtime.watsup:192.1-196.36 def {i : nat, i' : nat, j : nat, n : n, r : ref, r'* : ref*, rt : reftype, ti : tableinst, ti' : tableinst} grow_table(ti, n, r) = ?(ti') -- if (ti = {TYPE `%%`(`[%..%]`(i, j), rt), ELEM r'*{r'}}) -- if (i' = (|r'*{r'}| + n)) @@ -5285,9 +5285,9 @@ def grow_table : (tableinst, nat, ref) -> tableinst? -- Tabletype_ok: `|-%:OK`(ti'.TYPE_tableinst) def {x : (tableinst, nat, ref)} grow_table(x) = ?() -;; 4-runtime.watsup:168.1-168.55 +;; 4-runtime.watsup:190.1-190.55 def grow_memory : (meminst, nat) -> meminst? - ;; 4-runtime.watsup:175.1-179.34 + ;; 4-runtime.watsup:198.1-202.34 def {b* : byte*, i : nat, i' : nat, j : nat, mi : meminst, mi' : meminst, n : n} grow_memory(mi, n) = ?(mi') -- if (mi = {TYPE `%I8`(`[%..%]`(i, j)), DATA b*{b}}) -- if (i' = ((|b*{b}| / (64 * $Ki)) + n)) @@ -5295,10 +5295,10 @@ def grow_memory : (meminst, nat) -> meminst? -- Memtype_ok: `|-%:OK`(mi'.TYPE_meminst) def {x : (meminst, nat)} grow_memory(x) = ?() -;; 4-runtime.watsup:192.1-195.21 +;; 4-runtime.watsup:218.1-221.21 rec { -;; 4-runtime.watsup:192.1-195.21 +;; 4-runtime.watsup:218.1-221.21 syntax E = | _HOLE | _SEQ(val*, E, instr*) @@ -5329,480 +5329,469 @@ def wrap_ : ((nat, nat), c_numtype) -> nat ;; 5-numerics.watsup:13.1-13.28 def bytes_ : (nat, c_numtype) -> byte* -;; 6-reduction.watsup:4.1-4.63 +;; 6-reduction.watsup:6.1-6.63 relation Step_pure: `%*~>%*`(admininstr*, admininstr*) - ;; 6-reduction.watsup:16.1-17.24 + ;; 6-reduction.watsup:24.1-25.24 rule unreachable: `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) - ;; 6-reduction.watsup:19.1-20.19 + ;; 6-reduction.watsup:27.1-28.19 rule nop: `%*~>%*`([NOP_admininstr], []) - ;; 6-reduction.watsup:22.1-23.24 + ;; 6-reduction.watsup:30.1-31.24 rule drop {val : val}: `%*~>%*`([$admininstr_val(val) DROP_admininstr], []) - ;; 6-reduction.watsup:26.1-28.16 + ;; 6-reduction.watsup:34.1-36.16 rule select-true {c : c_numtype, t? : valtype?, val_1 : val, val_2 : val}: `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t?{t})], [$admininstr_val(val_1)]) -- if (c =/= 0) - ;; 6-reduction.watsup:30.1-32.14 + ;; 6-reduction.watsup:38.1-40.14 rule select-false {c : c_numtype, t? : valtype?, val_1 : val, val_2 : val}: `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t?{t})], [$admininstr_val(val_2)]) -- if (c = 0) - ;; 6-reduction.watsup:35.1-37.28 + ;; 6-reduction.watsup:45.1-47.28 rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k}: `%*~>%*`($admininstr_val(val)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})], [LABEL__admininstr(n, [], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) -- if (bt = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 6-reduction.watsup:39.1-41.28 + ;; 6-reduction.watsup:49.1-51.28 rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k}: `%*~>%*`($admininstr_val(val)^k{val} :: [LOOP_admininstr(bt, instr*{instr})], [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) -- if (bt = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 6-reduction.watsup:43.1-45.16 + ;; 6-reduction.watsup:53.1-55.16 rule if-true {bt : blocktype, c : c_numtype, 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) - ;; 6-reduction.watsup:47.1-49.14 + ;; 6-reduction.watsup:57.1-59.14 rule if-false {bt : blocktype, c : c_numtype, 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) - ;; 6-reduction.watsup:52.1-53.38 + ;; 6-reduction.watsup:62.1-63.38 rule label-vals {instr* : instr*, n : n, val* : val*}: `%*~>%*`([LABEL__admininstr(n, instr*{instr}, $admininstr_val(val)*{val})], $admininstr_val(val)*{val}) - ;; 6-reduction.watsup:57.1-58.69 + ;; 6-reduction.watsup:69.1-70.69 rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [BR_admininstr(0)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val} :: $admininstr_instr(instr')*{instr'}) - ;; 6-reduction.watsup:60.1-61.65 + ;; 6-reduction.watsup:72.1-73.65 rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val)*{val} :: [BR_admininstr(l + 1)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [BR_admininstr(l)]) - ;; 6-reduction.watsup:64.1-66.16 + ;; 6-reduction.watsup:76.1-78.16 rule br_if-true {c : c_numtype, l : labelidx}: `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) -- if (c =/= 0) - ;; 6-reduction.watsup:68.1-70.14 + ;; 6-reduction.watsup:80.1-82.14 rule br_if-false {c : c_numtype, l : labelidx}: `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) -- if (c = 0) - ;; 6-reduction.watsup:73.1-75.17 + ;; 6-reduction.watsup:85.1-87.17 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}|) - ;; 6-reduction.watsup:77.1-79.18 + ;; 6-reduction.watsup:89.1-91.18 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}|) - ;; 6-reduction.watsup:102.1-103.35 + ;; 6-reduction.watsup:116.1-117.35 rule frame-vals {f : frame, n : n, val^n : val^n}: `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val)^n{val})], $admininstr_val(val)^n{val}) - ;; 6-reduction.watsup:105.1-106.55 + ;; 6-reduction.watsup:119.1-120.55 rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val}) - ;; 6-reduction.watsup:108.1-109.60 + ;; 6-reduction.watsup:122.1-123.60 rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [RETURN_admininstr]) - ;; 6-reduction.watsup:112.1-114.33 + ;; 6-reduction.watsup:128.1-130.33 rule unop-val {c : c_numtype, c_1 : c_numtype, nt : numtype, unop : unop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) -- if ($unop(unop, nt, c_1) = [c]) - ;; 6-reduction.watsup:116.1-118.39 + ;; 6-reduction.watsup:132.1-134.39 rule unop-trap {c_1 : c_numtype, nt : numtype, unop : unop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) -- if ($unop(unop, nt, c_1) = []) - ;; 6-reduction.watsup:121.1-123.40 + ;; 6-reduction.watsup:137.1-139.40 rule binop-val {binop : binop_numtype, c : c_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- if ($binop(binop, nt, c_1, c_2) = [c]) - ;; 6-reduction.watsup:125.1-127.46 + ;; 6-reduction.watsup:141.1-143.46 rule binop-trap {binop : binop_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) -- if ($binop(binop, nt, c_1, c_2) = []) - ;; 6-reduction.watsup:130.1-132.37 + ;; 6-reduction.watsup:146.1-148.37 rule testop {c : c_numtype, c_1 : c_numtype, nt : numtype, testop : testop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $testop(testop, nt, c_1)) - ;; 6-reduction.watsup:134.1-136.40 + ;; 6-reduction.watsup:150.1-152.40 rule relop {c : c_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype, relop : relop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $relop(relop, nt, c_1, c_2)) - ;; 6-reduction.watsup:139.1-140.70 + ;; 6-reduction.watsup:155.1-156.70 rule extend {c : c_numtype, n : n, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, !($size($valtype_numtype(nt))), S_sx, c))]) - ;; 6-reduction.watsup:143.1-145.48 + ;; 6-reduction.watsup:159.1-161.48 rule cvtop-val {c : c_numtype, c_1 : c_numtype, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) -- if ($cvtop(nt_1, cvtop, nt_2, sx?{sx}, c_1) = [c]) - ;; 6-reduction.watsup:147.1-149.54 + ;; 6-reduction.watsup:163.1-165.54 rule cvtop-trap {c_1 : c_numtype, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) -- if ($cvtop(nt_1, cvtop, nt_2, sx?{sx}, c_1) = []) - ;; 6-reduction.watsup:156.1-158.28 + ;; 6-reduction.watsup:174.1-176.28 rule ref.is_null-true {rt : reftype, val : val}: `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) -- if (val = REF.NULL_val(rt)) - ;; 6-reduction.watsup:160.1-162.15 + ;; 6-reduction.watsup:178.1-180.15 rule ref.is_null-false {val : val}: `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 6-reduction.watsup:171.1-172.47 + ;; 6-reduction.watsup:191.1-192.47 rule local.tee {val : val, x : idx}: `%*~>%*`([$admininstr_val(val) LOCAL.TEE_admininstr(x)], [$admininstr_val(val) $admininstr_val(val) LOCAL.SET_admininstr(x)]) -;; 6-reduction.watsup:5.1-5.63 +;; 6-reduction.watsup:7.1-7.63 relation Step_read: `%~>%*`(config, admininstr*) - ;; 6-reduction.watsup:82.1-83.47 + ;; 6-reduction.watsup:96.1-97.47 rule call {x : idx, z : state}: `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [CALL_ADDR_admininstr($funcaddr(z)[x])]) - ;; 6-reduction.watsup:85.1-89.17 + ;; 6-reduction.watsup:99.1-103.17 rule call_indirect-call {a : addr, ft : functype, ft' : functype, i : nat, instr* : instr*, t* : valtype*, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CALL_INDIRECT_admininstr(x, ft)]), [CALL_ADDR_admininstr(a)]) -- if ($table(z, x).ELEM_tableinst[i] = REF.FUNC_ADDR_ref(a)) -- if ($funcinst(z)[a].CODE_funcinst = `FUNC%%*%`(ft', t*{t}, instr*{instr})) -- if (ft = ft') - ;; 6-reduction.watsup:91.1-93.15 + ;; 6-reduction.watsup:105.1-107.15 rule call_indirect-trap {ft : functype, i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CALL_INDIRECT_admininstr(x, ft)]), [TRAP_admininstr]) -- otherwise - ;; 6-reduction.watsup:95.1-99.52 + ;; 6-reduction.watsup:109.1-113.52 rule call_addr {a : addr, f : frame, func : func, instr* : instr*, k : nat, m : moduleinst, n : n, t* : valtype*, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [CALL_ADDR_admininstr(a)]), [FRAME__admininstr(n, f, [LABEL__admininstr(n, [], $admininstr_instr(instr)*{instr})])]) -- if ($funcinst(z)[a] = {MODULE m, CODE func}) -- if (func = `FUNC%%*%`(`%->%`(t_1^k{t_1}, t_2^n{t_2}), t*{t}, instr*{instr})) -- if (f = {LOCAL val^k{val} :: !($default_(t))*{t}, MODULE m}) - ;; 6-reduction.watsup:152.1-153.53 + ;; 6-reduction.watsup:170.1-171.53 rule ref.func {x : idx, z : state}: `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) - ;; 6-reduction.watsup:165.1-166.37 + ;; 6-reduction.watsup:185.1-186.37 rule local.get {x : idx, z : state}: `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [$admininstr_val($local(z, x))]) - ;; 6-reduction.watsup:175.1-176.45 + ;; 6-reduction.watsup:197.1-198.45 rule global.get {x : idx, z : state}: `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [$admininstr_val($global(z, x).VALUE_globalinst)]) - ;; 6-reduction.watsup:182.1-184.33 + ;; 6-reduction.watsup:206.1-208.33 rule table.get-trap {i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:186.1-188.32 + ;; 6-reduction.watsup:210.1-212.32 rule table.get-val {i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [$admininstr_ref($table(z, x).ELEM_tableinst[i])]) -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:199.1-201.32 + ;; 6-reduction.watsup:223.1-225.32 rule table.size {n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) -- if (|$table(z, x).ELEM_tableinst| = n) - ;; 6-reduction.watsup:212.1-214.39 + ;; 6-reduction.watsup:236.1-238.39 rule table.fill-trap {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:216.1-219.14 + ;; 6-reduction.watsup:240.1-243.14 rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:221.1-225.15 + ;; 6-reduction.watsup:245.1-249.15 rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) -- otherwise - ;; 6-reduction.watsup:228.1-230.73 + ;; 6-reduction.watsup:252.1-254.73 rule table.copy-trap {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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|)) - ;; 6-reduction.watsup:232.1-235.14 + ;; 6-reduction.watsup:256.1-259.14 rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:237.1-242.15 + ;; 6-reduction.watsup:261.1-266.15 rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:244.1-248.15 + ;; 6-reduction.watsup:268.1-272.15 rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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 - ;; 6-reduction.watsup:251.1-253.72 + ;; 6-reduction.watsup:275.1-277.72 rule table.init-trap {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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|)) - ;; 6-reduction.watsup:255.1-258.14 + ;; 6-reduction.watsup:279.1-282.14 rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:260.1-264.15 + ;; 6-reduction.watsup:284.1-288.15 rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) $admininstr_ref($elem(z, y).ELEM_eleminst[i]) 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 - ;; 6-reduction.watsup:271.1-273.53 + ;; 6-reduction.watsup:297.1-299.53 rule load-num-trap {i : nat, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), n_A, n_O)]), [TRAP_admininstr]) -- if (((i + n_O) + (!($size($valtype_numtype(nt))) / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:275.1-277.71 + ;; 6-reduction.watsup:301.1-303.71 rule load-num-val {c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), n_A, n_O)]), [CONST_admininstr(nt, c)]) -- if ($bytes_(!($size($valtype_numtype(nt))), c) = $mem(z, 0).DATA_meminst[(i + n_O) : (!($size($valtype_numtype(nt))) / 8)]) - ;; 6-reduction.watsup:279.1-281.45 + ;; 6-reduction.watsup:305.1-307.45 rule load-pack-trap {i : nat, n : n, n_A : n, n_O : n, nt : numtype, sx : sx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), n_A, n_O)]), [TRAP_admininstr]) -- if (((i + n_O) + (n / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:283.1-285.55 + ;; 6-reduction.watsup:309.1-311.55 rule load-pack-val {c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, sx : sx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), n_A, n_O)]), [CONST_admininstr(nt, $ext(n, !($size($valtype_numtype(nt))), sx, c))]) -- if ($bytes_(n, c) = $mem(z, 0).DATA_meminst[(i + n_O) : (n / 8)]) - ;; 6-reduction.watsup:305.1-307.44 + ;; 6-reduction.watsup:331.1-333.44 rule memory.size {n : n, z : state}: `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr]), [CONST_admininstr(I32_numtype, n)]) -- if (((n * 64) * $Ki) = |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:318.1-320.37 + ;; 6-reduction.watsup:344.1-346.37 rule memory.fill-trap {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), [TRAP_admininstr]) -- if ((i + n) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:322.1-325.14 + ;; 6-reduction.watsup:348.1-351.14 rule memory.fill-zero {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:327.1-331.15 + ;; 6-reduction.watsup:353.1-357.15 rule memory.fill-succ {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr]) -- otherwise - ;; 6-reduction.watsup:334.1-336.69 + ;; 6-reduction.watsup:360.1-362.69 rule memory.copy-trap {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [TRAP_admininstr]) -- if (((i + n) > |$mem(z, 0).DATA_meminst|) \/ ((j + n) > |$mem(z, 0).DATA_meminst|)) - ;; 6-reduction.watsup:338.1-341.14 + ;; 6-reduction.watsup:364.1-367.14 rule memory.copy-zero {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:343.1-348.15 + ;; 6-reduction.watsup:369.1-374.15 rule memory.copy-le {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) LOAD_admininstr(I32_numtype, ?((8, U_sx)), 0, 0) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr]) -- otherwise -- if (j <= i) - ;; 6-reduction.watsup:350.1-354.15 + ;; 6-reduction.watsup:376.1-380.15 rule memory.copy-gt {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), 0, 0) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr]) -- otherwise - ;; 6-reduction.watsup:357.1-359.70 + ;; 6-reduction.watsup:383.1-385.70 rule memory.init-trap {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), [TRAP_admininstr]) -- if (((i + n) > |$data(z, x).DATA_datainst|) \/ ((j + n) > |$mem(z, 0).DATA_meminst|)) - ;; 6-reduction.watsup:361.1-364.14 + ;; 6-reduction.watsup:387.1-390.14 rule memory.init-zero {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:366.1-370.15 + ;; 6-reduction.watsup:392.1-396.15 rule memory.init-succ {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, x).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x)]) -- otherwise -;; 6-reduction.watsup:3.1-3.63 +;; 6-reduction.watsup:5.1-5.63 relation Step: `%~>%`(config, config) - ;; 6-reduction.watsup:7.1-9.34 + ;; 6-reduction.watsup:9.1-11.34 rule pure {instr* : instr*, instr'* : instr*, z : state}: `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) -- Step_pure: `%*~>%*`($admininstr_instr(instr)*{instr}, $admininstr_instr(instr')*{instr'}) - ;; 6-reduction.watsup:11.1-13.37 + ;; 6-reduction.watsup:13.1-15.37 rule read {instr* : instr*, instr'* : instr*, z : state}: `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) -- Step_read: `%~>%*`(`%;%*`(z, $admininstr_instr(instr)*{instr}), $admininstr_instr(instr')*{instr'}) - ;; 6-reduction.watsup:168.1-169.60 + ;; 6-reduction.watsup:188.1-189.60 rule local.set {val : val, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_val(val) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) - ;; 6-reduction.watsup:178.1-179.62 + ;; 6-reduction.watsup:200.1-201.62 rule global.set {val : val, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_val(val) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) - ;; 6-reduction.watsup:190.1-192.33 + ;; 6-reduction.watsup:214.1-216.33 rule table.set-trap {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:194.1-196.32 + ;; 6-reduction.watsup:218.1-220.32 rule table.set-val {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:204.1-206.47 + ;; 6-reduction.watsup:228.1-230.47 rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) -- if (!($grow_table($table(z, x), n, ref)) = ti) - ;; 6-reduction.watsup:208.1-209.64 + ;; 6-reduction.watsup:232.1-233.64 rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, - 1)])) - ;; 6-reduction.watsup:267.1-268.59 + ;; 6-reduction.watsup:291.1-292.59 rule elem.drop {x : idx, z : state}: `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) - ;; 6-reduction.watsup:288.1-290.53 + ;; 6-reduction.watsup:314.1-316.53 rule store-num-trap {c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), n_A, n_O)]), `%;%*`(z, [TRAP_admininstr])) -- if (((i + n_O) + (!($size($valtype_numtype(nt))) / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:292.1-294.35 + ;; 6-reduction.watsup:318.1-320.35 rule store-num-val {b* : byte*, c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), n_A, n_O)]), `%;%*`($with_mem(z, 0, (i + n_O), (!($size($valtype_numtype(nt))) / 8), b*{b}), [])) -- if (b*{b} = $bytes_(!($size($valtype_numtype(nt))), c)) - ;; 6-reduction.watsup:296.1-298.45 + ;; 6-reduction.watsup:322.1-324.45 rule store-pack-trap {c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), n_A, n_O)]), `%;%*`(z, [TRAP_admininstr])) -- if (((i + n_O) + (n / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:300.1-302.50 + ;; 6-reduction.watsup:326.1-328.50 rule store-pack-val {b* : byte*, c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), n_A, n_O)]), `%;%*`($with_mem(z, 0, (i + n_O), (n / 8), b*{b}), [])) -- if (b*{b} = $bytes_(n, $wrap_((!($size($valtype_numtype(nt))), n), c))) - ;; 6-reduction.watsup:310.1-312.41 + ;; 6-reduction.watsup:336.1-338.41 rule memory.grow-succeed {mi : meminst, n : n, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr]), `%;%*`($with_meminst(z, 0, mi), [CONST_admininstr(I32_numtype, (|$mem(z, 0).DATA_meminst| / (64 * $Ki)))])) -- if (!($grow_memory($mem(z, 0), n)) = mi) - ;; 6-reduction.watsup:314.1-315.59 + ;; 6-reduction.watsup:340.1-341.59 rule memory.grow-fail {n : n, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr]), `%;%*`(z, [CONST_admininstr(I32_numtype, - 1)])) - ;; 6-reduction.watsup:373.1-374.59 + ;; 6-reduction.watsup:399.1-400.59 rule data.drop {x : idx, z : state}: `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) -;; 7-module.watsup:4.1-4.35 +;; 7-module.watsup:5.1-5.35 rec { -;; 7-module.watsup:4.1-4.35 +;; 7-module.watsup:5.1-5.35 def funcs : externval* -> funcaddr* - ;; 7-module.watsup:5.1-5.30 + ;; 7-module.watsup:6.1-6.30 def funcs([]) = [] - ;; 7-module.watsup:6.1-6.59 + ;; 7-module.watsup:7.1-7.59 def {externval'* : externval*, fa : funcaddr} funcs([FUNC_externval(fa)] :: externval'*{externval'}) = [fa] :: $funcs(externval'*{externval'}) - ;; 7-module.watsup:7.1-8.15 + ;; 7-module.watsup:8.1-9.15 def {externval : externval, externval'* : externval*} funcs([externval] :: externval'*{externval'}) = $funcs(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:10.1-10.39 +;; 7-module.watsup:11.1-11.39 rec { -;; 7-module.watsup:10.1-10.39 +;; 7-module.watsup:11.1-11.39 def globals : externval* -> globaladdr* - ;; 7-module.watsup:11.1-11.32 + ;; 7-module.watsup:12.1-12.32 def globals([]) = [] - ;; 7-module.watsup:12.1-12.65 + ;; 7-module.watsup:13.1-13.65 def {externval'* : externval*, ga : globaladdr} globals([GLOBAL_externval(ga)] :: externval'*{externval'}) = [ga] :: $globals(externval'*{externval'}) - ;; 7-module.watsup:13.1-14.15 + ;; 7-module.watsup:14.1-15.15 def {externval : externval, externval'* : externval*} globals([externval] :: externval'*{externval'}) = $globals(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:16.1-16.37 +;; 7-module.watsup:17.1-17.37 rec { -;; 7-module.watsup:16.1-16.37 +;; 7-module.watsup:17.1-17.37 def tables : externval* -> tableaddr* - ;; 7-module.watsup:17.1-17.31 + ;; 7-module.watsup:18.1-18.31 def tables([]) = [] - ;; 7-module.watsup:18.1-18.62 + ;; 7-module.watsup:19.1-19.62 def {externval'* : externval*, ta : tableaddr} tables([TABLE_externval(ta)] :: externval'*{externval'}) = [ta] :: $tables(externval'*{externval'}) - ;; 7-module.watsup:19.1-20.15 + ;; 7-module.watsup:20.1-21.15 def {externval : externval, externval'* : externval*} tables([externval] :: externval'*{externval'}) = $tables(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:22.1-22.33 +;; 7-module.watsup:23.1-23.33 rec { -;; 7-module.watsup:22.1-22.33 +;; 7-module.watsup:23.1-23.33 def mems : externval* -> memaddr* - ;; 7-module.watsup:23.1-23.29 + ;; 7-module.watsup:24.1-24.29 def mems([]) = [] - ;; 7-module.watsup:24.1-24.56 + ;; 7-module.watsup:25.1-25.56 def {externval'* : externval*, ma : memaddr} mems([MEM_externval(ma)] :: externval'*{externval'}) = [ma] :: $mems(externval'*{externval'}) - ;; 7-module.watsup:25.1-26.15 + ;; 7-module.watsup:26.1-27.15 def {externval : externval, externval'* : externval*} mems([externval] :: externval'*{externval'}) = $mems(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:29.1-29.83 -def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst - ;; 7-module.watsup:30.1-30.95 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externuse(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} - ;; 7-module.watsup:31.1-31.99 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externuse(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} - ;; 7-module.watsup:32.1-32.97 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externuse(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} - ;; 7-module.watsup:33.1-33.93 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externuse(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} - ;; 7-module.watsup:36.1-36.60 def allocfunc : (store, moduleinst, func) -> (store, funcaddr) ;; 7-module.watsup:37.1-38.37 @@ -5917,9 +5906,20 @@ def allocdatas : (store, byte**) -> (store, dataaddr*) -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) } -;; 7-module.watsup:97.1-97.81 +;; 7-module.watsup:99.1-99.83 +def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst + ;; 7-module.watsup:100.1-100.95 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externuse(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} + ;; 7-module.watsup:101.1-101.99 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externuse(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} + ;; 7-module.watsup:102.1-102.97 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externuse(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} + ;; 7-module.watsup:103.1-103.93 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externuse(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} + +;; 7-module.watsup:106.1-106.81 def allocmodule : (store, module, externval*, val*, ref**) -> (store, moduleinst) - ;; 7-module.watsup:98.1-135.54 + ;; 7-module.watsup:107.1-144.54 def {byte*^n_data : byte*^n_data, da* : dataaddr*, datamode?^n_data : datamode?^n_data, ea* : elemaddr*, elemmode?^n_elem : elemmode?^n_elem, export* : export*, expr_1^n_global : expr^n_global, expr_2*^n_elem : expr*^n_elem, externval* : externval*, fa* : funcaddr*, fa_ex* : funcaddr*, func^n_func : func^n_func, ga* : globaladdr*, ga_ex* : globaladdr*, globaltype^n_global : globaltype^n_global, i_data^n_data : nat^n_data, i_elem^n_elem : nat^n_elem, i_func^n_func : nat^n_func, i_global^n_global : nat^n_global, i_mem^n_mem : nat^n_mem, i_table^n_table : nat^n_table, import* : import*, m : moduleinst, ma* : memaddr*, ma_ex* : memaddr*, memtype^n_mem : memtype^n_mem, module : module, n_data : n, n_elem : n, n_func : n, n_global : n, n_mem : n, n_table : n, ref** : ref**, rt^n_elem : reftype^n_elem, s : store, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store, s_6 : store, start? : start?, ta* : tableaddr*, ta_ex* : tableaddr*, tabletype^n_table : tabletype^n_table, val* : val*, xi* : exportinst*} allocmodule(s, module, externval*{externval}, val*{val}, ref*{ref}*{ref}) = (s_6, m) -- if (module = `MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func^n_func{func}, GLOBAL(globaltype, expr_1)^n_global{expr_1 globaltype}, TABLE(tabletype)^n_table{tabletype}, MEMORY(memtype)^n_mem{memtype}, `ELEM%%*%?`(rt, expr_2*{expr_2}, elemmode?{elemmode})^n_elem{elemmode expr_2 rt}, `DATA%*%?`(byte*{byte}, datamode?{datamode})^n_data{byte datamode}, start?{start}, export*{export})) -- if (fa_ex*{fa_ex} = $funcs(externval*{externval})) @@ -5941,39 +5941,39 @@ def allocmodule : (store, module, externval*, val*, ref**) -> (store, moduleinst -- if ((s_5, ea*{ea}) = $allocelems(s_4, rt^n_elem{rt}, ref*{ref}*{ref})) -- if ((s_6, da*{da}) = $allocdatas(s_5, byte*{byte}^n_data{byte})) -;; 7-module.watsup:138.1-138.33 +;; 7-module.watsup:151.1-151.36 +rec { + +;; 7-module.watsup:151.1-151.36 +def concat_instr : instr** -> instr* + ;; 7-module.watsup:152.1-152.37 + def concat_instr([]) = [] + ;; 7-module.watsup:153.1-153.68 + def {instr* : instr*, instr'** : instr**} concat_instr([instr]*{instr} :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) +} + +;; 7-module.watsup:155.1-155.33 def runelem : (elem, idx) -> instr* - ;; 7-module.watsup:139.1-139.46 + ;; 7-module.watsup:156.1-156.46 def {expr* : expr*, i : nat, reftype : reftype} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?()), i) = [] - ;; 7-module.watsup:140.1-140.62 + ;; 7-module.watsup:157.1-157.62 def {expr* : expr*, i : nat, reftype : reftype} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?(DECLARE_elemmode)), i) = [ELEM.DROP_instr(i)] - ;; 7-module.watsup:141.1-143.20 + ;; 7-module.watsup:158.1-160.20 def {expr* : expr*, i : nat, instr* : instr*, n : n, reftype : reftype, x : idx} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?(TABLE_elemmode(x, instr*{instr}))), i) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, n) TABLE.INIT_instr(x, i) ELEM.DROP_instr(i)] -- if (n = |expr*{expr}|) -;; 7-module.watsup:145.1-145.33 +;; 7-module.watsup:162.1-162.33 def rundata : (data, idx) -> instr* - ;; 7-module.watsup:146.1-146.38 + ;; 7-module.watsup:163.1-163.38 def {byte* : byte*, i : nat} rundata(`DATA%*%?`(byte*{byte}, ?()), i) = [] - ;; 7-module.watsup:147.1-149.20 + ;; 7-module.watsup:164.1-166.20 def {byte* : byte*, i : nat, instr* : instr*, n : n} rundata(`DATA%*%?`(byte*{byte}, ?(MEMORY_datamode(0, instr*{instr}))), i) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, n) MEMORY.INIT_instr(i) DATA.DROP_instr(i)] -- if (n = |byte*{byte}|) -;; 7-module.watsup:152.1-152.36 -rec { - -;; 7-module.watsup:152.1-152.36 -def concat_instr : instr** -> instr* - ;; 7-module.watsup:153.1-153.37 - def concat_instr([]) = [] - ;; 7-module.watsup:154.1-154.68 - def {instr* : instr*, instr'** : instr**} concat_instr([instr]*{instr} :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) -} - -;; 7-module.watsup:157.1-157.55 -def instantiation : (store, module, externval*) -> config - ;; 7-module.watsup:158.1-180.28 - def {data* : data*, elem* : elem*, elemmode?* : elemmode?*, export* : export*, externval* : externval*, f : frame, f_init : frame, func* : func*, global* : global*, globaltype* : globaltype*, i^n_elem : nat^n_elem, import* : import*, instr_1** : instr**, instr_2*** : instr***, instr_data* : instr*, instr_elem* : instr*, j^n_data : nat^n_data, m : moduleinst, m_init : moduleinst, mem* : mem*, module : module, n_data : n, n_elem : n, ref** : ref**, reftype* : reftype*, s : store, s' : store, start? : start?, table* : table*, val* : val*, x? : idx?} instantiation(s, module, externval*{externval}) = `%;%*`(`%;%`(s', f), $admininstr_instr(instr_elem)*{instr_elem} :: $admininstr_instr(instr_data)*{instr_data} :: CALL_admininstr(x)?{x}) +;; 7-module.watsup:168.1-168.53 +def instantiate : (store, module, externval*) -> config + ;; 7-module.watsup:169.1-191.28 + def {data* : data*, elem* : elem*, elemmode?* : elemmode?*, export* : export*, externval* : externval*, f : frame, f_init : frame, func* : func*, global* : global*, globaltype* : globaltype*, i^n_elem : nat^n_elem, import* : import*, instr_1** : instr**, instr_2*** : instr***, instr_data* : instr*, instr_elem* : instr*, j^n_data : nat^n_data, m : moduleinst, m_init : moduleinst, mem* : mem*, module : module, n_data : n, n_elem : n, ref** : ref**, reftype* : reftype*, s : store, s' : store, start? : start?, table* : table*, val* : val*, x? : idx?} instantiate(s, module, externval*{externval}) = `%;%*`(`%;%`(s', f), $admininstr_instr(instr_elem)*{instr_elem} :: $admininstr_instr(instr_data)*{instr_data} :: CALL_admininstr(x)?{x}) -- if (module = `MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data*{data}, start?{start}, export*{export})) -- if (m_init = {FUNC $funcs(externval*{externval}), GLOBAL $globals(externval*{externval}), TABLE [], MEM [], ELEM [], DATA [], EXPORT []}) -- if (f_init = {LOCAL [], MODULE m_init}) @@ -5989,10 +5989,10 @@ def instantiation : (store, module, externval*) -> config -- if (instr_data*{instr_data} = $concat_instr($rundata(data*{data}[j], j)^(j config - ;; 7-module.watsup:184.1-196.52 - def {expr : expr, f : frame, fa : funcaddr, functype : functype, k : nat, m : moduleinst, n : n, s : store, val^n : val^n, valtype* : valtype*, valtype_param^n : valtype^n, valtype_res^k : valtype^k} invocation(s, fa, val^n{val}) = `%;%*`(`%;%`(s, f), $admininstr_val(val)^n{val} :: [CALL_ADDR_admininstr(fa)]) +;; 7-module.watsup:198.1-198.44 +def invoke : (store, funcaddr, val*) -> config + ;; 7-module.watsup:199.1-211.52 + def {expr : expr, f : frame, fa : funcaddr, functype : functype, k : nat, m : moduleinst, n : n, s : store, val^n : val^n, valtype* : valtype*, valtype_param^n : valtype^n, valtype_res^k : valtype^k} invoke(s, fa, val^n{val}) = `%;%*`(`%;%`(s, f), $admininstr_val(val)^n{val} :: [CALL_ADDR_admininstr(fa)]) -- if (m = {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], EXPORT []}) -- if (f = {LOCAL [], MODULE m}) -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = `FUNC%%*%`(functype, valtype*{valtype}, expr)) @@ -6343,49 +6343,49 @@ syntax import = IMPORT(name, name, externtype) ;; 1-syntax.watsup:212.1-213.70 syntax module = `MODULE%*%*%*%*%*%*%*%?%*`(import*, func*, global*, table*, mem*, elem*, data*, start?, export*) -;; 2-aux.watsup:3.1-3.14 +;; 2-aux.watsup:7.1-7.14 def Ki : nat - ;; 2-aux.watsup:4.1-4.15 + ;; 2-aux.watsup:8.1-8.15 def Ki = 1024 -;; 2-aux.watsup:9.1-9.25 +;; 2-aux.watsup:13.1-13.25 rec { -;; 2-aux.watsup:9.1-9.25 +;; 2-aux.watsup:13.1-13.25 def min : (nat, nat) -> nat - ;; 2-aux.watsup:10.1-10.19 + ;; 2-aux.watsup:14.1-14.19 def {j : nat} min(0, j) = 0 - ;; 2-aux.watsup:11.1-11.19 + ;; 2-aux.watsup:15.1-15.19 def {i : nat} min(i, 0) = 0 - ;; 2-aux.watsup:12.1-12.38 + ;; 2-aux.watsup:16.1-16.38 def {i : nat, j : nat} min((i + 1), (j + 1)) = $min(i, j) } -;; 2-aux.watsup:19.1-19.55 +;; 2-aux.watsup:27.1-27.55 def size : valtype -> nat? - ;; 2-aux.watsup:20.1-20.20 + ;; 2-aux.watsup:28.1-28.20 def size(I32_valtype) = ?(32) - ;; 2-aux.watsup:21.1-21.20 + ;; 2-aux.watsup:29.1-29.20 def size(I64_valtype) = ?(64) - ;; 2-aux.watsup:22.1-22.20 + ;; 2-aux.watsup:30.1-30.20 def size(F32_valtype) = ?(32) - ;; 2-aux.watsup:23.1-23.20 + ;; 2-aux.watsup:31.1-31.20 def size(F64_valtype) = ?(64) - ;; 2-aux.watsup:24.1-24.22 + ;; 2-aux.watsup:32.1-32.22 def size(V128_valtype) = ?(128) def {x : valtype} size(x) = ?() -;; 2-aux.watsup:29.1-29.40 +;; 2-aux.watsup:40.1-40.40 def test_sub_ATOM_22 : n -> nat - ;; 2-aux.watsup:30.1-30.38 + ;; 2-aux.watsup:41.1-41.38 def {n_3_ATOM_y : n} test_sub_ATOM_22(n_3_ATOM_y) = 0 -;; 2-aux.watsup:32.1-32.26 +;; 2-aux.watsup:43.1-43.26 def curried_ : (n, n) -> nat - ;; 2-aux.watsup:33.1-33.39 + ;; 2-aux.watsup:44.1-44.39 def {n_1 : n, n_2 : n} curried_(n_1, n_2) = (n_1 + n_2) -;; 2-aux.watsup:35.1-44.39 +;; 2-aux.watsup:46.1-55.39 syntax testfuse = | AB_(nat, nat, nat) | CD(nat, nat, nat) @@ -6397,249 +6397,249 @@ syntax testfuse = | OP(nat, nat, nat) | QR(nat, nat, nat) -;; 3-typing.watsup:3.1-6.60 +;; 3-typing.watsup:5.1-8.60 syntax context = {FUNC functype*, GLOBAL globaltype*, TABLE tabletype*, MEM memtype*, ELEM elemtype*, DATA datatype*, LOCAL valtype*, LABEL resulttype*, RETURN resulttype?} -;; 3-typing.watsup:14.1-14.66 +;; 3-typing.watsup:18.1-18.66 relation Limits_ok: `|-%:%`(limits, nat) - ;; 3-typing.watsup:22.1-24.24 + ;; 3-typing.watsup:26.1-28.24 rule _ {k : nat, n_1 : n, n_2 : n}: `|-%:%`(`[%..%]`(n_1, n_2), k) -- if ((n_1 <= n_2) /\ (n_2 <= k)) -;; 3-typing.watsup:15.1-15.64 +;; 3-typing.watsup:19.1-19.64 relation Functype_ok: `|-%:OK`(functype) - ;; 3-typing.watsup:26.1-27.13 + ;; 3-typing.watsup:30.1-31.13 rule _ {ft : functype}: `|-%:OK`(ft) -;; 3-typing.watsup:16.1-16.66 +;; 3-typing.watsup:20.1-20.66 relation Globaltype_ok: `|-%:OK`(globaltype) - ;; 3-typing.watsup:29.1-30.13 + ;; 3-typing.watsup:33.1-34.13 rule _ {gt : globaltype}: `|-%:OK`(gt) -;; 3-typing.watsup:17.1-17.65 +;; 3-typing.watsup:21.1-21.65 relation Tabletype_ok: `|-%:OK`(tabletype) - ;; 3-typing.watsup:32.1-34.35 + ;; 3-typing.watsup:36.1-38.35 rule _ {lim : limits, rt : reftype}: `|-%:OK`(`%%`(lim, rt)) -- Limits_ok: `|-%:%`(lim, ((2 ^ 32) - 1)) -;; 3-typing.watsup:18.1-18.63 +;; 3-typing.watsup:22.1-22.63 relation Memtype_ok: `|-%:OK`(memtype) - ;; 3-typing.watsup:36.1-38.33 + ;; 3-typing.watsup:40.1-42.33 rule _ {lim : limits}: `|-%:OK`(`%I8`(lim)) -- Limits_ok: `|-%:%`(lim, (2 ^ 16)) -;; 3-typing.watsup:19.1-19.66 +;; 3-typing.watsup:23.1-23.66 relation Externtype_ok: `|-%:OK`(externtype) - ;; 3-typing.watsup:41.1-43.35 + ;; 3-typing.watsup:45.1-47.35 rule func {functype : functype}: `|-%:OK`(FUNC_externtype(functype)) -- Functype_ok: `|-%:OK`(functype) - ;; 3-typing.watsup:45.1-47.39 + ;; 3-typing.watsup:49.1-51.39 rule global {globaltype : globaltype}: `|-%:OK`(GLOBAL_externtype(globaltype)) -- Globaltype_ok: `|-%:OK`(globaltype) - ;; 3-typing.watsup:49.1-51.37 + ;; 3-typing.watsup:53.1-55.37 rule table {tabletype : tabletype}: `|-%:OK`(TABLE_externtype(tabletype)) -- Tabletype_ok: `|-%:OK`(tabletype) - ;; 3-typing.watsup:53.1-55.33 + ;; 3-typing.watsup:57.1-59.33 rule mem {memtype : memtype}: `|-%:OK`(MEM_externtype(memtype)) -- Memtype_ok: `|-%:OK`(memtype) -;; 3-typing.watsup:61.1-61.65 +;; 3-typing.watsup:69.1-69.65 relation Valtype_sub: `|-%<:%`(valtype, valtype) - ;; 3-typing.watsup:64.1-65.12 + ;; 3-typing.watsup:72.1-73.12 rule refl {t : valtype}: `|-%<:%`(t, t) - ;; 3-typing.watsup:67.1-68.14 + ;; 3-typing.watsup:75.1-76.14 rule bot {t : valtype}: `|-%<:%`(BOT_valtype, t) -;; 3-typing.watsup:62.1-62.72 +;; 3-typing.watsup:70.1-70.72 relation Resulttype_sub: `|-%*<:%*`(valtype*, valtype*) - ;; 3-typing.watsup:70.1-72.35 + ;; 3-typing.watsup:78.1-80.35 rule _ {t_1* : valtype*, t_2* : valtype*}: `|-%*<:%*`(t_1*{t_1}, t_2*{t_2}) -- (Valtype_sub: `|-%<:%`(t_1, t_2))*{t_1 t_2} -;; 3-typing.watsup:75.1-75.75 +;; 3-typing.watsup:85.1-85.75 relation Limits_sub: `|-%<:%`(limits, limits) - ;; 3-typing.watsup:83.1-86.21 + ;; 3-typing.watsup:93.1-96.21 rule _ {n_11 : n, n_12 : n, n_21 : n, n_22 : n}: `|-%<:%`(`[%..%]`(n_11, n_12), `[%..%]`(n_21, n_22)) -- if (n_11 >= n_21) -- if (n_12 <= n_22) -;; 3-typing.watsup:76.1-76.73 +;; 3-typing.watsup:86.1-86.73 relation Functype_sub: `|-%<:%`(functype, functype) - ;; 3-typing.watsup:88.1-89.14 + ;; 3-typing.watsup:98.1-99.14 rule _ {ft : functype}: `|-%<:%`(ft, ft) -;; 3-typing.watsup:77.1-77.75 +;; 3-typing.watsup:87.1-87.75 relation Globaltype_sub: `|-%<:%`(globaltype, globaltype) - ;; 3-typing.watsup:91.1-92.14 + ;; 3-typing.watsup:101.1-102.14 rule _ {gt : globaltype}: `|-%<:%`(gt, gt) -;; 3-typing.watsup:78.1-78.74 +;; 3-typing.watsup:88.1-88.74 relation Tabletype_sub: `|-%<:%`(tabletype, tabletype) - ;; 3-typing.watsup:94.1-96.35 + ;; 3-typing.watsup:104.1-106.35 rule _ {lim_1 : limits, lim_2 : limits, rt : reftype}: `|-%<:%`(`%%`(lim_1, rt), `%%`(lim_2, rt)) -- Limits_sub: `|-%<:%`(lim_1, lim_2) -;; 3-typing.watsup:79.1-79.72 +;; 3-typing.watsup:89.1-89.72 relation Memtype_sub: `|-%<:%`(memtype, memtype) - ;; 3-typing.watsup:98.1-100.35 + ;; 3-typing.watsup:108.1-110.35 rule _ {lim_1 : limits, lim_2 : limits}: `|-%<:%`(`%I8`(lim_1), `%I8`(lim_2)) -- Limits_sub: `|-%<:%`(lim_1, lim_2) -;; 3-typing.watsup:80.1-80.75 +;; 3-typing.watsup:90.1-90.75 relation Externtype_sub: `|-%<:%`(externtype, externtype) - ;; 3-typing.watsup:103.1-105.35 + ;; 3-typing.watsup:113.1-115.35 rule func {ft_1 : functype, ft_2 : functype}: `|-%<:%`(FUNC_externtype(ft_1), FUNC_externtype(ft_2)) -- Functype_sub: `|-%<:%`(ft_1, ft_2) - ;; 3-typing.watsup:107.1-109.37 + ;; 3-typing.watsup:117.1-119.37 rule global {gt_1 : globaltype, gt_2 : globaltype}: `|-%<:%`(GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) -- Globaltype_sub: `|-%<:%`(gt_1, gt_2) - ;; 3-typing.watsup:111.1-113.36 + ;; 3-typing.watsup:121.1-123.36 rule table {tt_1 : tabletype, tt_2 : tabletype}: `|-%<:%`(TABLE_externtype(tt_1), TABLE_externtype(tt_2)) -- Tabletype_sub: `|-%<:%`(tt_1, tt_2) - ;; 3-typing.watsup:115.1-117.34 + ;; 3-typing.watsup:125.1-127.34 rule mem {mt_1 : memtype, mt_2 : memtype}: `|-%<:%`(MEM_externtype(mt_1), MEM_externtype(mt_2)) -- Memtype_sub: `|-%<:%`(mt_1, mt_2) -;; 3-typing.watsup:172.1-172.76 +;; 3-typing.watsup:192.1-192.76 relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) - ;; 3-typing.watsup:174.1-176.29 + ;; 3-typing.watsup:194.1-196.29 rule _ {C : context, ft : functype}: `%|-%:%`(C, ft, ft) -- Functype_ok: `|-%:OK`(ft) -;; 3-typing.watsup:123.1-124.67 +;; 3-typing.watsup:135.1-136.67 rec { -;; 3-typing.watsup:123.1-123.66 +;; 3-typing.watsup:135.1-135.66 relation Instr_ok: `%|-%:%`(context, instr, functype) - ;; 3-typing.watsup:153.1-154.34 + ;; 3-typing.watsup:171.1-172.34 rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:156.1-157.32 + ;; 3-typing.watsup:174.1-175.32 rule nop {C : context}: `%|-%:%`(C, NOP_instr, `%->%`([], [])) - ;; 3-typing.watsup:159.1-160.27 + ;; 3-typing.watsup:177.1-178.27 rule drop {C : context, t : valtype}: `%|-%:%`(C, DROP_instr, `%->%`([t], [])) - ;; 3-typing.watsup:163.1-164.31 + ;; 3-typing.watsup:181.1-182.31 rule select-expl {C : context, t : valtype}: `%|-%:%`(C, SELECT_instr(?(t)), `%->%`([t t I32_valtype], [t])) - ;; 3-typing.watsup:166.1-169.37 + ;; 3-typing.watsup:184.1-187.37 rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) -- Valtype_sub: `|-%<:%`(t, t') -- if ((t' = $valtype_numtype(numtype)) \/ (t' = $valtype_vectype(vectype))) - ;; 3-typing.watsup:178.1-181.59 + ;; 3-typing.watsup:198.1-201.59 rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:183.1-186.59 + ;; 3-typing.watsup:203.1-206.59 rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:188.1-192.61 + ;; 3-typing.watsup:208.1-212.61 rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%`(t_1*{t_1}, t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:195.1-197.24 + ;; 3-typing.watsup:217.1-219.24 rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- if (C.LABEL_context[l] = t*{t}) - ;; 3-typing.watsup:199.1-201.24 + ;; 3-typing.watsup:221.1-223.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] = t*{t}) - ;; 3-typing.watsup:203.1-206.42 + ;; 3-typing.watsup:225.1-228.42 rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- (Resulttype_sub: `|-%*<:%*`(t*{t}, C.LABEL_context[l]))*{l} -- Resulttype_sub: `|-%*<:%*`(t*{t}, C.LABEL_context[l']) - ;; 3-typing.watsup:208.1-210.24 + ;; 3-typing.watsup:233.1-235.24 rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- if (C.RETURN_context = ?(t*{t})) - ;; 3-typing.watsup:212.1-214.33 + ;; 3-typing.watsup:237.1-239.33 rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) -- if (C.FUNC_context[x] = `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:216.1-219.26 + ;; 3-typing.watsup:241.1-244.26 rule call_indirect {C : context, ft : functype, lim : limits, t_1* : valtype*, t_2* : valtype*, x : idx}: `%|-%:%`(C, CALL_INDIRECT_instr(x, ft), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) -- if (C.TABLE_context[x] = `%%`(lim, FUNCREF_reftype)) -- if (ft = `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:222.1-223.37 + ;; 3-typing.watsup:249.1-250.37 rule const {C : context, c_nt : c_numtype, nt : numtype}: `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [$valtype_numtype(nt)])) - ;; 3-typing.watsup:225.1-226.31 + ;; 3-typing.watsup:252.1-253.31 rule unop {C : context, nt : numtype, unop : unop_numtype}: `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 3-typing.watsup:228.1-229.36 + ;; 3-typing.watsup:255.1-256.36 rule binop {C : context, binop : binop_numtype, nt : numtype}: `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 3-typing.watsup:231.1-232.36 + ;; 3-typing.watsup:258.1-259.36 rule testop {C : context, nt : numtype, testop : testop_numtype}: `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([$valtype_numtype(nt)], [I32_valtype])) - ;; 3-typing.watsup:234.1-235.37 + ;; 3-typing.watsup:261.1-262.37 rule relop {C : context, nt : numtype, relop : relop_numtype}: `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [I32_valtype])) - ;; 3-typing.watsup:238.1-240.23 + ;; 3-typing.watsup:265.1-267.23 rule extend {C : context, n : n, nt : numtype, o0 : nat}: `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if (n <= o0) - ;; 3-typing.watsup:242.1-245.34 + ;; 3-typing.watsup:269.1-272.34 rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype, o0 : nat, o1 : nat}: `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([$valtype_numtype(nt_2)], [$valtype_numtype(nt_1)])) -- if ($size($valtype_numtype(nt_1)) = ?(o0)) @@ -6647,7 +6647,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- if (nt_1 =/= nt_2) -- if (o0 = o1) - ;; 3-typing.watsup:247.1-250.52 + ;; 3-typing.watsup:274.1-277.52 rule convert-i {C : context, in_1 : in, in_2 : in, sx? : sx?, o0 : nat, o1 : nat}: `%|-%:%`(C, CVTOP_instr($numtype_in(in_1), CONVERT_cvtop, $numtype_in(in_2), sx?{sx}), `%->%`([$valtype_in(in_2)], [$valtype_in(in_1)])) -- if ($size($valtype_in(in_1)) = ?(o0)) @@ -6655,123 +6655,123 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- if (in_1 =/= in_2) -- if ((sx?{sx} = ?()) <=> (o0 > o1)) - ;; 3-typing.watsup:252.1-254.22 + ;; 3-typing.watsup:279.1-281.22 rule convert-f {C : context, fn_1 : fn, fn_2 : fn}: `%|-%:%`(C, CVTOP_instr($numtype_fn(fn_1), CONVERT_cvtop, $numtype_fn(fn_2), ?()), `%->%`([$valtype_fn(fn_2)], [$valtype_fn(fn_1)])) -- if (fn_1 =/= fn_2) - ;; 3-typing.watsup:257.1-258.35 + ;; 3-typing.watsup:286.1-287.35 rule ref.null {C : context, rt : reftype}: `%|-%:%`(C, REF.NULL_instr(rt), `%->%`([], [$valtype_reftype(rt)])) - ;; 3-typing.watsup:260.1-262.23 + ;; 3-typing.watsup:289.1-291.23 rule ref.func {C : context, ft : functype, x : idx}: `%|-%:%`(C, REF.FUNC_instr(x), `%->%`([], [FUNCREF_valtype])) -- if (C.FUNC_context[x] = ft) - ;; 3-typing.watsup:264.1-265.31 + ;; 3-typing.watsup:293.1-294.31 rule ref.is_null {C : context, rt : reftype}: `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([$valtype_reftype(rt)], [I32_valtype])) - ;; 3-typing.watsup:268.1-270.23 + ;; 3-typing.watsup:299.1-301.23 rule local.get {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:272.1-274.23 + ;; 3-typing.watsup:303.1-305.23 rule local.set {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->%`([t], [])) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:276.1-278.23 + ;; 3-typing.watsup:307.1-309.23 rule local.tee {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%`([t], [t])) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:281.1-283.29 + ;; 3-typing.watsup:314.1-316.29 rule global.get {C : context, t : valtype, x : idx}: `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) -- if (C.GLOBAL_context[x] = `MUT%?%`(()?{}, t)) - ;; 3-typing.watsup:285.1-287.28 + ;; 3-typing.watsup:318.1-320.28 rule global.set {C : context, t : valtype, x : idx}: `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) -- if (C.GLOBAL_context[x] = `MUT%?%`(?(()), t)) - ;; 3-typing.watsup:290.1-292.28 + ;; 3-typing.watsup:325.1-327.28 rule table.get {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [$valtype_reftype(rt)])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:294.1-296.28 + ;; 3-typing.watsup:329.1-331.28 rule table.set {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype $valtype_reftype(rt)], [])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:298.1-300.24 + ;; 3-typing.watsup:333.1-335.24 rule table.size {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) -- if (C.TABLE_context[x] = tt) - ;; 3-typing.watsup:302.1-304.28 + ;; 3-typing.watsup:337.1-339.28 rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([$valtype_reftype(rt) I32_valtype], [I32_valtype])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:306.1-308.28 + ;; 3-typing.watsup:341.1-343.28 rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype $valtype_reftype(rt) I32_valtype], [])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:310.1-313.32 + ;; 3-typing.watsup:345.1-348.32 rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt : reftype, x_1 : idx, x_2 : idx}: `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt)) -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt)) - ;; 3-typing.watsup:315.1-318.25 + ;; 3-typing.watsup:350.1-353.25 rule table.init {C : context, lim : limits, rt : reftype, x_1 : idx, x_2 : idx}: `%|-%:%`(C, TABLE.INIT_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.TABLE_context[x_1] = `%%`(lim, rt)) -- if (C.ELEM_context[x_2] = rt) - ;; 3-typing.watsup:320.1-322.23 + ;; 3-typing.watsup:355.1-357.23 rule elem.drop {C : context, rt : reftype, x : idx}: `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) -- if (C.ELEM_context[x] = rt) - ;; 3-typing.watsup:325.1-327.22 + ;; 3-typing.watsup:362.1-364.22 rule memory.size {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.SIZE_instr, `%->%`([], [I32_valtype])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:329.1-331.22 + ;; 3-typing.watsup:366.1-368.22 rule memory.grow {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.GROW_instr, `%->%`([I32_valtype], [I32_valtype])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:333.1-335.22 + ;; 3-typing.watsup:370.1-372.22 rule memory.fill {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.FILL_instr, `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:337.1-339.22 + ;; 3-typing.watsup:374.1-376.22 rule memory.copy {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.COPY_instr, `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:341.1-344.23 + ;; 3-typing.watsup:378.1-381.23 rule memory.init {C : context, mt : memtype, x : idx}: `%|-%:%`(C, MEMORY.INIT_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.MEM_context[0] = mt) -- if (C.DATA_context[x] = OK) - ;; 3-typing.watsup:346.1-348.23 + ;; 3-typing.watsup:383.1-385.23 rule data.drop {C : context, x : idx}: `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) -- if (C.DATA_context[x] = OK) - ;; 3-typing.watsup:350.1-355.32 + ;; 3-typing.watsup:387.1-392.32 rule load {C : context, in : in, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, o0 : nat, o1? : nat?}: `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, n_A, n_O), `%->%`([I32_valtype], [$valtype_numtype(nt)])) -- if ($size($valtype_numtype(nt)) = ?(o0)) @@ -6781,7 +6781,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} -- if ((n?{n} = ?()) \/ (nt = $numtype_in(in))) - ;; 3-typing.watsup:357.1-362.32 + ;; 3-typing.watsup:394.1-399.32 rule store {C : context, in : in, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, o0 : nat, o1? : nat?}: `%|-%:%`(C, STORE_instr(nt, n?{n}, n_A, n_O), `%->%`([I32_valtype $valtype_numtype(nt)], [])) -- if ($size($valtype_numtype(nt)) = ?(o0)) @@ -6791,185 +6791,185 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} -- if ((n?{n} = ?()) \/ (nt = $numtype_in(in))) -;; 3-typing.watsup:124.1-124.67 +;; 3-typing.watsup:136.1-136.67 relation InstrSeq_ok: `%|-%*:%`(context, instr*, functype) - ;; 3-typing.watsup:133.1-134.36 + ;; 3-typing.watsup:149.1-150.36 rule empty {C : context}: `%|-%*:%`(C, [], `%->%`([], [])) - ;; 3-typing.watsup:136.1-139.46 + ;; 3-typing.watsup:152.1-155.46 rule seq {C : context, instr_1 : instr, instr_2 : instr, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*}: `%|-%*:%`(C, [instr_1] :: instr_2*{}, `%->%`(t_1*{t_1}, t_3*{t_3})) -- Instr_ok: `%|-%:%`(C, instr_1, `%->%`(t_1*{t_1}, t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C, [instr_2], `%->%`(t_2*{t_2}, t_3*{t_3})) - ;; 3-typing.watsup:141.1-146.38 + ;; 3-typing.watsup:157.1-162.38 rule weak {C : context, instr* : instr*, t'_1* : valtype*, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%*:%`(C, instr*{instr}, `%->%`(t'_1*{t'_1}, t'_2*{t'_2})) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) -- Resulttype_sub: `|-%*<:%*`(t'_1*{t'_1}, t_1*{t_1}) -- Resulttype_sub: `|-%*<:%*`(t_2*{t_2}, t'_2*{t'_2}) - ;; 3-typing.watsup:148.1-150.45 + ;; 3-typing.watsup:164.1-166.45 rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%*:%`(C, instr*{instr}, `%->%`(t*{t} :: t_1*{t_1}, t*{t} :: t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) } -;; 3-typing.watsup:125.1-125.71 +;; 3-typing.watsup:137.1-137.71 relation Expr_ok: `%|-%:%`(context, expr, resulttype) - ;; 3-typing.watsup:128.1-130.46 + ;; 3-typing.watsup:142.1-144.46 rule _ {C : context, instr* : instr*, t* : valtype*}: `%|-%:%`(C, instr*{instr}, t*{t}) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`([], t*{t})) -;; 3-typing.watsup:367.1-367.78 +;; 3-typing.watsup:406.1-406.78 relation Instr_const: `%|-%CONST`(context, instr) - ;; 3-typing.watsup:371.1-372.26 + ;; 3-typing.watsup:410.1-411.26 rule const {C : context, c : c_numtype, nt : numtype}: `%|-%CONST`(C, CONST_instr(nt, c)) - ;; 3-typing.watsup:374.1-375.27 + ;; 3-typing.watsup:413.1-414.27 rule ref.null {C : context, rt : reftype}: `%|-%CONST`(C, REF.NULL_instr(rt)) - ;; 3-typing.watsup:377.1-378.26 + ;; 3-typing.watsup:416.1-417.26 rule ref.func {C : context, x : idx}: `%|-%CONST`(C, REF.FUNC_instr(x)) - ;; 3-typing.watsup:380.1-382.32 + ;; 3-typing.watsup:419.1-421.32 rule global.get {C : context, t : valtype, x : idx}: `%|-%CONST`(C, GLOBAL.GET_instr(x)) -- if (C.GLOBAL_context[x] = `MUT%?%`(?(), t)) -;; 3-typing.watsup:368.1-368.77 +;; 3-typing.watsup:407.1-407.77 relation Expr_const: `%|-%CONST`(context, expr) - ;; 3-typing.watsup:385.1-386.38 + ;; 3-typing.watsup:424.1-425.38 rule _ {C : context, instr* : instr*}: `%|-%CONST`(C, instr*{instr}) -- (Instr_const: `%|-%CONST`(C, instr))*{instr} -;; 3-typing.watsup:369.1-369.78 +;; 3-typing.watsup:408.1-408.78 relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) - ;; 3-typing.watsup:389.1-392.33 + ;; 3-typing.watsup:428.1-431.33 rule _ {C : context, expr : expr, t : valtype}: `%|-%:%CONST`(C, expr, t) -- Expr_ok: `%|-%:%`(C, expr, [t]) -- Expr_const: `%|-%CONST`(C, expr) -;; 3-typing.watsup:397.1-397.73 +;; 3-typing.watsup:438.1-438.73 relation Func_ok: `%|-%:%`(context, func, functype) - ;; 3-typing.watsup:408.1-412.75 + ;; 3-typing.watsup:451.1-455.75 rule _ {C : context, expr : expr, ft : functype, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, `FUNC%%*%`(ft, t*{t}, expr), ft) -- if (ft = `%->%`(t_1*{t_1}, t_2*{t_2})) -- Functype_ok: `|-%:OK`(ft) -- Expr_ok: `%|-%:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL t_1*{t_1} :: t*{t}, LABEL [], RETURN ?()} ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()} ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2})}, expr, t_2*{t_2}) -;; 3-typing.watsup:398.1-398.75 +;; 3-typing.watsup:439.1-439.75 relation Global_ok: `%|-%:%`(context, global, globaltype) - ;; 3-typing.watsup:414.1-418.40 + ;; 3-typing.watsup:457.1-461.40 rule _ {C : context, expr : expr, gt : globaltype, t : valtype}: `%|-%:%`(C, GLOBAL(gt, expr), gt) -- Globaltype_ok: `|-%:OK`(gt) -- if (gt = `MUT%?%`(()?{}, t)) -- Expr_ok_const: `%|-%:%CONST`(C, expr, t) -;; 3-typing.watsup:399.1-399.74 +;; 3-typing.watsup:440.1-440.74 relation Table_ok: `%|-%:%`(context, table, tabletype) - ;; 3-typing.watsup:420.1-422.30 + ;; 3-typing.watsup:463.1-465.30 rule _ {C : context, tt : tabletype}: `%|-%:%`(C, TABLE(tt), tt) -- Tabletype_ok: `|-%:OK`(tt) -;; 3-typing.watsup:400.1-400.72 +;; 3-typing.watsup:441.1-441.72 relation Mem_ok: `%|-%:%`(context, mem, memtype) - ;; 3-typing.watsup:424.1-426.28 + ;; 3-typing.watsup:467.1-469.28 rule _ {C : context, mt : memtype}: `%|-%:%`(C, MEMORY(mt), mt) -- Memtype_ok: `|-%:OK`(mt) -;; 3-typing.watsup:403.1-403.77 +;; 3-typing.watsup:444.1-444.77 relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) - ;; 3-typing.watsup:437.1-440.45 + ;; 3-typing.watsup:480.1-483.45 rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE_elemmode(x, expr), rt) -- if (C.TABLE_context[x] = `%%`(lim, rt)) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} - ;; 3-typing.watsup:442.1-443.20 + ;; 3-typing.watsup:485.1-486.20 rule declare {C : context, rt : reftype}: `%|-%:%`(C, DECLARE_elemmode, rt) -;; 3-typing.watsup:401.1-401.73 +;; 3-typing.watsup:442.1-442.73 relation Elem_ok: `%|-%:%`(context, elem, reftype) - ;; 3-typing.watsup:428.1-431.40 + ;; 3-typing.watsup:471.1-474.40 rule _ {C : context, elemmode? : elemmode?, expr* : expr*, rt : reftype}: `%|-%:%`(C, `ELEM%%*%?`(rt, expr*{expr}, elemmode?{elemmode}), rt) -- (Expr_ok: `%|-%:%`(C, expr, [$valtype_reftype(rt)]))*{expr} -- (Elemmode_ok: `%|-%:%`(C, elemmode, rt))?{elemmode} -;; 3-typing.watsup:404.1-404.77 +;; 3-typing.watsup:445.1-445.77 relation Datamode_ok: `%|-%:OK`(context, datamode) - ;; 3-typing.watsup:445.1-448.45 + ;; 3-typing.watsup:488.1-491.45 rule _ {C : context, expr : expr, mt : memtype}: `%|-%:OK`(C, MEMORY_datamode(0, expr)) -- if (C.MEM_context[0] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} -;; 3-typing.watsup:402.1-402.73 +;; 3-typing.watsup:443.1-443.73 relation Data_ok: `%|-%:OK`(context, data) - ;; 3-typing.watsup:433.1-435.40 + ;; 3-typing.watsup:476.1-478.40 rule _ {C : context, b* : byte*, datamode? : datamode?}: `%|-%:OK`(C, `DATA%*%?`(b*{b}, datamode?{datamode})) -- (Datamode_ok: `%|-%:OK`(C, datamode))?{datamode} -;; 3-typing.watsup:405.1-405.74 +;; 3-typing.watsup:446.1-446.74 relation Start_ok: `%|-%:OK`(context, start) - ;; 3-typing.watsup:450.1-452.39 + ;; 3-typing.watsup:493.1-495.39 rule _ {C : context, x : idx}: `%|-%:OK`(C, START(x)) -- if (C.FUNC_context[x] = `%->%`([], [])) -;; 3-typing.watsup:455.1-455.80 +;; 3-typing.watsup:500.1-500.80 relation Import_ok: `%|-%:%`(context, import, externtype) - ;; 3-typing.watsup:459.1-461.31 + ;; 3-typing.watsup:504.1-506.31 rule _ {C : context, name_1 : name, name_2 : name, xt : externtype}: `%|-%:%`(C, IMPORT(name_1, name_2, xt), xt) -- Externtype_ok: `|-%:OK`(xt) -;; 3-typing.watsup:457.1-457.83 +;; 3-typing.watsup:502.1-502.83 relation Externuse_ok: `%|-%:%`(context, externuse, externtype) - ;; 3-typing.watsup:467.1-469.23 + ;; 3-typing.watsup:512.1-514.23 rule func {C : context, ft : functype, x : idx}: `%|-%:%`(C, FUNC_externuse(x), FUNC_externtype(ft)) -- if (C.FUNC_context[x] = ft) - ;; 3-typing.watsup:471.1-473.25 + ;; 3-typing.watsup:516.1-518.25 rule global {C : context, gt : globaltype, x : idx}: `%|-%:%`(C, GLOBAL_externuse(x), GLOBAL_externtype(gt)) -- if (C.GLOBAL_context[x] = gt) - ;; 3-typing.watsup:475.1-477.24 + ;; 3-typing.watsup:520.1-522.24 rule table {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE_externuse(x), TABLE_externtype(tt)) -- if (C.TABLE_context[x] = tt) - ;; 3-typing.watsup:479.1-481.22 + ;; 3-typing.watsup:524.1-526.22 rule mem {C : context, mt : memtype, x : idx}: `%|-%:%`(C, MEM_externuse(x), MEM_externtype(mt)) -- if (C.MEM_context[x] = mt) -;; 3-typing.watsup:456.1-456.80 +;; 3-typing.watsup:501.1-501.80 relation Export_ok: `%|-%:%`(context, export, externtype) - ;; 3-typing.watsup:463.1-465.39 + ;; 3-typing.watsup:508.1-510.39 rule _ {C : context, externuse : externuse, name : name, xt : externtype}: `%|-%:%`(C, EXPORT(name, externuse), xt) -- Externuse_ok: `%|-%:%`(C, externuse, xt) -;; 3-typing.watsup:484.1-484.62 +;; 3-typing.watsup:531.1-531.62 relation Module_ok: `|-%:OK`(module) - ;; 3-typing.watsup:486.1-500.16 + ;; 3-typing.watsup:533.1-547.16 rule _ {C : context, data^n : data^n, elem* : elem*, export* : export*, ft* : functype*, func* : func*, global* : global*, gt* : globaltype*, import* : import*, mem* : mem*, mt* : memtype*, n : n, rt* : reftype*, start? : start?, table* : table*, tt* : tabletype*}: `|-%:OK`(`MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data^n{data}, start?{start}, export*{export})) -- if (C = {FUNC ft*{ft}, GLOBAL gt*{gt}, TABLE tt*{tt}, MEM mt*{mt}, ELEM rt*{rt}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) @@ -6982,115 +6982,115 @@ relation Module_ok: `|-%:OK`(module) -- (Start_ok: `%|-%:OK`(C, start))?{start} -- if (|mem*{mem}| <= 1) -;; 4-runtime.watsup:3.1-3.39 +;; 4-runtime.watsup:5.1-5.39 syntax addr = nat -;; 4-runtime.watsup:4.1-4.53 +;; 4-runtime.watsup:6.1-6.53 syntax funcaddr = addr -;; 4-runtime.watsup:5.1-5.53 +;; 4-runtime.watsup:7.1-7.53 syntax globaladdr = addr -;; 4-runtime.watsup:6.1-6.51 +;; 4-runtime.watsup:8.1-8.51 syntax tableaddr = addr -;; 4-runtime.watsup:7.1-7.50 +;; 4-runtime.watsup:9.1-9.50 syntax memaddr = addr -;; 4-runtime.watsup:8.1-8.49 +;; 4-runtime.watsup:10.1-10.49 syntax elemaddr = addr -;; 4-runtime.watsup:9.1-9.49 +;; 4-runtime.watsup:11.1-11.49 syntax dataaddr = addr -;; 4-runtime.watsup:10.1-10.51 +;; 4-runtime.watsup:12.1-12.51 syntax labeladdr = addr -;; 4-runtime.watsup:11.1-11.49 +;; 4-runtime.watsup:13.1-13.49 syntax hostaddr = addr -;; 4-runtime.watsup:24.1-25.24 +;; 4-runtime.watsup:30.1-31.24 syntax num = | CONST(numtype, c_numtype) -;; 4-runtime.watsup:26.1-27.67 +;; 4-runtime.watsup:32.1-33.67 syntax ref = | REF.NULL(reftype) | REF.FUNC_ADDR(funcaddr) | REF.HOST_ADDR(hostaddr) -;; 4-runtime.watsup:28.1-29.10 +;; 4-runtime.watsup:34.1-35.10 syntax val = | CONST(numtype, c_numtype) | REF.NULL(reftype) | REF.FUNC_ADDR(funcaddr) | REF.HOST_ADDR(hostaddr) -;; 4-runtime.watsup:31.1-32.18 +;; 4-runtime.watsup:37.1-38.18 syntax result = | _VALS(val*) | TRAP -;; 4-runtime.watsup:38.1-39.66 +;; 4-runtime.watsup:47.1-48.66 syntax externval = | FUNC(funcaddr) | GLOBAL(globaladdr) | TABLE(tableaddr) | MEM(memaddr) -;; 4-runtime.watsup:44.1-44.44 +;; 4-runtime.watsup:55.1-55.44 def default_ : valtype -> val? - ;; 4-runtime.watsup:45.1-45.35 + ;; 4-runtime.watsup:56.1-56.35 def default_(I32_valtype) = ?(CONST_val(I32_numtype, 0)) - ;; 4-runtime.watsup:46.1-46.35 + ;; 4-runtime.watsup:57.1-57.35 def default_(I64_valtype) = ?(CONST_val(I64_numtype, 0)) - ;; 4-runtime.watsup:47.1-47.35 + ;; 4-runtime.watsup:58.1-58.35 def default_(F32_valtype) = ?(CONST_val(F32_numtype, 0)) - ;; 4-runtime.watsup:48.1-48.35 + ;; 4-runtime.watsup:59.1-59.35 def default_(F64_valtype) = ?(CONST_val(F64_numtype, 0)) - ;; 4-runtime.watsup:49.1-49.44 + ;; 4-runtime.watsup:60.1-60.44 def default_(FUNCREF_valtype) = ?(REF.NULL_val(FUNCREF_reftype)) - ;; 4-runtime.watsup:50.1-50.48 + ;; 4-runtime.watsup:61.1-61.48 def default_(EXTERNREF_valtype) = ?(REF.NULL_val(EXTERNREF_reftype)) def {x : valtype} default_(x) = ?() -;; 4-runtime.watsup:72.1-74.22 +;; 4-runtime.watsup:87.1-89.22 syntax exportinst = {NAME name, VALUE externval} -;; 4-runtime.watsup:84.1-91.25 +;; 4-runtime.watsup:91.1-98.25 syntax moduleinst = {FUNC funcaddr*, GLOBAL globaladdr*, TABLE tableaddr*, MEM memaddr*, ELEM elemaddr*, DATA dataaddr*, EXPORT exportinst*} -;; 4-runtime.watsup:55.1-57.16 +;; 4-runtime.watsup:70.1-72.16 syntax funcinst = {MODULE moduleinst, CODE func} -;; 4-runtime.watsup:58.1-60.16 +;; 4-runtime.watsup:73.1-75.16 syntax globalinst = {TYPE globaltype, VALUE val} -;; 4-runtime.watsup:61.1-63.16 +;; 4-runtime.watsup:76.1-78.16 syntax tableinst = {TYPE tabletype, ELEM ref*} -;; 4-runtime.watsup:64.1-66.17 +;; 4-runtime.watsup:79.1-81.17 syntax meminst = {TYPE memtype, DATA byte*} -;; 4-runtime.watsup:67.1-69.16 +;; 4-runtime.watsup:82.1-84.16 syntax eleminst = {TYPE elemtype, ELEM ref*} -;; 4-runtime.watsup:70.1-71.17 +;; 4-runtime.watsup:85.1-86.17 syntax datainst = {DATA byte*} -;; 4-runtime.watsup:76.1-82.21 +;; 4-runtime.watsup:112.1-118.21 syntax store = {FUNC funcinst*, GLOBAL globalinst*, TABLE tableinst*, MEM meminst*, ELEM eleminst*, DATA datainst*} -;; 4-runtime.watsup:93.1-95.24 +;; 4-runtime.watsup:120.1-122.24 syntax frame = {LOCAL val*, MODULE moduleinst} -;; 4-runtime.watsup:96.1-96.47 +;; 4-runtime.watsup:124.1-124.47 syntax state = `%;%`(store, frame) -;; 4-runtime.watsup:183.1-190.5 +;; 4-runtime.watsup:209.1-216.5 rec { -;; 4-runtime.watsup:183.1-190.5 +;; 4-runtime.watsup:209.1-216.5 syntax admininstr = | UNREACHABLE | NOP @@ -7201,122 +7201,122 @@ def admininstr_val : val -> admininstr def {x : funcaddr} admininstr_val(REF.FUNC_ADDR_val(x)) = REF.FUNC_ADDR_admininstr(x) def {x : hostaddr} admininstr_val(REF.HOST_ADDR_val(x)) = REF.HOST_ADDR_admininstr(x) -;; 4-runtime.watsup:97.1-97.62 +;; 4-runtime.watsup:125.1-125.62 syntax config = `%;%*`(state, admininstr*) -;; 4-runtime.watsup:115.1-115.59 +;; 4-runtime.watsup:134.1-134.59 def funcaddr : state -> funcaddr* - ;; 4-runtime.watsup:116.1-116.38 + ;; 4-runtime.watsup:135.1-135.38 def {f : frame, s : store} funcaddr(`%;%`(s, f)) = f.MODULE_frame.FUNC_moduleinst -;; 4-runtime.watsup:118.1-118.52 +;; 4-runtime.watsup:137.1-137.52 def funcinst : state -> funcinst* - ;; 4-runtime.watsup:125.1-125.31 + ;; 4-runtime.watsup:144.1-144.31 def {f : frame, s : store} funcinst(`%;%`(s, f)) = s.FUNC_store -;; 4-runtime.watsup:119.1-119.58 +;; 4-runtime.watsup:138.1-138.58 def globalinst : state -> globalinst* - ;; 4-runtime.watsup:126.1-126.35 + ;; 4-runtime.watsup:145.1-145.35 def {f : frame, s : store} globalinst(`%;%`(s, f)) = s.GLOBAL_store -;; 4-runtime.watsup:120.1-120.55 +;; 4-runtime.watsup:139.1-139.55 def tableinst : state -> tableinst* - ;; 4-runtime.watsup:127.1-127.33 + ;; 4-runtime.watsup:146.1-146.33 def {f : frame, s : store} tableinst(`%;%`(s, f)) = s.TABLE_store -;; 4-runtime.watsup:121.1-121.49 +;; 4-runtime.watsup:140.1-140.49 def meminst : state -> meminst* - ;; 4-runtime.watsup:128.1-128.29 + ;; 4-runtime.watsup:147.1-147.29 def {f : frame, s : store} meminst(`%;%`(s, f)) = s.MEM_store -;; 4-runtime.watsup:122.1-122.52 +;; 4-runtime.watsup:141.1-141.52 def eleminst : state -> eleminst* - ;; 4-runtime.watsup:129.1-129.31 + ;; 4-runtime.watsup:148.1-148.31 def {f : frame, s : store} eleminst(`%;%`(s, f)) = s.ELEM_store -;; 4-runtime.watsup:123.1-123.52 +;; 4-runtime.watsup:142.1-142.52 def datainst : state -> datainst* - ;; 4-runtime.watsup:130.1-130.31 + ;; 4-runtime.watsup:149.1-149.31 def {f : frame, s : store} datainst(`%;%`(s, f)) = s.DATA_store -;; 4-runtime.watsup:132.1-132.67 +;; 4-runtime.watsup:151.1-151.67 def func : (state, funcidx) -> funcinst - ;; 4-runtime.watsup:140.1-140.48 + ;; 4-runtime.watsup:159.1-159.48 def {f : frame, s : store, x : idx} func(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[x]] -;; 4-runtime.watsup:133.1-133.69 +;; 4-runtime.watsup:152.1-152.69 def global : (state, globalidx) -> globalinst - ;; 4-runtime.watsup:141.1-141.54 + ;; 4-runtime.watsup:160.1-160.54 def {f : frame, s : store, x : idx} global(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x]] -;; 4-runtime.watsup:134.1-134.68 +;; 4-runtime.watsup:153.1-153.68 def table : (state, tableidx) -> tableinst - ;; 4-runtime.watsup:142.1-142.51 + ;; 4-runtime.watsup:161.1-161.51 def {f : frame, s : store, x : idx} table(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]] -;; 4-runtime.watsup:135.1-135.66 +;; 4-runtime.watsup:154.1-154.66 def mem : (state, memidx) -> meminst - ;; 4-runtime.watsup:143.1-143.45 + ;; 4-runtime.watsup:162.1-162.45 def {f : frame, s : store, x : idx} mem(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[x]] -;; 4-runtime.watsup:136.1-136.67 +;; 4-runtime.watsup:155.1-155.67 def elem : (state, tableidx) -> eleminst - ;; 4-runtime.watsup:144.1-144.48 + ;; 4-runtime.watsup:163.1-163.48 def {f : frame, s : store, x : idx} elem(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[x]] -;; 4-runtime.watsup:137.1-137.67 +;; 4-runtime.watsup:156.1-156.67 def data : (state, dataidx) -> datainst - ;; 4-runtime.watsup:145.1-145.48 + ;; 4-runtime.watsup:164.1-164.48 def {f : frame, s : store, x : idx} data(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[x]] -;; 4-runtime.watsup:138.1-138.68 +;; 4-runtime.watsup:157.1-157.68 def local : (state, localidx) -> val - ;; 4-runtime.watsup:146.1-146.35 + ;; 4-runtime.watsup:165.1-165.35 def {f : frame, s : store, x : idx} local(`%;%`(s, f), x) = f.LOCAL_frame[x] -;; 4-runtime.watsup:149.1-149.78 +;; 4-runtime.watsup:168.1-168.78 def with_local : (state, localidx, val) -> state - ;; 4-runtime.watsup:158.1-158.52 + ;; 4-runtime.watsup:177.1-177.52 def {f : frame, s : store, v : val, x : idx} with_local(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[x] = v]) -;; 4-runtime.watsup:150.1-150.85 +;; 4-runtime.watsup:169.1-169.85 def with_global : (state, globalidx, val) -> state - ;; 4-runtime.watsup:159.1-159.77 + ;; 4-runtime.watsup:178.1-178.77 def {f : frame, s : store, v : val, x : idx} with_global(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x]].VALUE_globalinst = v], f) -;; 4-runtime.watsup:151.1-151.88 +;; 4-runtime.watsup:170.1-170.88 def with_table : (state, tableidx, nat, ref) -> state - ;; 4-runtime.watsup:160.1-160.79 + ;; 4-runtime.watsup:179.1-179.79 def {f : frame, i : nat, r : ref, s : store, x : idx} with_table(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]].ELEM_tableinst[i] = r], f) -;; 4-runtime.watsup:152.1-152.84 +;; 4-runtime.watsup:171.1-171.84 def with_tableinst : (state, tableidx, tableinst) -> state - ;; 4-runtime.watsup:161.1-161.74 + ;; 4-runtime.watsup:180.1-180.74 def {f : frame, s : store, ti : tableinst, x : idx} with_tableinst(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]] = ti], f) -;; 4-runtime.watsup:153.1-153.93 +;; 4-runtime.watsup:172.1-172.93 def with_mem : (state, memidx, nat, nat, byte*) -> state - ;; 4-runtime.watsup:162.1-162.82 + ;; 4-runtime.watsup:181.1-181.82 def {b* : byte*, f : frame, i : nat, j : nat, s : store, x : idx} with_mem(`%;%`(s, f), x, i, j, b*{b}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x]].DATA_meminst[i : j] = b*{b}], f) -;; 4-runtime.watsup:154.1-154.77 +;; 4-runtime.watsup:173.1-173.77 def with_meminst : (state, memidx, meminst) -> state - ;; 4-runtime.watsup:163.1-163.68 + ;; 4-runtime.watsup:182.1-182.68 def {f : frame, mi : meminst, s : store, x : idx} with_meminst(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x]] = mi], f) -;; 4-runtime.watsup:155.1-155.82 +;; 4-runtime.watsup:174.1-174.82 def with_elem : (state, elemidx, ref*) -> state - ;; 4-runtime.watsup:164.1-164.72 + ;; 4-runtime.watsup:183.1-183.72 def {f : frame, r* : ref*, s : store, x : idx} with_elem(`%;%`(s, f), x, r*{r}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x]].ELEM_eleminst = r*{r}], f) -;; 4-runtime.watsup:156.1-156.82 +;; 4-runtime.watsup:175.1-175.82 def with_data : (state, dataidx, byte*) -> state - ;; 4-runtime.watsup:165.1-165.72 + ;; 4-runtime.watsup:184.1-184.72 def {b* : byte*, f : frame, s : store, x : idx} with_data(`%;%`(s, f), x, b*{b}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x]].DATA_datainst = b*{b}], f) -;; 4-runtime.watsup:167.1-167.63 +;; 4-runtime.watsup:189.1-189.63 def grow_table : (tableinst, nat, ref) -> tableinst? - ;; 4-runtime.watsup:170.1-174.36 + ;; 4-runtime.watsup:192.1-196.36 def {i : nat, i' : nat, j : nat, n : n, r : ref, r'* : ref*, rt : reftype, ti : tableinst, ti' : tableinst} grow_table(ti, n, r) = ?(ti') -- if (ti = {TYPE `%%`(`[%..%]`(i, j), rt), ELEM r'*{r'}}) -- if (i' = (|r'*{r'}| + n)) @@ -7324,9 +7324,9 @@ def grow_table : (tableinst, nat, ref) -> tableinst? -- Tabletype_ok: `|-%:OK`(ti'.TYPE_tableinst) def {x : (tableinst, nat, ref)} grow_table(x) = ?() -;; 4-runtime.watsup:168.1-168.55 +;; 4-runtime.watsup:190.1-190.55 def grow_memory : (meminst, nat) -> meminst? - ;; 4-runtime.watsup:175.1-179.34 + ;; 4-runtime.watsup:198.1-202.34 def {b* : byte*, i : nat, i' : nat, j : nat, mi : meminst, mi' : meminst, n : n} grow_memory(mi, n) = ?(mi') -- if (mi = {TYPE `%I8`(`[%..%]`(i, j)), DATA b*{b}}) -- if (i' = ((|b*{b}| / (64 * $Ki)) + n)) @@ -7334,10 +7334,10 @@ def grow_memory : (meminst, nat) -> meminst? -- Memtype_ok: `|-%:OK`(mi'.TYPE_meminst) def {x : (meminst, nat)} grow_memory(x) = ?() -;; 4-runtime.watsup:192.1-195.21 +;; 4-runtime.watsup:218.1-221.21 rec { -;; 4-runtime.watsup:192.1-195.21 +;; 4-runtime.watsup:218.1-221.21 syntax E = | _HOLE | _SEQ(val*, E, instr*) @@ -7368,172 +7368,172 @@ def wrap_ : ((nat, nat), c_numtype) -> nat ;; 5-numerics.watsup:13.1-13.28 def bytes_ : (nat, c_numtype) -> byte* -;; 6-reduction.watsup:4.1-4.63 +;; 6-reduction.watsup:6.1-6.63 relation Step_pure: `%*~>%*`(admininstr*, admininstr*) - ;; 6-reduction.watsup:16.1-17.24 + ;; 6-reduction.watsup:24.1-25.24 rule unreachable: `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) - ;; 6-reduction.watsup:19.1-20.19 + ;; 6-reduction.watsup:27.1-28.19 rule nop: `%*~>%*`([NOP_admininstr], []) - ;; 6-reduction.watsup:22.1-23.24 + ;; 6-reduction.watsup:30.1-31.24 rule drop {val : val}: `%*~>%*`([$admininstr_val(val) DROP_admininstr], []) - ;; 6-reduction.watsup:26.1-28.16 + ;; 6-reduction.watsup:34.1-36.16 rule select-true {c : c_numtype, t? : valtype?, val_1 : val, val_2 : val}: `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t?{t})], [$admininstr_val(val_1)]) -- if (c =/= 0) - ;; 6-reduction.watsup:30.1-32.14 + ;; 6-reduction.watsup:38.1-40.14 rule select-false {c : c_numtype, t? : valtype?, val_1 : val, val_2 : val}: `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t?{t})], [$admininstr_val(val_2)]) -- if (c = 0) - ;; 6-reduction.watsup:35.1-37.28 + ;; 6-reduction.watsup:45.1-47.28 rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k}: `%*~>%*`($admininstr_val(val)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})], [LABEL__admininstr(n, [], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) -- if (bt = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 6-reduction.watsup:39.1-41.28 + ;; 6-reduction.watsup:49.1-51.28 rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k}: `%*~>%*`($admininstr_val(val)^k{val} :: [LOOP_admininstr(bt, instr*{instr})], [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) -- if (bt = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 6-reduction.watsup:43.1-45.16 + ;; 6-reduction.watsup:53.1-55.16 rule if-true {bt : blocktype, c : c_numtype, 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) - ;; 6-reduction.watsup:47.1-49.14 + ;; 6-reduction.watsup:57.1-59.14 rule if-false {bt : blocktype, c : c_numtype, 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) - ;; 6-reduction.watsup:52.1-53.38 + ;; 6-reduction.watsup:62.1-63.38 rule label-vals {instr* : instr*, n : n, val* : val*}: `%*~>%*`([LABEL__admininstr(n, instr*{instr}, $admininstr_val(val)*{val})], $admininstr_val(val)*{val}) - ;; 6-reduction.watsup:57.1-58.69 + ;; 6-reduction.watsup:69.1-70.69 rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [BR_admininstr(0)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val} :: $admininstr_instr(instr')*{instr'}) - ;; 6-reduction.watsup:60.1-61.65 + ;; 6-reduction.watsup:72.1-73.65 rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val)*{val} :: [BR_admininstr(l + 1)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [BR_admininstr(l)]) - ;; 6-reduction.watsup:64.1-66.16 + ;; 6-reduction.watsup:76.1-78.16 rule br_if-true {c : c_numtype, l : labelidx}: `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) -- if (c =/= 0) - ;; 6-reduction.watsup:68.1-70.14 + ;; 6-reduction.watsup:80.1-82.14 rule br_if-false {c : c_numtype, l : labelidx}: `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) -- if (c = 0) - ;; 6-reduction.watsup:73.1-75.17 + ;; 6-reduction.watsup:85.1-87.17 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}|) - ;; 6-reduction.watsup:77.1-79.18 + ;; 6-reduction.watsup:89.1-91.18 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}|) - ;; 6-reduction.watsup:102.1-103.35 + ;; 6-reduction.watsup:116.1-117.35 rule frame-vals {f : frame, n : n, val^n : val^n}: `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val)^n{val})], $admininstr_val(val)^n{val}) - ;; 6-reduction.watsup:105.1-106.55 + ;; 6-reduction.watsup:119.1-120.55 rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val}) - ;; 6-reduction.watsup:108.1-109.60 + ;; 6-reduction.watsup:122.1-123.60 rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [RETURN_admininstr]) - ;; 6-reduction.watsup:112.1-114.33 + ;; 6-reduction.watsup:128.1-130.33 rule unop-val {c : c_numtype, c_1 : c_numtype, nt : numtype, unop : unop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) -- if ($unop(unop, nt, c_1) = [c]) - ;; 6-reduction.watsup:116.1-118.39 + ;; 6-reduction.watsup:132.1-134.39 rule unop-trap {c_1 : c_numtype, nt : numtype, unop : unop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) -- if ($unop(unop, nt, c_1) = []) - ;; 6-reduction.watsup:121.1-123.40 + ;; 6-reduction.watsup:137.1-139.40 rule binop-val {binop : binop_numtype, c : c_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- if ($binop(binop, nt, c_1, c_2) = [c]) - ;; 6-reduction.watsup:125.1-127.46 + ;; 6-reduction.watsup:141.1-143.46 rule binop-trap {binop : binop_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) -- if ($binop(binop, nt, c_1, c_2) = []) - ;; 6-reduction.watsup:130.1-132.37 + ;; 6-reduction.watsup:146.1-148.37 rule testop {c : c_numtype, c_1 : c_numtype, nt : numtype, testop : testop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $testop(testop, nt, c_1)) - ;; 6-reduction.watsup:134.1-136.40 + ;; 6-reduction.watsup:150.1-152.40 rule relop {c : c_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype, relop : relop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $relop(relop, nt, c_1, c_2)) - ;; 6-reduction.watsup:139.1-140.70 + ;; 6-reduction.watsup:155.1-156.70 rule extend {c : c_numtype, n : n, nt : numtype, o0 : nat}: `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, o0, S_sx, c))]) -- if ($size($valtype_numtype(nt)) = ?(o0)) - ;; 6-reduction.watsup:143.1-145.48 + ;; 6-reduction.watsup:159.1-161.48 rule cvtop-val {c : c_numtype, c_1 : c_numtype, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) -- if ($cvtop(nt_1, cvtop, nt_2, sx?{sx}, c_1) = [c]) - ;; 6-reduction.watsup:147.1-149.54 + ;; 6-reduction.watsup:163.1-165.54 rule cvtop-trap {c_1 : c_numtype, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) -- if ($cvtop(nt_1, cvtop, nt_2, sx?{sx}, c_1) = []) - ;; 6-reduction.watsup:156.1-158.28 + ;; 6-reduction.watsup:174.1-176.28 rule ref.is_null-true {rt : reftype, val : val}: `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) -- if (val = REF.NULL_val(rt)) - ;; 6-reduction.watsup:160.1-162.15 + ;; 6-reduction.watsup:178.1-180.15 rule ref.is_null-false {val : val}: `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 6-reduction.watsup:171.1-172.47 + ;; 6-reduction.watsup:191.1-192.47 rule local.tee {val : val, x : idx}: `%*~>%*`([$admininstr_val(val) LOCAL.TEE_admininstr(x)], [$admininstr_val(val) $admininstr_val(val) LOCAL.SET_admininstr(x)]) -;; 6-reduction.watsup:5.1-5.63 +;; 6-reduction.watsup:7.1-7.63 relation Step_read: `%~>%*`(config, admininstr*) - ;; 6-reduction.watsup:82.1-83.47 + ;; 6-reduction.watsup:96.1-97.47 rule call {x : idx, z : state}: `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [CALL_ADDR_admininstr($funcaddr(z)[x])]) - ;; 6-reduction.watsup:85.1-89.17 + ;; 6-reduction.watsup:99.1-103.17 rule call_indirect-call {a : addr, ft : functype, ft' : functype, i : nat, instr* : instr*, t* : valtype*, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CALL_INDIRECT_admininstr(x, ft)]), [CALL_ADDR_admininstr(a)]) -- if ($table(z, x).ELEM_tableinst[i] = REF.FUNC_ADDR_ref(a)) -- if ($funcinst(z)[a].CODE_funcinst = `FUNC%%*%`(ft', t*{t}, instr*{instr})) -- if (ft = ft') - ;; 6-reduction.watsup:91.1-93.15 + ;; 6-reduction.watsup:105.1-107.15 rule call_indirect-trap {ft : functype, i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CALL_INDIRECT_admininstr(x, ft)]), [TRAP_admininstr]) -- otherwise - ;; 6-reduction.watsup:95.1-99.52 + ;; 6-reduction.watsup:109.1-113.52 rule call_addr {a : addr, f : frame, func : func, instr* : instr*, k : nat, m : moduleinst, n : n, t* : valtype*, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state, o0* : val*}: `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [CALL_ADDR_admininstr(a)]), [FRAME__admininstr(n, f, [LABEL__admininstr(n, [], $admininstr_instr(instr)*{instr})])]) -- (if ($default_(t) = ?(o0)))*{t o0} @@ -7541,319 +7541,308 @@ relation Step_read: `%~>%*`(config, admininstr*) -- if (func = `FUNC%%*%`(`%->%`(t_1^k{t_1}, t_2^n{t_2}), t*{t}, instr*{instr})) -- if (f = {LOCAL val^k{val} :: o0*{o0}, MODULE m}) - ;; 6-reduction.watsup:152.1-153.53 + ;; 6-reduction.watsup:170.1-171.53 rule ref.func {x : idx, z : state}: `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) - ;; 6-reduction.watsup:165.1-166.37 + ;; 6-reduction.watsup:185.1-186.37 rule local.get {x : idx, z : state}: `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [$admininstr_val($local(z, x))]) - ;; 6-reduction.watsup:175.1-176.45 + ;; 6-reduction.watsup:197.1-198.45 rule global.get {x : idx, z : state}: `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [$admininstr_val($global(z, x).VALUE_globalinst)]) - ;; 6-reduction.watsup:182.1-184.33 + ;; 6-reduction.watsup:206.1-208.33 rule table.get-trap {i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:186.1-188.32 + ;; 6-reduction.watsup:210.1-212.32 rule table.get-val {i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [$admininstr_ref($table(z, x).ELEM_tableinst[i])]) -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:199.1-201.32 + ;; 6-reduction.watsup:223.1-225.32 rule table.size {n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) -- if (|$table(z, x).ELEM_tableinst| = n) - ;; 6-reduction.watsup:212.1-214.39 + ;; 6-reduction.watsup:236.1-238.39 rule table.fill-trap {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:216.1-219.14 + ;; 6-reduction.watsup:240.1-243.14 rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:221.1-225.15 + ;; 6-reduction.watsup:245.1-249.15 rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) -- otherwise - ;; 6-reduction.watsup:228.1-230.73 + ;; 6-reduction.watsup:252.1-254.73 rule table.copy-trap {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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|)) - ;; 6-reduction.watsup:232.1-235.14 + ;; 6-reduction.watsup:256.1-259.14 rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:237.1-242.15 + ;; 6-reduction.watsup:261.1-266.15 rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:244.1-248.15 + ;; 6-reduction.watsup:268.1-272.15 rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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 - ;; 6-reduction.watsup:251.1-253.72 + ;; 6-reduction.watsup:275.1-277.72 rule table.init-trap {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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|)) - ;; 6-reduction.watsup:255.1-258.14 + ;; 6-reduction.watsup:279.1-282.14 rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:260.1-264.15 + ;; 6-reduction.watsup:284.1-288.15 rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) $admininstr_ref($elem(z, y).ELEM_eleminst[i]) 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 - ;; 6-reduction.watsup:271.1-273.53 + ;; 6-reduction.watsup:297.1-299.53 rule load-num-trap {i : nat, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), n_A, n_O)]), [TRAP_admininstr]) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if (((i + n_O) + (o0 / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:275.1-277.71 + ;; 6-reduction.watsup:301.1-303.71 rule load-num-val {c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat, o1 : nat}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), n_A, n_O)]), [CONST_admininstr(nt, c)]) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if ($size($valtype_numtype(nt)) = ?(o1)) -- if ($bytes_(o0, c) = $mem(z, 0).DATA_meminst[(i + n_O) : (o1 / 8)]) - ;; 6-reduction.watsup:279.1-281.45 + ;; 6-reduction.watsup:305.1-307.45 rule load-pack-trap {i : nat, n : n, n_A : n, n_O : n, nt : numtype, sx : sx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), n_A, n_O)]), [TRAP_admininstr]) -- if (((i + n_O) + (n / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:283.1-285.55 + ;; 6-reduction.watsup:309.1-311.55 rule load-pack-val {c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, sx : sx, z : state, o0 : nat}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), n_A, n_O)]), [CONST_admininstr(nt, $ext(n, o0, sx, c))]) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if ($bytes_(n, c) = $mem(z, 0).DATA_meminst[(i + n_O) : (n / 8)]) - ;; 6-reduction.watsup:305.1-307.44 + ;; 6-reduction.watsup:331.1-333.44 rule memory.size {n : n, z : state}: `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr]), [CONST_admininstr(I32_numtype, n)]) -- if (((n * 64) * $Ki) = |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:318.1-320.37 + ;; 6-reduction.watsup:344.1-346.37 rule memory.fill-trap {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), [TRAP_admininstr]) -- if ((i + n) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:322.1-325.14 + ;; 6-reduction.watsup:348.1-351.14 rule memory.fill-zero {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:327.1-331.15 + ;; 6-reduction.watsup:353.1-357.15 rule memory.fill-succ {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr]) -- otherwise - ;; 6-reduction.watsup:334.1-336.69 + ;; 6-reduction.watsup:360.1-362.69 rule memory.copy-trap {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [TRAP_admininstr]) -- if (((i + n) > |$mem(z, 0).DATA_meminst|) \/ ((j + n) > |$mem(z, 0).DATA_meminst|)) - ;; 6-reduction.watsup:338.1-341.14 + ;; 6-reduction.watsup:364.1-367.14 rule memory.copy-zero {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:343.1-348.15 + ;; 6-reduction.watsup:369.1-374.15 rule memory.copy-le {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) LOAD_admininstr(I32_numtype, ?((8, U_sx)), 0, 0) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr]) -- otherwise -- if (j <= i) - ;; 6-reduction.watsup:350.1-354.15 + ;; 6-reduction.watsup:376.1-380.15 rule memory.copy-gt {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), 0, 0) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr]) -- otherwise - ;; 6-reduction.watsup:357.1-359.70 + ;; 6-reduction.watsup:383.1-385.70 rule memory.init-trap {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), [TRAP_admininstr]) -- if (((i + n) > |$data(z, x).DATA_datainst|) \/ ((j + n) > |$mem(z, 0).DATA_meminst|)) - ;; 6-reduction.watsup:361.1-364.14 + ;; 6-reduction.watsup:387.1-390.14 rule memory.init-zero {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:366.1-370.15 + ;; 6-reduction.watsup:392.1-396.15 rule memory.init-succ {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, x).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x)]) -- otherwise -;; 6-reduction.watsup:3.1-3.63 +;; 6-reduction.watsup:5.1-5.63 relation Step: `%~>%`(config, config) - ;; 6-reduction.watsup:7.1-9.34 + ;; 6-reduction.watsup:9.1-11.34 rule pure {instr* : instr*, instr'* : instr*, z : state}: `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) -- Step_pure: `%*~>%*`($admininstr_instr(instr)*{instr}, $admininstr_instr(instr')*{instr'}) - ;; 6-reduction.watsup:11.1-13.37 + ;; 6-reduction.watsup:13.1-15.37 rule read {instr* : instr*, instr'* : instr*, z : state}: `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) -- Step_read: `%~>%*`(`%;%*`(z, $admininstr_instr(instr)*{instr}), $admininstr_instr(instr')*{instr'}) - ;; 6-reduction.watsup:168.1-169.60 + ;; 6-reduction.watsup:188.1-189.60 rule local.set {val : val, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_val(val) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) - ;; 6-reduction.watsup:178.1-179.62 + ;; 6-reduction.watsup:200.1-201.62 rule global.set {val : val, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_val(val) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) - ;; 6-reduction.watsup:190.1-192.33 + ;; 6-reduction.watsup:214.1-216.33 rule table.set-trap {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:194.1-196.32 + ;; 6-reduction.watsup:218.1-220.32 rule table.set-val {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:204.1-206.47 + ;; 6-reduction.watsup:228.1-230.47 rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state, o0 : tableinst}: `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) -- if ($grow_table($table(z, x), n, ref) = ?(o0)) -- if (o0 = ti) - ;; 6-reduction.watsup:208.1-209.64 + ;; 6-reduction.watsup:232.1-233.64 rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, - 1)])) - ;; 6-reduction.watsup:267.1-268.59 + ;; 6-reduction.watsup:291.1-292.59 rule elem.drop {x : idx, z : state}: `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) - ;; 6-reduction.watsup:288.1-290.53 + ;; 6-reduction.watsup:314.1-316.53 rule store-num-trap {c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), n_A, n_O)]), `%;%*`(z, [TRAP_admininstr])) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if (((i + n_O) + (o0 / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:292.1-294.35 + ;; 6-reduction.watsup:318.1-320.35 rule store-num-val {b* : byte*, c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat, o1 : nat}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), n_A, n_O)]), `%;%*`($with_mem(z, 0, (i + n_O), (o0 / 8), b*{b}), [])) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if ($size($valtype_numtype(nt)) = ?(o1)) -- if (b*{b} = $bytes_(o1, c)) - ;; 6-reduction.watsup:296.1-298.45 + ;; 6-reduction.watsup:322.1-324.45 rule store-pack-trap {c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), n_A, n_O)]), `%;%*`(z, [TRAP_admininstr])) -- if (((i + n_O) + (n / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:300.1-302.50 + ;; 6-reduction.watsup:326.1-328.50 rule store-pack-val {b* : byte*, c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), n_A, n_O)]), `%;%*`($with_mem(z, 0, (i + n_O), (n / 8), b*{b}), [])) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if (b*{b} = $bytes_(n, $wrap_((o0, n), c))) - ;; 6-reduction.watsup:310.1-312.41 + ;; 6-reduction.watsup:336.1-338.41 rule memory.grow-succeed {mi : meminst, n : n, z : state, o0 : meminst}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr]), `%;%*`($with_meminst(z, 0, mi), [CONST_admininstr(I32_numtype, (|$mem(z, 0).DATA_meminst| / (64 * $Ki)))])) -- if ($grow_memory($mem(z, 0), n) = ?(o0)) -- if (o0 = mi) - ;; 6-reduction.watsup:314.1-315.59 + ;; 6-reduction.watsup:340.1-341.59 rule memory.grow-fail {n : n, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr]), `%;%*`(z, [CONST_admininstr(I32_numtype, - 1)])) - ;; 6-reduction.watsup:373.1-374.59 + ;; 6-reduction.watsup:399.1-400.59 rule data.drop {x : idx, z : state}: `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) -;; 7-module.watsup:4.1-4.35 +;; 7-module.watsup:5.1-5.35 rec { -;; 7-module.watsup:4.1-4.35 +;; 7-module.watsup:5.1-5.35 def funcs : externval* -> funcaddr* - ;; 7-module.watsup:5.1-5.30 + ;; 7-module.watsup:6.1-6.30 def funcs([]) = [] - ;; 7-module.watsup:6.1-6.59 + ;; 7-module.watsup:7.1-7.59 def {externval'* : externval*, fa : funcaddr} funcs([FUNC_externval(fa)] :: externval'*{externval'}) = [fa] :: $funcs(externval'*{externval'}) - ;; 7-module.watsup:7.1-8.15 + ;; 7-module.watsup:8.1-9.15 def {externval : externval, externval'* : externval*} funcs([externval] :: externval'*{externval'}) = $funcs(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:10.1-10.39 +;; 7-module.watsup:11.1-11.39 rec { -;; 7-module.watsup:10.1-10.39 +;; 7-module.watsup:11.1-11.39 def globals : externval* -> globaladdr* - ;; 7-module.watsup:11.1-11.32 + ;; 7-module.watsup:12.1-12.32 def globals([]) = [] - ;; 7-module.watsup:12.1-12.65 + ;; 7-module.watsup:13.1-13.65 def {externval'* : externval*, ga : globaladdr} globals([GLOBAL_externval(ga)] :: externval'*{externval'}) = [ga] :: $globals(externval'*{externval'}) - ;; 7-module.watsup:13.1-14.15 + ;; 7-module.watsup:14.1-15.15 def {externval : externval, externval'* : externval*} globals([externval] :: externval'*{externval'}) = $globals(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:16.1-16.37 +;; 7-module.watsup:17.1-17.37 rec { -;; 7-module.watsup:16.1-16.37 +;; 7-module.watsup:17.1-17.37 def tables : externval* -> tableaddr* - ;; 7-module.watsup:17.1-17.31 + ;; 7-module.watsup:18.1-18.31 def tables([]) = [] - ;; 7-module.watsup:18.1-18.62 + ;; 7-module.watsup:19.1-19.62 def {externval'* : externval*, ta : tableaddr} tables([TABLE_externval(ta)] :: externval'*{externval'}) = [ta] :: $tables(externval'*{externval'}) - ;; 7-module.watsup:19.1-20.15 + ;; 7-module.watsup:20.1-21.15 def {externval : externval, externval'* : externval*} tables([externval] :: externval'*{externval'}) = $tables(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:22.1-22.33 +;; 7-module.watsup:23.1-23.33 rec { -;; 7-module.watsup:22.1-22.33 +;; 7-module.watsup:23.1-23.33 def mems : externval* -> memaddr* - ;; 7-module.watsup:23.1-23.29 + ;; 7-module.watsup:24.1-24.29 def mems([]) = [] - ;; 7-module.watsup:24.1-24.56 + ;; 7-module.watsup:25.1-25.56 def {externval'* : externval*, ma : memaddr} mems([MEM_externval(ma)] :: externval'*{externval'}) = [ma] :: $mems(externval'*{externval'}) - ;; 7-module.watsup:25.1-26.15 + ;; 7-module.watsup:26.1-27.15 def {externval : externval, externval'* : externval*} mems([externval] :: externval'*{externval'}) = $mems(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:29.1-29.83 -def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst - ;; 7-module.watsup:30.1-30.95 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externuse(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} - ;; 7-module.watsup:31.1-31.99 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externuse(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} - ;; 7-module.watsup:32.1-32.97 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externuse(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} - ;; 7-module.watsup:33.1-33.93 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externuse(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} - ;; 7-module.watsup:36.1-36.60 def allocfunc : (store, moduleinst, func) -> (store, funcaddr) ;; 7-module.watsup:37.1-38.37 @@ -7968,9 +7957,20 @@ def allocdatas : (store, byte**) -> (store, dataaddr*) -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) } -;; 7-module.watsup:97.1-97.81 +;; 7-module.watsup:99.1-99.83 +def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst + ;; 7-module.watsup:100.1-100.95 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externuse(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} + ;; 7-module.watsup:101.1-101.99 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externuse(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} + ;; 7-module.watsup:102.1-102.97 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externuse(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} + ;; 7-module.watsup:103.1-103.93 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externuse(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} + +;; 7-module.watsup:106.1-106.81 def allocmodule : (store, module, externval*, val*, ref**) -> (store, moduleinst) - ;; 7-module.watsup:98.1-135.54 + ;; 7-module.watsup:107.1-144.54 def {byte*^n_data : byte*^n_data, da* : dataaddr*, datamode?^n_data : datamode?^n_data, ea* : elemaddr*, elemmode?^n_elem : elemmode?^n_elem, export* : export*, expr_1^n_global : expr^n_global, expr_2*^n_elem : expr*^n_elem, externval* : externval*, fa* : funcaddr*, fa_ex* : funcaddr*, func^n_func : func^n_func, ga* : globaladdr*, ga_ex* : globaladdr*, globaltype^n_global : globaltype^n_global, i_data^n_data : nat^n_data, i_elem^n_elem : nat^n_elem, i_func^n_func : nat^n_func, i_global^n_global : nat^n_global, i_mem^n_mem : nat^n_mem, i_table^n_table : nat^n_table, import* : import*, m : moduleinst, ma* : memaddr*, ma_ex* : memaddr*, memtype^n_mem : memtype^n_mem, module : module, n_data : n, n_elem : n, n_func : n, n_global : n, n_mem : n, n_table : n, ref** : ref**, rt^n_elem : reftype^n_elem, s : store, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store, s_6 : store, start? : start?, ta* : tableaddr*, ta_ex* : tableaddr*, tabletype^n_table : tabletype^n_table, val* : val*, xi* : exportinst*} allocmodule(s, module, externval*{externval}, val*{val}, ref*{ref}*{ref}) = (s_6, m) -- if (module = `MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func^n_func{func}, GLOBAL(globaltype, expr_1)^n_global{expr_1 globaltype}, TABLE(tabletype)^n_table{tabletype}, MEMORY(memtype)^n_mem{memtype}, `ELEM%%*%?`(rt, expr_2*{expr_2}, elemmode?{elemmode})^n_elem{elemmode expr_2 rt}, `DATA%*%?`(byte*{byte}, datamode?{datamode})^n_data{byte datamode}, start?{start}, export*{export})) -- if (fa_ex*{fa_ex} = $funcs(externval*{externval})) @@ -7992,39 +7992,39 @@ def allocmodule : (store, module, externval*, val*, ref**) -> (store, moduleinst -- if ((s_5, ea*{ea}) = $allocelems(s_4, rt^n_elem{rt}, ref*{ref}*{ref})) -- if ((s_6, da*{da}) = $allocdatas(s_5, byte*{byte}^n_data{byte})) -;; 7-module.watsup:138.1-138.33 +;; 7-module.watsup:151.1-151.36 +rec { + +;; 7-module.watsup:151.1-151.36 +def concat_instr : instr** -> instr* + ;; 7-module.watsup:152.1-152.37 + def concat_instr([]) = [] + ;; 7-module.watsup:153.1-153.68 + def {instr* : instr*, instr'** : instr**} concat_instr([instr]*{instr} :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) +} + +;; 7-module.watsup:155.1-155.33 def runelem : (elem, idx) -> instr* - ;; 7-module.watsup:139.1-139.46 + ;; 7-module.watsup:156.1-156.46 def {expr* : expr*, i : nat, reftype : reftype} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?()), i) = [] - ;; 7-module.watsup:140.1-140.62 + ;; 7-module.watsup:157.1-157.62 def {expr* : expr*, i : nat, reftype : reftype} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?(DECLARE_elemmode)), i) = [ELEM.DROP_instr(i)] - ;; 7-module.watsup:141.1-143.20 + ;; 7-module.watsup:158.1-160.20 def {expr* : expr*, i : nat, instr* : instr*, n : n, reftype : reftype, x : idx} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?(TABLE_elemmode(x, instr*{instr}))), i) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, n) TABLE.INIT_instr(x, i) ELEM.DROP_instr(i)] -- if (n = |expr*{expr}|) -;; 7-module.watsup:145.1-145.33 +;; 7-module.watsup:162.1-162.33 def rundata : (data, idx) -> instr* - ;; 7-module.watsup:146.1-146.38 + ;; 7-module.watsup:163.1-163.38 def {byte* : byte*, i : nat} rundata(`DATA%*%?`(byte*{byte}, ?()), i) = [] - ;; 7-module.watsup:147.1-149.20 + ;; 7-module.watsup:164.1-166.20 def {byte* : byte*, i : nat, instr* : instr*, n : n} rundata(`DATA%*%?`(byte*{byte}, ?(MEMORY_datamode(0, instr*{instr}))), i) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, n) MEMORY.INIT_instr(i) DATA.DROP_instr(i)] -- if (n = |byte*{byte}|) -;; 7-module.watsup:152.1-152.36 -rec { - -;; 7-module.watsup:152.1-152.36 -def concat_instr : instr** -> instr* - ;; 7-module.watsup:153.1-153.37 - def concat_instr([]) = [] - ;; 7-module.watsup:154.1-154.68 - def {instr* : instr*, instr'** : instr**} concat_instr([instr]*{instr} :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) -} - -;; 7-module.watsup:157.1-157.55 -def instantiation : (store, module, externval*) -> config - ;; 7-module.watsup:158.1-180.28 - def {data* : data*, elem* : elem*, elemmode?* : elemmode?*, export* : export*, externval* : externval*, f : frame, f_init : frame, func* : func*, global* : global*, globaltype* : globaltype*, i^n_elem : nat^n_elem, import* : import*, instr_1** : instr**, instr_2*** : instr***, instr_data* : instr*, instr_elem* : instr*, j^n_data : nat^n_data, m : moduleinst, m_init : moduleinst, mem* : mem*, module : module, n_data : n, n_elem : n, ref** : ref**, reftype* : reftype*, s : store, s' : store, start? : start?, table* : table*, val* : val*, x? : idx?} instantiation(s, module, externval*{externval}) = `%;%*`(`%;%`(s', f), $admininstr_instr(instr_elem)*{instr_elem} :: $admininstr_instr(instr_data)*{instr_data} :: CALL_admininstr(x)?{x}) +;; 7-module.watsup:168.1-168.53 +def instantiate : (store, module, externval*) -> config + ;; 7-module.watsup:169.1-191.28 + def {data* : data*, elem* : elem*, elemmode?* : elemmode?*, export* : export*, externval* : externval*, f : frame, f_init : frame, func* : func*, global* : global*, globaltype* : globaltype*, i^n_elem : nat^n_elem, import* : import*, instr_1** : instr**, instr_2*** : instr***, instr_data* : instr*, instr_elem* : instr*, j^n_data : nat^n_data, m : moduleinst, m_init : moduleinst, mem* : mem*, module : module, n_data : n, n_elem : n, ref** : ref**, reftype* : reftype*, s : store, s' : store, start? : start?, table* : table*, val* : val*, x? : idx?} instantiate(s, module, externval*{externval}) = `%;%*`(`%;%`(s', f), $admininstr_instr(instr_elem)*{instr_elem} :: $admininstr_instr(instr_data)*{instr_data} :: CALL_admininstr(x)?{x}) -- if (module = `MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data*{data}, start?{start}, export*{export})) -- if (m_init = {FUNC $funcs(externval*{externval}), GLOBAL $globals(externval*{externval}), TABLE [], MEM [], ELEM [], DATA [], EXPORT []}) -- if (f_init = {LOCAL [], MODULE m_init}) @@ -8040,10 +8040,10 @@ def instantiation : (store, module, externval*) -> config -- if (instr_data*{instr_data} = $concat_instr($rundata(data*{data}[j], j)^(j config - ;; 7-module.watsup:184.1-196.52 - def {expr : expr, f : frame, fa : funcaddr, functype : functype, k : nat, m : moduleinst, n : n, s : store, val^n : val^n, valtype* : valtype*, valtype_param^n : valtype^n, valtype_res^k : valtype^k} invocation(s, fa, val^n{val}) = `%;%*`(`%;%`(s, f), $admininstr_val(val)^n{val} :: [CALL_ADDR_admininstr(fa)]) +;; 7-module.watsup:198.1-198.44 +def invoke : (store, funcaddr, val*) -> config + ;; 7-module.watsup:199.1-211.52 + def {expr : expr, f : frame, fa : funcaddr, functype : functype, k : nat, m : moduleinst, n : n, s : store, val^n : val^n, valtype* : valtype*, valtype_param^n : valtype^n, valtype_res^k : valtype^k} invoke(s, fa, val^n{val}) = `%;%*`(`%;%`(s, f), $admininstr_val(val)^n{val} :: [CALL_ADDR_admininstr(fa)]) -- if (m = {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], EXPORT []}) -- if (f = {LOCAL [], MODULE m}) -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = `FUNC%%*%`(functype, valtype*{valtype}, expr)) @@ -8394,49 +8394,49 @@ syntax import = IMPORT(name, name, externtype) ;; 1-syntax.watsup:212.1-213.70 syntax module = `MODULE%*%*%*%*%*%*%*%?%*`(import*, func*, global*, table*, mem*, elem*, data*, start?, export*) -;; 2-aux.watsup:3.1-3.14 +;; 2-aux.watsup:7.1-7.14 def Ki : nat - ;; 2-aux.watsup:4.1-4.15 + ;; 2-aux.watsup:8.1-8.15 def Ki = 1024 -;; 2-aux.watsup:9.1-9.25 +;; 2-aux.watsup:13.1-13.25 rec { -;; 2-aux.watsup:9.1-9.25 +;; 2-aux.watsup:13.1-13.25 def min : (nat, nat) -> nat - ;; 2-aux.watsup:10.1-10.19 + ;; 2-aux.watsup:14.1-14.19 def {j : nat} min(0, j) = 0 - ;; 2-aux.watsup:11.1-11.19 + ;; 2-aux.watsup:15.1-15.19 def {i : nat} min(i, 0) = 0 - ;; 2-aux.watsup:12.1-12.38 + ;; 2-aux.watsup:16.1-16.38 def {i : nat, j : nat} min((i + 1), (j + 1)) = $min(i, j) } -;; 2-aux.watsup:19.1-19.55 +;; 2-aux.watsup:27.1-27.55 def size : valtype -> nat? - ;; 2-aux.watsup:20.1-20.20 + ;; 2-aux.watsup:28.1-28.20 def size(I32_valtype) = ?(32) - ;; 2-aux.watsup:21.1-21.20 + ;; 2-aux.watsup:29.1-29.20 def size(I64_valtype) = ?(64) - ;; 2-aux.watsup:22.1-22.20 + ;; 2-aux.watsup:30.1-30.20 def size(F32_valtype) = ?(32) - ;; 2-aux.watsup:23.1-23.20 + ;; 2-aux.watsup:31.1-31.20 def size(F64_valtype) = ?(64) - ;; 2-aux.watsup:24.1-24.22 + ;; 2-aux.watsup:32.1-32.22 def size(V128_valtype) = ?(128) def {x : valtype} size(x) = ?() -;; 2-aux.watsup:29.1-29.40 +;; 2-aux.watsup:40.1-40.40 def test_sub_ATOM_22 : n -> nat - ;; 2-aux.watsup:30.1-30.38 + ;; 2-aux.watsup:41.1-41.38 def {n_3_ATOM_y : n} test_sub_ATOM_22(n_3_ATOM_y) = 0 -;; 2-aux.watsup:32.1-32.26 +;; 2-aux.watsup:43.1-43.26 def curried_ : (n, n) -> nat - ;; 2-aux.watsup:33.1-33.39 + ;; 2-aux.watsup:44.1-44.39 def {n_1 : n, n_2 : n} curried_(n_1, n_2) = (n_1 + n_2) -;; 2-aux.watsup:35.1-44.39 +;; 2-aux.watsup:46.1-55.39 syntax testfuse = | AB_(nat, nat, nat) | CD(nat, nat, nat) @@ -8448,249 +8448,249 @@ syntax testfuse = | OP(nat, nat, nat) | QR(nat, nat, nat) -;; 3-typing.watsup:3.1-6.60 +;; 3-typing.watsup:5.1-8.60 syntax context = {FUNC functype*, GLOBAL globaltype*, TABLE tabletype*, MEM memtype*, ELEM elemtype*, DATA datatype*, LOCAL valtype*, LABEL resulttype*, RETURN resulttype?} -;; 3-typing.watsup:14.1-14.66 +;; 3-typing.watsup:18.1-18.66 relation Limits_ok: `|-%:%`(limits, nat) - ;; 3-typing.watsup:22.1-24.24 + ;; 3-typing.watsup:26.1-28.24 rule _ {k : nat, n_1 : n, n_2 : n}: `|-%:%`(`[%..%]`(n_1, n_2), k) -- if ((n_1 <= n_2) /\ (n_2 <= k)) -;; 3-typing.watsup:15.1-15.64 +;; 3-typing.watsup:19.1-19.64 relation Functype_ok: `|-%:OK`(functype) - ;; 3-typing.watsup:26.1-27.13 + ;; 3-typing.watsup:30.1-31.13 rule _ {ft : functype}: `|-%:OK`(ft) -;; 3-typing.watsup:16.1-16.66 +;; 3-typing.watsup:20.1-20.66 relation Globaltype_ok: `|-%:OK`(globaltype) - ;; 3-typing.watsup:29.1-30.13 + ;; 3-typing.watsup:33.1-34.13 rule _ {gt : globaltype}: `|-%:OK`(gt) -;; 3-typing.watsup:17.1-17.65 +;; 3-typing.watsup:21.1-21.65 relation Tabletype_ok: `|-%:OK`(tabletype) - ;; 3-typing.watsup:32.1-34.35 + ;; 3-typing.watsup:36.1-38.35 rule _ {lim : limits, rt : reftype}: `|-%:OK`(`%%`(lim, rt)) -- Limits_ok: `|-%:%`(lim, ((2 ^ 32) - 1)) -;; 3-typing.watsup:18.1-18.63 +;; 3-typing.watsup:22.1-22.63 relation Memtype_ok: `|-%:OK`(memtype) - ;; 3-typing.watsup:36.1-38.33 + ;; 3-typing.watsup:40.1-42.33 rule _ {lim : limits}: `|-%:OK`(`%I8`(lim)) -- Limits_ok: `|-%:%`(lim, (2 ^ 16)) -;; 3-typing.watsup:19.1-19.66 +;; 3-typing.watsup:23.1-23.66 relation Externtype_ok: `|-%:OK`(externtype) - ;; 3-typing.watsup:41.1-43.35 + ;; 3-typing.watsup:45.1-47.35 rule func {functype : functype}: `|-%:OK`(FUNC_externtype(functype)) -- Functype_ok: `|-%:OK`(functype) - ;; 3-typing.watsup:45.1-47.39 + ;; 3-typing.watsup:49.1-51.39 rule global {globaltype : globaltype}: `|-%:OK`(GLOBAL_externtype(globaltype)) -- Globaltype_ok: `|-%:OK`(globaltype) - ;; 3-typing.watsup:49.1-51.37 + ;; 3-typing.watsup:53.1-55.37 rule table {tabletype : tabletype}: `|-%:OK`(TABLE_externtype(tabletype)) -- Tabletype_ok: `|-%:OK`(tabletype) - ;; 3-typing.watsup:53.1-55.33 + ;; 3-typing.watsup:57.1-59.33 rule mem {memtype : memtype}: `|-%:OK`(MEM_externtype(memtype)) -- Memtype_ok: `|-%:OK`(memtype) -;; 3-typing.watsup:61.1-61.65 +;; 3-typing.watsup:69.1-69.65 relation Valtype_sub: `|-%<:%`(valtype, valtype) - ;; 3-typing.watsup:64.1-65.12 + ;; 3-typing.watsup:72.1-73.12 rule refl {t : valtype}: `|-%<:%`(t, t) - ;; 3-typing.watsup:67.1-68.14 + ;; 3-typing.watsup:75.1-76.14 rule bot {t : valtype}: `|-%<:%`(BOT_valtype, t) -;; 3-typing.watsup:62.1-62.72 +;; 3-typing.watsup:70.1-70.72 relation Resulttype_sub: `|-%*<:%*`(valtype*, valtype*) - ;; 3-typing.watsup:70.1-72.35 + ;; 3-typing.watsup:78.1-80.35 rule _ {t_1* : valtype*, t_2* : valtype*}: `|-%*<:%*`(t_1*{t_1}, t_2*{t_2}) -- (Valtype_sub: `|-%<:%`(t_1, t_2))*{t_1 t_2} -;; 3-typing.watsup:75.1-75.75 +;; 3-typing.watsup:85.1-85.75 relation Limits_sub: `|-%<:%`(limits, limits) - ;; 3-typing.watsup:83.1-86.21 + ;; 3-typing.watsup:93.1-96.21 rule _ {n_11 : n, n_12 : n, n_21 : n, n_22 : n}: `|-%<:%`(`[%..%]`(n_11, n_12), `[%..%]`(n_21, n_22)) -- if (n_11 >= n_21) -- if (n_12 <= n_22) -;; 3-typing.watsup:76.1-76.73 +;; 3-typing.watsup:86.1-86.73 relation Functype_sub: `|-%<:%`(functype, functype) - ;; 3-typing.watsup:88.1-89.14 + ;; 3-typing.watsup:98.1-99.14 rule _ {ft : functype}: `|-%<:%`(ft, ft) -;; 3-typing.watsup:77.1-77.75 +;; 3-typing.watsup:87.1-87.75 relation Globaltype_sub: `|-%<:%`(globaltype, globaltype) - ;; 3-typing.watsup:91.1-92.14 + ;; 3-typing.watsup:101.1-102.14 rule _ {gt : globaltype}: `|-%<:%`(gt, gt) -;; 3-typing.watsup:78.1-78.74 +;; 3-typing.watsup:88.1-88.74 relation Tabletype_sub: `|-%<:%`(tabletype, tabletype) - ;; 3-typing.watsup:94.1-96.35 + ;; 3-typing.watsup:104.1-106.35 rule _ {lim_1 : limits, lim_2 : limits, rt : reftype}: `|-%<:%`(`%%`(lim_1, rt), `%%`(lim_2, rt)) -- Limits_sub: `|-%<:%`(lim_1, lim_2) -;; 3-typing.watsup:79.1-79.72 +;; 3-typing.watsup:89.1-89.72 relation Memtype_sub: `|-%<:%`(memtype, memtype) - ;; 3-typing.watsup:98.1-100.35 + ;; 3-typing.watsup:108.1-110.35 rule _ {lim_1 : limits, lim_2 : limits}: `|-%<:%`(`%I8`(lim_1), `%I8`(lim_2)) -- Limits_sub: `|-%<:%`(lim_1, lim_2) -;; 3-typing.watsup:80.1-80.75 +;; 3-typing.watsup:90.1-90.75 relation Externtype_sub: `|-%<:%`(externtype, externtype) - ;; 3-typing.watsup:103.1-105.35 + ;; 3-typing.watsup:113.1-115.35 rule func {ft_1 : functype, ft_2 : functype}: `|-%<:%`(FUNC_externtype(ft_1), FUNC_externtype(ft_2)) -- Functype_sub: `|-%<:%`(ft_1, ft_2) - ;; 3-typing.watsup:107.1-109.37 + ;; 3-typing.watsup:117.1-119.37 rule global {gt_1 : globaltype, gt_2 : globaltype}: `|-%<:%`(GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) -- Globaltype_sub: `|-%<:%`(gt_1, gt_2) - ;; 3-typing.watsup:111.1-113.36 + ;; 3-typing.watsup:121.1-123.36 rule table {tt_1 : tabletype, tt_2 : tabletype}: `|-%<:%`(TABLE_externtype(tt_1), TABLE_externtype(tt_2)) -- Tabletype_sub: `|-%<:%`(tt_1, tt_2) - ;; 3-typing.watsup:115.1-117.34 + ;; 3-typing.watsup:125.1-127.34 rule mem {mt_1 : memtype, mt_2 : memtype}: `|-%<:%`(MEM_externtype(mt_1), MEM_externtype(mt_2)) -- Memtype_sub: `|-%<:%`(mt_1, mt_2) -;; 3-typing.watsup:172.1-172.76 +;; 3-typing.watsup:192.1-192.76 relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) - ;; 3-typing.watsup:174.1-176.29 + ;; 3-typing.watsup:194.1-196.29 rule _ {C : context, ft : functype}: `%|-%:%`(C, ft, ft) -- Functype_ok: `|-%:OK`(ft) -;; 3-typing.watsup:123.1-124.67 +;; 3-typing.watsup:135.1-136.67 rec { -;; 3-typing.watsup:123.1-123.66 +;; 3-typing.watsup:135.1-135.66 relation Instr_ok: `%|-%:%`(context, instr, functype) - ;; 3-typing.watsup:153.1-154.34 + ;; 3-typing.watsup:171.1-172.34 rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:156.1-157.32 + ;; 3-typing.watsup:174.1-175.32 rule nop {C : context}: `%|-%:%`(C, NOP_instr, `%->%`([], [])) - ;; 3-typing.watsup:159.1-160.27 + ;; 3-typing.watsup:177.1-178.27 rule drop {C : context, t : valtype}: `%|-%:%`(C, DROP_instr, `%->%`([t], [])) - ;; 3-typing.watsup:163.1-164.31 + ;; 3-typing.watsup:181.1-182.31 rule select-expl {C : context, t : valtype}: `%|-%:%`(C, SELECT_instr(?(t)), `%->%`([t t I32_valtype], [t])) - ;; 3-typing.watsup:166.1-169.37 + ;; 3-typing.watsup:184.1-187.37 rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) -- Valtype_sub: `|-%<:%`(t, t') -- if ((t' = $valtype_numtype(numtype)) \/ (t' = $valtype_vectype(vectype))) - ;; 3-typing.watsup:178.1-181.59 + ;; 3-typing.watsup:198.1-201.59 rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:183.1-186.59 + ;; 3-typing.watsup:203.1-206.59 rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:188.1-192.61 + ;; 3-typing.watsup:208.1-212.61 rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%`(t_1*{t_1}, t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:195.1-197.24 + ;; 3-typing.watsup:217.1-219.24 rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- if (C.LABEL_context[l] = t*{t}) - ;; 3-typing.watsup:199.1-201.24 + ;; 3-typing.watsup:221.1-223.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] = t*{t}) - ;; 3-typing.watsup:203.1-206.42 + ;; 3-typing.watsup:225.1-228.42 rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- (Resulttype_sub: `|-%*<:%*`(t*{t}, C.LABEL_context[l]))*{l} -- Resulttype_sub: `|-%*<:%*`(t*{t}, C.LABEL_context[l']) - ;; 3-typing.watsup:208.1-210.24 + ;; 3-typing.watsup:233.1-235.24 rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- if (C.RETURN_context = ?(t*{t})) - ;; 3-typing.watsup:212.1-214.33 + ;; 3-typing.watsup:237.1-239.33 rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) -- if (C.FUNC_context[x] = `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:216.1-219.26 + ;; 3-typing.watsup:241.1-244.26 rule call_indirect {C : context, ft : functype, lim : limits, t_1* : valtype*, t_2* : valtype*, x : idx}: `%|-%:%`(C, CALL_INDIRECT_instr(x, ft), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) -- if (C.TABLE_context[x] = `%%`(lim, FUNCREF_reftype)) -- if (ft = `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:222.1-223.37 + ;; 3-typing.watsup:249.1-250.37 rule const {C : context, c_nt : c_numtype, nt : numtype}: `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [$valtype_numtype(nt)])) - ;; 3-typing.watsup:225.1-226.31 + ;; 3-typing.watsup:252.1-253.31 rule unop {C : context, nt : numtype, unop : unop_numtype}: `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 3-typing.watsup:228.1-229.36 + ;; 3-typing.watsup:255.1-256.36 rule binop {C : context, binop : binop_numtype, nt : numtype}: `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 3-typing.watsup:231.1-232.36 + ;; 3-typing.watsup:258.1-259.36 rule testop {C : context, nt : numtype, testop : testop_numtype}: `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([$valtype_numtype(nt)], [I32_valtype])) - ;; 3-typing.watsup:234.1-235.37 + ;; 3-typing.watsup:261.1-262.37 rule relop {C : context, nt : numtype, relop : relop_numtype}: `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [I32_valtype])) - ;; 3-typing.watsup:238.1-240.23 + ;; 3-typing.watsup:265.1-267.23 rule extend {C : context, n : n, nt : numtype, o0 : nat}: `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if (n <= o0) - ;; 3-typing.watsup:242.1-245.34 + ;; 3-typing.watsup:269.1-272.34 rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype, o0 : nat, o1 : nat}: `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([$valtype_numtype(nt_2)], [$valtype_numtype(nt_1)])) -- if ($size($valtype_numtype(nt_1)) = ?(o0)) @@ -8698,7 +8698,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- if (nt_1 =/= nt_2) -- if (o0 = o1) - ;; 3-typing.watsup:247.1-250.52 + ;; 3-typing.watsup:274.1-277.52 rule convert-i {C : context, in_1 : in, in_2 : in, sx? : sx?, o0 : nat, o1 : nat}: `%|-%:%`(C, CVTOP_instr($numtype_in(in_1), CONVERT_cvtop, $numtype_in(in_2), sx?{sx}), `%->%`([$valtype_in(in_2)], [$valtype_in(in_1)])) -- if ($size($valtype_in(in_1)) = ?(o0)) @@ -8706,123 +8706,123 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- if (in_1 =/= in_2) -- if ((sx?{sx} = ?()) <=> (o0 > o1)) - ;; 3-typing.watsup:252.1-254.22 + ;; 3-typing.watsup:279.1-281.22 rule convert-f {C : context, fn_1 : fn, fn_2 : fn}: `%|-%:%`(C, CVTOP_instr($numtype_fn(fn_1), CONVERT_cvtop, $numtype_fn(fn_2), ?()), `%->%`([$valtype_fn(fn_2)], [$valtype_fn(fn_1)])) -- if (fn_1 =/= fn_2) - ;; 3-typing.watsup:257.1-258.35 + ;; 3-typing.watsup:286.1-287.35 rule ref.null {C : context, rt : reftype}: `%|-%:%`(C, REF.NULL_instr(rt), `%->%`([], [$valtype_reftype(rt)])) - ;; 3-typing.watsup:260.1-262.23 + ;; 3-typing.watsup:289.1-291.23 rule ref.func {C : context, ft : functype, x : idx}: `%|-%:%`(C, REF.FUNC_instr(x), `%->%`([], [FUNCREF_valtype])) -- if (C.FUNC_context[x] = ft) - ;; 3-typing.watsup:264.1-265.31 + ;; 3-typing.watsup:293.1-294.31 rule ref.is_null {C : context, rt : reftype}: `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([$valtype_reftype(rt)], [I32_valtype])) - ;; 3-typing.watsup:268.1-270.23 + ;; 3-typing.watsup:299.1-301.23 rule local.get {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:272.1-274.23 + ;; 3-typing.watsup:303.1-305.23 rule local.set {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->%`([t], [])) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:276.1-278.23 + ;; 3-typing.watsup:307.1-309.23 rule local.tee {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%`([t], [t])) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:281.1-283.29 + ;; 3-typing.watsup:314.1-316.29 rule global.get {C : context, t : valtype, x : idx, w0 : ()?}: `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) -- if (C.GLOBAL_context[x] = `MUT%?%`(w0, t)) - ;; 3-typing.watsup:285.1-287.28 + ;; 3-typing.watsup:318.1-320.28 rule global.set {C : context, t : valtype, x : idx}: `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) -- if (C.GLOBAL_context[x] = `MUT%?%`(?(()), t)) - ;; 3-typing.watsup:290.1-292.28 + ;; 3-typing.watsup:325.1-327.28 rule table.get {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [$valtype_reftype(rt)])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:294.1-296.28 + ;; 3-typing.watsup:329.1-331.28 rule table.set {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype $valtype_reftype(rt)], [])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:298.1-300.24 + ;; 3-typing.watsup:333.1-335.24 rule table.size {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) -- if (C.TABLE_context[x] = tt) - ;; 3-typing.watsup:302.1-304.28 + ;; 3-typing.watsup:337.1-339.28 rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([$valtype_reftype(rt) I32_valtype], [I32_valtype])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:306.1-308.28 + ;; 3-typing.watsup:341.1-343.28 rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype $valtype_reftype(rt) I32_valtype], [])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:310.1-313.32 + ;; 3-typing.watsup:345.1-348.32 rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt : reftype, x_1 : idx, x_2 : idx}: `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt)) -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt)) - ;; 3-typing.watsup:315.1-318.25 + ;; 3-typing.watsup:350.1-353.25 rule table.init {C : context, lim : limits, rt : reftype, x_1 : idx, x_2 : idx}: `%|-%:%`(C, TABLE.INIT_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.TABLE_context[x_1] = `%%`(lim, rt)) -- if (C.ELEM_context[x_2] = rt) - ;; 3-typing.watsup:320.1-322.23 + ;; 3-typing.watsup:355.1-357.23 rule elem.drop {C : context, rt : reftype, x : idx}: `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) -- if (C.ELEM_context[x] = rt) - ;; 3-typing.watsup:325.1-327.22 + ;; 3-typing.watsup:362.1-364.22 rule memory.size {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.SIZE_instr, `%->%`([], [I32_valtype])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:329.1-331.22 + ;; 3-typing.watsup:366.1-368.22 rule memory.grow {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.GROW_instr, `%->%`([I32_valtype], [I32_valtype])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:333.1-335.22 + ;; 3-typing.watsup:370.1-372.22 rule memory.fill {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.FILL_instr, `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:337.1-339.22 + ;; 3-typing.watsup:374.1-376.22 rule memory.copy {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.COPY_instr, `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:341.1-344.23 + ;; 3-typing.watsup:378.1-381.23 rule memory.init {C : context, mt : memtype, x : idx}: `%|-%:%`(C, MEMORY.INIT_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (C.MEM_context[0] = mt) -- if (C.DATA_context[x] = OK) - ;; 3-typing.watsup:346.1-348.23 + ;; 3-typing.watsup:383.1-385.23 rule data.drop {C : context, x : idx}: `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) -- if (C.DATA_context[x] = OK) - ;; 3-typing.watsup:350.1-355.32 + ;; 3-typing.watsup:387.1-392.32 rule load {C : context, in : in, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, o0 : nat, o1? : nat?}: `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, n_A, n_O), `%->%`([I32_valtype], [$valtype_numtype(nt)])) -- if ($size($valtype_numtype(nt)) = ?(o0)) @@ -8832,7 +8832,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} -- if ((n?{n} = ?()) \/ (nt = $numtype_in(in))) - ;; 3-typing.watsup:357.1-362.32 + ;; 3-typing.watsup:394.1-399.32 rule store {C : context, in : in, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, o0 : nat, o1? : nat?}: `%|-%:%`(C, STORE_instr(nt, n?{n}, n_A, n_O), `%->%`([I32_valtype $valtype_numtype(nt)], [])) -- if ($size($valtype_numtype(nt)) = ?(o0)) @@ -8842,185 +8842,185 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} -- if ((n?{n} = ?()) \/ (nt = $numtype_in(in))) -;; 3-typing.watsup:124.1-124.67 +;; 3-typing.watsup:136.1-136.67 relation InstrSeq_ok: `%|-%*:%`(context, instr*, functype) - ;; 3-typing.watsup:133.1-134.36 + ;; 3-typing.watsup:149.1-150.36 rule empty {C : context}: `%|-%*:%`(C, [], `%->%`([], [])) - ;; 3-typing.watsup:136.1-139.46 + ;; 3-typing.watsup:152.1-155.46 rule seq {C : context, instr_1 : instr, instr_2 : instr, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*}: `%|-%*:%`(C, [instr_1] :: instr_2*{}, `%->%`(t_1*{t_1}, t_3*{t_3})) -- Instr_ok: `%|-%:%`(C, instr_1, `%->%`(t_1*{t_1}, t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C, [instr_2], `%->%`(t_2*{t_2}, t_3*{t_3})) - ;; 3-typing.watsup:141.1-146.38 + ;; 3-typing.watsup:157.1-162.38 rule weak {C : context, instr* : instr*, t'_1* : valtype*, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%*:%`(C, instr*{instr}, `%->%`(t'_1*{t'_1}, t'_2*{t'_2})) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) -- Resulttype_sub: `|-%*<:%*`(t'_1*{t'_1}, t_1*{t_1}) -- Resulttype_sub: `|-%*<:%*`(t_2*{t_2}, t'_2*{t'_2}) - ;; 3-typing.watsup:148.1-150.45 + ;; 3-typing.watsup:164.1-166.45 rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%*:%`(C, instr*{instr}, `%->%`(t*{t} :: t_1*{t_1}, t*{t} :: t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) } -;; 3-typing.watsup:125.1-125.71 +;; 3-typing.watsup:137.1-137.71 relation Expr_ok: `%|-%:%`(context, expr, resulttype) - ;; 3-typing.watsup:128.1-130.46 + ;; 3-typing.watsup:142.1-144.46 rule _ {C : context, instr* : instr*, t* : valtype*}: `%|-%:%`(C, instr*{instr}, t*{t}) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`([], t*{t})) -;; 3-typing.watsup:367.1-367.78 +;; 3-typing.watsup:406.1-406.78 relation Instr_const: `%|-%CONST`(context, instr) - ;; 3-typing.watsup:371.1-372.26 + ;; 3-typing.watsup:410.1-411.26 rule const {C : context, c : c_numtype, nt : numtype}: `%|-%CONST`(C, CONST_instr(nt, c)) - ;; 3-typing.watsup:374.1-375.27 + ;; 3-typing.watsup:413.1-414.27 rule ref.null {C : context, rt : reftype}: `%|-%CONST`(C, REF.NULL_instr(rt)) - ;; 3-typing.watsup:377.1-378.26 + ;; 3-typing.watsup:416.1-417.26 rule ref.func {C : context, x : idx}: `%|-%CONST`(C, REF.FUNC_instr(x)) - ;; 3-typing.watsup:380.1-382.32 + ;; 3-typing.watsup:419.1-421.32 rule global.get {C : context, t : valtype, x : idx}: `%|-%CONST`(C, GLOBAL.GET_instr(x)) -- if (C.GLOBAL_context[x] = `MUT%?%`(?(), t)) -;; 3-typing.watsup:368.1-368.77 +;; 3-typing.watsup:407.1-407.77 relation Expr_const: `%|-%CONST`(context, expr) - ;; 3-typing.watsup:385.1-386.38 + ;; 3-typing.watsup:424.1-425.38 rule _ {C : context, instr* : instr*}: `%|-%CONST`(C, instr*{instr}) -- (Instr_const: `%|-%CONST`(C, instr))*{instr} -;; 3-typing.watsup:369.1-369.78 +;; 3-typing.watsup:408.1-408.78 relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) - ;; 3-typing.watsup:389.1-392.33 + ;; 3-typing.watsup:428.1-431.33 rule _ {C : context, expr : expr, t : valtype}: `%|-%:%CONST`(C, expr, t) -- Expr_ok: `%|-%:%`(C, expr, [t]) -- Expr_const: `%|-%CONST`(C, expr) -;; 3-typing.watsup:397.1-397.73 +;; 3-typing.watsup:438.1-438.73 relation Func_ok: `%|-%:%`(context, func, functype) - ;; 3-typing.watsup:408.1-412.75 + ;; 3-typing.watsup:451.1-455.75 rule _ {C : context, expr : expr, ft : functype, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, `FUNC%%*%`(ft, t*{t}, expr), ft) -- if (ft = `%->%`(t_1*{t_1}, t_2*{t_2})) -- Functype_ok: `|-%:OK`(ft) -- Expr_ok: `%|-%:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL t_1*{t_1} :: t*{t}, LABEL [], RETURN ?()} ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()} ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2})}, expr, t_2*{t_2}) -;; 3-typing.watsup:398.1-398.75 +;; 3-typing.watsup:439.1-439.75 relation Global_ok: `%|-%:%`(context, global, globaltype) - ;; 3-typing.watsup:414.1-418.40 + ;; 3-typing.watsup:457.1-461.40 rule _ {C : context, expr : expr, gt : globaltype, t : valtype, w0 : ()?}: `%|-%:%`(C, GLOBAL(gt, expr), gt) -- Globaltype_ok: `|-%:OK`(gt) -- if (gt = `MUT%?%`(w0, t)) -- Expr_ok_const: `%|-%:%CONST`(C, expr, t) -;; 3-typing.watsup:399.1-399.74 +;; 3-typing.watsup:440.1-440.74 relation Table_ok: `%|-%:%`(context, table, tabletype) - ;; 3-typing.watsup:420.1-422.30 + ;; 3-typing.watsup:463.1-465.30 rule _ {C : context, tt : tabletype}: `%|-%:%`(C, TABLE(tt), tt) -- Tabletype_ok: `|-%:OK`(tt) -;; 3-typing.watsup:400.1-400.72 +;; 3-typing.watsup:441.1-441.72 relation Mem_ok: `%|-%:%`(context, mem, memtype) - ;; 3-typing.watsup:424.1-426.28 + ;; 3-typing.watsup:467.1-469.28 rule _ {C : context, mt : memtype}: `%|-%:%`(C, MEMORY(mt), mt) -- Memtype_ok: `|-%:OK`(mt) -;; 3-typing.watsup:403.1-403.77 +;; 3-typing.watsup:444.1-444.77 relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) - ;; 3-typing.watsup:437.1-440.45 + ;; 3-typing.watsup:480.1-483.45 rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE_elemmode(x, expr), rt) -- if (C.TABLE_context[x] = `%%`(lim, rt)) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} - ;; 3-typing.watsup:442.1-443.20 + ;; 3-typing.watsup:485.1-486.20 rule declare {C : context, rt : reftype}: `%|-%:%`(C, DECLARE_elemmode, rt) -;; 3-typing.watsup:401.1-401.73 +;; 3-typing.watsup:442.1-442.73 relation Elem_ok: `%|-%:%`(context, elem, reftype) - ;; 3-typing.watsup:428.1-431.40 + ;; 3-typing.watsup:471.1-474.40 rule _ {C : context, elemmode? : elemmode?, expr* : expr*, rt : reftype}: `%|-%:%`(C, `ELEM%%*%?`(rt, expr*{expr}, elemmode?{elemmode}), rt) -- (Expr_ok: `%|-%:%`(C, expr, [$valtype_reftype(rt)]))*{expr} -- (Elemmode_ok: `%|-%:%`(C, elemmode, rt))?{elemmode} -;; 3-typing.watsup:404.1-404.77 +;; 3-typing.watsup:445.1-445.77 relation Datamode_ok: `%|-%:OK`(context, datamode) - ;; 3-typing.watsup:445.1-448.45 + ;; 3-typing.watsup:488.1-491.45 rule _ {C : context, expr : expr, mt : memtype}: `%|-%:OK`(C, MEMORY_datamode(0, expr)) -- if (C.MEM_context[0] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} -;; 3-typing.watsup:402.1-402.73 +;; 3-typing.watsup:443.1-443.73 relation Data_ok: `%|-%:OK`(context, data) - ;; 3-typing.watsup:433.1-435.40 + ;; 3-typing.watsup:476.1-478.40 rule _ {C : context, b* : byte*, datamode? : datamode?}: `%|-%:OK`(C, `DATA%*%?`(b*{b}, datamode?{datamode})) -- (Datamode_ok: `%|-%:OK`(C, datamode))?{datamode} -;; 3-typing.watsup:405.1-405.74 +;; 3-typing.watsup:446.1-446.74 relation Start_ok: `%|-%:OK`(context, start) - ;; 3-typing.watsup:450.1-452.39 + ;; 3-typing.watsup:493.1-495.39 rule _ {C : context, x : idx}: `%|-%:OK`(C, START(x)) -- if (C.FUNC_context[x] = `%->%`([], [])) -;; 3-typing.watsup:455.1-455.80 +;; 3-typing.watsup:500.1-500.80 relation Import_ok: `%|-%:%`(context, import, externtype) - ;; 3-typing.watsup:459.1-461.31 + ;; 3-typing.watsup:504.1-506.31 rule _ {C : context, name_1 : name, name_2 : name, xt : externtype}: `%|-%:%`(C, IMPORT(name_1, name_2, xt), xt) -- Externtype_ok: `|-%:OK`(xt) -;; 3-typing.watsup:457.1-457.83 +;; 3-typing.watsup:502.1-502.83 relation Externuse_ok: `%|-%:%`(context, externuse, externtype) - ;; 3-typing.watsup:467.1-469.23 + ;; 3-typing.watsup:512.1-514.23 rule func {C : context, ft : functype, x : idx}: `%|-%:%`(C, FUNC_externuse(x), FUNC_externtype(ft)) -- if (C.FUNC_context[x] = ft) - ;; 3-typing.watsup:471.1-473.25 + ;; 3-typing.watsup:516.1-518.25 rule global {C : context, gt : globaltype, x : idx}: `%|-%:%`(C, GLOBAL_externuse(x), GLOBAL_externtype(gt)) -- if (C.GLOBAL_context[x] = gt) - ;; 3-typing.watsup:475.1-477.24 + ;; 3-typing.watsup:520.1-522.24 rule table {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE_externuse(x), TABLE_externtype(tt)) -- if (C.TABLE_context[x] = tt) - ;; 3-typing.watsup:479.1-481.22 + ;; 3-typing.watsup:524.1-526.22 rule mem {C : context, mt : memtype, x : idx}: `%|-%:%`(C, MEM_externuse(x), MEM_externtype(mt)) -- if (C.MEM_context[x] = mt) -;; 3-typing.watsup:456.1-456.80 +;; 3-typing.watsup:501.1-501.80 relation Export_ok: `%|-%:%`(context, export, externtype) - ;; 3-typing.watsup:463.1-465.39 + ;; 3-typing.watsup:508.1-510.39 rule _ {C : context, externuse : externuse, name : name, xt : externtype}: `%|-%:%`(C, EXPORT(name, externuse), xt) -- Externuse_ok: `%|-%:%`(C, externuse, xt) -;; 3-typing.watsup:484.1-484.62 +;; 3-typing.watsup:531.1-531.62 relation Module_ok: `|-%:OK`(module) - ;; 3-typing.watsup:486.1-500.16 + ;; 3-typing.watsup:533.1-547.16 rule _ {C : context, data^n : data^n, elem* : elem*, export* : export*, ft* : functype*, func* : func*, global* : global*, gt* : globaltype*, import* : import*, mem* : mem*, mt* : memtype*, n : n, rt* : reftype*, start? : start?, table* : table*, tt* : tabletype*}: `|-%:OK`(`MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data^n{data}, start?{start}, export*{export})) -- if (C = {FUNC ft*{ft}, GLOBAL gt*{gt}, TABLE tt*{tt}, MEM mt*{mt}, ELEM rt*{rt}, DATA OK^n{}, LOCAL [], LABEL [], RETURN ?()}) @@ -9033,115 +9033,115 @@ relation Module_ok: `|-%:OK`(module) -- (Start_ok: `%|-%:OK`(C, start))?{start} -- if (|mem*{mem}| <= 1) -;; 4-runtime.watsup:3.1-3.39 +;; 4-runtime.watsup:5.1-5.39 syntax addr = nat -;; 4-runtime.watsup:4.1-4.53 +;; 4-runtime.watsup:6.1-6.53 syntax funcaddr = addr -;; 4-runtime.watsup:5.1-5.53 +;; 4-runtime.watsup:7.1-7.53 syntax globaladdr = addr -;; 4-runtime.watsup:6.1-6.51 +;; 4-runtime.watsup:8.1-8.51 syntax tableaddr = addr -;; 4-runtime.watsup:7.1-7.50 +;; 4-runtime.watsup:9.1-9.50 syntax memaddr = addr -;; 4-runtime.watsup:8.1-8.49 +;; 4-runtime.watsup:10.1-10.49 syntax elemaddr = addr -;; 4-runtime.watsup:9.1-9.49 +;; 4-runtime.watsup:11.1-11.49 syntax dataaddr = addr -;; 4-runtime.watsup:10.1-10.51 +;; 4-runtime.watsup:12.1-12.51 syntax labeladdr = addr -;; 4-runtime.watsup:11.1-11.49 +;; 4-runtime.watsup:13.1-13.49 syntax hostaddr = addr -;; 4-runtime.watsup:24.1-25.24 +;; 4-runtime.watsup:30.1-31.24 syntax num = | CONST(numtype, c_numtype) -;; 4-runtime.watsup:26.1-27.67 +;; 4-runtime.watsup:32.1-33.67 syntax ref = | REF.NULL(reftype) | REF.FUNC_ADDR(funcaddr) | REF.HOST_ADDR(hostaddr) -;; 4-runtime.watsup:28.1-29.10 +;; 4-runtime.watsup:34.1-35.10 syntax val = | CONST(numtype, c_numtype) | REF.NULL(reftype) | REF.FUNC_ADDR(funcaddr) | REF.HOST_ADDR(hostaddr) -;; 4-runtime.watsup:31.1-32.18 +;; 4-runtime.watsup:37.1-38.18 syntax result = | _VALS(val*) | TRAP -;; 4-runtime.watsup:38.1-39.66 +;; 4-runtime.watsup:47.1-48.66 syntax externval = | FUNC(funcaddr) | GLOBAL(globaladdr) | TABLE(tableaddr) | MEM(memaddr) -;; 4-runtime.watsup:44.1-44.44 +;; 4-runtime.watsup:55.1-55.44 def default_ : valtype -> val? - ;; 4-runtime.watsup:45.1-45.35 + ;; 4-runtime.watsup:56.1-56.35 def default_(I32_valtype) = ?(CONST_val(I32_numtype, 0)) - ;; 4-runtime.watsup:46.1-46.35 + ;; 4-runtime.watsup:57.1-57.35 def default_(I64_valtype) = ?(CONST_val(I64_numtype, 0)) - ;; 4-runtime.watsup:47.1-47.35 + ;; 4-runtime.watsup:58.1-58.35 def default_(F32_valtype) = ?(CONST_val(F32_numtype, 0)) - ;; 4-runtime.watsup:48.1-48.35 + ;; 4-runtime.watsup:59.1-59.35 def default_(F64_valtype) = ?(CONST_val(F64_numtype, 0)) - ;; 4-runtime.watsup:49.1-49.44 + ;; 4-runtime.watsup:60.1-60.44 def default_(FUNCREF_valtype) = ?(REF.NULL_val(FUNCREF_reftype)) - ;; 4-runtime.watsup:50.1-50.48 + ;; 4-runtime.watsup:61.1-61.48 def default_(EXTERNREF_valtype) = ?(REF.NULL_val(EXTERNREF_reftype)) def {x : valtype} default_(x) = ?() -;; 4-runtime.watsup:72.1-74.22 +;; 4-runtime.watsup:87.1-89.22 syntax exportinst = {NAME name, VALUE externval} -;; 4-runtime.watsup:84.1-91.25 +;; 4-runtime.watsup:91.1-98.25 syntax moduleinst = {FUNC funcaddr*, GLOBAL globaladdr*, TABLE tableaddr*, MEM memaddr*, ELEM elemaddr*, DATA dataaddr*, EXPORT exportinst*} -;; 4-runtime.watsup:55.1-57.16 +;; 4-runtime.watsup:70.1-72.16 syntax funcinst = {MODULE moduleinst, CODE func} -;; 4-runtime.watsup:58.1-60.16 +;; 4-runtime.watsup:73.1-75.16 syntax globalinst = {TYPE globaltype, VALUE val} -;; 4-runtime.watsup:61.1-63.16 +;; 4-runtime.watsup:76.1-78.16 syntax tableinst = {TYPE tabletype, ELEM ref*} -;; 4-runtime.watsup:64.1-66.17 +;; 4-runtime.watsup:79.1-81.17 syntax meminst = {TYPE memtype, DATA byte*} -;; 4-runtime.watsup:67.1-69.16 +;; 4-runtime.watsup:82.1-84.16 syntax eleminst = {TYPE elemtype, ELEM ref*} -;; 4-runtime.watsup:70.1-71.17 +;; 4-runtime.watsup:85.1-86.17 syntax datainst = {DATA byte*} -;; 4-runtime.watsup:76.1-82.21 +;; 4-runtime.watsup:112.1-118.21 syntax store = {FUNC funcinst*, GLOBAL globalinst*, TABLE tableinst*, MEM meminst*, ELEM eleminst*, DATA datainst*} -;; 4-runtime.watsup:93.1-95.24 +;; 4-runtime.watsup:120.1-122.24 syntax frame = {LOCAL val*, MODULE moduleinst} -;; 4-runtime.watsup:96.1-96.47 +;; 4-runtime.watsup:124.1-124.47 syntax state = `%;%`(store, frame) -;; 4-runtime.watsup:183.1-190.5 +;; 4-runtime.watsup:209.1-216.5 rec { -;; 4-runtime.watsup:183.1-190.5 +;; 4-runtime.watsup:209.1-216.5 syntax admininstr = | UNREACHABLE | NOP @@ -9252,122 +9252,122 @@ def admininstr_val : val -> admininstr def {x : funcaddr} admininstr_val(REF.FUNC_ADDR_val(x)) = REF.FUNC_ADDR_admininstr(x) def {x : hostaddr} admininstr_val(REF.HOST_ADDR_val(x)) = REF.HOST_ADDR_admininstr(x) -;; 4-runtime.watsup:97.1-97.62 +;; 4-runtime.watsup:125.1-125.62 syntax config = `%;%*`(state, admininstr*) -;; 4-runtime.watsup:115.1-115.59 +;; 4-runtime.watsup:134.1-134.59 def funcaddr : state -> funcaddr* - ;; 4-runtime.watsup:116.1-116.38 + ;; 4-runtime.watsup:135.1-135.38 def {f : frame, s : store} funcaddr(`%;%`(s, f)) = f.MODULE_frame.FUNC_moduleinst -;; 4-runtime.watsup:118.1-118.52 +;; 4-runtime.watsup:137.1-137.52 def funcinst : state -> funcinst* - ;; 4-runtime.watsup:125.1-125.31 + ;; 4-runtime.watsup:144.1-144.31 def {f : frame, s : store} funcinst(`%;%`(s, f)) = s.FUNC_store -;; 4-runtime.watsup:119.1-119.58 +;; 4-runtime.watsup:138.1-138.58 def globalinst : state -> globalinst* - ;; 4-runtime.watsup:126.1-126.35 + ;; 4-runtime.watsup:145.1-145.35 def {f : frame, s : store} globalinst(`%;%`(s, f)) = s.GLOBAL_store -;; 4-runtime.watsup:120.1-120.55 +;; 4-runtime.watsup:139.1-139.55 def tableinst : state -> tableinst* - ;; 4-runtime.watsup:127.1-127.33 + ;; 4-runtime.watsup:146.1-146.33 def {f : frame, s : store} tableinst(`%;%`(s, f)) = s.TABLE_store -;; 4-runtime.watsup:121.1-121.49 +;; 4-runtime.watsup:140.1-140.49 def meminst : state -> meminst* - ;; 4-runtime.watsup:128.1-128.29 + ;; 4-runtime.watsup:147.1-147.29 def {f : frame, s : store} meminst(`%;%`(s, f)) = s.MEM_store -;; 4-runtime.watsup:122.1-122.52 +;; 4-runtime.watsup:141.1-141.52 def eleminst : state -> eleminst* - ;; 4-runtime.watsup:129.1-129.31 + ;; 4-runtime.watsup:148.1-148.31 def {f : frame, s : store} eleminst(`%;%`(s, f)) = s.ELEM_store -;; 4-runtime.watsup:123.1-123.52 +;; 4-runtime.watsup:142.1-142.52 def datainst : state -> datainst* - ;; 4-runtime.watsup:130.1-130.31 + ;; 4-runtime.watsup:149.1-149.31 def {f : frame, s : store} datainst(`%;%`(s, f)) = s.DATA_store -;; 4-runtime.watsup:132.1-132.67 +;; 4-runtime.watsup:151.1-151.67 def func : (state, funcidx) -> funcinst - ;; 4-runtime.watsup:140.1-140.48 + ;; 4-runtime.watsup:159.1-159.48 def {f : frame, s : store, x : idx} func(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[x]] -;; 4-runtime.watsup:133.1-133.69 +;; 4-runtime.watsup:152.1-152.69 def global : (state, globalidx) -> globalinst - ;; 4-runtime.watsup:141.1-141.54 + ;; 4-runtime.watsup:160.1-160.54 def {f : frame, s : store, x : idx} global(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x]] -;; 4-runtime.watsup:134.1-134.68 +;; 4-runtime.watsup:153.1-153.68 def table : (state, tableidx) -> tableinst - ;; 4-runtime.watsup:142.1-142.51 + ;; 4-runtime.watsup:161.1-161.51 def {f : frame, s : store, x : idx} table(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]] -;; 4-runtime.watsup:135.1-135.66 +;; 4-runtime.watsup:154.1-154.66 def mem : (state, memidx) -> meminst - ;; 4-runtime.watsup:143.1-143.45 + ;; 4-runtime.watsup:162.1-162.45 def {f : frame, s : store, x : idx} mem(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[x]] -;; 4-runtime.watsup:136.1-136.67 +;; 4-runtime.watsup:155.1-155.67 def elem : (state, tableidx) -> eleminst - ;; 4-runtime.watsup:144.1-144.48 + ;; 4-runtime.watsup:163.1-163.48 def {f : frame, s : store, x : idx} elem(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[x]] -;; 4-runtime.watsup:137.1-137.67 +;; 4-runtime.watsup:156.1-156.67 def data : (state, dataidx) -> datainst - ;; 4-runtime.watsup:145.1-145.48 + ;; 4-runtime.watsup:164.1-164.48 def {f : frame, s : store, x : idx} data(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[x]] -;; 4-runtime.watsup:138.1-138.68 +;; 4-runtime.watsup:157.1-157.68 def local : (state, localidx) -> val - ;; 4-runtime.watsup:146.1-146.35 + ;; 4-runtime.watsup:165.1-165.35 def {f : frame, s : store, x : idx} local(`%;%`(s, f), x) = f.LOCAL_frame[x] -;; 4-runtime.watsup:149.1-149.78 +;; 4-runtime.watsup:168.1-168.78 def with_local : (state, localidx, val) -> state - ;; 4-runtime.watsup:158.1-158.52 + ;; 4-runtime.watsup:177.1-177.52 def {f : frame, s : store, v : val, x : idx} with_local(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[x] = v]) -;; 4-runtime.watsup:150.1-150.85 +;; 4-runtime.watsup:169.1-169.85 def with_global : (state, globalidx, val) -> state - ;; 4-runtime.watsup:159.1-159.77 + ;; 4-runtime.watsup:178.1-178.77 def {f : frame, s : store, v : val, x : idx} with_global(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x]].VALUE_globalinst = v], f) -;; 4-runtime.watsup:151.1-151.88 +;; 4-runtime.watsup:170.1-170.88 def with_table : (state, tableidx, nat, ref) -> state - ;; 4-runtime.watsup:160.1-160.79 + ;; 4-runtime.watsup:179.1-179.79 def {f : frame, i : nat, r : ref, s : store, x : idx} with_table(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]].ELEM_tableinst[i] = r], f) -;; 4-runtime.watsup:152.1-152.84 +;; 4-runtime.watsup:171.1-171.84 def with_tableinst : (state, tableidx, tableinst) -> state - ;; 4-runtime.watsup:161.1-161.74 + ;; 4-runtime.watsup:180.1-180.74 def {f : frame, s : store, ti : tableinst, x : idx} with_tableinst(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]] = ti], f) -;; 4-runtime.watsup:153.1-153.93 +;; 4-runtime.watsup:172.1-172.93 def with_mem : (state, memidx, nat, nat, byte*) -> state - ;; 4-runtime.watsup:162.1-162.82 + ;; 4-runtime.watsup:181.1-181.82 def {b* : byte*, f : frame, i : nat, j : nat, s : store, x : idx} with_mem(`%;%`(s, f), x, i, j, b*{b}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x]].DATA_meminst[i : j] = b*{b}], f) -;; 4-runtime.watsup:154.1-154.77 +;; 4-runtime.watsup:173.1-173.77 def with_meminst : (state, memidx, meminst) -> state - ;; 4-runtime.watsup:163.1-163.68 + ;; 4-runtime.watsup:182.1-182.68 def {f : frame, mi : meminst, s : store, x : idx} with_meminst(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x]] = mi], f) -;; 4-runtime.watsup:155.1-155.82 +;; 4-runtime.watsup:174.1-174.82 def with_elem : (state, elemidx, ref*) -> state - ;; 4-runtime.watsup:164.1-164.72 + ;; 4-runtime.watsup:183.1-183.72 def {f : frame, r* : ref*, s : store, x : idx} with_elem(`%;%`(s, f), x, r*{r}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x]].ELEM_eleminst = r*{r}], f) -;; 4-runtime.watsup:156.1-156.82 +;; 4-runtime.watsup:175.1-175.82 def with_data : (state, dataidx, byte*) -> state - ;; 4-runtime.watsup:165.1-165.72 + ;; 4-runtime.watsup:184.1-184.72 def {b* : byte*, f : frame, s : store, x : idx} with_data(`%;%`(s, f), x, b*{b}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x]].DATA_datainst = b*{b}], f) -;; 4-runtime.watsup:167.1-167.63 +;; 4-runtime.watsup:189.1-189.63 def grow_table : (tableinst, nat, ref) -> tableinst? - ;; 4-runtime.watsup:170.1-174.36 + ;; 4-runtime.watsup:192.1-196.36 def {i : nat, i' : nat, j : nat, n : n, r : ref, r'* : ref*, rt : reftype, ti : tableinst, ti' : tableinst} grow_table(ti, n, r) = ?(ti') -- if (ti = {TYPE `%%`(`[%..%]`(i, j), rt), ELEM r'*{r'}}) -- if (i' = (|r'*{r'}| + n)) @@ -9375,9 +9375,9 @@ def grow_table : (tableinst, nat, ref) -> tableinst? -- Tabletype_ok: `|-%:OK`(ti'.TYPE_tableinst) def {x : (tableinst, nat, ref)} grow_table(x) = ?() -;; 4-runtime.watsup:168.1-168.55 +;; 4-runtime.watsup:190.1-190.55 def grow_memory : (meminst, nat) -> meminst? - ;; 4-runtime.watsup:175.1-179.34 + ;; 4-runtime.watsup:198.1-202.34 def {b* : byte*, i : nat, i' : nat, j : nat, mi : meminst, mi' : meminst, n : n} grow_memory(mi, n) = ?(mi') -- if (mi = {TYPE `%I8`(`[%..%]`(i, j)), DATA b*{b}}) -- if (i' = ((|b*{b}| / (64 * $Ki)) + n)) @@ -9385,10 +9385,10 @@ def grow_memory : (meminst, nat) -> meminst? -- Memtype_ok: `|-%:OK`(mi'.TYPE_meminst) def {x : (meminst, nat)} grow_memory(x) = ?() -;; 4-runtime.watsup:192.1-195.21 +;; 4-runtime.watsup:218.1-221.21 rec { -;; 4-runtime.watsup:192.1-195.21 +;; 4-runtime.watsup:218.1-221.21 syntax E = | _HOLE | _SEQ(val*, E, instr*) @@ -9419,172 +9419,172 @@ def wrap_ : ((nat, nat), c_numtype) -> nat ;; 5-numerics.watsup:13.1-13.28 def bytes_ : (nat, c_numtype) -> byte* -;; 6-reduction.watsup:4.1-4.63 +;; 6-reduction.watsup:6.1-6.63 relation Step_pure: `%*~>%*`(admininstr*, admininstr*) - ;; 6-reduction.watsup:16.1-17.24 + ;; 6-reduction.watsup:24.1-25.24 rule unreachable: `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) - ;; 6-reduction.watsup:19.1-20.19 + ;; 6-reduction.watsup:27.1-28.19 rule nop: `%*~>%*`([NOP_admininstr], []) - ;; 6-reduction.watsup:22.1-23.24 + ;; 6-reduction.watsup:30.1-31.24 rule drop {val : val}: `%*~>%*`([$admininstr_val(val) DROP_admininstr], []) - ;; 6-reduction.watsup:26.1-28.16 + ;; 6-reduction.watsup:34.1-36.16 rule select-true {c : c_numtype, t? : valtype?, val_1 : val, val_2 : val}: `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t?{t})], [$admininstr_val(val_1)]) -- if (c =/= 0) - ;; 6-reduction.watsup:30.1-32.14 + ;; 6-reduction.watsup:38.1-40.14 rule select-false {c : c_numtype, t? : valtype?, val_1 : val, val_2 : val}: `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t?{t})], [$admininstr_val(val_2)]) -- if (c = 0) - ;; 6-reduction.watsup:35.1-37.28 + ;; 6-reduction.watsup:45.1-47.28 rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k}: `%*~>%*`($admininstr_val(val)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})], [LABEL__admininstr(n, [], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) -- if (bt = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 6-reduction.watsup:39.1-41.28 + ;; 6-reduction.watsup:49.1-51.28 rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k}: `%*~>%*`($admininstr_val(val)^k{val} :: [LOOP_admininstr(bt, instr*{instr})], [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) -- if (bt = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 6-reduction.watsup:43.1-45.16 + ;; 6-reduction.watsup:53.1-55.16 rule if-true {bt : blocktype, c : c_numtype, 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) - ;; 6-reduction.watsup:47.1-49.14 + ;; 6-reduction.watsup:57.1-59.14 rule if-false {bt : blocktype, c : c_numtype, 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) - ;; 6-reduction.watsup:52.1-53.38 + ;; 6-reduction.watsup:62.1-63.38 rule label-vals {instr* : instr*, n : n, val* : val*}: `%*~>%*`([LABEL__admininstr(n, instr*{instr}, $admininstr_val(val)*{val})], $admininstr_val(val)*{val}) - ;; 6-reduction.watsup:57.1-58.69 + ;; 6-reduction.watsup:69.1-70.69 rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [BR_admininstr(0)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val} :: $admininstr_instr(instr')*{instr'}) - ;; 6-reduction.watsup:60.1-61.65 + ;; 6-reduction.watsup:72.1-73.65 rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val)*{val} :: [BR_admininstr(l + 1)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [BR_admininstr(l)]) - ;; 6-reduction.watsup:64.1-66.16 + ;; 6-reduction.watsup:76.1-78.16 rule br_if-true {c : c_numtype, l : labelidx}: `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) -- if (c =/= 0) - ;; 6-reduction.watsup:68.1-70.14 + ;; 6-reduction.watsup:80.1-82.14 rule br_if-false {c : c_numtype, l : labelidx}: `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) -- if (c = 0) - ;; 6-reduction.watsup:73.1-75.17 + ;; 6-reduction.watsup:85.1-87.17 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}|) - ;; 6-reduction.watsup:77.1-79.18 + ;; 6-reduction.watsup:89.1-91.18 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}|) - ;; 6-reduction.watsup:102.1-103.35 + ;; 6-reduction.watsup:116.1-117.35 rule frame-vals {f : frame, n : n, val^n : val^n}: `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val)^n{val})], $admininstr_val(val)^n{val}) - ;; 6-reduction.watsup:105.1-106.55 + ;; 6-reduction.watsup:119.1-120.55 rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val}) - ;; 6-reduction.watsup:108.1-109.60 + ;; 6-reduction.watsup:122.1-123.60 rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [RETURN_admininstr]) - ;; 6-reduction.watsup:112.1-114.33 + ;; 6-reduction.watsup:128.1-130.33 rule unop-val {c : c_numtype, c_1 : c_numtype, nt : numtype, unop : unop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) -- if ($unop(unop, nt, c_1) = [c]) - ;; 6-reduction.watsup:116.1-118.39 + ;; 6-reduction.watsup:132.1-134.39 rule unop-trap {c_1 : c_numtype, nt : numtype, unop : unop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) -- if ($unop(unop, nt, c_1) = []) - ;; 6-reduction.watsup:121.1-123.40 + ;; 6-reduction.watsup:137.1-139.40 rule binop-val {binop : binop_numtype, c : c_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- if ($binop(binop, nt, c_1, c_2) = [c]) - ;; 6-reduction.watsup:125.1-127.46 + ;; 6-reduction.watsup:141.1-143.46 rule binop-trap {binop : binop_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) -- if ($binop(binop, nt, c_1, c_2) = []) - ;; 6-reduction.watsup:130.1-132.37 + ;; 6-reduction.watsup:146.1-148.37 rule testop {c : c_numtype, c_1 : c_numtype, nt : numtype, testop : testop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $testop(testop, nt, c_1)) - ;; 6-reduction.watsup:134.1-136.40 + ;; 6-reduction.watsup:150.1-152.40 rule relop {c : c_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype, relop : relop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $relop(relop, nt, c_1, c_2)) - ;; 6-reduction.watsup:139.1-140.70 + ;; 6-reduction.watsup:155.1-156.70 rule extend {c : c_numtype, n : n, nt : numtype, o0 : nat}: `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, o0, S_sx, c))]) -- if ($size($valtype_numtype(nt)) = ?(o0)) - ;; 6-reduction.watsup:143.1-145.48 + ;; 6-reduction.watsup:159.1-161.48 rule cvtop-val {c : c_numtype, c_1 : c_numtype, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) -- if ($cvtop(nt_1, cvtop, nt_2, sx?{sx}, c_1) = [c]) - ;; 6-reduction.watsup:147.1-149.54 + ;; 6-reduction.watsup:163.1-165.54 rule cvtop-trap {c_1 : c_numtype, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) -- if ($cvtop(nt_1, cvtop, nt_2, sx?{sx}, c_1) = []) - ;; 6-reduction.watsup:156.1-158.28 + ;; 6-reduction.watsup:174.1-176.28 rule ref.is_null-true {rt : reftype, val : val}: `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) -- if (val = REF.NULL_val(rt)) - ;; 6-reduction.watsup:160.1-162.15 + ;; 6-reduction.watsup:178.1-180.15 rule ref.is_null-false {val : val}: `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 6-reduction.watsup:171.1-172.47 + ;; 6-reduction.watsup:191.1-192.47 rule local.tee {val : val, x : idx}: `%*~>%*`([$admininstr_val(val) LOCAL.TEE_admininstr(x)], [$admininstr_val(val) $admininstr_val(val) LOCAL.SET_admininstr(x)]) -;; 6-reduction.watsup:5.1-5.63 +;; 6-reduction.watsup:7.1-7.63 relation Step_read: `%~>%*`(config, admininstr*) - ;; 6-reduction.watsup:82.1-83.47 + ;; 6-reduction.watsup:96.1-97.47 rule call {x : idx, z : state}: `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [CALL_ADDR_admininstr($funcaddr(z)[x])]) - ;; 6-reduction.watsup:85.1-89.17 + ;; 6-reduction.watsup:99.1-103.17 rule call_indirect-call {a : addr, ft : functype, ft' : functype, i : nat, instr* : instr*, t* : valtype*, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CALL_INDIRECT_admininstr(x, ft)]), [CALL_ADDR_admininstr(a)]) -- if ($table(z, x).ELEM_tableinst[i] = REF.FUNC_ADDR_ref(a)) -- if ($funcinst(z)[a].CODE_funcinst = `FUNC%%*%`(ft', t*{t}, instr*{instr})) -- if (ft = ft') - ;; 6-reduction.watsup:91.1-93.15 + ;; 6-reduction.watsup:105.1-107.15 rule call_indirect-trap {ft : functype, i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CALL_INDIRECT_admininstr(x, ft)]), [TRAP_admininstr]) -- otherwise - ;; 6-reduction.watsup:95.1-99.52 + ;; 6-reduction.watsup:109.1-113.52 rule call_addr {a : addr, f : frame, func : func, instr* : instr*, k : nat, m : moduleinst, n : n, t* : valtype*, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state, o0* : val*}: `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [CALL_ADDR_admininstr(a)]), [FRAME__admininstr(n, f, [LABEL__admininstr(n, [], $admininstr_instr(instr)*{instr})])]) -- (if ($default_(t) = ?(o0)))*{t o0} @@ -9592,319 +9592,308 @@ relation Step_read: `%~>%*`(config, admininstr*) -- if (func = `FUNC%%*%`(`%->%`(t_1^k{t_1}, t_2^n{t_2}), t*{t}, instr*{instr})) -- if (f = {LOCAL val^k{val} :: o0*{o0}, MODULE m}) - ;; 6-reduction.watsup:152.1-153.53 + ;; 6-reduction.watsup:170.1-171.53 rule ref.func {x : idx, z : state}: `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) - ;; 6-reduction.watsup:165.1-166.37 + ;; 6-reduction.watsup:185.1-186.37 rule local.get {x : idx, z : state}: `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [$admininstr_val($local(z, x))]) - ;; 6-reduction.watsup:175.1-176.45 + ;; 6-reduction.watsup:197.1-198.45 rule global.get {x : idx, z : state}: `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [$admininstr_val($global(z, x).VALUE_globalinst)]) - ;; 6-reduction.watsup:182.1-184.33 + ;; 6-reduction.watsup:206.1-208.33 rule table.get-trap {i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:186.1-188.32 + ;; 6-reduction.watsup:210.1-212.32 rule table.get-val {i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [$admininstr_ref($table(z, x).ELEM_tableinst[i])]) -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:199.1-201.32 + ;; 6-reduction.watsup:223.1-225.32 rule table.size {n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) -- if (|$table(z, x).ELEM_tableinst| = n) - ;; 6-reduction.watsup:212.1-214.39 + ;; 6-reduction.watsup:236.1-238.39 rule table.fill-trap {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:216.1-219.14 + ;; 6-reduction.watsup:240.1-243.14 rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:221.1-225.15 + ;; 6-reduction.watsup:245.1-249.15 rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) -- otherwise - ;; 6-reduction.watsup:228.1-230.73 + ;; 6-reduction.watsup:252.1-254.73 rule table.copy-trap {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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|)) - ;; 6-reduction.watsup:232.1-235.14 + ;; 6-reduction.watsup:256.1-259.14 rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:237.1-242.15 + ;; 6-reduction.watsup:261.1-266.15 rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:244.1-248.15 + ;; 6-reduction.watsup:268.1-272.15 rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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 - ;; 6-reduction.watsup:251.1-253.72 + ;; 6-reduction.watsup:275.1-277.72 rule table.init-trap {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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|)) - ;; 6-reduction.watsup:255.1-258.14 + ;; 6-reduction.watsup:279.1-282.14 rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:260.1-264.15 + ;; 6-reduction.watsup:284.1-288.15 rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) $admininstr_ref($elem(z, y).ELEM_eleminst[i]) 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 - ;; 6-reduction.watsup:271.1-273.53 + ;; 6-reduction.watsup:297.1-299.53 rule load-num-trap {i : nat, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), n_A, n_O)]), [TRAP_admininstr]) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if (((i + n_O) + (o0 / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:275.1-277.71 + ;; 6-reduction.watsup:301.1-303.71 rule load-num-val {c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat, o1 : nat}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), n_A, n_O)]), [CONST_admininstr(nt, c)]) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if ($size($valtype_numtype(nt)) = ?(o1)) -- if ($bytes_(o0, c) = $mem(z, 0).DATA_meminst[(i + n_O) : (o1 / 8)]) - ;; 6-reduction.watsup:279.1-281.45 + ;; 6-reduction.watsup:305.1-307.45 rule load-pack-trap {i : nat, n : n, n_A : n, n_O : n, nt : numtype, sx : sx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), n_A, n_O)]), [TRAP_admininstr]) -- if (((i + n_O) + (n / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:283.1-285.55 + ;; 6-reduction.watsup:309.1-311.55 rule load-pack-val {c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, sx : sx, z : state, o0 : nat}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), n_A, n_O)]), [CONST_admininstr(nt, $ext(n, o0, sx, c))]) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if ($bytes_(n, c) = $mem(z, 0).DATA_meminst[(i + n_O) : (n / 8)]) - ;; 6-reduction.watsup:305.1-307.44 + ;; 6-reduction.watsup:331.1-333.44 rule memory.size {n : n, z : state}: `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr]), [CONST_admininstr(I32_numtype, n)]) -- if (((n * 64) * $Ki) = |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:318.1-320.37 + ;; 6-reduction.watsup:344.1-346.37 rule memory.fill-trap {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), [TRAP_admininstr]) -- if ((i + n) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:322.1-325.14 + ;; 6-reduction.watsup:348.1-351.14 rule memory.fill-zero {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:327.1-331.15 + ;; 6-reduction.watsup:353.1-357.15 rule memory.fill-succ {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr]) -- otherwise - ;; 6-reduction.watsup:334.1-336.69 + ;; 6-reduction.watsup:360.1-362.69 rule memory.copy-trap {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [TRAP_admininstr]) -- if (((i + n) > |$mem(z, 0).DATA_meminst|) \/ ((j + n) > |$mem(z, 0).DATA_meminst|)) - ;; 6-reduction.watsup:338.1-341.14 + ;; 6-reduction.watsup:364.1-367.14 rule memory.copy-zero {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:343.1-348.15 + ;; 6-reduction.watsup:369.1-374.15 rule memory.copy-le {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) LOAD_admininstr(I32_numtype, ?((8, U_sx)), 0, 0) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr]) -- otherwise -- if (j <= i) - ;; 6-reduction.watsup:350.1-354.15 + ;; 6-reduction.watsup:376.1-380.15 rule memory.copy-gt {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), 0, 0) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr]) -- otherwise - ;; 6-reduction.watsup:357.1-359.70 + ;; 6-reduction.watsup:383.1-385.70 rule memory.init-trap {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), [TRAP_admininstr]) -- if (((i + n) > |$data(z, x).DATA_datainst|) \/ ((j + n) > |$mem(z, 0).DATA_meminst|)) - ;; 6-reduction.watsup:361.1-364.14 + ;; 6-reduction.watsup:387.1-390.14 rule memory.init-zero {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:366.1-370.15 + ;; 6-reduction.watsup:392.1-396.15 rule memory.init-succ {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, x).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x)]) -- otherwise -;; 6-reduction.watsup:3.1-3.63 +;; 6-reduction.watsup:5.1-5.63 relation Step: `%~>%`(config, config) - ;; 6-reduction.watsup:7.1-9.34 + ;; 6-reduction.watsup:9.1-11.34 rule pure {instr* : instr*, instr'* : instr*, z : state}: `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) -- Step_pure: `%*~>%*`($admininstr_instr(instr)*{instr}, $admininstr_instr(instr')*{instr'}) - ;; 6-reduction.watsup:11.1-13.37 + ;; 6-reduction.watsup:13.1-15.37 rule read {instr* : instr*, instr'* : instr*, z : state}: `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) -- Step_read: `%~>%*`(`%;%*`(z, $admininstr_instr(instr)*{instr}), $admininstr_instr(instr')*{instr'}) - ;; 6-reduction.watsup:168.1-169.60 + ;; 6-reduction.watsup:188.1-189.60 rule local.set {val : val, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_val(val) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) - ;; 6-reduction.watsup:178.1-179.62 + ;; 6-reduction.watsup:200.1-201.62 rule global.set {val : val, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_val(val) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) - ;; 6-reduction.watsup:190.1-192.33 + ;; 6-reduction.watsup:214.1-216.33 rule table.set-trap {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:194.1-196.32 + ;; 6-reduction.watsup:218.1-220.32 rule table.set-val {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:204.1-206.47 + ;; 6-reduction.watsup:228.1-230.47 rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state, o0 : tableinst}: `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) -- if ($grow_table($table(z, x), n, ref) = ?(o0)) -- if (o0 = ti) - ;; 6-reduction.watsup:208.1-209.64 + ;; 6-reduction.watsup:232.1-233.64 rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, - 1)])) - ;; 6-reduction.watsup:267.1-268.59 + ;; 6-reduction.watsup:291.1-292.59 rule elem.drop {x : idx, z : state}: `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) - ;; 6-reduction.watsup:288.1-290.53 + ;; 6-reduction.watsup:314.1-316.53 rule store-num-trap {c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), n_A, n_O)]), `%;%*`(z, [TRAP_admininstr])) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if (((i + n_O) + (o0 / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:292.1-294.35 + ;; 6-reduction.watsup:318.1-320.35 rule store-num-val {b* : byte*, c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat, o1 : nat}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), n_A, n_O)]), `%;%*`($with_mem(z, 0, (i + n_O), (o0 / 8), b*{b}), [])) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if ($size($valtype_numtype(nt)) = ?(o1)) -- if (b*{b} = $bytes_(o1, c)) - ;; 6-reduction.watsup:296.1-298.45 + ;; 6-reduction.watsup:322.1-324.45 rule store-pack-trap {c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), n_A, n_O)]), `%;%*`(z, [TRAP_admininstr])) -- if (((i + n_O) + (n / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:300.1-302.50 + ;; 6-reduction.watsup:326.1-328.50 rule store-pack-val {b* : byte*, c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), n_A, n_O)]), `%;%*`($with_mem(z, 0, (i + n_O), (n / 8), b*{b}), [])) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if (b*{b} = $bytes_(n, $wrap_((o0, n), c))) - ;; 6-reduction.watsup:310.1-312.41 + ;; 6-reduction.watsup:336.1-338.41 rule memory.grow-succeed {mi : meminst, n : n, z : state, o0 : meminst}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr]), `%;%*`($with_meminst(z, 0, mi), [CONST_admininstr(I32_numtype, (|$mem(z, 0).DATA_meminst| / (64 * $Ki)))])) -- if ($grow_memory($mem(z, 0), n) = ?(o0)) -- if (o0 = mi) - ;; 6-reduction.watsup:314.1-315.59 + ;; 6-reduction.watsup:340.1-341.59 rule memory.grow-fail {n : n, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr]), `%;%*`(z, [CONST_admininstr(I32_numtype, - 1)])) - ;; 6-reduction.watsup:373.1-374.59 + ;; 6-reduction.watsup:399.1-400.59 rule data.drop {x : idx, z : state}: `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) -;; 7-module.watsup:4.1-4.35 +;; 7-module.watsup:5.1-5.35 rec { -;; 7-module.watsup:4.1-4.35 +;; 7-module.watsup:5.1-5.35 def funcs : externval* -> funcaddr* - ;; 7-module.watsup:5.1-5.30 + ;; 7-module.watsup:6.1-6.30 def funcs([]) = [] - ;; 7-module.watsup:6.1-6.59 + ;; 7-module.watsup:7.1-7.59 def {externval'* : externval*, fa : funcaddr} funcs([FUNC_externval(fa)] :: externval'*{externval'}) = [fa] :: $funcs(externval'*{externval'}) - ;; 7-module.watsup:7.1-8.15 + ;; 7-module.watsup:8.1-9.15 def {externval : externval, externval'* : externval*} funcs([externval] :: externval'*{externval'}) = $funcs(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:10.1-10.39 +;; 7-module.watsup:11.1-11.39 rec { -;; 7-module.watsup:10.1-10.39 +;; 7-module.watsup:11.1-11.39 def globals : externval* -> globaladdr* - ;; 7-module.watsup:11.1-11.32 + ;; 7-module.watsup:12.1-12.32 def globals([]) = [] - ;; 7-module.watsup:12.1-12.65 + ;; 7-module.watsup:13.1-13.65 def {externval'* : externval*, ga : globaladdr} globals([GLOBAL_externval(ga)] :: externval'*{externval'}) = [ga] :: $globals(externval'*{externval'}) - ;; 7-module.watsup:13.1-14.15 + ;; 7-module.watsup:14.1-15.15 def {externval : externval, externval'* : externval*} globals([externval] :: externval'*{externval'}) = $globals(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:16.1-16.37 +;; 7-module.watsup:17.1-17.37 rec { -;; 7-module.watsup:16.1-16.37 +;; 7-module.watsup:17.1-17.37 def tables : externval* -> tableaddr* - ;; 7-module.watsup:17.1-17.31 + ;; 7-module.watsup:18.1-18.31 def tables([]) = [] - ;; 7-module.watsup:18.1-18.62 + ;; 7-module.watsup:19.1-19.62 def {externval'* : externval*, ta : tableaddr} tables([TABLE_externval(ta)] :: externval'*{externval'}) = [ta] :: $tables(externval'*{externval'}) - ;; 7-module.watsup:19.1-20.15 + ;; 7-module.watsup:20.1-21.15 def {externval : externval, externval'* : externval*} tables([externval] :: externval'*{externval'}) = $tables(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:22.1-22.33 +;; 7-module.watsup:23.1-23.33 rec { -;; 7-module.watsup:22.1-22.33 +;; 7-module.watsup:23.1-23.33 def mems : externval* -> memaddr* - ;; 7-module.watsup:23.1-23.29 + ;; 7-module.watsup:24.1-24.29 def mems([]) = [] - ;; 7-module.watsup:24.1-24.56 + ;; 7-module.watsup:25.1-25.56 def {externval'* : externval*, ma : memaddr} mems([MEM_externval(ma)] :: externval'*{externval'}) = [ma] :: $mems(externval'*{externval'}) - ;; 7-module.watsup:25.1-26.15 + ;; 7-module.watsup:26.1-27.15 def {externval : externval, externval'* : externval*} mems([externval] :: externval'*{externval'}) = $mems(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:29.1-29.83 -def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst - ;; 7-module.watsup:30.1-30.95 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externuse(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} - ;; 7-module.watsup:31.1-31.99 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externuse(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} - ;; 7-module.watsup:32.1-32.97 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externuse(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} - ;; 7-module.watsup:33.1-33.93 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externuse(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} - ;; 7-module.watsup:36.1-36.60 def allocfunc : (store, moduleinst, func) -> (store, funcaddr) ;; 7-module.watsup:37.1-38.37 @@ -10019,9 +10008,20 @@ def allocdatas : (store, byte**) -> (store, dataaddr*) -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) } -;; 7-module.watsup:97.1-97.81 +;; 7-module.watsup:99.1-99.83 +def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst + ;; 7-module.watsup:100.1-100.95 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externuse(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} + ;; 7-module.watsup:101.1-101.99 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externuse(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} + ;; 7-module.watsup:102.1-102.97 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externuse(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} + ;; 7-module.watsup:103.1-103.93 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externuse(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} + +;; 7-module.watsup:106.1-106.81 def allocmodule : (store, module, externval*, val*, ref**) -> (store, moduleinst) - ;; 7-module.watsup:98.1-135.54 + ;; 7-module.watsup:107.1-144.54 def {byte*^n_data : byte*^n_data, da* : dataaddr*, datamode?^n_data : datamode?^n_data, ea* : elemaddr*, elemmode?^n_elem : elemmode?^n_elem, export* : export*, expr_1^n_global : expr^n_global, expr_2*^n_elem : expr*^n_elem, externval* : externval*, fa* : funcaddr*, fa_ex* : funcaddr*, func^n_func : func^n_func, ga* : globaladdr*, ga_ex* : globaladdr*, globaltype^n_global : globaltype^n_global, i_data^n_data : nat^n_data, i_elem^n_elem : nat^n_elem, i_func^n_func : nat^n_func, i_global^n_global : nat^n_global, i_mem^n_mem : nat^n_mem, i_table^n_table : nat^n_table, import* : import*, m : moduleinst, ma* : memaddr*, ma_ex* : memaddr*, memtype^n_mem : memtype^n_mem, module : module, n_data : n, n_elem : n, n_func : n, n_global : n, n_mem : n, n_table : n, ref** : ref**, rt^n_elem : reftype^n_elem, s : store, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store, s_6 : store, start? : start?, ta* : tableaddr*, ta_ex* : tableaddr*, tabletype^n_table : tabletype^n_table, val* : val*, xi* : exportinst*} allocmodule(s, module, externval*{externval}, val*{val}, ref*{ref}*{ref}) = (s_6, m) -- if (module = `MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func^n_func{func}, GLOBAL(globaltype, expr_1)^n_global{expr_1 globaltype}, TABLE(tabletype)^n_table{tabletype}, MEMORY(memtype)^n_mem{memtype}, `ELEM%%*%?`(rt, expr_2*{expr_2}, elemmode?{elemmode})^n_elem{elemmode expr_2 rt}, `DATA%*%?`(byte*{byte}, datamode?{datamode})^n_data{byte datamode}, start?{start}, export*{export})) -- if (fa_ex*{fa_ex} = $funcs(externval*{externval})) @@ -10043,39 +10043,39 @@ def allocmodule : (store, module, externval*, val*, ref**) -> (store, moduleinst -- if ((s_5, ea*{ea}) = $allocelems(s_4, rt^n_elem{rt}, ref*{ref}*{ref})) -- if ((s_6, da*{da}) = $allocdatas(s_5, byte*{byte}^n_data{byte})) -;; 7-module.watsup:138.1-138.33 +;; 7-module.watsup:151.1-151.36 +rec { + +;; 7-module.watsup:151.1-151.36 +def concat_instr : instr** -> instr* + ;; 7-module.watsup:152.1-152.37 + def concat_instr([]) = [] + ;; 7-module.watsup:153.1-153.68 + def {instr* : instr*, instr'** : instr**} concat_instr([instr]*{instr} :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) +} + +;; 7-module.watsup:155.1-155.33 def runelem : (elem, idx) -> instr* - ;; 7-module.watsup:139.1-139.46 + ;; 7-module.watsup:156.1-156.46 def {expr* : expr*, i : nat, reftype : reftype} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?()), i) = [] - ;; 7-module.watsup:140.1-140.62 + ;; 7-module.watsup:157.1-157.62 def {expr* : expr*, i : nat, reftype : reftype} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?(DECLARE_elemmode)), i) = [ELEM.DROP_instr(i)] - ;; 7-module.watsup:141.1-143.20 + ;; 7-module.watsup:158.1-160.20 def {expr* : expr*, i : nat, instr* : instr*, n : n, reftype : reftype, x : idx} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?(TABLE_elemmode(x, instr*{instr}))), i) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, n) TABLE.INIT_instr(x, i) ELEM.DROP_instr(i)] -- if (n = |expr*{expr}|) -;; 7-module.watsup:145.1-145.33 +;; 7-module.watsup:162.1-162.33 def rundata : (data, idx) -> instr* - ;; 7-module.watsup:146.1-146.38 + ;; 7-module.watsup:163.1-163.38 def {byte* : byte*, i : nat} rundata(`DATA%*%?`(byte*{byte}, ?()), i) = [] - ;; 7-module.watsup:147.1-149.20 + ;; 7-module.watsup:164.1-166.20 def {byte* : byte*, i : nat, instr* : instr*, n : n} rundata(`DATA%*%?`(byte*{byte}, ?(MEMORY_datamode(0, instr*{instr}))), i) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, n) MEMORY.INIT_instr(i) DATA.DROP_instr(i)] -- if (n = |byte*{byte}|) -;; 7-module.watsup:152.1-152.36 -rec { - -;; 7-module.watsup:152.1-152.36 -def concat_instr : instr** -> instr* - ;; 7-module.watsup:153.1-153.37 - def concat_instr([]) = [] - ;; 7-module.watsup:154.1-154.68 - def {instr* : instr*, instr'** : instr**} concat_instr([instr]*{instr} :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) -} - -;; 7-module.watsup:157.1-157.55 -def instantiation : (store, module, externval*) -> config - ;; 7-module.watsup:158.1-180.28 - def {data* : data*, elem* : elem*, elemmode?* : elemmode?*, export* : export*, externval* : externval*, f : frame, f_init : frame, func* : func*, global* : global*, globaltype* : globaltype*, i^n_elem : nat^n_elem, import* : import*, instr_1** : instr**, instr_2*** : instr***, instr_data* : instr*, instr_elem* : instr*, j^n_data : nat^n_data, m : moduleinst, m_init : moduleinst, mem* : mem*, module : module, n_data : n, n_elem : n, ref** : ref**, reftype* : reftype*, s : store, s' : store, start? : start?, table* : table*, val* : val*, x? : idx?} instantiation(s, module, externval*{externval}) = `%;%*`(`%;%`(s', f), $admininstr_instr(instr_elem)*{instr_elem} :: $admininstr_instr(instr_data)*{instr_data} :: CALL_admininstr(x)?{x}) +;; 7-module.watsup:168.1-168.53 +def instantiate : (store, module, externval*) -> config + ;; 7-module.watsup:169.1-191.28 + def {data* : data*, elem* : elem*, elemmode?* : elemmode?*, export* : export*, externval* : externval*, f : frame, f_init : frame, func* : func*, global* : global*, globaltype* : globaltype*, i^n_elem : nat^n_elem, import* : import*, instr_1** : instr**, instr_2*** : instr***, instr_data* : instr*, instr_elem* : instr*, j^n_data : nat^n_data, m : moduleinst, m_init : moduleinst, mem* : mem*, module : module, n_data : n, n_elem : n, ref** : ref**, reftype* : reftype*, s : store, s' : store, start? : start?, table* : table*, val* : val*, x? : idx?} instantiate(s, module, externval*{externval}) = `%;%*`(`%;%`(s', f), $admininstr_instr(instr_elem)*{instr_elem} :: $admininstr_instr(instr_data)*{instr_data} :: CALL_admininstr(x)?{x}) -- if (module = `MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data*{data}, start?{start}, export*{export})) -- if (m_init = {FUNC $funcs(externval*{externval}), GLOBAL $globals(externval*{externval}), TABLE [], MEM [], ELEM [], DATA [], EXPORT []}) -- if (f_init = {LOCAL [], MODULE m_init}) @@ -10091,10 +10091,10 @@ def instantiation : (store, module, externval*) -> config -- if (instr_data*{instr_data} = $concat_instr($rundata(data*{data}[j], j)^(j config - ;; 7-module.watsup:184.1-196.52 - def {expr : expr, f : frame, fa : funcaddr, functype : functype, k : nat, m : moduleinst, n : n, s : store, val^n : val^n, valtype* : valtype*, valtype_param^n : valtype^n, valtype_res^k : valtype^k} invocation(s, fa, val^n{val}) = `%;%*`(`%;%`(s, f), $admininstr_val(val)^n{val} :: [CALL_ADDR_admininstr(fa)]) +;; 7-module.watsup:198.1-198.44 +def invoke : (store, funcaddr, val*) -> config + ;; 7-module.watsup:199.1-211.52 + def {expr : expr, f : frame, fa : funcaddr, functype : functype, k : nat, m : moduleinst, n : n, s : store, val^n : val^n, valtype* : valtype*, valtype_param^n : valtype^n, valtype_res^k : valtype^k} invoke(s, fa, val^n{val}) = `%;%*`(`%;%`(s, f), $admininstr_val(val)^n{val} :: [CALL_ADDR_admininstr(fa)]) -- if (m = {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], EXPORT []}) -- if (f = {LOCAL [], MODULE m}) -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = `FUNC%%*%`(functype, valtype*{valtype}, expr)) @@ -10445,49 +10445,49 @@ syntax import = IMPORT(name, name, externtype) ;; 1-syntax.watsup:212.1-213.70 syntax module = `MODULE%*%*%*%*%*%*%*%?%*`(import*, func*, global*, table*, mem*, elem*, data*, start?, export*) -;; 2-aux.watsup:3.1-3.14 +;; 2-aux.watsup:7.1-7.14 def Ki : nat - ;; 2-aux.watsup:4.1-4.15 + ;; 2-aux.watsup:8.1-8.15 def Ki = 1024 -;; 2-aux.watsup:9.1-9.25 +;; 2-aux.watsup:13.1-13.25 rec { -;; 2-aux.watsup:9.1-9.25 +;; 2-aux.watsup:13.1-13.25 def min : (nat, nat) -> nat - ;; 2-aux.watsup:10.1-10.19 + ;; 2-aux.watsup:14.1-14.19 def {j : nat} min(0, j) = 0 - ;; 2-aux.watsup:11.1-11.19 + ;; 2-aux.watsup:15.1-15.19 def {i : nat} min(i, 0) = 0 - ;; 2-aux.watsup:12.1-12.38 + ;; 2-aux.watsup:16.1-16.38 def {i : nat, j : nat} min((i + 1), (j + 1)) = $min(i, j) } -;; 2-aux.watsup:19.1-19.55 +;; 2-aux.watsup:27.1-27.55 def size : valtype -> nat? - ;; 2-aux.watsup:20.1-20.20 + ;; 2-aux.watsup:28.1-28.20 def size(I32_valtype) = ?(32) - ;; 2-aux.watsup:21.1-21.20 + ;; 2-aux.watsup:29.1-29.20 def size(I64_valtype) = ?(64) - ;; 2-aux.watsup:22.1-22.20 + ;; 2-aux.watsup:30.1-30.20 def size(F32_valtype) = ?(32) - ;; 2-aux.watsup:23.1-23.20 + ;; 2-aux.watsup:31.1-31.20 def size(F64_valtype) = ?(64) - ;; 2-aux.watsup:24.1-24.22 + ;; 2-aux.watsup:32.1-32.22 def size(V128_valtype) = ?(128) def {x : valtype} size(x) = ?() -;; 2-aux.watsup:29.1-29.40 +;; 2-aux.watsup:40.1-40.40 def test_sub_ATOM_22 : n -> nat - ;; 2-aux.watsup:30.1-30.38 + ;; 2-aux.watsup:41.1-41.38 def {n_3_ATOM_y : n} test_sub_ATOM_22(n_3_ATOM_y) = 0 -;; 2-aux.watsup:32.1-32.26 +;; 2-aux.watsup:43.1-43.26 def curried_ : (n, n) -> nat - ;; 2-aux.watsup:33.1-33.39 + ;; 2-aux.watsup:44.1-44.39 def {n_1 : n, n_2 : n} curried_(n_1, n_2) = (n_1 + n_2) -;; 2-aux.watsup:35.1-44.39 +;; 2-aux.watsup:46.1-55.39 syntax testfuse = | AB_(nat, nat, nat) | CD(nat, nat, nat) @@ -10499,204 +10499,204 @@ syntax testfuse = | OP(nat, nat, nat) | QR(nat, nat, nat) -;; 3-typing.watsup:3.1-6.60 +;; 3-typing.watsup:5.1-8.60 syntax context = {FUNC functype*, GLOBAL globaltype*, TABLE tabletype*, MEM memtype*, ELEM elemtype*, DATA datatype*, LOCAL valtype*, LABEL resulttype*, RETURN resulttype?} -;; 3-typing.watsup:14.1-14.66 +;; 3-typing.watsup:18.1-18.66 relation Limits_ok: `|-%:%`(limits, nat) - ;; 3-typing.watsup:22.1-24.24 + ;; 3-typing.watsup:26.1-28.24 rule _ {k : nat, n_1 : n, n_2 : n}: `|-%:%`(`[%..%]`(n_1, n_2), k) -- if ((n_1 <= n_2) /\ (n_2 <= k)) -;; 3-typing.watsup:15.1-15.64 +;; 3-typing.watsup:19.1-19.64 relation Functype_ok: `|-%:OK`(functype) - ;; 3-typing.watsup:26.1-27.13 + ;; 3-typing.watsup:30.1-31.13 rule _ {ft : functype}: `|-%:OK`(ft) -;; 3-typing.watsup:16.1-16.66 +;; 3-typing.watsup:20.1-20.66 relation Globaltype_ok: `|-%:OK`(globaltype) - ;; 3-typing.watsup:29.1-30.13 + ;; 3-typing.watsup:33.1-34.13 rule _ {gt : globaltype}: `|-%:OK`(gt) -;; 3-typing.watsup:17.1-17.65 +;; 3-typing.watsup:21.1-21.65 relation Tabletype_ok: `|-%:OK`(tabletype) - ;; 3-typing.watsup:32.1-34.35 + ;; 3-typing.watsup:36.1-38.35 rule _ {lim : limits, rt : reftype}: `|-%:OK`(`%%`(lim, rt)) -- Limits_ok: `|-%:%`(lim, ((2 ^ 32) - 1)) -;; 3-typing.watsup:18.1-18.63 +;; 3-typing.watsup:22.1-22.63 relation Memtype_ok: `|-%:OK`(memtype) - ;; 3-typing.watsup:36.1-38.33 + ;; 3-typing.watsup:40.1-42.33 rule _ {lim : limits}: `|-%:OK`(`%I8`(lim)) -- Limits_ok: `|-%:%`(lim, (2 ^ 16)) -;; 3-typing.watsup:19.1-19.66 +;; 3-typing.watsup:23.1-23.66 relation Externtype_ok: `|-%:OK`(externtype) - ;; 3-typing.watsup:41.1-43.35 + ;; 3-typing.watsup:45.1-47.35 rule func {functype : functype}: `|-%:OK`(FUNC_externtype(functype)) -- Functype_ok: `|-%:OK`(functype) - ;; 3-typing.watsup:45.1-47.39 + ;; 3-typing.watsup:49.1-51.39 rule global {globaltype : globaltype}: `|-%:OK`(GLOBAL_externtype(globaltype)) -- Globaltype_ok: `|-%:OK`(globaltype) - ;; 3-typing.watsup:49.1-51.37 + ;; 3-typing.watsup:53.1-55.37 rule table {tabletype : tabletype}: `|-%:OK`(TABLE_externtype(tabletype)) -- Tabletype_ok: `|-%:OK`(tabletype) - ;; 3-typing.watsup:53.1-55.33 + ;; 3-typing.watsup:57.1-59.33 rule mem {memtype : memtype}: `|-%:OK`(MEM_externtype(memtype)) -- Memtype_ok: `|-%:OK`(memtype) -;; 3-typing.watsup:61.1-61.65 +;; 3-typing.watsup:69.1-69.65 relation Valtype_sub: `|-%<:%`(valtype, valtype) - ;; 3-typing.watsup:64.1-65.12 + ;; 3-typing.watsup:72.1-73.12 rule refl {t : valtype}: `|-%<:%`(t, t) - ;; 3-typing.watsup:67.1-68.14 + ;; 3-typing.watsup:75.1-76.14 rule bot {t : valtype}: `|-%<:%`(BOT_valtype, t) -;; 3-typing.watsup:62.1-62.72 +;; 3-typing.watsup:70.1-70.72 relation Resulttype_sub: `|-%*<:%*`(valtype*, valtype*) - ;; 3-typing.watsup:70.1-72.35 + ;; 3-typing.watsup:78.1-80.35 rule _ {t_1* : valtype*, t_2* : valtype*}: `|-%*<:%*`(t_1*{t_1}, t_2*{t_2}) -- if (|t_1*{t_1}| = |t_2*{t_2}|) -- (Valtype_sub: `|-%<:%`(t_1, t_2))*{t_1 t_2} -;; 3-typing.watsup:75.1-75.75 +;; 3-typing.watsup:85.1-85.75 relation Limits_sub: `|-%<:%`(limits, limits) - ;; 3-typing.watsup:83.1-86.21 + ;; 3-typing.watsup:93.1-96.21 rule _ {n_11 : n, n_12 : n, n_21 : n, n_22 : n}: `|-%<:%`(`[%..%]`(n_11, n_12), `[%..%]`(n_21, n_22)) -- if (n_11 >= n_21) -- if (n_12 <= n_22) -;; 3-typing.watsup:76.1-76.73 +;; 3-typing.watsup:86.1-86.73 relation Functype_sub: `|-%<:%`(functype, functype) - ;; 3-typing.watsup:88.1-89.14 + ;; 3-typing.watsup:98.1-99.14 rule _ {ft : functype}: `|-%<:%`(ft, ft) -;; 3-typing.watsup:77.1-77.75 +;; 3-typing.watsup:87.1-87.75 relation Globaltype_sub: `|-%<:%`(globaltype, globaltype) - ;; 3-typing.watsup:91.1-92.14 + ;; 3-typing.watsup:101.1-102.14 rule _ {gt : globaltype}: `|-%<:%`(gt, gt) -;; 3-typing.watsup:78.1-78.74 +;; 3-typing.watsup:88.1-88.74 relation Tabletype_sub: `|-%<:%`(tabletype, tabletype) - ;; 3-typing.watsup:94.1-96.35 + ;; 3-typing.watsup:104.1-106.35 rule _ {lim_1 : limits, lim_2 : limits, rt : reftype}: `|-%<:%`(`%%`(lim_1, rt), `%%`(lim_2, rt)) -- Limits_sub: `|-%<:%`(lim_1, lim_2) -;; 3-typing.watsup:79.1-79.72 +;; 3-typing.watsup:89.1-89.72 relation Memtype_sub: `|-%<:%`(memtype, memtype) - ;; 3-typing.watsup:98.1-100.35 + ;; 3-typing.watsup:108.1-110.35 rule _ {lim_1 : limits, lim_2 : limits}: `|-%<:%`(`%I8`(lim_1), `%I8`(lim_2)) -- Limits_sub: `|-%<:%`(lim_1, lim_2) -;; 3-typing.watsup:80.1-80.75 +;; 3-typing.watsup:90.1-90.75 relation Externtype_sub: `|-%<:%`(externtype, externtype) - ;; 3-typing.watsup:103.1-105.35 + ;; 3-typing.watsup:113.1-115.35 rule func {ft_1 : functype, ft_2 : functype}: `|-%<:%`(FUNC_externtype(ft_1), FUNC_externtype(ft_2)) -- Functype_sub: `|-%<:%`(ft_1, ft_2) - ;; 3-typing.watsup:107.1-109.37 + ;; 3-typing.watsup:117.1-119.37 rule global {gt_1 : globaltype, gt_2 : globaltype}: `|-%<:%`(GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) -- Globaltype_sub: `|-%<:%`(gt_1, gt_2) - ;; 3-typing.watsup:111.1-113.36 + ;; 3-typing.watsup:121.1-123.36 rule table {tt_1 : tabletype, tt_2 : tabletype}: `|-%<:%`(TABLE_externtype(tt_1), TABLE_externtype(tt_2)) -- Tabletype_sub: `|-%<:%`(tt_1, tt_2) - ;; 3-typing.watsup:115.1-117.34 + ;; 3-typing.watsup:125.1-127.34 rule mem {mt_1 : memtype, mt_2 : memtype}: `|-%<:%`(MEM_externtype(mt_1), MEM_externtype(mt_2)) -- Memtype_sub: `|-%<:%`(mt_1, mt_2) -;; 3-typing.watsup:172.1-172.76 +;; 3-typing.watsup:192.1-192.76 relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) - ;; 3-typing.watsup:174.1-176.29 + ;; 3-typing.watsup:194.1-196.29 rule _ {C : context, ft : functype}: `%|-%:%`(C, ft, ft) -- Functype_ok: `|-%:OK`(ft) -;; 3-typing.watsup:123.1-124.67 +;; 3-typing.watsup:135.1-136.67 rec { -;; 3-typing.watsup:123.1-123.66 +;; 3-typing.watsup:135.1-135.66 relation Instr_ok: `%|-%:%`(context, instr, functype) - ;; 3-typing.watsup:153.1-154.34 + ;; 3-typing.watsup:171.1-172.34 rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:156.1-157.32 + ;; 3-typing.watsup:174.1-175.32 rule nop {C : context}: `%|-%:%`(C, NOP_instr, `%->%`([], [])) - ;; 3-typing.watsup:159.1-160.27 + ;; 3-typing.watsup:177.1-178.27 rule drop {C : context, t : valtype}: `%|-%:%`(C, DROP_instr, `%->%`([t], [])) - ;; 3-typing.watsup:163.1-164.31 + ;; 3-typing.watsup:181.1-182.31 rule select-expl {C : context, t : valtype}: `%|-%:%`(C, SELECT_instr(?(t)), `%->%`([t t I32_valtype], [t])) - ;; 3-typing.watsup:166.1-169.37 + ;; 3-typing.watsup:184.1-187.37 rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) -- Valtype_sub: `|-%<:%`(t, t') -- if ((t' = $valtype_numtype(numtype)) \/ (t' = $valtype_vectype(vectype))) - ;; 3-typing.watsup:178.1-181.59 + ;; 3-typing.watsup:198.1-201.59 rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:183.1-186.59 + ;; 3-typing.watsup:203.1-206.59 rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:188.1-192.61 + ;; 3-typing.watsup:208.1-212.61 rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%`(t_1*{t_1}, t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:195.1-197.24 + ;; 3-typing.watsup:217.1-219.24 rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- if (l < |C.LABEL_context|) -- if (C.LABEL_context[l] = t*{t}) - ;; 3-typing.watsup:199.1-201.24 + ;; 3-typing.watsup:221.1-223.24 rule br_if {C : context, l : labelidx, t* : valtype*}: `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) -- if (l < |C.LABEL_context|) -- if (C.LABEL_context[l] = t*{t}) - ;; 3-typing.watsup:203.1-206.42 + ;; 3-typing.watsup:225.1-228.42 rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- (if (l < |C.LABEL_context|))*{l} @@ -10704,51 +10704,51 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- (Resulttype_sub: `|-%*<:%*`(t*{t}, C.LABEL_context[l]))*{l} -- Resulttype_sub: `|-%*<:%*`(t*{t}, C.LABEL_context[l']) - ;; 3-typing.watsup:208.1-210.24 + ;; 3-typing.watsup:233.1-235.24 rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- if (C.RETURN_context = ?(t*{t})) - ;; 3-typing.watsup:212.1-214.33 + ;; 3-typing.watsup:237.1-239.33 rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) -- if (x < |C.FUNC_context|) -- if (C.FUNC_context[x] = `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:216.1-219.26 + ;; 3-typing.watsup:241.1-244.26 rule call_indirect {C : context, ft : functype, lim : limits, t_1* : valtype*, t_2* : valtype*, x : idx}: `%|-%:%`(C, CALL_INDIRECT_instr(x, ft), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) -- if (x < |C.TABLE_context|) -- if (C.TABLE_context[x] = `%%`(lim, FUNCREF_reftype)) -- if (ft = `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:222.1-223.37 + ;; 3-typing.watsup:249.1-250.37 rule const {C : context, c_nt : c_numtype, nt : numtype}: `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [$valtype_numtype(nt)])) - ;; 3-typing.watsup:225.1-226.31 + ;; 3-typing.watsup:252.1-253.31 rule unop {C : context, nt : numtype, unop : unop_numtype}: `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 3-typing.watsup:228.1-229.36 + ;; 3-typing.watsup:255.1-256.36 rule binop {C : context, binop : binop_numtype, nt : numtype}: `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 3-typing.watsup:231.1-232.36 + ;; 3-typing.watsup:258.1-259.36 rule testop {C : context, nt : numtype, testop : testop_numtype}: `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([$valtype_numtype(nt)], [I32_valtype])) - ;; 3-typing.watsup:234.1-235.37 + ;; 3-typing.watsup:261.1-262.37 rule relop {C : context, nt : numtype, relop : relop_numtype}: `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [I32_valtype])) - ;; 3-typing.watsup:238.1-240.23 + ;; 3-typing.watsup:265.1-267.23 rule extend {C : context, n : n, nt : numtype, o0 : nat}: `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if (n <= o0) - ;; 3-typing.watsup:242.1-245.34 + ;; 3-typing.watsup:269.1-272.34 rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype, o0 : nat, o1 : nat}: `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([$valtype_numtype(nt_2)], [$valtype_numtype(nt_1)])) -- if ($size($valtype_numtype(nt_1)) = ?(o0)) @@ -10756,7 +10756,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- if (nt_1 =/= nt_2) -- if (o0 = o1) - ;; 3-typing.watsup:247.1-250.52 + ;; 3-typing.watsup:274.1-277.52 rule convert-i {C : context, in_1 : in, in_2 : in, sx? : sx?, o0 : nat, o1 : nat}: `%|-%:%`(C, CVTOP_instr($numtype_in(in_1), CONVERT_cvtop, $numtype_in(in_2), sx?{sx}), `%->%`([$valtype_in(in_2)], [$valtype_in(in_1)])) -- if ($size($valtype_in(in_1)) = ?(o0)) @@ -10764,86 +10764,86 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- if (in_1 =/= in_2) -- if ((sx?{sx} = ?()) <=> (o0 > o1)) - ;; 3-typing.watsup:252.1-254.22 + ;; 3-typing.watsup:279.1-281.22 rule convert-f {C : context, fn_1 : fn, fn_2 : fn}: `%|-%:%`(C, CVTOP_instr($numtype_fn(fn_1), CONVERT_cvtop, $numtype_fn(fn_2), ?()), `%->%`([$valtype_fn(fn_2)], [$valtype_fn(fn_1)])) -- if (fn_1 =/= fn_2) - ;; 3-typing.watsup:257.1-258.35 + ;; 3-typing.watsup:286.1-287.35 rule ref.null {C : context, rt : reftype}: `%|-%:%`(C, REF.NULL_instr(rt), `%->%`([], [$valtype_reftype(rt)])) - ;; 3-typing.watsup:260.1-262.23 + ;; 3-typing.watsup:289.1-291.23 rule ref.func {C : context, ft : functype, x : idx}: `%|-%:%`(C, REF.FUNC_instr(x), `%->%`([], [FUNCREF_valtype])) -- if (x < |C.FUNC_context|) -- if (C.FUNC_context[x] = ft) - ;; 3-typing.watsup:264.1-265.31 + ;; 3-typing.watsup:293.1-294.31 rule ref.is_null {C : context, rt : reftype}: `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([$valtype_reftype(rt)], [I32_valtype])) - ;; 3-typing.watsup:268.1-270.23 + ;; 3-typing.watsup:299.1-301.23 rule local.get {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) -- if (x < |C.LOCAL_context|) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:272.1-274.23 + ;; 3-typing.watsup:303.1-305.23 rule local.set {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->%`([t], [])) -- if (x < |C.LOCAL_context|) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:276.1-278.23 + ;; 3-typing.watsup:307.1-309.23 rule local.tee {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%`([t], [t])) -- if (x < |C.LOCAL_context|) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:281.1-283.29 + ;; 3-typing.watsup:314.1-316.29 rule global.get {C : context, t : valtype, x : idx, w0 : ()?}: `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) -- if (x < |C.GLOBAL_context|) -- if (C.GLOBAL_context[x] = `MUT%?%`(w0, t)) - ;; 3-typing.watsup:285.1-287.28 + ;; 3-typing.watsup:318.1-320.28 rule global.set {C : context, t : valtype, x : idx}: `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) -- if (x < |C.GLOBAL_context|) -- if (C.GLOBAL_context[x] = `MUT%?%`(?(()), t)) - ;; 3-typing.watsup:290.1-292.28 + ;; 3-typing.watsup:325.1-327.28 rule table.get {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [$valtype_reftype(rt)])) -- if (x < |C.TABLE_context|) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:294.1-296.28 + ;; 3-typing.watsup:329.1-331.28 rule table.set {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype $valtype_reftype(rt)], [])) -- if (x < |C.TABLE_context|) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:298.1-300.24 + ;; 3-typing.watsup:333.1-335.24 rule table.size {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) -- if (x < |C.TABLE_context|) -- if (C.TABLE_context[x] = tt) - ;; 3-typing.watsup:302.1-304.28 + ;; 3-typing.watsup:337.1-339.28 rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([$valtype_reftype(rt) I32_valtype], [I32_valtype])) -- if (x < |C.TABLE_context|) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:306.1-308.28 + ;; 3-typing.watsup:341.1-343.28 rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype $valtype_reftype(rt) I32_valtype], [])) -- if (x < |C.TABLE_context|) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:310.1-313.32 + ;; 3-typing.watsup:345.1-348.32 rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt : reftype, x_1 : idx, x_2 : idx}: `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (x_1 < |C.TABLE_context|) @@ -10851,7 +10851,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt)) -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt)) - ;; 3-typing.watsup:315.1-318.25 + ;; 3-typing.watsup:350.1-353.25 rule table.init {C : context, lim : limits, rt : reftype, x_1 : idx, x_2 : idx}: `%|-%:%`(C, TABLE.INIT_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (x_1 < |C.TABLE_context|) @@ -10859,37 +10859,37 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- if (C.TABLE_context[x_1] = `%%`(lim, rt)) -- if (C.ELEM_context[x_2] = rt) - ;; 3-typing.watsup:320.1-322.23 + ;; 3-typing.watsup:355.1-357.23 rule elem.drop {C : context, rt : reftype, x : idx}: `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) -- if (x < |C.ELEM_context|) -- if (C.ELEM_context[x] = rt) - ;; 3-typing.watsup:325.1-327.22 + ;; 3-typing.watsup:362.1-364.22 rule memory.size {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.SIZE_instr, `%->%`([], [I32_valtype])) -- if (0 < |C.MEM_context|) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:329.1-331.22 + ;; 3-typing.watsup:366.1-368.22 rule memory.grow {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.GROW_instr, `%->%`([I32_valtype], [I32_valtype])) -- if (0 < |C.MEM_context|) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:333.1-335.22 + ;; 3-typing.watsup:370.1-372.22 rule memory.fill {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.FILL_instr, `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (0 < |C.MEM_context|) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:337.1-339.22 + ;; 3-typing.watsup:374.1-376.22 rule memory.copy {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.COPY_instr, `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (0 < |C.MEM_context|) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:341.1-344.23 + ;; 3-typing.watsup:378.1-381.23 rule memory.init {C : context, mt : memtype, x : idx}: `%|-%:%`(C, MEMORY.INIT_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (0 < |C.MEM_context|) @@ -10897,13 +10897,13 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- if (C.MEM_context[0] = mt) -- if (C.DATA_context[x] = OK) - ;; 3-typing.watsup:346.1-348.23 + ;; 3-typing.watsup:383.1-385.23 rule data.drop {C : context, x : idx}: `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) -- if (x < |C.DATA_context|) -- if (C.DATA_context[x] = OK) - ;; 3-typing.watsup:350.1-355.32 + ;; 3-typing.watsup:387.1-392.32 rule load {C : context, in : in, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, o0 : nat, o1? : nat?}: `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, n_A, n_O), `%->%`([I32_valtype], [$valtype_numtype(nt)])) -- if (0 < |C.MEM_context|) @@ -10916,7 +10916,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} -- if ((n?{n} = ?()) \/ (nt = $numtype_in(in))) - ;; 3-typing.watsup:357.1-362.32 + ;; 3-typing.watsup:394.1-399.32 rule store {C : context, in : in, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, o0 : nat, o1? : nat?}: `%|-%:%`(C, STORE_instr(nt, n?{n}, n_A, n_O), `%->%`([I32_valtype $valtype_numtype(nt)], [])) -- if (0 < |C.MEM_context|) @@ -10928,193 +10928,193 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} -- if ((n?{n} = ?()) \/ (nt = $numtype_in(in))) -;; 3-typing.watsup:124.1-124.67 +;; 3-typing.watsup:136.1-136.67 relation InstrSeq_ok: `%|-%*:%`(context, instr*, functype) - ;; 3-typing.watsup:133.1-134.36 + ;; 3-typing.watsup:149.1-150.36 rule empty {C : context}: `%|-%*:%`(C, [], `%->%`([], [])) - ;; 3-typing.watsup:136.1-139.46 + ;; 3-typing.watsup:152.1-155.46 rule seq {C : context, instr_1 : instr, instr_2 : instr, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*}: `%|-%*:%`(C, [instr_1] :: instr_2*{}, `%->%`(t_1*{t_1}, t_3*{t_3})) -- Instr_ok: `%|-%:%`(C, instr_1, `%->%`(t_1*{t_1}, t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C, [instr_2], `%->%`(t_2*{t_2}, t_3*{t_3})) - ;; 3-typing.watsup:141.1-146.38 + ;; 3-typing.watsup:157.1-162.38 rule weak {C : context, instr* : instr*, t'_1* : valtype*, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%*:%`(C, instr*{instr}, `%->%`(t'_1*{t'_1}, t'_2*{t'_2})) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) -- Resulttype_sub: `|-%*<:%*`(t'_1*{t'_1}, t_1*{t_1}) -- Resulttype_sub: `|-%*<:%*`(t_2*{t_2}, t'_2*{t'_2}) - ;; 3-typing.watsup:148.1-150.45 + ;; 3-typing.watsup:164.1-166.45 rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%*:%`(C, instr*{instr}, `%->%`(t*{t} :: t_1*{t_1}, t*{t} :: t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) } -;; 3-typing.watsup:125.1-125.71 +;; 3-typing.watsup:137.1-137.71 relation Expr_ok: `%|-%:%`(context, expr, resulttype) - ;; 3-typing.watsup:128.1-130.46 + ;; 3-typing.watsup:142.1-144.46 rule _ {C : context, instr* : instr*, t* : valtype*}: `%|-%:%`(C, instr*{instr}, t*{t}) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`([], t*{t})) -;; 3-typing.watsup:367.1-367.78 +;; 3-typing.watsup:406.1-406.78 relation Instr_const: `%|-%CONST`(context, instr) - ;; 3-typing.watsup:371.1-372.26 + ;; 3-typing.watsup:410.1-411.26 rule const {C : context, c : c_numtype, nt : numtype}: `%|-%CONST`(C, CONST_instr(nt, c)) - ;; 3-typing.watsup:374.1-375.27 + ;; 3-typing.watsup:413.1-414.27 rule ref.null {C : context, rt : reftype}: `%|-%CONST`(C, REF.NULL_instr(rt)) - ;; 3-typing.watsup:377.1-378.26 + ;; 3-typing.watsup:416.1-417.26 rule ref.func {C : context, x : idx}: `%|-%CONST`(C, REF.FUNC_instr(x)) - ;; 3-typing.watsup:380.1-382.32 + ;; 3-typing.watsup:419.1-421.32 rule global.get {C : context, t : valtype, x : idx}: `%|-%CONST`(C, GLOBAL.GET_instr(x)) -- if (x < |C.GLOBAL_context|) -- if (C.GLOBAL_context[x] = `MUT%?%`(?(), t)) -;; 3-typing.watsup:368.1-368.77 +;; 3-typing.watsup:407.1-407.77 relation Expr_const: `%|-%CONST`(context, expr) - ;; 3-typing.watsup:385.1-386.38 + ;; 3-typing.watsup:424.1-425.38 rule _ {C : context, instr* : instr*}: `%|-%CONST`(C, instr*{instr}) -- (Instr_const: `%|-%CONST`(C, instr))*{instr} -;; 3-typing.watsup:369.1-369.78 +;; 3-typing.watsup:408.1-408.78 relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) - ;; 3-typing.watsup:389.1-392.33 + ;; 3-typing.watsup:428.1-431.33 rule _ {C : context, expr : expr, t : valtype}: `%|-%:%CONST`(C, expr, t) -- Expr_ok: `%|-%:%`(C, expr, [t]) -- Expr_const: `%|-%CONST`(C, expr) -;; 3-typing.watsup:397.1-397.73 +;; 3-typing.watsup:438.1-438.73 relation Func_ok: `%|-%:%`(context, func, functype) - ;; 3-typing.watsup:408.1-412.75 + ;; 3-typing.watsup:451.1-455.75 rule _ {C : context, expr : expr, ft : functype, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, `FUNC%%*%`(ft, t*{t}, expr), ft) -- if (ft = `%->%`(t_1*{t_1}, t_2*{t_2})) -- Functype_ok: `|-%:OK`(ft) -- Expr_ok: `%|-%:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL t_1*{t_1} :: t*{t}, LABEL [], RETURN ?()} ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()} ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2})}, expr, t_2*{t_2}) -;; 3-typing.watsup:398.1-398.75 +;; 3-typing.watsup:439.1-439.75 relation Global_ok: `%|-%:%`(context, global, globaltype) - ;; 3-typing.watsup:414.1-418.40 + ;; 3-typing.watsup:457.1-461.40 rule _ {C : context, expr : expr, gt : globaltype, t : valtype, w0 : ()?}: `%|-%:%`(C, GLOBAL(gt, expr), gt) -- Globaltype_ok: `|-%:OK`(gt) -- if (gt = `MUT%?%`(w0, t)) -- Expr_ok_const: `%|-%:%CONST`(C, expr, t) -;; 3-typing.watsup:399.1-399.74 +;; 3-typing.watsup:440.1-440.74 relation Table_ok: `%|-%:%`(context, table, tabletype) - ;; 3-typing.watsup:420.1-422.30 + ;; 3-typing.watsup:463.1-465.30 rule _ {C : context, tt : tabletype}: `%|-%:%`(C, TABLE(tt), tt) -- Tabletype_ok: `|-%:OK`(tt) -;; 3-typing.watsup:400.1-400.72 +;; 3-typing.watsup:441.1-441.72 relation Mem_ok: `%|-%:%`(context, mem, memtype) - ;; 3-typing.watsup:424.1-426.28 + ;; 3-typing.watsup:467.1-469.28 rule _ {C : context, mt : memtype}: `%|-%:%`(C, MEMORY(mt), mt) -- Memtype_ok: `|-%:OK`(mt) -;; 3-typing.watsup:403.1-403.77 +;; 3-typing.watsup:444.1-444.77 relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) - ;; 3-typing.watsup:437.1-440.45 + ;; 3-typing.watsup:480.1-483.45 rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE_elemmode(x, expr), rt) -- if (x < |C.TABLE_context|) -- if (C.TABLE_context[x] = `%%`(lim, rt)) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} - ;; 3-typing.watsup:442.1-443.20 + ;; 3-typing.watsup:485.1-486.20 rule declare {C : context, rt : reftype}: `%|-%:%`(C, DECLARE_elemmode, rt) -;; 3-typing.watsup:401.1-401.73 +;; 3-typing.watsup:442.1-442.73 relation Elem_ok: `%|-%:%`(context, elem, reftype) - ;; 3-typing.watsup:428.1-431.40 + ;; 3-typing.watsup:471.1-474.40 rule _ {C : context, elemmode? : elemmode?, expr* : expr*, rt : reftype}: `%|-%:%`(C, `ELEM%%*%?`(rt, expr*{expr}, elemmode?{elemmode}), rt) -- (Expr_ok: `%|-%:%`(C, expr, [$valtype_reftype(rt)]))*{expr} -- (Elemmode_ok: `%|-%:%`(C, elemmode, rt))?{elemmode} -;; 3-typing.watsup:404.1-404.77 +;; 3-typing.watsup:445.1-445.77 relation Datamode_ok: `%|-%:OK`(context, datamode) - ;; 3-typing.watsup:445.1-448.45 + ;; 3-typing.watsup:488.1-491.45 rule _ {C : context, expr : expr, mt : memtype}: `%|-%:OK`(C, MEMORY_datamode(0, expr)) -- if (0 < |C.MEM_context|) -- if (C.MEM_context[0] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} -;; 3-typing.watsup:402.1-402.73 +;; 3-typing.watsup:443.1-443.73 relation Data_ok: `%|-%:OK`(context, data) - ;; 3-typing.watsup:433.1-435.40 + ;; 3-typing.watsup:476.1-478.40 rule _ {C : context, b* : byte*, datamode? : datamode?}: `%|-%:OK`(C, `DATA%*%?`(b*{b}, datamode?{datamode})) -- (Datamode_ok: `%|-%:OK`(C, datamode))?{datamode} -;; 3-typing.watsup:405.1-405.74 +;; 3-typing.watsup:446.1-446.74 relation Start_ok: `%|-%:OK`(context, start) - ;; 3-typing.watsup:450.1-452.39 + ;; 3-typing.watsup:493.1-495.39 rule _ {C : context, x : idx}: `%|-%:OK`(C, START(x)) -- if (x < |C.FUNC_context|) -- if (C.FUNC_context[x] = `%->%`([], [])) -;; 3-typing.watsup:455.1-455.80 +;; 3-typing.watsup:500.1-500.80 relation Import_ok: `%|-%:%`(context, import, externtype) - ;; 3-typing.watsup:459.1-461.31 + ;; 3-typing.watsup:504.1-506.31 rule _ {C : context, name_1 : name, name_2 : name, xt : externtype}: `%|-%:%`(C, IMPORT(name_1, name_2, xt), xt) -- Externtype_ok: `|-%:OK`(xt) -;; 3-typing.watsup:457.1-457.83 +;; 3-typing.watsup:502.1-502.83 relation Externuse_ok: `%|-%:%`(context, externuse, externtype) - ;; 3-typing.watsup:467.1-469.23 + ;; 3-typing.watsup:512.1-514.23 rule func {C : context, ft : functype, x : idx}: `%|-%:%`(C, FUNC_externuse(x), FUNC_externtype(ft)) -- if (x < |C.FUNC_context|) -- if (C.FUNC_context[x] = ft) - ;; 3-typing.watsup:471.1-473.25 + ;; 3-typing.watsup:516.1-518.25 rule global {C : context, gt : globaltype, x : idx}: `%|-%:%`(C, GLOBAL_externuse(x), GLOBAL_externtype(gt)) -- if (x < |C.GLOBAL_context|) -- if (C.GLOBAL_context[x] = gt) - ;; 3-typing.watsup:475.1-477.24 + ;; 3-typing.watsup:520.1-522.24 rule table {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE_externuse(x), TABLE_externtype(tt)) -- if (x < |C.TABLE_context|) -- if (C.TABLE_context[x] = tt) - ;; 3-typing.watsup:479.1-481.22 + ;; 3-typing.watsup:524.1-526.22 rule mem {C : context, mt : memtype, x : idx}: `%|-%:%`(C, MEM_externuse(x), MEM_externtype(mt)) -- if (x < |C.MEM_context|) -- if (C.MEM_context[x] = mt) -;; 3-typing.watsup:456.1-456.80 +;; 3-typing.watsup:501.1-501.80 relation Export_ok: `%|-%:%`(context, export, externtype) - ;; 3-typing.watsup:463.1-465.39 + ;; 3-typing.watsup:508.1-510.39 rule _ {C : context, externuse : externuse, name : name, xt : externtype}: `%|-%:%`(C, EXPORT(name, externuse), xt) -- Externuse_ok: `%|-%:%`(C, externuse, xt) -;; 3-typing.watsup:484.1-484.62 +;; 3-typing.watsup:531.1-531.62 relation Module_ok: `|-%:OK`(module) - ;; 3-typing.watsup:486.1-500.16 + ;; 3-typing.watsup:533.1-547.16 rule _ {C : context, data^n : data^n, elem* : elem*, export* : export*, ft* : functype*, func* : func*, global* : global*, gt* : globaltype*, import* : import*, mem* : mem*, mt* : memtype*, n : n, rt* : reftype*, start? : start?, table* : table*, tt* : tabletype*}: `|-%:OK`(`MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data^n{data}, start?{start}, export*{export})) -- if (|ft*{ft}| = |func*{func}|) @@ -11132,115 +11132,115 @@ relation Module_ok: `|-%:OK`(module) -- (Start_ok: `%|-%:OK`(C, start))?{start} -- if (|mem*{mem}| <= 1) -;; 4-runtime.watsup:3.1-3.39 +;; 4-runtime.watsup:5.1-5.39 syntax addr = nat -;; 4-runtime.watsup:4.1-4.53 +;; 4-runtime.watsup:6.1-6.53 syntax funcaddr = addr -;; 4-runtime.watsup:5.1-5.53 +;; 4-runtime.watsup:7.1-7.53 syntax globaladdr = addr -;; 4-runtime.watsup:6.1-6.51 +;; 4-runtime.watsup:8.1-8.51 syntax tableaddr = addr -;; 4-runtime.watsup:7.1-7.50 +;; 4-runtime.watsup:9.1-9.50 syntax memaddr = addr -;; 4-runtime.watsup:8.1-8.49 +;; 4-runtime.watsup:10.1-10.49 syntax elemaddr = addr -;; 4-runtime.watsup:9.1-9.49 +;; 4-runtime.watsup:11.1-11.49 syntax dataaddr = addr -;; 4-runtime.watsup:10.1-10.51 +;; 4-runtime.watsup:12.1-12.51 syntax labeladdr = addr -;; 4-runtime.watsup:11.1-11.49 +;; 4-runtime.watsup:13.1-13.49 syntax hostaddr = addr -;; 4-runtime.watsup:24.1-25.24 +;; 4-runtime.watsup:30.1-31.24 syntax num = | CONST(numtype, c_numtype) -;; 4-runtime.watsup:26.1-27.67 +;; 4-runtime.watsup:32.1-33.67 syntax ref = | REF.NULL(reftype) | REF.FUNC_ADDR(funcaddr) | REF.HOST_ADDR(hostaddr) -;; 4-runtime.watsup:28.1-29.10 +;; 4-runtime.watsup:34.1-35.10 syntax val = | CONST(numtype, c_numtype) | REF.NULL(reftype) | REF.FUNC_ADDR(funcaddr) | REF.HOST_ADDR(hostaddr) -;; 4-runtime.watsup:31.1-32.18 +;; 4-runtime.watsup:37.1-38.18 syntax result = | _VALS(val*) | TRAP -;; 4-runtime.watsup:38.1-39.66 +;; 4-runtime.watsup:47.1-48.66 syntax externval = | FUNC(funcaddr) | GLOBAL(globaladdr) | TABLE(tableaddr) | MEM(memaddr) -;; 4-runtime.watsup:44.1-44.44 +;; 4-runtime.watsup:55.1-55.44 def default_ : valtype -> val? - ;; 4-runtime.watsup:45.1-45.35 + ;; 4-runtime.watsup:56.1-56.35 def default_(I32_valtype) = ?(CONST_val(I32_numtype, 0)) - ;; 4-runtime.watsup:46.1-46.35 + ;; 4-runtime.watsup:57.1-57.35 def default_(I64_valtype) = ?(CONST_val(I64_numtype, 0)) - ;; 4-runtime.watsup:47.1-47.35 + ;; 4-runtime.watsup:58.1-58.35 def default_(F32_valtype) = ?(CONST_val(F32_numtype, 0)) - ;; 4-runtime.watsup:48.1-48.35 + ;; 4-runtime.watsup:59.1-59.35 def default_(F64_valtype) = ?(CONST_val(F64_numtype, 0)) - ;; 4-runtime.watsup:49.1-49.44 + ;; 4-runtime.watsup:60.1-60.44 def default_(FUNCREF_valtype) = ?(REF.NULL_val(FUNCREF_reftype)) - ;; 4-runtime.watsup:50.1-50.48 + ;; 4-runtime.watsup:61.1-61.48 def default_(EXTERNREF_valtype) = ?(REF.NULL_val(EXTERNREF_reftype)) def {x : valtype} default_(x) = ?() -;; 4-runtime.watsup:72.1-74.22 +;; 4-runtime.watsup:87.1-89.22 syntax exportinst = {NAME name, VALUE externval} -;; 4-runtime.watsup:84.1-91.25 +;; 4-runtime.watsup:91.1-98.25 syntax moduleinst = {FUNC funcaddr*, GLOBAL globaladdr*, TABLE tableaddr*, MEM memaddr*, ELEM elemaddr*, DATA dataaddr*, EXPORT exportinst*} -;; 4-runtime.watsup:55.1-57.16 +;; 4-runtime.watsup:70.1-72.16 syntax funcinst = {MODULE moduleinst, CODE func} -;; 4-runtime.watsup:58.1-60.16 +;; 4-runtime.watsup:73.1-75.16 syntax globalinst = {TYPE globaltype, VALUE val} -;; 4-runtime.watsup:61.1-63.16 +;; 4-runtime.watsup:76.1-78.16 syntax tableinst = {TYPE tabletype, ELEM ref*} -;; 4-runtime.watsup:64.1-66.17 +;; 4-runtime.watsup:79.1-81.17 syntax meminst = {TYPE memtype, DATA byte*} -;; 4-runtime.watsup:67.1-69.16 +;; 4-runtime.watsup:82.1-84.16 syntax eleminst = {TYPE elemtype, ELEM ref*} -;; 4-runtime.watsup:70.1-71.17 +;; 4-runtime.watsup:85.1-86.17 syntax datainst = {DATA byte*} -;; 4-runtime.watsup:76.1-82.21 +;; 4-runtime.watsup:112.1-118.21 syntax store = {FUNC funcinst*, GLOBAL globalinst*, TABLE tableinst*, MEM meminst*, ELEM eleminst*, DATA datainst*} -;; 4-runtime.watsup:93.1-95.24 +;; 4-runtime.watsup:120.1-122.24 syntax frame = {LOCAL val*, MODULE moduleinst} -;; 4-runtime.watsup:96.1-96.47 +;; 4-runtime.watsup:124.1-124.47 syntax state = `%;%`(store, frame) -;; 4-runtime.watsup:183.1-190.5 +;; 4-runtime.watsup:209.1-216.5 rec { -;; 4-runtime.watsup:183.1-190.5 +;; 4-runtime.watsup:209.1-216.5 syntax admininstr = | UNREACHABLE | NOP @@ -11351,122 +11351,122 @@ def admininstr_val : val -> admininstr def {x : funcaddr} admininstr_val(REF.FUNC_ADDR_val(x)) = REF.FUNC_ADDR_admininstr(x) def {x : hostaddr} admininstr_val(REF.HOST_ADDR_val(x)) = REF.HOST_ADDR_admininstr(x) -;; 4-runtime.watsup:97.1-97.62 +;; 4-runtime.watsup:125.1-125.62 syntax config = `%;%*`(state, admininstr*) -;; 4-runtime.watsup:115.1-115.59 +;; 4-runtime.watsup:134.1-134.59 def funcaddr : state -> funcaddr* - ;; 4-runtime.watsup:116.1-116.38 + ;; 4-runtime.watsup:135.1-135.38 def {f : frame, s : store} funcaddr(`%;%`(s, f)) = f.MODULE_frame.FUNC_moduleinst -;; 4-runtime.watsup:118.1-118.52 +;; 4-runtime.watsup:137.1-137.52 def funcinst : state -> funcinst* - ;; 4-runtime.watsup:125.1-125.31 + ;; 4-runtime.watsup:144.1-144.31 def {f : frame, s : store} funcinst(`%;%`(s, f)) = s.FUNC_store -;; 4-runtime.watsup:119.1-119.58 +;; 4-runtime.watsup:138.1-138.58 def globalinst : state -> globalinst* - ;; 4-runtime.watsup:126.1-126.35 + ;; 4-runtime.watsup:145.1-145.35 def {f : frame, s : store} globalinst(`%;%`(s, f)) = s.GLOBAL_store -;; 4-runtime.watsup:120.1-120.55 +;; 4-runtime.watsup:139.1-139.55 def tableinst : state -> tableinst* - ;; 4-runtime.watsup:127.1-127.33 + ;; 4-runtime.watsup:146.1-146.33 def {f : frame, s : store} tableinst(`%;%`(s, f)) = s.TABLE_store -;; 4-runtime.watsup:121.1-121.49 +;; 4-runtime.watsup:140.1-140.49 def meminst : state -> meminst* - ;; 4-runtime.watsup:128.1-128.29 + ;; 4-runtime.watsup:147.1-147.29 def {f : frame, s : store} meminst(`%;%`(s, f)) = s.MEM_store -;; 4-runtime.watsup:122.1-122.52 +;; 4-runtime.watsup:141.1-141.52 def eleminst : state -> eleminst* - ;; 4-runtime.watsup:129.1-129.31 + ;; 4-runtime.watsup:148.1-148.31 def {f : frame, s : store} eleminst(`%;%`(s, f)) = s.ELEM_store -;; 4-runtime.watsup:123.1-123.52 +;; 4-runtime.watsup:142.1-142.52 def datainst : state -> datainst* - ;; 4-runtime.watsup:130.1-130.31 + ;; 4-runtime.watsup:149.1-149.31 def {f : frame, s : store} datainst(`%;%`(s, f)) = s.DATA_store -;; 4-runtime.watsup:132.1-132.67 +;; 4-runtime.watsup:151.1-151.67 def func : (state, funcidx) -> funcinst - ;; 4-runtime.watsup:140.1-140.48 + ;; 4-runtime.watsup:159.1-159.48 def {f : frame, s : store, x : idx} func(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[x]] -;; 4-runtime.watsup:133.1-133.69 +;; 4-runtime.watsup:152.1-152.69 def global : (state, globalidx) -> globalinst - ;; 4-runtime.watsup:141.1-141.54 + ;; 4-runtime.watsup:160.1-160.54 def {f : frame, s : store, x : idx} global(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x]] -;; 4-runtime.watsup:134.1-134.68 +;; 4-runtime.watsup:153.1-153.68 def table : (state, tableidx) -> tableinst - ;; 4-runtime.watsup:142.1-142.51 + ;; 4-runtime.watsup:161.1-161.51 def {f : frame, s : store, x : idx} table(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]] -;; 4-runtime.watsup:135.1-135.66 +;; 4-runtime.watsup:154.1-154.66 def mem : (state, memidx) -> meminst - ;; 4-runtime.watsup:143.1-143.45 + ;; 4-runtime.watsup:162.1-162.45 def {f : frame, s : store, x : idx} mem(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[x]] -;; 4-runtime.watsup:136.1-136.67 +;; 4-runtime.watsup:155.1-155.67 def elem : (state, tableidx) -> eleminst - ;; 4-runtime.watsup:144.1-144.48 + ;; 4-runtime.watsup:163.1-163.48 def {f : frame, s : store, x : idx} elem(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[x]] -;; 4-runtime.watsup:137.1-137.67 +;; 4-runtime.watsup:156.1-156.67 def data : (state, dataidx) -> datainst - ;; 4-runtime.watsup:145.1-145.48 + ;; 4-runtime.watsup:164.1-164.48 def {f : frame, s : store, x : idx} data(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[x]] -;; 4-runtime.watsup:138.1-138.68 +;; 4-runtime.watsup:157.1-157.68 def local : (state, localidx) -> val - ;; 4-runtime.watsup:146.1-146.35 + ;; 4-runtime.watsup:165.1-165.35 def {f : frame, s : store, x : idx} local(`%;%`(s, f), x) = f.LOCAL_frame[x] -;; 4-runtime.watsup:149.1-149.78 +;; 4-runtime.watsup:168.1-168.78 def with_local : (state, localidx, val) -> state - ;; 4-runtime.watsup:158.1-158.52 + ;; 4-runtime.watsup:177.1-177.52 def {f : frame, s : store, v : val, x : idx} with_local(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[x] = v]) -;; 4-runtime.watsup:150.1-150.85 +;; 4-runtime.watsup:169.1-169.85 def with_global : (state, globalidx, val) -> state - ;; 4-runtime.watsup:159.1-159.77 + ;; 4-runtime.watsup:178.1-178.77 def {f : frame, s : store, v : val, x : idx} with_global(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x]].VALUE_globalinst = v], f) -;; 4-runtime.watsup:151.1-151.88 +;; 4-runtime.watsup:170.1-170.88 def with_table : (state, tableidx, nat, ref) -> state - ;; 4-runtime.watsup:160.1-160.79 + ;; 4-runtime.watsup:179.1-179.79 def {f : frame, i : nat, r : ref, s : store, x : idx} with_table(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]].ELEM_tableinst[i] = r], f) -;; 4-runtime.watsup:152.1-152.84 +;; 4-runtime.watsup:171.1-171.84 def with_tableinst : (state, tableidx, tableinst) -> state - ;; 4-runtime.watsup:161.1-161.74 + ;; 4-runtime.watsup:180.1-180.74 def {f : frame, s : store, ti : tableinst, x : idx} with_tableinst(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]] = ti], f) -;; 4-runtime.watsup:153.1-153.93 +;; 4-runtime.watsup:172.1-172.93 def with_mem : (state, memidx, nat, nat, byte*) -> state - ;; 4-runtime.watsup:162.1-162.82 + ;; 4-runtime.watsup:181.1-181.82 def {b* : byte*, f : frame, i : nat, j : nat, s : store, x : idx} with_mem(`%;%`(s, f), x, i, j, b*{b}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x]].DATA_meminst[i : j] = b*{b}], f) -;; 4-runtime.watsup:154.1-154.77 +;; 4-runtime.watsup:173.1-173.77 def with_meminst : (state, memidx, meminst) -> state - ;; 4-runtime.watsup:163.1-163.68 + ;; 4-runtime.watsup:182.1-182.68 def {f : frame, mi : meminst, s : store, x : idx} with_meminst(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x]] = mi], f) -;; 4-runtime.watsup:155.1-155.82 +;; 4-runtime.watsup:174.1-174.82 def with_elem : (state, elemidx, ref*) -> state - ;; 4-runtime.watsup:164.1-164.72 + ;; 4-runtime.watsup:183.1-183.72 def {f : frame, r* : ref*, s : store, x : idx} with_elem(`%;%`(s, f), x, r*{r}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x]].ELEM_eleminst = r*{r}], f) -;; 4-runtime.watsup:156.1-156.82 +;; 4-runtime.watsup:175.1-175.82 def with_data : (state, dataidx, byte*) -> state - ;; 4-runtime.watsup:165.1-165.72 + ;; 4-runtime.watsup:184.1-184.72 def {b* : byte*, f : frame, s : store, x : idx} with_data(`%;%`(s, f), x, b*{b}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x]].DATA_datainst = b*{b}], f) -;; 4-runtime.watsup:167.1-167.63 +;; 4-runtime.watsup:189.1-189.63 def grow_table : (tableinst, nat, ref) -> tableinst? - ;; 4-runtime.watsup:170.1-174.36 + ;; 4-runtime.watsup:192.1-196.36 def {i : nat, i' : nat, j : nat, n : n, r : ref, r'* : ref*, rt : reftype, ti : tableinst, ti' : tableinst} grow_table(ti, n, r) = ?(ti') -- if (ti = {TYPE `%%`(`[%..%]`(i, j), rt), ELEM r'*{r'}}) -- if (i' = (|r'*{r'}| + n)) @@ -11474,9 +11474,9 @@ def grow_table : (tableinst, nat, ref) -> tableinst? -- Tabletype_ok: `|-%:OK`(ti'.TYPE_tableinst) def {x : (tableinst, nat, ref)} grow_table(x) = ?() -;; 4-runtime.watsup:168.1-168.55 +;; 4-runtime.watsup:190.1-190.55 def grow_memory : (meminst, nat) -> meminst? - ;; 4-runtime.watsup:175.1-179.34 + ;; 4-runtime.watsup:198.1-202.34 def {b* : byte*, i : nat, i' : nat, j : nat, mi : meminst, mi' : meminst, n : n} grow_memory(mi, n) = ?(mi') -- if (mi = {TYPE `%I8`(`[%..%]`(i, j)), DATA b*{b}}) -- if (i' = ((|b*{b}| / (64 * $Ki)) + n)) @@ -11484,10 +11484,10 @@ def grow_memory : (meminst, nat) -> meminst? -- Memtype_ok: `|-%:OK`(mi'.TYPE_meminst) def {x : (meminst, nat)} grow_memory(x) = ?() -;; 4-runtime.watsup:192.1-195.21 +;; 4-runtime.watsup:218.1-221.21 rec { -;; 4-runtime.watsup:192.1-195.21 +;; 4-runtime.watsup:218.1-221.21 syntax E = | _HOLE | _SEQ(val*, E, instr*) @@ -11518,161 +11518,161 @@ def wrap_ : ((nat, nat), c_numtype) -> nat ;; 5-numerics.watsup:13.1-13.28 def bytes_ : (nat, c_numtype) -> byte* -;; 6-reduction.watsup:4.1-4.63 +;; 6-reduction.watsup:6.1-6.63 relation Step_pure: `%*~>%*`(admininstr*, admininstr*) - ;; 6-reduction.watsup:16.1-17.24 + ;; 6-reduction.watsup:24.1-25.24 rule unreachable: `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) - ;; 6-reduction.watsup:19.1-20.19 + ;; 6-reduction.watsup:27.1-28.19 rule nop: `%*~>%*`([NOP_admininstr], []) - ;; 6-reduction.watsup:22.1-23.24 + ;; 6-reduction.watsup:30.1-31.24 rule drop {val : val}: `%*~>%*`([$admininstr_val(val) DROP_admininstr], []) - ;; 6-reduction.watsup:26.1-28.16 + ;; 6-reduction.watsup:34.1-36.16 rule select-true {c : c_numtype, t? : valtype?, val_1 : val, val_2 : val}: `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t?{t})], [$admininstr_val(val_1)]) -- if (c =/= 0) - ;; 6-reduction.watsup:30.1-32.14 + ;; 6-reduction.watsup:38.1-40.14 rule select-false {c : c_numtype, t? : valtype?, val_1 : val, val_2 : val}: `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t?{t})], [$admininstr_val(val_2)]) -- if (c = 0) - ;; 6-reduction.watsup:35.1-37.28 + ;; 6-reduction.watsup:45.1-47.28 rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k}: `%*~>%*`($admininstr_val(val)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})], [LABEL__admininstr(n, [], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) -- if (bt = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 6-reduction.watsup:39.1-41.28 + ;; 6-reduction.watsup:49.1-51.28 rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k}: `%*~>%*`($admininstr_val(val)^k{val} :: [LOOP_admininstr(bt, instr*{instr})], [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) -- if (bt = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 6-reduction.watsup:43.1-45.16 + ;; 6-reduction.watsup:53.1-55.16 rule if-true {bt : blocktype, c : c_numtype, 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) - ;; 6-reduction.watsup:47.1-49.14 + ;; 6-reduction.watsup:57.1-59.14 rule if-false {bt : blocktype, c : c_numtype, 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) - ;; 6-reduction.watsup:52.1-53.38 + ;; 6-reduction.watsup:62.1-63.38 rule label-vals {instr* : instr*, n : n, val* : val*}: `%*~>%*`([LABEL__admininstr(n, instr*{instr}, $admininstr_val(val)*{val})], $admininstr_val(val)*{val}) - ;; 6-reduction.watsup:57.1-58.69 + ;; 6-reduction.watsup:69.1-70.69 rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [BR_admininstr(0)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val} :: $admininstr_instr(instr')*{instr'}) - ;; 6-reduction.watsup:60.1-61.65 + ;; 6-reduction.watsup:72.1-73.65 rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val)*{val} :: [BR_admininstr(l + 1)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [BR_admininstr(l)]) - ;; 6-reduction.watsup:64.1-66.16 + ;; 6-reduction.watsup:76.1-78.16 rule br_if-true {c : c_numtype, l : labelidx}: `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) -- if (c =/= 0) - ;; 6-reduction.watsup:68.1-70.14 + ;; 6-reduction.watsup:80.1-82.14 rule br_if-false {c : c_numtype, l : labelidx}: `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) -- if (c = 0) - ;; 6-reduction.watsup:73.1-75.17 + ;; 6-reduction.watsup:85.1-87.17 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}|) - ;; 6-reduction.watsup:77.1-79.18 + ;; 6-reduction.watsup:89.1-91.18 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}|) - ;; 6-reduction.watsup:102.1-103.35 + ;; 6-reduction.watsup:116.1-117.35 rule frame-vals {f : frame, n : n, val^n : val^n}: `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val)^n{val})], $admininstr_val(val)^n{val}) - ;; 6-reduction.watsup:105.1-106.55 + ;; 6-reduction.watsup:119.1-120.55 rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val}) - ;; 6-reduction.watsup:108.1-109.60 + ;; 6-reduction.watsup:122.1-123.60 rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [RETURN_admininstr]) - ;; 6-reduction.watsup:112.1-114.33 + ;; 6-reduction.watsup:128.1-130.33 rule unop-val {c : c_numtype, c_1 : c_numtype, nt : numtype, unop : unop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) -- if ($unop(unop, nt, c_1) = [c]) - ;; 6-reduction.watsup:116.1-118.39 + ;; 6-reduction.watsup:132.1-134.39 rule unop-trap {c_1 : c_numtype, nt : numtype, unop : unop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) -- if ($unop(unop, nt, c_1) = []) - ;; 6-reduction.watsup:121.1-123.40 + ;; 6-reduction.watsup:137.1-139.40 rule binop-val {binop : binop_numtype, c : c_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- if ($binop(binop, nt, c_1, c_2) = [c]) - ;; 6-reduction.watsup:125.1-127.46 + ;; 6-reduction.watsup:141.1-143.46 rule binop-trap {binop : binop_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) -- if ($binop(binop, nt, c_1, c_2) = []) - ;; 6-reduction.watsup:130.1-132.37 + ;; 6-reduction.watsup:146.1-148.37 rule testop {c : c_numtype, c_1 : c_numtype, nt : numtype, testop : testop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $testop(testop, nt, c_1)) - ;; 6-reduction.watsup:134.1-136.40 + ;; 6-reduction.watsup:150.1-152.40 rule relop {c : c_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype, relop : relop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) -- if (c = $relop(relop, nt, c_1, c_2)) - ;; 6-reduction.watsup:139.1-140.70 + ;; 6-reduction.watsup:155.1-156.70 rule extend {c : c_numtype, n : n, nt : numtype, o0 : nat}: `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, o0, S_sx, c))]) -- if ($size($valtype_numtype(nt)) = ?(o0)) - ;; 6-reduction.watsup:143.1-145.48 + ;; 6-reduction.watsup:159.1-161.48 rule cvtop-val {c : c_numtype, c_1 : c_numtype, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) -- if ($cvtop(nt_1, cvtop, nt_2, sx?{sx}, c_1) = [c]) - ;; 6-reduction.watsup:147.1-149.54 + ;; 6-reduction.watsup:163.1-165.54 rule cvtop-trap {c_1 : c_numtype, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) -- if ($cvtop(nt_1, cvtop, nt_2, sx?{sx}, c_1) = []) - ;; 6-reduction.watsup:156.1-158.28 + ;; 6-reduction.watsup:174.1-176.28 rule ref.is_null-true {rt : reftype, val : val}: `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) -- if (val = REF.NULL_val(rt)) - ;; 6-reduction.watsup:160.1-162.15 + ;; 6-reduction.watsup:178.1-180.15 rule ref.is_null-false {val : val}: `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 6-reduction.watsup:171.1-172.47 + ;; 6-reduction.watsup:191.1-192.47 rule local.tee {val : val, x : idx}: `%*~>%*`([$admininstr_val(val) LOCAL.TEE_admininstr(x)], [$admininstr_val(val) $admininstr_val(val) LOCAL.SET_admininstr(x)]) -;; 6-reduction.watsup:5.1-5.63 +;; 6-reduction.watsup:7.1-7.63 relation Step_read: `%~>%*`(config, admininstr*) - ;; 6-reduction.watsup:82.1-83.47 + ;; 6-reduction.watsup:96.1-97.47 rule call {x : idx, z : state}: `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [CALL_ADDR_admininstr($funcaddr(z)[x])]) -- if (x < |$funcaddr(z)|) - ;; 6-reduction.watsup:85.1-89.17 + ;; 6-reduction.watsup:99.1-103.17 rule call_indirect-call {a : addr, ft : functype, ft' : functype, i : nat, instr* : instr*, t* : valtype*, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CALL_INDIRECT_admininstr(x, ft)]), [CALL_ADDR_admininstr(a)]) -- if (i < |$table(z, x).ELEM_tableinst|) @@ -11681,12 +11681,12 @@ relation Step_read: `%~>%*`(config, admininstr*) -- if ($funcinst(z)[a].CODE_funcinst = `FUNC%%*%`(ft', t*{t}, instr*{instr})) -- if (ft = ft') - ;; 6-reduction.watsup:91.1-93.15 + ;; 6-reduction.watsup:105.1-107.15 rule call_indirect-trap {ft : functype, i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CALL_INDIRECT_admininstr(x, ft)]), [TRAP_admininstr]) -- otherwise - ;; 6-reduction.watsup:95.1-99.52 + ;; 6-reduction.watsup:109.1-113.52 rule call_addr {a : addr, f : frame, func : func, instr* : instr*, k : nat, m : moduleinst, n : n, t* : valtype*, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state, o0* : val*}: `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [CALL_ADDR_admininstr(a)]), [FRAME__admininstr(n, f, [LABEL__admininstr(n, [], $admininstr_instr(instr)*{instr})])]) -- if (|t*{t}| = |o0*{o0}|) @@ -11696,322 +11696,311 @@ relation Step_read: `%~>%*`(config, admininstr*) -- if (func = `FUNC%%*%`(`%->%`(t_1^k{t_1}, t_2^n{t_2}), t*{t}, instr*{instr})) -- if (f = {LOCAL val^k{val} :: o0*{o0}, MODULE m}) - ;; 6-reduction.watsup:152.1-153.53 + ;; 6-reduction.watsup:170.1-171.53 rule ref.func {x : idx, z : state}: `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) -- if (x < |$funcaddr(z)|) - ;; 6-reduction.watsup:165.1-166.37 + ;; 6-reduction.watsup:185.1-186.37 rule local.get {x : idx, z : state}: `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [$admininstr_val($local(z, x))]) - ;; 6-reduction.watsup:175.1-176.45 + ;; 6-reduction.watsup:197.1-198.45 rule global.get {x : idx, z : state}: `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [$admininstr_val($global(z, x).VALUE_globalinst)]) - ;; 6-reduction.watsup:182.1-184.33 + ;; 6-reduction.watsup:206.1-208.33 rule table.get-trap {i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:186.1-188.32 + ;; 6-reduction.watsup:210.1-212.32 rule table.get-val {i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [$admininstr_ref($table(z, x).ELEM_tableinst[i])]) -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:199.1-201.32 + ;; 6-reduction.watsup:223.1-225.32 rule table.size {n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) -- if (|$table(z, x).ELEM_tableinst| = n) - ;; 6-reduction.watsup:212.1-214.39 + ;; 6-reduction.watsup:236.1-238.39 rule table.fill-trap {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:216.1-219.14 + ;; 6-reduction.watsup:240.1-243.14 rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:221.1-225.15 + ;; 6-reduction.watsup:245.1-249.15 rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) -- otherwise - ;; 6-reduction.watsup:228.1-230.73 + ;; 6-reduction.watsup:252.1-254.73 rule table.copy-trap {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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|)) - ;; 6-reduction.watsup:232.1-235.14 + ;; 6-reduction.watsup:256.1-259.14 rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:237.1-242.15 + ;; 6-reduction.watsup:261.1-266.15 rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:244.1-248.15 + ;; 6-reduction.watsup:268.1-272.15 rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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 - ;; 6-reduction.watsup:251.1-253.72 + ;; 6-reduction.watsup:275.1-277.72 rule table.init-trap {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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|)) - ;; 6-reduction.watsup:255.1-258.14 + ;; 6-reduction.watsup:279.1-282.14 rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:260.1-264.15 + ;; 6-reduction.watsup:284.1-288.15 rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) $admininstr_ref($elem(z, y).ELEM_eleminst[i]) 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 - ;; 6-reduction.watsup:271.1-273.53 + ;; 6-reduction.watsup:297.1-299.53 rule load-num-trap {i : nat, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), n_A, n_O)]), [TRAP_admininstr]) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if (((i + n_O) + (o0 / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:275.1-277.71 + ;; 6-reduction.watsup:301.1-303.71 rule load-num-val {c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat, o1 : nat}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), n_A, n_O)]), [CONST_admininstr(nt, c)]) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if ($size($valtype_numtype(nt)) = ?(o1)) -- if ($bytes_(o0, c) = $mem(z, 0).DATA_meminst[(i + n_O) : (o1 / 8)]) - ;; 6-reduction.watsup:279.1-281.45 + ;; 6-reduction.watsup:305.1-307.45 rule load-pack-trap {i : nat, n : n, n_A : n, n_O : n, nt : numtype, sx : sx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), n_A, n_O)]), [TRAP_admininstr]) -- if (((i + n_O) + (n / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:283.1-285.55 + ;; 6-reduction.watsup:309.1-311.55 rule load-pack-val {c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, sx : sx, z : state, o0 : nat}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), n_A, n_O)]), [CONST_admininstr(nt, $ext(n, o0, sx, c))]) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if ($bytes_(n, c) = $mem(z, 0).DATA_meminst[(i + n_O) : (n / 8)]) - ;; 6-reduction.watsup:305.1-307.44 + ;; 6-reduction.watsup:331.1-333.44 rule memory.size {n : n, z : state}: `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr]), [CONST_admininstr(I32_numtype, n)]) -- if (((n * 64) * $Ki) = |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:318.1-320.37 + ;; 6-reduction.watsup:344.1-346.37 rule memory.fill-trap {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), [TRAP_admininstr]) -- if ((i + n) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:322.1-325.14 + ;; 6-reduction.watsup:348.1-351.14 rule memory.fill-zero {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:327.1-331.15 + ;; 6-reduction.watsup:353.1-357.15 rule memory.fill-succ {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr]) -- otherwise - ;; 6-reduction.watsup:334.1-336.69 + ;; 6-reduction.watsup:360.1-362.69 rule memory.copy-trap {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [TRAP_admininstr]) -- if (((i + n) > |$mem(z, 0).DATA_meminst|) \/ ((j + n) > |$mem(z, 0).DATA_meminst|)) - ;; 6-reduction.watsup:338.1-341.14 + ;; 6-reduction.watsup:364.1-367.14 rule memory.copy-zero {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:343.1-348.15 + ;; 6-reduction.watsup:369.1-374.15 rule memory.copy-le {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) LOAD_admininstr(I32_numtype, ?((8, U_sx)), 0, 0) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr]) -- otherwise -- if (j <= i) - ;; 6-reduction.watsup:350.1-354.15 + ;; 6-reduction.watsup:376.1-380.15 rule memory.copy-gt {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), 0, 0) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr]) -- otherwise - ;; 6-reduction.watsup:357.1-359.70 + ;; 6-reduction.watsup:383.1-385.70 rule memory.init-trap {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), [TRAP_admininstr]) -- if (((i + n) > |$data(z, x).DATA_datainst|) \/ ((j + n) > |$mem(z, 0).DATA_meminst|)) - ;; 6-reduction.watsup:361.1-364.14 + ;; 6-reduction.watsup:387.1-390.14 rule memory.init-zero {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:366.1-370.15 + ;; 6-reduction.watsup:392.1-396.15 rule memory.init-succ {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, x).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x)]) -- if (i < |$data(z, x).DATA_datainst|) -- otherwise -;; 6-reduction.watsup:3.1-3.63 +;; 6-reduction.watsup:5.1-5.63 relation Step: `%~>%`(config, config) - ;; 6-reduction.watsup:7.1-9.34 + ;; 6-reduction.watsup:9.1-11.34 rule pure {instr* : instr*, instr'* : instr*, z : state}: `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) -- Step_pure: `%*~>%*`($admininstr_instr(instr)*{instr}, $admininstr_instr(instr')*{instr'}) - ;; 6-reduction.watsup:11.1-13.37 + ;; 6-reduction.watsup:13.1-15.37 rule read {instr* : instr*, instr'* : instr*, z : state}: `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) -- Step_read: `%~>%*`(`%;%*`(z, $admininstr_instr(instr)*{instr}), $admininstr_instr(instr')*{instr'}) - ;; 6-reduction.watsup:168.1-169.60 + ;; 6-reduction.watsup:188.1-189.60 rule local.set {val : val, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_val(val) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) - ;; 6-reduction.watsup:178.1-179.62 + ;; 6-reduction.watsup:200.1-201.62 rule global.set {val : val, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_val(val) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) - ;; 6-reduction.watsup:190.1-192.33 + ;; 6-reduction.watsup:214.1-216.33 rule table.set-trap {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:194.1-196.32 + ;; 6-reduction.watsup:218.1-220.32 rule table.set-val {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:204.1-206.47 + ;; 6-reduction.watsup:228.1-230.47 rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state, o0 : tableinst}: `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) -- if ($grow_table($table(z, x), n, ref) = ?(o0)) -- if (o0 = ti) - ;; 6-reduction.watsup:208.1-209.64 + ;; 6-reduction.watsup:232.1-233.64 rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, - 1)])) - ;; 6-reduction.watsup:267.1-268.59 + ;; 6-reduction.watsup:291.1-292.59 rule elem.drop {x : idx, z : state}: `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) - ;; 6-reduction.watsup:288.1-290.53 + ;; 6-reduction.watsup:314.1-316.53 rule store-num-trap {c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), n_A, n_O)]), `%;%*`(z, [TRAP_admininstr])) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if (((i + n_O) + (o0 / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:292.1-294.35 + ;; 6-reduction.watsup:318.1-320.35 rule store-num-val {b* : byte*, c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat, o1 : nat}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), n_A, n_O)]), `%;%*`($with_mem(z, 0, (i + n_O), (o0 / 8), b*{b}), [])) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if ($size($valtype_numtype(nt)) = ?(o1)) -- if (b*{b} = $bytes_(o1, c)) - ;; 6-reduction.watsup:296.1-298.45 + ;; 6-reduction.watsup:322.1-324.45 rule store-pack-trap {c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), n_A, n_O)]), `%;%*`(z, [TRAP_admininstr])) -- if (((i + n_O) + (n / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:300.1-302.50 + ;; 6-reduction.watsup:326.1-328.50 rule store-pack-val {b* : byte*, c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), n_A, n_O)]), `%;%*`($with_mem(z, 0, (i + n_O), (n / 8), b*{b}), [])) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if (b*{b} = $bytes_(n, $wrap_((o0, n), c))) - ;; 6-reduction.watsup:310.1-312.41 + ;; 6-reduction.watsup:336.1-338.41 rule memory.grow-succeed {mi : meminst, n : n, z : state, o0 : meminst}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr]), `%;%*`($with_meminst(z, 0, mi), [CONST_admininstr(I32_numtype, (|$mem(z, 0).DATA_meminst| / (64 * $Ki)))])) -- if ($grow_memory($mem(z, 0), n) = ?(o0)) -- if (o0 = mi) - ;; 6-reduction.watsup:314.1-315.59 + ;; 6-reduction.watsup:340.1-341.59 rule memory.grow-fail {n : n, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr]), `%;%*`(z, [CONST_admininstr(I32_numtype, - 1)])) - ;; 6-reduction.watsup:373.1-374.59 + ;; 6-reduction.watsup:399.1-400.59 rule data.drop {x : idx, z : state}: `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) -;; 7-module.watsup:4.1-4.35 +;; 7-module.watsup:5.1-5.35 rec { -;; 7-module.watsup:4.1-4.35 +;; 7-module.watsup:5.1-5.35 def funcs : externval* -> funcaddr* - ;; 7-module.watsup:5.1-5.30 + ;; 7-module.watsup:6.1-6.30 def funcs([]) = [] - ;; 7-module.watsup:6.1-6.59 + ;; 7-module.watsup:7.1-7.59 def {externval'* : externval*, fa : funcaddr} funcs([FUNC_externval(fa)] :: externval'*{externval'}) = [fa] :: $funcs(externval'*{externval'}) - ;; 7-module.watsup:7.1-8.15 + ;; 7-module.watsup:8.1-9.15 def {externval : externval, externval'* : externval*} funcs([externval] :: externval'*{externval'}) = $funcs(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:10.1-10.39 +;; 7-module.watsup:11.1-11.39 rec { -;; 7-module.watsup:10.1-10.39 +;; 7-module.watsup:11.1-11.39 def globals : externval* -> globaladdr* - ;; 7-module.watsup:11.1-11.32 + ;; 7-module.watsup:12.1-12.32 def globals([]) = [] - ;; 7-module.watsup:12.1-12.65 + ;; 7-module.watsup:13.1-13.65 def {externval'* : externval*, ga : globaladdr} globals([GLOBAL_externval(ga)] :: externval'*{externval'}) = [ga] :: $globals(externval'*{externval'}) - ;; 7-module.watsup:13.1-14.15 + ;; 7-module.watsup:14.1-15.15 def {externval : externval, externval'* : externval*} globals([externval] :: externval'*{externval'}) = $globals(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:16.1-16.37 +;; 7-module.watsup:17.1-17.37 rec { -;; 7-module.watsup:16.1-16.37 +;; 7-module.watsup:17.1-17.37 def tables : externval* -> tableaddr* - ;; 7-module.watsup:17.1-17.31 + ;; 7-module.watsup:18.1-18.31 def tables([]) = [] - ;; 7-module.watsup:18.1-18.62 + ;; 7-module.watsup:19.1-19.62 def {externval'* : externval*, ta : tableaddr} tables([TABLE_externval(ta)] :: externval'*{externval'}) = [ta] :: $tables(externval'*{externval'}) - ;; 7-module.watsup:19.1-20.15 + ;; 7-module.watsup:20.1-21.15 def {externval : externval, externval'* : externval*} tables([externval] :: externval'*{externval'}) = $tables(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:22.1-22.33 +;; 7-module.watsup:23.1-23.33 rec { -;; 7-module.watsup:22.1-22.33 +;; 7-module.watsup:23.1-23.33 def mems : externval* -> memaddr* - ;; 7-module.watsup:23.1-23.29 + ;; 7-module.watsup:24.1-24.29 def mems([]) = [] - ;; 7-module.watsup:24.1-24.56 + ;; 7-module.watsup:25.1-25.56 def {externval'* : externval*, ma : memaddr} mems([MEM_externval(ma)] :: externval'*{externval'}) = [ma] :: $mems(externval'*{externval'}) - ;; 7-module.watsup:25.1-26.15 + ;; 7-module.watsup:26.1-27.15 def {externval : externval, externval'* : externval*} mems([externval] :: externval'*{externval'}) = $mems(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:29.1-29.83 -def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst - ;; 7-module.watsup:30.1-30.95 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externuse(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} - ;; 7-module.watsup:31.1-31.99 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externuse(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} - ;; 7-module.watsup:32.1-32.97 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externuse(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} - ;; 7-module.watsup:33.1-33.93 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externuse(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} - ;; 7-module.watsup:36.1-36.60 def allocfunc : (store, moduleinst, func) -> (store, funcaddr) ;; 7-module.watsup:37.1-38.37 @@ -12126,9 +12115,20 @@ def allocdatas : (store, byte**) -> (store, dataaddr*) -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) } -;; 7-module.watsup:97.1-97.81 +;; 7-module.watsup:99.1-99.83 +def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst + ;; 7-module.watsup:100.1-100.95 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externuse(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} + ;; 7-module.watsup:101.1-101.99 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externuse(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} + ;; 7-module.watsup:102.1-102.97 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externuse(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} + ;; 7-module.watsup:103.1-103.93 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externuse(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} + +;; 7-module.watsup:106.1-106.81 def allocmodule : (store, module, externval*, val*, ref**) -> (store, moduleinst) - ;; 7-module.watsup:98.1-135.54 + ;; 7-module.watsup:107.1-144.54 def {byte*^n_data : byte*^n_data, da* : dataaddr*, datamode?^n_data : datamode?^n_data, ea* : elemaddr*, elemmode?^n_elem : elemmode?^n_elem, export* : export*, expr_1^n_global : expr^n_global, expr_2*^n_elem : expr*^n_elem, externval* : externval*, fa* : funcaddr*, fa_ex* : funcaddr*, func^n_func : func^n_func, ga* : globaladdr*, ga_ex* : globaladdr*, globaltype^n_global : globaltype^n_global, i_data^n_data : nat^n_data, i_elem^n_elem : nat^n_elem, i_func^n_func : nat^n_func, i_global^n_global : nat^n_global, i_mem^n_mem : nat^n_mem, i_table^n_table : nat^n_table, import* : import*, m : moduleinst, ma* : memaddr*, ma_ex* : memaddr*, memtype^n_mem : memtype^n_mem, module : module, n_data : n, n_elem : n, n_func : n, n_global : n, n_mem : n, n_table : n, ref** : ref**, rt^n_elem : reftype^n_elem, s : store, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store, s_6 : store, start? : start?, ta* : tableaddr*, ta_ex* : tableaddr*, tabletype^n_table : tabletype^n_table, val* : val*, xi* : exportinst*} allocmodule(s, module, externval*{externval}, val*{val}, ref*{ref}*{ref}) = (s_6, m) -- if (module = `MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func^n_func{func}, GLOBAL(globaltype, expr_1)^n_global{expr_1 globaltype}, TABLE(tabletype)^n_table{tabletype}, MEMORY(memtype)^n_mem{memtype}, `ELEM%%*%?`(rt, expr_2*{expr_2}, elemmode?{elemmode})^n_elem{elemmode expr_2 rt}, `DATA%*%?`(byte*{byte}, datamode?{datamode})^n_data{byte datamode}, start?{start}, export*{export})) -- if (fa_ex*{fa_ex} = $funcs(externval*{externval})) @@ -12150,39 +12150,39 @@ def allocmodule : (store, module, externval*, val*, ref**) -> (store, moduleinst -- if ((s_5, ea*{ea}) = $allocelems(s_4, rt^n_elem{rt}, ref*{ref}*{ref})) -- if ((s_6, da*{da}) = $allocdatas(s_5, byte*{byte}^n_data{byte})) -;; 7-module.watsup:138.1-138.33 +;; 7-module.watsup:151.1-151.36 +rec { + +;; 7-module.watsup:151.1-151.36 +def concat_instr : instr** -> instr* + ;; 7-module.watsup:152.1-152.37 + def concat_instr([]) = [] + ;; 7-module.watsup:153.1-153.68 + def {instr* : instr*, instr'** : instr**} concat_instr([instr]*{instr} :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) +} + +;; 7-module.watsup:155.1-155.33 def runelem : (elem, idx) -> instr* - ;; 7-module.watsup:139.1-139.46 + ;; 7-module.watsup:156.1-156.46 def {expr* : expr*, i : nat, reftype : reftype} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?()), i) = [] - ;; 7-module.watsup:140.1-140.62 + ;; 7-module.watsup:157.1-157.62 def {expr* : expr*, i : nat, reftype : reftype} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?(DECLARE_elemmode)), i) = [ELEM.DROP_instr(i)] - ;; 7-module.watsup:141.1-143.20 + ;; 7-module.watsup:158.1-160.20 def {expr* : expr*, i : nat, instr* : instr*, n : n, reftype : reftype, x : idx} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?(TABLE_elemmode(x, instr*{instr}))), i) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, n) TABLE.INIT_instr(x, i) ELEM.DROP_instr(i)] -- if (n = |expr*{expr}|) -;; 7-module.watsup:145.1-145.33 +;; 7-module.watsup:162.1-162.33 def rundata : (data, idx) -> instr* - ;; 7-module.watsup:146.1-146.38 + ;; 7-module.watsup:163.1-163.38 def {byte* : byte*, i : nat} rundata(`DATA%*%?`(byte*{byte}, ?()), i) = [] - ;; 7-module.watsup:147.1-149.20 + ;; 7-module.watsup:164.1-166.20 def {byte* : byte*, i : nat, instr* : instr*, n : n} rundata(`DATA%*%?`(byte*{byte}, ?(MEMORY_datamode(0, instr*{instr}))), i) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, n) MEMORY.INIT_instr(i) DATA.DROP_instr(i)] -- if (n = |byte*{byte}|) -;; 7-module.watsup:152.1-152.36 -rec { - -;; 7-module.watsup:152.1-152.36 -def concat_instr : instr** -> instr* - ;; 7-module.watsup:153.1-153.37 - def concat_instr([]) = [] - ;; 7-module.watsup:154.1-154.68 - def {instr* : instr*, instr'** : instr**} concat_instr([instr]*{instr} :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) -} - -;; 7-module.watsup:157.1-157.55 -def instantiation : (store, module, externval*) -> config - ;; 7-module.watsup:158.1-180.28 - def {data* : data*, elem* : elem*, elemmode?* : elemmode?*, export* : export*, externval* : externval*, f : frame, f_init : frame, func* : func*, global* : global*, globaltype* : globaltype*, i^n_elem : nat^n_elem, import* : import*, instr_1** : instr**, instr_2*** : instr***, instr_data* : instr*, instr_elem* : instr*, j^n_data : nat^n_data, m : moduleinst, m_init : moduleinst, mem* : mem*, module : module, n_data : n, n_elem : n, ref** : ref**, reftype* : reftype*, s : store, s' : store, start? : start?, table* : table*, val* : val*, x? : idx?} instantiation(s, module, externval*{externval}) = `%;%*`(`%;%`(s', f), $admininstr_instr(instr_elem)*{instr_elem} :: $admininstr_instr(instr_data)*{instr_data} :: CALL_admininstr(x)?{x}) +;; 7-module.watsup:168.1-168.53 +def instantiate : (store, module, externval*) -> config + ;; 7-module.watsup:169.1-191.28 + def {data* : data*, elem* : elem*, elemmode?* : elemmode?*, export* : export*, externval* : externval*, f : frame, f_init : frame, func* : func*, global* : global*, globaltype* : globaltype*, i^n_elem : nat^n_elem, import* : import*, instr_1** : instr**, instr_2*** : instr***, instr_data* : instr*, instr_elem* : instr*, j^n_data : nat^n_data, m : moduleinst, m_init : moduleinst, mem* : mem*, module : module, n_data : n, n_elem : n, ref** : ref**, reftype* : reftype*, s : store, s' : store, start? : start?, table* : table*, val* : val*, x? : idx?} instantiate(s, module, externval*{externval}) = `%;%*`(`%;%`(s', f), $admininstr_instr(instr_elem)*{instr_elem} :: $admininstr_instr(instr_data)*{instr_data} :: CALL_admininstr(x)?{x}) -- if (module = `MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data*{data}, start?{start}, export*{export})) -- if (m_init = {FUNC $funcs(externval*{externval}), GLOBAL $globals(externval*{externval}), TABLE [], MEM [], ELEM [], DATA [], EXPORT []}) -- if (f_init = {LOCAL [], MODULE m_init}) @@ -12198,10 +12198,10 @@ def instantiation : (store, module, externval*) -> config -- if (instr_data*{instr_data} = $concat_instr($rundata(data*{data}[j], j)^(j config - ;; 7-module.watsup:184.1-196.52 - def {expr : expr, f : frame, fa : funcaddr, functype : functype, k : nat, m : moduleinst, n : n, s : store, val^n : val^n, valtype* : valtype*, valtype_param^n : valtype^n, valtype_res^k : valtype^k} invocation(s, fa, val^n{val}) = `%;%*`(`%;%`(s, f), $admininstr_val(val)^n{val} :: [CALL_ADDR_admininstr(fa)]) +;; 7-module.watsup:198.1-198.44 +def invoke : (store, funcaddr, val*) -> config + ;; 7-module.watsup:199.1-211.52 + def {expr : expr, f : frame, fa : funcaddr, functype : functype, k : nat, m : moduleinst, n : n, s : store, val^n : val^n, valtype* : valtype*, valtype_param^n : valtype^n, valtype_res^k : valtype^k} invoke(s, fa, val^n{val}) = `%;%*`(`%;%`(s, f), $admininstr_val(val)^n{val} :: [CALL_ADDR_admininstr(fa)]) -- if (m = {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], EXPORT []}) -- if (f = {LOCAL [], MODULE m}) -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = `FUNC%%*%`(functype, valtype*{valtype}, expr)) @@ -12555,49 +12555,49 @@ syntax import = IMPORT(name, name, externtype) ;; 1-syntax.watsup:212.1-213.70 syntax module = `MODULE%*%*%*%*%*%*%*%?%*`(import*, func*, global*, table*, mem*, elem*, data*, start?, export*) -;; 2-aux.watsup:3.1-3.14 +;; 2-aux.watsup:7.1-7.14 def Ki : nat - ;; 2-aux.watsup:4.1-4.15 + ;; 2-aux.watsup:8.1-8.15 def Ki = 1024 -;; 2-aux.watsup:9.1-9.25 +;; 2-aux.watsup:13.1-13.25 rec { -;; 2-aux.watsup:9.1-9.25 +;; 2-aux.watsup:13.1-13.25 def min : (nat, nat) -> nat - ;; 2-aux.watsup:10.1-10.19 + ;; 2-aux.watsup:14.1-14.19 def {j : nat} min(0, j) = 0 - ;; 2-aux.watsup:11.1-11.19 + ;; 2-aux.watsup:15.1-15.19 def {i : nat} min(i, 0) = 0 - ;; 2-aux.watsup:12.1-12.38 + ;; 2-aux.watsup:16.1-16.38 def {i : nat, j : nat} min((i + 1), (j + 1)) = $min(i, j) } -;; 2-aux.watsup:19.1-19.55 +;; 2-aux.watsup:27.1-27.55 def size : valtype -> nat? - ;; 2-aux.watsup:20.1-20.20 + ;; 2-aux.watsup:28.1-28.20 def size(I32_valtype) = ?(32) - ;; 2-aux.watsup:21.1-21.20 + ;; 2-aux.watsup:29.1-29.20 def size(I64_valtype) = ?(64) - ;; 2-aux.watsup:22.1-22.20 + ;; 2-aux.watsup:30.1-30.20 def size(F32_valtype) = ?(32) - ;; 2-aux.watsup:23.1-23.20 + ;; 2-aux.watsup:31.1-31.20 def size(F64_valtype) = ?(64) - ;; 2-aux.watsup:24.1-24.22 + ;; 2-aux.watsup:32.1-32.22 def size(V128_valtype) = ?(128) def {x : valtype} size(x) = ?() -;; 2-aux.watsup:29.1-29.40 +;; 2-aux.watsup:40.1-40.40 def test_sub_ATOM_22 : n -> nat - ;; 2-aux.watsup:30.1-30.38 + ;; 2-aux.watsup:41.1-41.38 def {n_3_ATOM_y : n} test_sub_ATOM_22(n_3_ATOM_y) = 0 -;; 2-aux.watsup:32.1-32.26 +;; 2-aux.watsup:43.1-43.26 def curried_ : (n, n) -> nat - ;; 2-aux.watsup:33.1-33.39 + ;; 2-aux.watsup:44.1-44.39 def {n_1 : n, n_2 : n} curried_(n_1, n_2) = (n_1 + n_2) -;; 2-aux.watsup:35.1-44.39 +;; 2-aux.watsup:46.1-55.39 syntax testfuse = | AB_(nat, nat, nat) | CD(nat, nat, nat) @@ -12609,204 +12609,204 @@ syntax testfuse = | OP(nat, nat, nat) | QR(nat, nat, nat) -;; 3-typing.watsup:3.1-6.60 +;; 3-typing.watsup:5.1-8.60 syntax context = {FUNC functype*, GLOBAL globaltype*, TABLE tabletype*, MEM memtype*, ELEM elemtype*, DATA datatype*, LOCAL valtype*, LABEL resulttype*, RETURN resulttype?} -;; 3-typing.watsup:14.1-14.66 +;; 3-typing.watsup:18.1-18.66 relation Limits_ok: `|-%:%`(limits, nat) - ;; 3-typing.watsup:22.1-24.24 + ;; 3-typing.watsup:26.1-28.24 rule _ {k : nat, n_1 : n, n_2 : n}: `|-%:%`(`[%..%]`(n_1, n_2), k) -- if ((n_1 <= n_2) /\ (n_2 <= k)) -;; 3-typing.watsup:15.1-15.64 +;; 3-typing.watsup:19.1-19.64 relation Functype_ok: `|-%:OK`(functype) - ;; 3-typing.watsup:26.1-27.13 + ;; 3-typing.watsup:30.1-31.13 rule _ {ft : functype}: `|-%:OK`(ft) -;; 3-typing.watsup:16.1-16.66 +;; 3-typing.watsup:20.1-20.66 relation Globaltype_ok: `|-%:OK`(globaltype) - ;; 3-typing.watsup:29.1-30.13 + ;; 3-typing.watsup:33.1-34.13 rule _ {gt : globaltype}: `|-%:OK`(gt) -;; 3-typing.watsup:17.1-17.65 +;; 3-typing.watsup:21.1-21.65 relation Tabletype_ok: `|-%:OK`(tabletype) - ;; 3-typing.watsup:32.1-34.35 + ;; 3-typing.watsup:36.1-38.35 rule _ {lim : limits, rt : reftype}: `|-%:OK`(`%%`(lim, rt)) -- Limits_ok: `|-%:%`(lim, ((2 ^ 32) - 1)) -;; 3-typing.watsup:18.1-18.63 +;; 3-typing.watsup:22.1-22.63 relation Memtype_ok: `|-%:OK`(memtype) - ;; 3-typing.watsup:36.1-38.33 + ;; 3-typing.watsup:40.1-42.33 rule _ {lim : limits}: `|-%:OK`(`%I8`(lim)) -- Limits_ok: `|-%:%`(lim, (2 ^ 16)) -;; 3-typing.watsup:19.1-19.66 +;; 3-typing.watsup:23.1-23.66 relation Externtype_ok: `|-%:OK`(externtype) - ;; 3-typing.watsup:41.1-43.35 + ;; 3-typing.watsup:45.1-47.35 rule func {functype : functype}: `|-%:OK`(FUNC_externtype(functype)) -- Functype_ok: `|-%:OK`(functype) - ;; 3-typing.watsup:45.1-47.39 + ;; 3-typing.watsup:49.1-51.39 rule global {globaltype : globaltype}: `|-%:OK`(GLOBAL_externtype(globaltype)) -- Globaltype_ok: `|-%:OK`(globaltype) - ;; 3-typing.watsup:49.1-51.37 + ;; 3-typing.watsup:53.1-55.37 rule table {tabletype : tabletype}: `|-%:OK`(TABLE_externtype(tabletype)) -- Tabletype_ok: `|-%:OK`(tabletype) - ;; 3-typing.watsup:53.1-55.33 + ;; 3-typing.watsup:57.1-59.33 rule mem {memtype : memtype}: `|-%:OK`(MEM_externtype(memtype)) -- Memtype_ok: `|-%:OK`(memtype) -;; 3-typing.watsup:61.1-61.65 +;; 3-typing.watsup:69.1-69.65 relation Valtype_sub: `|-%<:%`(valtype, valtype) - ;; 3-typing.watsup:64.1-65.12 + ;; 3-typing.watsup:72.1-73.12 rule refl {t : valtype}: `|-%<:%`(t, t) - ;; 3-typing.watsup:67.1-68.14 + ;; 3-typing.watsup:75.1-76.14 rule bot {t : valtype}: `|-%<:%`(BOT_valtype, t) -;; 3-typing.watsup:62.1-62.72 +;; 3-typing.watsup:70.1-70.72 relation Resulttype_sub: `|-%*<:%*`(valtype*, valtype*) - ;; 3-typing.watsup:70.1-72.35 + ;; 3-typing.watsup:78.1-80.35 rule _ {t_1* : valtype*, t_2* : valtype*}: `|-%*<:%*`(t_1*{t_1}, t_2*{t_2}) -- if (|t_1*{t_1}| = |t_2*{t_2}|) -- (Valtype_sub: `|-%<:%`(t_1, t_2))*{t_1 t_2} -;; 3-typing.watsup:75.1-75.75 +;; 3-typing.watsup:85.1-85.75 relation Limits_sub: `|-%<:%`(limits, limits) - ;; 3-typing.watsup:83.1-86.21 + ;; 3-typing.watsup:93.1-96.21 rule _ {n_11 : n, n_12 : n, n_21 : n, n_22 : n}: `|-%<:%`(`[%..%]`(n_11, n_12), `[%..%]`(n_21, n_22)) -- if (n_11 >= n_21) -- if (n_12 <= n_22) -;; 3-typing.watsup:76.1-76.73 +;; 3-typing.watsup:86.1-86.73 relation Functype_sub: `|-%<:%`(functype, functype) - ;; 3-typing.watsup:88.1-89.14 + ;; 3-typing.watsup:98.1-99.14 rule _ {ft : functype}: `|-%<:%`(ft, ft) -;; 3-typing.watsup:77.1-77.75 +;; 3-typing.watsup:87.1-87.75 relation Globaltype_sub: `|-%<:%`(globaltype, globaltype) - ;; 3-typing.watsup:91.1-92.14 + ;; 3-typing.watsup:101.1-102.14 rule _ {gt : globaltype}: `|-%<:%`(gt, gt) -;; 3-typing.watsup:78.1-78.74 +;; 3-typing.watsup:88.1-88.74 relation Tabletype_sub: `|-%<:%`(tabletype, tabletype) - ;; 3-typing.watsup:94.1-96.35 + ;; 3-typing.watsup:104.1-106.35 rule _ {lim_1 : limits, lim_2 : limits, rt : reftype}: `|-%<:%`(`%%`(lim_1, rt), `%%`(lim_2, rt)) -- Limits_sub: `|-%<:%`(lim_1, lim_2) -;; 3-typing.watsup:79.1-79.72 +;; 3-typing.watsup:89.1-89.72 relation Memtype_sub: `|-%<:%`(memtype, memtype) - ;; 3-typing.watsup:98.1-100.35 + ;; 3-typing.watsup:108.1-110.35 rule _ {lim_1 : limits, lim_2 : limits}: `|-%<:%`(`%I8`(lim_1), `%I8`(lim_2)) -- Limits_sub: `|-%<:%`(lim_1, lim_2) -;; 3-typing.watsup:80.1-80.75 +;; 3-typing.watsup:90.1-90.75 relation Externtype_sub: `|-%<:%`(externtype, externtype) - ;; 3-typing.watsup:103.1-105.35 + ;; 3-typing.watsup:113.1-115.35 rule func {ft_1 : functype, ft_2 : functype}: `|-%<:%`(FUNC_externtype(ft_1), FUNC_externtype(ft_2)) -- Functype_sub: `|-%<:%`(ft_1, ft_2) - ;; 3-typing.watsup:107.1-109.37 + ;; 3-typing.watsup:117.1-119.37 rule global {gt_1 : globaltype, gt_2 : globaltype}: `|-%<:%`(GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) -- Globaltype_sub: `|-%<:%`(gt_1, gt_2) - ;; 3-typing.watsup:111.1-113.36 + ;; 3-typing.watsup:121.1-123.36 rule table {tt_1 : tabletype, tt_2 : tabletype}: `|-%<:%`(TABLE_externtype(tt_1), TABLE_externtype(tt_2)) -- Tabletype_sub: `|-%<:%`(tt_1, tt_2) - ;; 3-typing.watsup:115.1-117.34 + ;; 3-typing.watsup:125.1-127.34 rule mem {mt_1 : memtype, mt_2 : memtype}: `|-%<:%`(MEM_externtype(mt_1), MEM_externtype(mt_2)) -- Memtype_sub: `|-%<:%`(mt_1, mt_2) -;; 3-typing.watsup:172.1-172.76 +;; 3-typing.watsup:192.1-192.76 relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) - ;; 3-typing.watsup:174.1-176.29 + ;; 3-typing.watsup:194.1-196.29 rule _ {C : context, ft : functype}: `%|-%:%`(C, ft, ft) -- Functype_ok: `|-%:OK`(ft) -;; 3-typing.watsup:123.1-124.67 +;; 3-typing.watsup:135.1-136.67 rec { -;; 3-typing.watsup:123.1-123.66 +;; 3-typing.watsup:135.1-135.66 relation Instr_ok: `%|-%:%`(context, instr, functype) - ;; 3-typing.watsup:153.1-154.34 + ;; 3-typing.watsup:171.1-172.34 rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:156.1-157.32 + ;; 3-typing.watsup:174.1-175.32 rule nop {C : context}: `%|-%:%`(C, NOP_instr, `%->%`([], [])) - ;; 3-typing.watsup:159.1-160.27 + ;; 3-typing.watsup:177.1-178.27 rule drop {C : context, t : valtype}: `%|-%:%`(C, DROP_instr, `%->%`([t], [])) - ;; 3-typing.watsup:163.1-164.31 + ;; 3-typing.watsup:181.1-182.31 rule select-expl {C : context, t : valtype}: `%|-%:%`(C, SELECT_instr(?(t)), `%->%`([t t I32_valtype], [t])) - ;; 3-typing.watsup:166.1-169.37 + ;; 3-typing.watsup:184.1-187.37 rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) -- Valtype_sub: `|-%<:%`(t, t') -- if ((t' = $valtype_numtype(numtype)) \/ (t' = $valtype_vectype(vectype))) - ;; 3-typing.watsup:178.1-181.59 + ;; 3-typing.watsup:198.1-201.59 rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:183.1-186.59 + ;; 3-typing.watsup:203.1-206.59 rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:188.1-192.61 + ;; 3-typing.watsup:208.1-212.61 rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(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})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%`(t_1*{t_1}, t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:195.1-197.24 + ;; 3-typing.watsup:217.1-219.24 rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- if (l < |C.LABEL_context|) -- if (C.LABEL_context[l] = t*{t}) - ;; 3-typing.watsup:199.1-201.24 + ;; 3-typing.watsup:221.1-223.24 rule br_if {C : context, l : labelidx, t* : valtype*}: `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) -- if (l < |C.LABEL_context|) -- if (C.LABEL_context[l] = t*{t}) - ;; 3-typing.watsup:203.1-206.42 + ;; 3-typing.watsup:225.1-228.42 rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- (if (l < |C.LABEL_context|))*{l} @@ -12814,51 +12814,51 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- (Resulttype_sub: `|-%*<:%*`(t*{t}, C.LABEL_context[l]))*{l} -- Resulttype_sub: `|-%*<:%*`(t*{t}, C.LABEL_context[l']) - ;; 3-typing.watsup:208.1-210.24 + ;; 3-typing.watsup:233.1-235.24 rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) -- if (C.RETURN_context = ?(t*{t})) - ;; 3-typing.watsup:212.1-214.33 + ;; 3-typing.watsup:237.1-239.33 rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) -- if (x < |C.FUNC_context|) -- if (C.FUNC_context[x] = `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:216.1-219.26 + ;; 3-typing.watsup:241.1-244.26 rule call_indirect {C : context, ft : functype, lim : limits, t_1* : valtype*, t_2* : valtype*, x : idx}: `%|-%:%`(C, CALL_INDIRECT_instr(x, ft), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) -- if (x < |C.TABLE_context|) -- if (C.TABLE_context[x] = `%%`(lim, FUNCREF_reftype)) -- if (ft = `%->%`(t_1*{t_1}, t_2*{t_2})) - ;; 3-typing.watsup:222.1-223.37 + ;; 3-typing.watsup:249.1-250.37 rule const {C : context, c_nt : c_numtype, nt : numtype}: `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [$valtype_numtype(nt)])) - ;; 3-typing.watsup:225.1-226.31 + ;; 3-typing.watsup:252.1-253.31 rule unop {C : context, nt : numtype, unop : unop_numtype}: `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 3-typing.watsup:228.1-229.36 + ;; 3-typing.watsup:255.1-256.36 rule binop {C : context, binop : binop_numtype, nt : numtype}: `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 3-typing.watsup:231.1-232.36 + ;; 3-typing.watsup:258.1-259.36 rule testop {C : context, nt : numtype, testop : testop_numtype}: `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([$valtype_numtype(nt)], [I32_valtype])) - ;; 3-typing.watsup:234.1-235.37 + ;; 3-typing.watsup:261.1-262.37 rule relop {C : context, nt : numtype, relop : relop_numtype}: `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [I32_valtype])) - ;; 3-typing.watsup:238.1-240.23 + ;; 3-typing.watsup:265.1-267.23 rule extend {C : context, n : n, nt : numtype, o0 : nat}: `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) -- if ($size($valtype_numtype(nt)) = ?(o0)) -- if (n <= o0) - ;; 3-typing.watsup:242.1-245.34 + ;; 3-typing.watsup:269.1-272.34 rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype, o0 : nat, o1 : nat}: `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([$valtype_numtype(nt_2)], [$valtype_numtype(nt_1)])) -- if ($size($valtype_numtype(nt_1)) = ?(o0)) @@ -12866,7 +12866,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- if (nt_1 =/= nt_2) -- if (o0 = o1) - ;; 3-typing.watsup:247.1-250.52 + ;; 3-typing.watsup:274.1-277.52 rule convert-i {C : context, in_1 : in, in_2 : in, sx? : sx?, o0 : nat, o1 : nat}: `%|-%:%`(C, CVTOP_instr($numtype_in(in_1), CONVERT_cvtop, $numtype_in(in_2), sx?{sx}), `%->%`([$valtype_in(in_2)], [$valtype_in(in_1)])) -- if ($size($valtype_in(in_1)) = ?(o0)) @@ -12874,86 +12874,86 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- if (in_1 =/= in_2) -- if ((sx?{sx} = ?()) <=> (o0 > o1)) - ;; 3-typing.watsup:252.1-254.22 + ;; 3-typing.watsup:279.1-281.22 rule convert-f {C : context, fn_1 : fn, fn_2 : fn}: `%|-%:%`(C, CVTOP_instr($numtype_fn(fn_1), CONVERT_cvtop, $numtype_fn(fn_2), ?()), `%->%`([$valtype_fn(fn_2)], [$valtype_fn(fn_1)])) -- if (fn_1 =/= fn_2) - ;; 3-typing.watsup:257.1-258.35 + ;; 3-typing.watsup:286.1-287.35 rule ref.null {C : context, rt : reftype}: `%|-%:%`(C, REF.NULL_instr(rt), `%->%`([], [$valtype_reftype(rt)])) - ;; 3-typing.watsup:260.1-262.23 + ;; 3-typing.watsup:289.1-291.23 rule ref.func {C : context, ft : functype, x : idx}: `%|-%:%`(C, REF.FUNC_instr(x), `%->%`([], [FUNCREF_valtype])) -- if (x < |C.FUNC_context|) -- if (C.FUNC_context[x] = ft) - ;; 3-typing.watsup:264.1-265.31 + ;; 3-typing.watsup:293.1-294.31 rule ref.is_null {C : context, rt : reftype}: `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([$valtype_reftype(rt)], [I32_valtype])) - ;; 3-typing.watsup:268.1-270.23 + ;; 3-typing.watsup:299.1-301.23 rule local.get {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) -- if (x < |C.LOCAL_context|) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:272.1-274.23 + ;; 3-typing.watsup:303.1-305.23 rule local.set {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->%`([t], [])) -- if (x < |C.LOCAL_context|) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:276.1-278.23 + ;; 3-typing.watsup:307.1-309.23 rule local.tee {C : context, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%`([t], [t])) -- if (x < |C.LOCAL_context|) -- if (C.LOCAL_context[x] = t) - ;; 3-typing.watsup:281.1-283.29 + ;; 3-typing.watsup:314.1-316.29 rule global.get {C : context, t : valtype, x : idx, w0 : ()?}: `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) -- if (x < |C.GLOBAL_context|) -- if (C.GLOBAL_context[x] = `MUT%?%`(w0, t)) - ;; 3-typing.watsup:285.1-287.28 + ;; 3-typing.watsup:318.1-320.28 rule global.set {C : context, t : valtype, x : idx}: `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) -- if (x < |C.GLOBAL_context|) -- if (C.GLOBAL_context[x] = `MUT%?%`(?(()), t)) - ;; 3-typing.watsup:290.1-292.28 + ;; 3-typing.watsup:325.1-327.28 rule table.get {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [$valtype_reftype(rt)])) -- if (x < |C.TABLE_context|) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:294.1-296.28 + ;; 3-typing.watsup:329.1-331.28 rule table.set {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype $valtype_reftype(rt)], [])) -- if (x < |C.TABLE_context|) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:298.1-300.24 + ;; 3-typing.watsup:333.1-335.24 rule table.size {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) -- if (x < |C.TABLE_context|) -- if (C.TABLE_context[x] = tt) - ;; 3-typing.watsup:302.1-304.28 + ;; 3-typing.watsup:337.1-339.28 rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([$valtype_reftype(rt) I32_valtype], [I32_valtype])) -- if (x < |C.TABLE_context|) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:306.1-308.28 + ;; 3-typing.watsup:341.1-343.28 rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype $valtype_reftype(rt) I32_valtype], [])) -- if (x < |C.TABLE_context|) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 3-typing.watsup:310.1-313.32 + ;; 3-typing.watsup:345.1-348.32 rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt : reftype, x_1 : idx, x_2 : idx}: `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (x_1 < |C.TABLE_context|) @@ -12961,7 +12961,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt)) -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt)) - ;; 3-typing.watsup:315.1-318.25 + ;; 3-typing.watsup:350.1-353.25 rule table.init {C : context, lim : limits, rt : reftype, x_1 : idx, x_2 : idx}: `%|-%:%`(C, TABLE.INIT_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (x_1 < |C.TABLE_context|) @@ -12969,37 +12969,37 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- if (C.TABLE_context[x_1] = `%%`(lim, rt)) -- if (C.ELEM_context[x_2] = rt) - ;; 3-typing.watsup:320.1-322.23 + ;; 3-typing.watsup:355.1-357.23 rule elem.drop {C : context, rt : reftype, x : idx}: `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) -- if (x < |C.ELEM_context|) -- if (C.ELEM_context[x] = rt) - ;; 3-typing.watsup:325.1-327.22 + ;; 3-typing.watsup:362.1-364.22 rule memory.size {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.SIZE_instr, `%->%`([], [I32_valtype])) -- if (0 < |C.MEM_context|) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:329.1-331.22 + ;; 3-typing.watsup:366.1-368.22 rule memory.grow {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.GROW_instr, `%->%`([I32_valtype], [I32_valtype])) -- if (0 < |C.MEM_context|) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:333.1-335.22 + ;; 3-typing.watsup:370.1-372.22 rule memory.fill {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.FILL_instr, `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (0 < |C.MEM_context|) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:337.1-339.22 + ;; 3-typing.watsup:374.1-376.22 rule memory.copy {C : context, mt : memtype}: `%|-%:%`(C, MEMORY.COPY_instr, `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (0 < |C.MEM_context|) -- if (C.MEM_context[0] = mt) - ;; 3-typing.watsup:341.1-344.23 + ;; 3-typing.watsup:378.1-381.23 rule memory.init {C : context, mt : memtype, x : idx}: `%|-%:%`(C, MEMORY.INIT_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) -- if (0 < |C.MEM_context|) @@ -13007,13 +13007,13 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- if (C.MEM_context[0] = mt) -- if (C.DATA_context[x] = OK) - ;; 3-typing.watsup:346.1-348.23 + ;; 3-typing.watsup:383.1-385.23 rule data.drop {C : context, x : idx}: `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) -- if (x < |C.DATA_context|) -- if (C.DATA_context[x] = OK) - ;; 3-typing.watsup:350.1-355.32 + ;; 3-typing.watsup:387.1-392.32 rule load {C : context, in : in, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, o0 : nat, o1? : nat?}: `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, n_A, n_O), `%->%`([I32_valtype], [$valtype_numtype(nt)])) -- if (0 < |C.MEM_context|) @@ -13026,7 +13026,7 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} -- if ((n?{n} = ?()) \/ (nt = $numtype_in(in))) - ;; 3-typing.watsup:357.1-362.32 + ;; 3-typing.watsup:394.1-399.32 rule store {C : context, in : in, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, o0 : nat, o1? : nat?}: `%|-%:%`(C, STORE_instr(nt, n?{n}, n_A, n_O), `%->%`([I32_valtype $valtype_numtype(nt)], [])) -- if (0 < |C.MEM_context|) @@ -13038,193 +13038,193 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} -- if ((n?{n} = ?()) \/ (nt = $numtype_in(in))) -;; 3-typing.watsup:124.1-124.67 +;; 3-typing.watsup:136.1-136.67 relation InstrSeq_ok: `%|-%*:%`(context, instr*, functype) - ;; 3-typing.watsup:133.1-134.36 + ;; 3-typing.watsup:149.1-150.36 rule empty {C : context}: `%|-%*:%`(C, [], `%->%`([], [])) - ;; 3-typing.watsup:136.1-139.46 + ;; 3-typing.watsup:152.1-155.46 rule seq {C : context, instr_1 : instr, instr_2 : instr, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*}: `%|-%*:%`(C, [instr_1] :: instr_2*{}, `%->%`(t_1*{t_1}, t_3*{t_3})) -- Instr_ok: `%|-%:%`(C, instr_1, `%->%`(t_1*{t_1}, t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C, [instr_2], `%->%`(t_2*{t_2}, t_3*{t_3})) - ;; 3-typing.watsup:141.1-146.38 + ;; 3-typing.watsup:157.1-162.38 rule weak {C : context, instr* : instr*, t'_1* : valtype*, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%*:%`(C, instr*{instr}, `%->%`(t'_1*{t'_1}, t'_2*{t'_2})) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) -- Resulttype_sub: `|-%*<:%*`(t'_1*{t'_1}, t_1*{t_1}) -- Resulttype_sub: `|-%*<:%*`(t_2*{t_2}, t'_2*{t'_2}) - ;; 3-typing.watsup:148.1-150.45 + ;; 3-typing.watsup:164.1-166.45 rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%*:%`(C, instr*{instr}, `%->%`(t*{t} :: t_1*{t_1}, t*{t} :: t_2*{t_2})) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`(t_1*{t_1}, t_2*{t_2})) } -;; 3-typing.watsup:125.1-125.71 +;; 3-typing.watsup:137.1-137.71 relation Expr_ok: `%|-%:%`(context, expr, resulttype) - ;; 3-typing.watsup:128.1-130.46 + ;; 3-typing.watsup:142.1-144.46 rule _ {C : context, instr* : instr*, t* : valtype*}: `%|-%:%`(C, instr*{instr}, t*{t}) -- InstrSeq_ok: `%|-%*:%`(C, instr*{instr}, `%->%`([], t*{t})) -;; 3-typing.watsup:367.1-367.78 +;; 3-typing.watsup:406.1-406.78 relation Instr_const: `%|-%CONST`(context, instr) - ;; 3-typing.watsup:371.1-372.26 + ;; 3-typing.watsup:410.1-411.26 rule const {C : context, c : c_numtype, nt : numtype}: `%|-%CONST`(C, CONST_instr(nt, c)) - ;; 3-typing.watsup:374.1-375.27 + ;; 3-typing.watsup:413.1-414.27 rule ref.null {C : context, rt : reftype}: `%|-%CONST`(C, REF.NULL_instr(rt)) - ;; 3-typing.watsup:377.1-378.26 + ;; 3-typing.watsup:416.1-417.26 rule ref.func {C : context, x : idx}: `%|-%CONST`(C, REF.FUNC_instr(x)) - ;; 3-typing.watsup:380.1-382.32 + ;; 3-typing.watsup:419.1-421.32 rule global.get {C : context, t : valtype, x : idx}: `%|-%CONST`(C, GLOBAL.GET_instr(x)) -- if (x < |C.GLOBAL_context|) -- if (C.GLOBAL_context[x] = `MUT%?%`(?(), t)) -;; 3-typing.watsup:368.1-368.77 +;; 3-typing.watsup:407.1-407.77 relation Expr_const: `%|-%CONST`(context, expr) - ;; 3-typing.watsup:385.1-386.38 + ;; 3-typing.watsup:424.1-425.38 rule _ {C : context, instr* : instr*}: `%|-%CONST`(C, instr*{instr}) -- (Instr_const: `%|-%CONST`(C, instr))*{instr} -;; 3-typing.watsup:369.1-369.78 +;; 3-typing.watsup:408.1-408.78 relation Expr_ok_const: `%|-%:%CONST`(context, expr, valtype) - ;; 3-typing.watsup:389.1-392.33 + ;; 3-typing.watsup:428.1-431.33 rule _ {C : context, expr : expr, t : valtype}: `%|-%:%CONST`(C, expr, t) -- Expr_ok: `%|-%:%`(C, expr, [t]) -- Expr_const: `%|-%CONST`(C, expr) -;; 3-typing.watsup:397.1-397.73 +;; 3-typing.watsup:438.1-438.73 relation Func_ok: `%|-%:%`(context, func, functype) - ;; 3-typing.watsup:408.1-412.75 + ;; 3-typing.watsup:451.1-455.75 rule _ {C : context, expr : expr, ft : functype, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, `FUNC%%*%`(ft, t*{t}, expr), ft) -- if (ft = `%->%`(t_1*{t_1}, t_2*{t_2})) -- Functype_ok: `|-%:OK`(ft) -- Expr_ok: `%|-%:%`(C ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL t_1*{t_1} :: t*{t}, LABEL [], RETURN ?()} ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()} ++ {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?(t_2*{t_2})}, expr, t_2*{t_2}) -;; 3-typing.watsup:398.1-398.75 +;; 3-typing.watsup:439.1-439.75 relation Global_ok: `%|-%:%`(context, global, globaltype) - ;; 3-typing.watsup:414.1-418.40 + ;; 3-typing.watsup:457.1-461.40 rule _ {C : context, expr : expr, gt : globaltype, t : valtype, w0 : ()?}: `%|-%:%`(C, GLOBAL(gt, expr), gt) -- Globaltype_ok: `|-%:OK`(gt) -- if (gt = `MUT%?%`(w0, t)) -- Expr_ok_const: `%|-%:%CONST`(C, expr, t) -;; 3-typing.watsup:399.1-399.74 +;; 3-typing.watsup:440.1-440.74 relation Table_ok: `%|-%:%`(context, table, tabletype) - ;; 3-typing.watsup:420.1-422.30 + ;; 3-typing.watsup:463.1-465.30 rule _ {C : context, tt : tabletype}: `%|-%:%`(C, TABLE(tt), tt) -- Tabletype_ok: `|-%:OK`(tt) -;; 3-typing.watsup:400.1-400.72 +;; 3-typing.watsup:441.1-441.72 relation Mem_ok: `%|-%:%`(context, mem, memtype) - ;; 3-typing.watsup:424.1-426.28 + ;; 3-typing.watsup:467.1-469.28 rule _ {C : context, mt : memtype}: `%|-%:%`(C, MEMORY(mt), mt) -- Memtype_ok: `|-%:OK`(mt) -;; 3-typing.watsup:403.1-403.77 +;; 3-typing.watsup:444.1-444.77 relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) - ;; 3-typing.watsup:437.1-440.45 + ;; 3-typing.watsup:480.1-483.45 rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, TABLE_elemmode(x, expr), rt) -- if (x < |C.TABLE_context|) -- if (C.TABLE_context[x] = `%%`(lim, rt)) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} - ;; 3-typing.watsup:442.1-443.20 + ;; 3-typing.watsup:485.1-486.20 rule declare {C : context, rt : reftype}: `%|-%:%`(C, DECLARE_elemmode, rt) -;; 3-typing.watsup:401.1-401.73 +;; 3-typing.watsup:442.1-442.73 relation Elem_ok: `%|-%:%`(context, elem, reftype) - ;; 3-typing.watsup:428.1-431.40 + ;; 3-typing.watsup:471.1-474.40 rule _ {C : context, elemmode? : elemmode?, expr* : expr*, rt : reftype}: `%|-%:%`(C, `ELEM%%*%?`(rt, expr*{expr}, elemmode?{elemmode}), rt) -- (Expr_ok: `%|-%:%`(C, expr, [$valtype_reftype(rt)]))*{expr} -- (Elemmode_ok: `%|-%:%`(C, elemmode, rt))?{elemmode} -;; 3-typing.watsup:404.1-404.77 +;; 3-typing.watsup:445.1-445.77 relation Datamode_ok: `%|-%:OK`(context, datamode) - ;; 3-typing.watsup:445.1-448.45 + ;; 3-typing.watsup:488.1-491.45 rule _ {C : context, expr : expr, mt : memtype}: `%|-%:OK`(C, MEMORY_datamode(0, expr)) -- if (0 < |C.MEM_context|) -- if (C.MEM_context[0] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} -;; 3-typing.watsup:402.1-402.73 +;; 3-typing.watsup:443.1-443.73 relation Data_ok: `%|-%:OK`(context, data) - ;; 3-typing.watsup:433.1-435.40 + ;; 3-typing.watsup:476.1-478.40 rule _ {C : context, b* : byte*, datamode? : datamode?}: `%|-%:OK`(C, `DATA%*%?`(b*{b}, datamode?{datamode})) -- (Datamode_ok: `%|-%:OK`(C, datamode))?{datamode} -;; 3-typing.watsup:405.1-405.74 +;; 3-typing.watsup:446.1-446.74 relation Start_ok: `%|-%:OK`(context, start) - ;; 3-typing.watsup:450.1-452.39 + ;; 3-typing.watsup:493.1-495.39 rule _ {C : context, x : idx}: `%|-%:OK`(C, START(x)) -- if (x < |C.FUNC_context|) -- if (C.FUNC_context[x] = `%->%`([], [])) -;; 3-typing.watsup:455.1-455.80 +;; 3-typing.watsup:500.1-500.80 relation Import_ok: `%|-%:%`(context, import, externtype) - ;; 3-typing.watsup:459.1-461.31 + ;; 3-typing.watsup:504.1-506.31 rule _ {C : context, name_1 : name, name_2 : name, xt : externtype}: `%|-%:%`(C, IMPORT(name_1, name_2, xt), xt) -- Externtype_ok: `|-%:OK`(xt) -;; 3-typing.watsup:457.1-457.83 +;; 3-typing.watsup:502.1-502.83 relation Externuse_ok: `%|-%:%`(context, externuse, externtype) - ;; 3-typing.watsup:467.1-469.23 + ;; 3-typing.watsup:512.1-514.23 rule func {C : context, ft : functype, x : idx}: `%|-%:%`(C, FUNC_externuse(x), FUNC_externtype(ft)) -- if (x < |C.FUNC_context|) -- if (C.FUNC_context[x] = ft) - ;; 3-typing.watsup:471.1-473.25 + ;; 3-typing.watsup:516.1-518.25 rule global {C : context, gt : globaltype, x : idx}: `%|-%:%`(C, GLOBAL_externuse(x), GLOBAL_externtype(gt)) -- if (x < |C.GLOBAL_context|) -- if (C.GLOBAL_context[x] = gt) - ;; 3-typing.watsup:475.1-477.24 + ;; 3-typing.watsup:520.1-522.24 rule table {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE_externuse(x), TABLE_externtype(tt)) -- if (x < |C.TABLE_context|) -- if (C.TABLE_context[x] = tt) - ;; 3-typing.watsup:479.1-481.22 + ;; 3-typing.watsup:524.1-526.22 rule mem {C : context, mt : memtype, x : idx}: `%|-%:%`(C, MEM_externuse(x), MEM_externtype(mt)) -- if (x < |C.MEM_context|) -- if (C.MEM_context[x] = mt) -;; 3-typing.watsup:456.1-456.80 +;; 3-typing.watsup:501.1-501.80 relation Export_ok: `%|-%:%`(context, export, externtype) - ;; 3-typing.watsup:463.1-465.39 + ;; 3-typing.watsup:508.1-510.39 rule _ {C : context, externuse : externuse, name : name, xt : externtype}: `%|-%:%`(C, EXPORT(name, externuse), xt) -- Externuse_ok: `%|-%:%`(C, externuse, xt) -;; 3-typing.watsup:484.1-484.62 +;; 3-typing.watsup:531.1-531.62 relation Module_ok: `|-%:OK`(module) - ;; 3-typing.watsup:486.1-500.16 + ;; 3-typing.watsup:533.1-547.16 rule _ {C : context, data^n : data^n, elem* : elem*, export* : export*, ft* : functype*, func* : func*, global* : global*, gt* : globaltype*, import* : import*, mem* : mem*, mt* : memtype*, n : n, rt* : reftype*, start? : start?, table* : table*, tt* : tabletype*}: `|-%:OK`(`MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data^n{data}, start?{start}, export*{export})) -- if (|ft*{ft}| = |func*{func}|) @@ -13242,115 +13242,115 @@ relation Module_ok: `|-%:OK`(module) -- (Start_ok: `%|-%:OK`(C, start))?{start} -- if (|mem*{mem}| <= 1) -;; 4-runtime.watsup:3.1-3.39 +;; 4-runtime.watsup:5.1-5.39 syntax addr = nat -;; 4-runtime.watsup:4.1-4.53 +;; 4-runtime.watsup:6.1-6.53 syntax funcaddr = addr -;; 4-runtime.watsup:5.1-5.53 +;; 4-runtime.watsup:7.1-7.53 syntax globaladdr = addr -;; 4-runtime.watsup:6.1-6.51 +;; 4-runtime.watsup:8.1-8.51 syntax tableaddr = addr -;; 4-runtime.watsup:7.1-7.50 +;; 4-runtime.watsup:9.1-9.50 syntax memaddr = addr -;; 4-runtime.watsup:8.1-8.49 +;; 4-runtime.watsup:10.1-10.49 syntax elemaddr = addr -;; 4-runtime.watsup:9.1-9.49 +;; 4-runtime.watsup:11.1-11.49 syntax dataaddr = addr -;; 4-runtime.watsup:10.1-10.51 +;; 4-runtime.watsup:12.1-12.51 syntax labeladdr = addr -;; 4-runtime.watsup:11.1-11.49 +;; 4-runtime.watsup:13.1-13.49 syntax hostaddr = addr -;; 4-runtime.watsup:24.1-25.24 +;; 4-runtime.watsup:30.1-31.24 syntax num = | CONST(numtype, c_numtype) -;; 4-runtime.watsup:26.1-27.67 +;; 4-runtime.watsup:32.1-33.67 syntax ref = | REF.NULL(reftype) | REF.FUNC_ADDR(funcaddr) | REF.HOST_ADDR(hostaddr) -;; 4-runtime.watsup:28.1-29.10 +;; 4-runtime.watsup:34.1-35.10 syntax val = | CONST(numtype, c_numtype) | REF.NULL(reftype) | REF.FUNC_ADDR(funcaddr) | REF.HOST_ADDR(hostaddr) -;; 4-runtime.watsup:31.1-32.18 +;; 4-runtime.watsup:37.1-38.18 syntax result = | _VALS(val*) | TRAP -;; 4-runtime.watsup:38.1-39.66 +;; 4-runtime.watsup:47.1-48.66 syntax externval = | FUNC(funcaddr) | GLOBAL(globaladdr) | TABLE(tableaddr) | MEM(memaddr) -;; 4-runtime.watsup:44.1-44.44 +;; 4-runtime.watsup:55.1-55.44 def default_ : valtype -> val? - ;; 4-runtime.watsup:45.1-45.35 + ;; 4-runtime.watsup:56.1-56.35 def default_(I32_valtype) = ?(CONST_val(I32_numtype, 0)) - ;; 4-runtime.watsup:46.1-46.35 + ;; 4-runtime.watsup:57.1-57.35 def default_(I64_valtype) = ?(CONST_val(I64_numtype, 0)) - ;; 4-runtime.watsup:47.1-47.35 + ;; 4-runtime.watsup:58.1-58.35 def default_(F32_valtype) = ?(CONST_val(F32_numtype, 0)) - ;; 4-runtime.watsup:48.1-48.35 + ;; 4-runtime.watsup:59.1-59.35 def default_(F64_valtype) = ?(CONST_val(F64_numtype, 0)) - ;; 4-runtime.watsup:49.1-49.44 + ;; 4-runtime.watsup:60.1-60.44 def default_(FUNCREF_valtype) = ?(REF.NULL_val(FUNCREF_reftype)) - ;; 4-runtime.watsup:50.1-50.48 + ;; 4-runtime.watsup:61.1-61.48 def default_(EXTERNREF_valtype) = ?(REF.NULL_val(EXTERNREF_reftype)) def {x : valtype} default_(x) = ?() -;; 4-runtime.watsup:72.1-74.22 +;; 4-runtime.watsup:87.1-89.22 syntax exportinst = {NAME name, VALUE externval} -;; 4-runtime.watsup:84.1-91.25 +;; 4-runtime.watsup:91.1-98.25 syntax moduleinst = {FUNC funcaddr*, GLOBAL globaladdr*, TABLE tableaddr*, MEM memaddr*, ELEM elemaddr*, DATA dataaddr*, EXPORT exportinst*} -;; 4-runtime.watsup:55.1-57.16 +;; 4-runtime.watsup:70.1-72.16 syntax funcinst = {MODULE moduleinst, CODE func} -;; 4-runtime.watsup:58.1-60.16 +;; 4-runtime.watsup:73.1-75.16 syntax globalinst = {TYPE globaltype, VALUE val} -;; 4-runtime.watsup:61.1-63.16 +;; 4-runtime.watsup:76.1-78.16 syntax tableinst = {TYPE tabletype, ELEM ref*} -;; 4-runtime.watsup:64.1-66.17 +;; 4-runtime.watsup:79.1-81.17 syntax meminst = {TYPE memtype, DATA byte*} -;; 4-runtime.watsup:67.1-69.16 +;; 4-runtime.watsup:82.1-84.16 syntax eleminst = {TYPE elemtype, ELEM ref*} -;; 4-runtime.watsup:70.1-71.17 +;; 4-runtime.watsup:85.1-86.17 syntax datainst = {DATA byte*} -;; 4-runtime.watsup:76.1-82.21 +;; 4-runtime.watsup:112.1-118.21 syntax store = {FUNC funcinst*, GLOBAL globalinst*, TABLE tableinst*, MEM meminst*, ELEM eleminst*, DATA datainst*} -;; 4-runtime.watsup:93.1-95.24 +;; 4-runtime.watsup:120.1-122.24 syntax frame = {LOCAL val*, MODULE moduleinst} -;; 4-runtime.watsup:96.1-96.47 +;; 4-runtime.watsup:124.1-124.47 syntax state = `%;%`(store, frame) -;; 4-runtime.watsup:183.1-190.5 +;; 4-runtime.watsup:209.1-216.5 rec { -;; 4-runtime.watsup:183.1-190.5 +;; 4-runtime.watsup:209.1-216.5 syntax admininstr = | UNREACHABLE | NOP @@ -13461,122 +13461,122 @@ def admininstr_val : val -> admininstr def {x : funcaddr} admininstr_val(REF.FUNC_ADDR_val(x)) = REF.FUNC_ADDR_admininstr(x) def {x : hostaddr} admininstr_val(REF.HOST_ADDR_val(x)) = REF.HOST_ADDR_admininstr(x) -;; 4-runtime.watsup:97.1-97.62 +;; 4-runtime.watsup:125.1-125.62 syntax config = `%;%*`(state, admininstr*) -;; 4-runtime.watsup:115.1-115.59 +;; 4-runtime.watsup:134.1-134.59 def funcaddr : state -> funcaddr* - ;; 4-runtime.watsup:116.1-116.38 + ;; 4-runtime.watsup:135.1-135.38 def {f : frame, s : store} funcaddr(`%;%`(s, f)) = f.MODULE_frame.FUNC_moduleinst -;; 4-runtime.watsup:118.1-118.52 +;; 4-runtime.watsup:137.1-137.52 def funcinst : state -> funcinst* - ;; 4-runtime.watsup:125.1-125.31 + ;; 4-runtime.watsup:144.1-144.31 def {f : frame, s : store} funcinst(`%;%`(s, f)) = s.FUNC_store -;; 4-runtime.watsup:119.1-119.58 +;; 4-runtime.watsup:138.1-138.58 def globalinst : state -> globalinst* - ;; 4-runtime.watsup:126.1-126.35 + ;; 4-runtime.watsup:145.1-145.35 def {f : frame, s : store} globalinst(`%;%`(s, f)) = s.GLOBAL_store -;; 4-runtime.watsup:120.1-120.55 +;; 4-runtime.watsup:139.1-139.55 def tableinst : state -> tableinst* - ;; 4-runtime.watsup:127.1-127.33 + ;; 4-runtime.watsup:146.1-146.33 def {f : frame, s : store} tableinst(`%;%`(s, f)) = s.TABLE_store -;; 4-runtime.watsup:121.1-121.49 +;; 4-runtime.watsup:140.1-140.49 def meminst : state -> meminst* - ;; 4-runtime.watsup:128.1-128.29 + ;; 4-runtime.watsup:147.1-147.29 def {f : frame, s : store} meminst(`%;%`(s, f)) = s.MEM_store -;; 4-runtime.watsup:122.1-122.52 +;; 4-runtime.watsup:141.1-141.52 def eleminst : state -> eleminst* - ;; 4-runtime.watsup:129.1-129.31 + ;; 4-runtime.watsup:148.1-148.31 def {f : frame, s : store} eleminst(`%;%`(s, f)) = s.ELEM_store -;; 4-runtime.watsup:123.1-123.52 +;; 4-runtime.watsup:142.1-142.52 def datainst : state -> datainst* - ;; 4-runtime.watsup:130.1-130.31 + ;; 4-runtime.watsup:149.1-149.31 def {f : frame, s : store} datainst(`%;%`(s, f)) = s.DATA_store -;; 4-runtime.watsup:132.1-132.67 +;; 4-runtime.watsup:151.1-151.67 def func : (state, funcidx) -> funcinst - ;; 4-runtime.watsup:140.1-140.48 + ;; 4-runtime.watsup:159.1-159.48 def {f : frame, s : store, x : idx} func(`%;%`(s, f), x) = s.FUNC_store[f.MODULE_frame.FUNC_moduleinst[x]] -;; 4-runtime.watsup:133.1-133.69 +;; 4-runtime.watsup:152.1-152.69 def global : (state, globalidx) -> globalinst - ;; 4-runtime.watsup:141.1-141.54 + ;; 4-runtime.watsup:160.1-160.54 def {f : frame, s : store, x : idx} global(`%;%`(s, f), x) = s.GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x]] -;; 4-runtime.watsup:134.1-134.68 +;; 4-runtime.watsup:153.1-153.68 def table : (state, tableidx) -> tableinst - ;; 4-runtime.watsup:142.1-142.51 + ;; 4-runtime.watsup:161.1-161.51 def {f : frame, s : store, x : idx} table(`%;%`(s, f), x) = s.TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]] -;; 4-runtime.watsup:135.1-135.66 +;; 4-runtime.watsup:154.1-154.66 def mem : (state, memidx) -> meminst - ;; 4-runtime.watsup:143.1-143.45 + ;; 4-runtime.watsup:162.1-162.45 def {f : frame, s : store, x : idx} mem(`%;%`(s, f), x) = s.MEM_store[f.MODULE_frame.MEM_moduleinst[x]] -;; 4-runtime.watsup:136.1-136.67 +;; 4-runtime.watsup:155.1-155.67 def elem : (state, tableidx) -> eleminst - ;; 4-runtime.watsup:144.1-144.48 + ;; 4-runtime.watsup:163.1-163.48 def {f : frame, s : store, x : idx} elem(`%;%`(s, f), x) = s.ELEM_store[f.MODULE_frame.ELEM_moduleinst[x]] -;; 4-runtime.watsup:137.1-137.67 +;; 4-runtime.watsup:156.1-156.67 def data : (state, dataidx) -> datainst - ;; 4-runtime.watsup:145.1-145.48 + ;; 4-runtime.watsup:164.1-164.48 def {f : frame, s : store, x : idx} data(`%;%`(s, f), x) = s.DATA_store[f.MODULE_frame.DATA_moduleinst[x]] -;; 4-runtime.watsup:138.1-138.68 +;; 4-runtime.watsup:157.1-157.68 def local : (state, localidx) -> val - ;; 4-runtime.watsup:146.1-146.35 + ;; 4-runtime.watsup:165.1-165.35 def {f : frame, s : store, x : idx} local(`%;%`(s, f), x) = f.LOCAL_frame[x] -;; 4-runtime.watsup:149.1-149.78 +;; 4-runtime.watsup:168.1-168.78 def with_local : (state, localidx, val) -> state - ;; 4-runtime.watsup:158.1-158.52 + ;; 4-runtime.watsup:177.1-177.52 def {f : frame, s : store, v : val, x : idx} with_local(`%;%`(s, f), x, v) = `%;%`(s, f[LOCAL_frame[x] = v]) -;; 4-runtime.watsup:150.1-150.85 +;; 4-runtime.watsup:169.1-169.85 def with_global : (state, globalidx, val) -> state - ;; 4-runtime.watsup:159.1-159.77 + ;; 4-runtime.watsup:178.1-178.77 def {f : frame, s : store, v : val, x : idx} with_global(`%;%`(s, f), x, v) = `%;%`(s[GLOBAL_store[f.MODULE_frame.GLOBAL_moduleinst[x]].VALUE_globalinst = v], f) -;; 4-runtime.watsup:151.1-151.88 +;; 4-runtime.watsup:170.1-170.88 def with_table : (state, tableidx, nat, ref) -> state - ;; 4-runtime.watsup:160.1-160.79 + ;; 4-runtime.watsup:179.1-179.79 def {f : frame, i : nat, r : ref, s : store, x : idx} with_table(`%;%`(s, f), x, i, r) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]].ELEM_tableinst[i] = r], f) -;; 4-runtime.watsup:152.1-152.84 +;; 4-runtime.watsup:171.1-171.84 def with_tableinst : (state, tableidx, tableinst) -> state - ;; 4-runtime.watsup:161.1-161.74 + ;; 4-runtime.watsup:180.1-180.74 def {f : frame, s : store, ti : tableinst, x : idx} with_tableinst(`%;%`(s, f), x, ti) = `%;%`(s[TABLE_store[f.MODULE_frame.TABLE_moduleinst[x]] = ti], f) -;; 4-runtime.watsup:153.1-153.93 +;; 4-runtime.watsup:172.1-172.93 def with_mem : (state, memidx, nat, nat, byte*) -> state - ;; 4-runtime.watsup:162.1-162.82 + ;; 4-runtime.watsup:181.1-181.82 def {b* : byte*, f : frame, i : nat, j : nat, s : store, x : idx} with_mem(`%;%`(s, f), x, i, j, b*{b}) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x]].DATA_meminst[i : j] = b*{b}], f) -;; 4-runtime.watsup:154.1-154.77 +;; 4-runtime.watsup:173.1-173.77 def with_meminst : (state, memidx, meminst) -> state - ;; 4-runtime.watsup:163.1-163.68 + ;; 4-runtime.watsup:182.1-182.68 def {f : frame, mi : meminst, s : store, x : idx} with_meminst(`%;%`(s, f), x, mi) = `%;%`(s[MEM_store[f.MODULE_frame.MEM_moduleinst[x]] = mi], f) -;; 4-runtime.watsup:155.1-155.82 +;; 4-runtime.watsup:174.1-174.82 def with_elem : (state, elemidx, ref*) -> state - ;; 4-runtime.watsup:164.1-164.72 + ;; 4-runtime.watsup:183.1-183.72 def {f : frame, r* : ref*, s : store, x : idx} with_elem(`%;%`(s, f), x, r*{r}) = `%;%`(s[ELEM_store[f.MODULE_frame.ELEM_moduleinst[x]].ELEM_eleminst = r*{r}], f) -;; 4-runtime.watsup:156.1-156.82 +;; 4-runtime.watsup:175.1-175.82 def with_data : (state, dataidx, byte*) -> state - ;; 4-runtime.watsup:165.1-165.72 + ;; 4-runtime.watsup:184.1-184.72 def {b* : byte*, f : frame, s : store, x : idx} with_data(`%;%`(s, f), x, b*{b}) = `%;%`(s[DATA_store[f.MODULE_frame.DATA_moduleinst[x]].DATA_datainst = b*{b}], f) -;; 4-runtime.watsup:167.1-167.63 +;; 4-runtime.watsup:189.1-189.63 def grow_table : (tableinst, nat, ref) -> tableinst? - ;; 4-runtime.watsup:170.1-174.36 + ;; 4-runtime.watsup:192.1-196.36 def {i : nat, i' : nat, j : nat, n : n, r : ref, r'* : ref*, rt : reftype, ti : tableinst, ti' : tableinst} grow_table(ti, n, r) = ?(ti') -- if (ti = {TYPE `%%`(`[%..%]`(i, j), rt), ELEM r'*{r'}}) -- if (i' = (|r'*{r'}| + n)) @@ -13584,9 +13584,9 @@ def grow_table : (tableinst, nat, ref) -> tableinst? -- Tabletype_ok: `|-%:OK`(ti'.TYPE_tableinst) def {x : (tableinst, nat, ref)} grow_table(x) = ?() -;; 4-runtime.watsup:168.1-168.55 +;; 4-runtime.watsup:190.1-190.55 def grow_memory : (meminst, nat) -> meminst? - ;; 4-runtime.watsup:175.1-179.34 + ;; 4-runtime.watsup:198.1-202.34 def {b* : byte*, i : nat, i' : nat, j : nat, mi : meminst, mi' : meminst, n : n} grow_memory(mi, n) = ?(mi') -- if (mi = {TYPE `%I8`(`[%..%]`(i, j)), DATA b*{b}}) -- if (i' = ((|b*{b}| / (64 * $Ki)) + n)) @@ -13594,10 +13594,10 @@ def grow_memory : (meminst, nat) -> meminst? -- Memtype_ok: `|-%:OK`(mi'.TYPE_meminst) def {x : (meminst, nat)} grow_memory(x) = ?() -;; 4-runtime.watsup:192.1-195.21 +;; 4-runtime.watsup:218.1-221.21 rec { -;; 4-runtime.watsup:192.1-195.21 +;; 4-runtime.watsup:218.1-221.21 syntax E = | _HOLE | _SEQ(val*, E, instr*) @@ -13628,161 +13628,161 @@ def wrap_ : ((nat, nat), c_numtype) -> nat ;; 5-numerics.watsup:13.1-13.28 def bytes_ : (nat, c_numtype) -> byte* -;; 6-reduction.watsup:4.1-4.63 +;; 6-reduction.watsup:6.1-6.63 relation Step_pure: `%*~>%*`(admininstr*, admininstr*) - ;; 6-reduction.watsup:16.1-17.24 + ;; 6-reduction.watsup:24.1-25.24 rule unreachable: `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) - ;; 6-reduction.watsup:19.1-20.19 + ;; 6-reduction.watsup:27.1-28.19 rule nop: `%*~>%*`([NOP_admininstr], []) - ;; 6-reduction.watsup:22.1-23.24 + ;; 6-reduction.watsup:30.1-31.24 rule drop {val : val}: `%*~>%*`([$admininstr_val(val) DROP_admininstr], []) - ;; 6-reduction.watsup:26.1-28.16 + ;; 6-reduction.watsup:34.1-36.16 rule select-true {c : c_numtype, t? : valtype?, val_1 : val, val_2 : val}: `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t?{t})], [$admininstr_val(val_1)]) -- if (c =/= 0) - ;; 6-reduction.watsup:30.1-32.14 + ;; 6-reduction.watsup:38.1-40.14 rule select-false {c : c_numtype, t? : valtype?, val_1 : val, val_2 : val}: `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t?{t})], [$admininstr_val(val_2)]) -- if (c = 0) - ;; 6-reduction.watsup:35.1-37.28 + ;; 6-reduction.watsup:45.1-47.28 rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k}: `%*~>%*`($admininstr_val(val)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})], [LABEL__admininstr(n, [], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) -- where `%->%`(t_1^k{t_1}, t_2^n{t_2}) = bt - ;; 6-reduction.watsup:39.1-41.28 + ;; 6-reduction.watsup:49.1-51.28 rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k}: `%*~>%*`($admininstr_val(val)^k{val} :: [LOOP_admininstr(bt, instr*{instr})], [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) -- where `%->%`(t_1^k{t_1}, t_2^n{t_2}) = bt - ;; 6-reduction.watsup:43.1-45.16 + ;; 6-reduction.watsup:53.1-55.16 rule if-true {bt : blocktype, c : c_numtype, 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) - ;; 6-reduction.watsup:47.1-49.14 + ;; 6-reduction.watsup:57.1-59.14 rule if-false {bt : blocktype, c : c_numtype, 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) - ;; 6-reduction.watsup:52.1-53.38 + ;; 6-reduction.watsup:62.1-63.38 rule label-vals {instr* : instr*, n : n, val* : val*}: `%*~>%*`([LABEL__admininstr(n, instr*{instr}, $admininstr_val(val)*{val})], $admininstr_val(val)*{val}) - ;; 6-reduction.watsup:57.1-58.69 + ;; 6-reduction.watsup:69.1-70.69 rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [BR_admininstr(0)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val} :: $admininstr_instr(instr')*{instr'}) - ;; 6-reduction.watsup:60.1-61.65 + ;; 6-reduction.watsup:72.1-73.65 rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val)*{val} :: [BR_admininstr(l + 1)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [BR_admininstr(l)]) - ;; 6-reduction.watsup:64.1-66.16 + ;; 6-reduction.watsup:76.1-78.16 rule br_if-true {c : c_numtype, l : labelidx}: `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) -- if (c =/= 0) - ;; 6-reduction.watsup:68.1-70.14 + ;; 6-reduction.watsup:80.1-82.14 rule br_if-false {c : c_numtype, l : labelidx}: `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) -- if (c = 0) - ;; 6-reduction.watsup:73.1-75.17 + ;; 6-reduction.watsup:85.1-87.17 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}|) - ;; 6-reduction.watsup:77.1-79.18 + ;; 6-reduction.watsup:89.1-91.18 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}|) - ;; 6-reduction.watsup:102.1-103.35 + ;; 6-reduction.watsup:116.1-117.35 rule frame-vals {f : frame, n : n, val^n : val^n}: `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val)^n{val})], $admininstr_val(val)^n{val}) - ;; 6-reduction.watsup:105.1-106.55 + ;; 6-reduction.watsup:119.1-120.55 rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val}) - ;; 6-reduction.watsup:108.1-109.60 + ;; 6-reduction.watsup:122.1-123.60 rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [RETURN_admininstr]) - ;; 6-reduction.watsup:112.1-114.33 + ;; 6-reduction.watsup:128.1-130.33 rule unop-val {c : c_numtype, c_1 : c_numtype, nt : numtype, unop : unop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) -- where [c] = $unop(unop, nt, c_1) - ;; 6-reduction.watsup:116.1-118.39 + ;; 6-reduction.watsup:132.1-134.39 rule unop-trap {c_1 : c_numtype, nt : numtype, unop : unop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) -- if ($unop(unop, nt, c_1) = []) - ;; 6-reduction.watsup:121.1-123.40 + ;; 6-reduction.watsup:137.1-139.40 rule binop-val {binop : binop_numtype, c : c_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- where [c] = $binop(binop, nt, c_1, c_2) - ;; 6-reduction.watsup:125.1-127.46 + ;; 6-reduction.watsup:141.1-143.46 rule binop-trap {binop : binop_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) -- if ($binop(binop, nt, c_1, c_2) = []) - ;; 6-reduction.watsup:130.1-132.37 + ;; 6-reduction.watsup:146.1-148.37 rule testop {c : c_numtype, c_1 : c_numtype, nt : numtype, testop : testop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) -- where c = $testop(testop, nt, c_1) - ;; 6-reduction.watsup:134.1-136.40 + ;; 6-reduction.watsup:150.1-152.40 rule relop {c : c_numtype, c_1 : c_numtype, c_2 : c_numtype, nt : numtype, relop : relop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) -- where c = $relop(relop, nt, c_1, c_2) - ;; 6-reduction.watsup:139.1-140.70 + ;; 6-reduction.watsup:155.1-156.70 rule extend {c : c_numtype, n : n, nt : numtype, o0 : nat}: `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, o0, S_sx, c))]) -- where ?(o0) = $size($valtype_numtype(nt)) - ;; 6-reduction.watsup:143.1-145.48 + ;; 6-reduction.watsup:159.1-161.48 rule cvtop-val {c : c_numtype, c_1 : c_numtype, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: `%*~>%*`([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, cvtop, nt_2, sx?{sx}, c_1) - ;; 6-reduction.watsup:147.1-149.54 + ;; 6-reduction.watsup:163.1-165.54 rule cvtop-trap {c_1 : c_numtype, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) -- if ($cvtop(nt_1, cvtop, nt_2, sx?{sx}, c_1) = []) - ;; 6-reduction.watsup:156.1-158.28 + ;; 6-reduction.watsup:174.1-176.28 rule ref.is_null-true {rt : reftype, val : val}: `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) -- where REF.NULL_val(rt) = val - ;; 6-reduction.watsup:160.1-162.15 + ;; 6-reduction.watsup:178.1-180.15 rule ref.is_null-false {val : val}: `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 6-reduction.watsup:171.1-172.47 + ;; 6-reduction.watsup:191.1-192.47 rule local.tee {val : val, x : idx}: `%*~>%*`([$admininstr_val(val) LOCAL.TEE_admininstr(x)], [$admininstr_val(val) $admininstr_val(val) LOCAL.SET_admininstr(x)]) -;; 6-reduction.watsup:5.1-5.63 +;; 6-reduction.watsup:7.1-7.63 relation Step_read: `%~>%*`(config, admininstr*) - ;; 6-reduction.watsup:82.1-83.47 + ;; 6-reduction.watsup:96.1-97.47 rule call {x : idx, z : state}: `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [CALL_ADDR_admininstr($funcaddr(z)[x])]) -- if (x < |$funcaddr(z)|) - ;; 6-reduction.watsup:85.1-89.17 + ;; 6-reduction.watsup:99.1-103.17 rule call_indirect-call {a : addr, ft : functype, ft' : functype, i : nat, instr* : instr*, t* : valtype*, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CALL_INDIRECT_admininstr(x, ft)]), [CALL_ADDR_admininstr(a)]) -- if (i < |$table(z, x).ELEM_tableinst|) @@ -13791,12 +13791,12 @@ relation Step_read: `%~>%*`(config, admininstr*) -- if (a < |$funcinst(z)|) -- where `FUNC%%*%`(ft', t*{t}, instr*{instr}) = $funcinst(z)[a].CODE_funcinst - ;; 6-reduction.watsup:91.1-93.15 + ;; 6-reduction.watsup:105.1-107.15 rule call_indirect-trap {ft : functype, i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CALL_INDIRECT_admininstr(x, ft)]), [TRAP_admininstr]) -- otherwise - ;; 6-reduction.watsup:95.1-99.52 + ;; 6-reduction.watsup:109.1-113.52 rule call_addr {a : addr, f : frame, func : func, instr* : instr*, k : nat, m : moduleinst, n : n, t* : valtype*, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state, o0* : val*}: `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [CALL_ADDR_admininstr(a)]), [FRAME__admininstr(n, f, [LABEL__admininstr(n, [], $admininstr_instr(instr)*{instr})])]) -- if (a < |$funcinst(z)|) @@ -13806,322 +13806,311 @@ relation Step_read: `%~>%*`(config, admininstr*) -- (if ($default_(t) = ?(o0)))*{t o0} -- where f = {LOCAL val^k{val} :: o0*{o0}, MODULE m} - ;; 6-reduction.watsup:152.1-153.53 + ;; 6-reduction.watsup:170.1-171.53 rule ref.func {x : idx, z : state}: `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) -- if (x < |$funcaddr(z)|) - ;; 6-reduction.watsup:165.1-166.37 + ;; 6-reduction.watsup:185.1-186.37 rule local.get {x : idx, z : state}: `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [$admininstr_val($local(z, x))]) - ;; 6-reduction.watsup:175.1-176.45 + ;; 6-reduction.watsup:197.1-198.45 rule global.get {x : idx, z : state}: `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [$admininstr_val($global(z, x).VALUE_globalinst)]) - ;; 6-reduction.watsup:182.1-184.33 + ;; 6-reduction.watsup:206.1-208.33 rule table.get-trap {i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:186.1-188.32 + ;; 6-reduction.watsup:210.1-212.32 rule table.get-val {i : nat, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [$admininstr_ref($table(z, x).ELEM_tableinst[i])]) -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:199.1-201.32 + ;; 6-reduction.watsup:223.1-225.32 rule table.size {n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) -- where n = |$table(z, x).ELEM_tableinst| - ;; 6-reduction.watsup:212.1-214.39 + ;; 6-reduction.watsup:236.1-238.39 rule table.fill-trap {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:216.1-219.14 + ;; 6-reduction.watsup:240.1-243.14 rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:221.1-225.15 + ;; 6-reduction.watsup:245.1-249.15 rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) -- otherwise - ;; 6-reduction.watsup:228.1-230.73 + ;; 6-reduction.watsup:252.1-254.73 rule table.copy-trap {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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|)) - ;; 6-reduction.watsup:232.1-235.14 + ;; 6-reduction.watsup:256.1-259.14 rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:237.1-242.15 + ;; 6-reduction.watsup:261.1-266.15 rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:244.1-248.15 + ;; 6-reduction.watsup:268.1-272.15 rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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 - ;; 6-reduction.watsup:251.1-253.72 + ;; 6-reduction.watsup:275.1-277.72 rule table.init-trap {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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|)) - ;; 6-reduction.watsup:255.1-258.14 + ;; 6-reduction.watsup:279.1-282.14 rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) - ;; 6-reduction.watsup:260.1-264.15 + ;; 6-reduction.watsup:284.1-288.15 rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: `%~>%*`(`%;%*`(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) $admininstr_ref($elem(z, y).ELEM_eleminst[i]) 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|) - ;; 6-reduction.watsup:271.1-273.53 + ;; 6-reduction.watsup:297.1-299.53 rule load-num-trap {i : nat, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), n_A, n_O)]), [TRAP_admininstr]) -- where ?(o0) = $size($valtype_numtype(nt)) -- if (((i + n_O) + (o0 / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:275.1-277.71 + ;; 6-reduction.watsup:301.1-303.71 rule load-num-val {c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat, o1 : nat}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), n_A, n_O)]), [CONST_admininstr(nt, c)]) -- where ?(o0) = $size($valtype_numtype(nt)) -- where ?(o1) = $size($valtype_numtype(nt)) -- where $bytes_(o0, c) = $mem(z, 0).DATA_meminst[(i + n_O) : (o1 / 8)] - ;; 6-reduction.watsup:279.1-281.45 + ;; 6-reduction.watsup:305.1-307.45 rule load-pack-trap {i : nat, n : n, n_A : n, n_O : n, nt : numtype, sx : sx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), n_A, n_O)]), [TRAP_admininstr]) -- if (((i + n_O) + (n / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:283.1-285.55 + ;; 6-reduction.watsup:309.1-311.55 rule load-pack-val {c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, sx : sx, z : state, o0 : nat}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), n_A, n_O)]), [CONST_admininstr(nt, $ext(n, o0, sx, c))]) -- where ?(o0) = $size($valtype_numtype(nt)) -- where $bytes_(n, c) = $mem(z, 0).DATA_meminst[(i + n_O) : (n / 8)] - ;; 6-reduction.watsup:305.1-307.44 + ;; 6-reduction.watsup:331.1-333.44 rule memory.size {n : n, z : state}: `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr]), [CONST_admininstr(I32_numtype, n)]) -- where ((n * 64) * $Ki) = |$mem(z, 0).DATA_meminst| - ;; 6-reduction.watsup:318.1-320.37 + ;; 6-reduction.watsup:344.1-346.37 rule memory.fill-trap {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), [TRAP_admininstr]) -- if ((i + n) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:322.1-325.14 + ;; 6-reduction.watsup:348.1-351.14 rule memory.fill-zero {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:327.1-331.15 + ;; 6-reduction.watsup:353.1-357.15 rule memory.fill-succ {i : nat, n : n, val : val, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr]) -- otherwise - ;; 6-reduction.watsup:334.1-336.69 + ;; 6-reduction.watsup:360.1-362.69 rule memory.copy-trap {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [TRAP_admininstr]) -- if (((i + n) > |$mem(z, 0).DATA_meminst|) \/ ((j + n) > |$mem(z, 0).DATA_meminst|)) - ;; 6-reduction.watsup:338.1-341.14 + ;; 6-reduction.watsup:364.1-367.14 rule memory.copy-zero {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:343.1-348.15 + ;; 6-reduction.watsup:369.1-374.15 rule memory.copy-le {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) LOAD_admininstr(I32_numtype, ?((8, U_sx)), 0, 0) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr]) -- otherwise -- if (j <= i) - ;; 6-reduction.watsup:350.1-354.15 + ;; 6-reduction.watsup:376.1-380.15 rule memory.copy-gt {i : nat, j : nat, n : n, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), 0, 0) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr]) -- otherwise - ;; 6-reduction.watsup:357.1-359.70 + ;; 6-reduction.watsup:383.1-385.70 rule memory.init-trap {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), [TRAP_admininstr]) -- if (((i + n) > |$data(z, x).DATA_datainst|) \/ ((j + n) > |$mem(z, 0).DATA_meminst|)) - ;; 6-reduction.watsup:361.1-364.14 + ;; 6-reduction.watsup:387.1-390.14 rule memory.init-zero {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 6-reduction.watsup:366.1-370.15 + ;; 6-reduction.watsup:392.1-396.15 rule memory.init-succ {i : nat, j : nat, n : n, x : idx, z : state}: `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, x).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), 0, 0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x)]) -- otherwise -- if (i < |$data(z, x).DATA_datainst|) -;; 6-reduction.watsup:3.1-3.63 +;; 6-reduction.watsup:5.1-5.63 relation Step: `%~>%`(config, config) - ;; 6-reduction.watsup:7.1-9.34 + ;; 6-reduction.watsup:9.1-11.34 rule pure {instr* : instr*, instr'* : instr*, z : state}: `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) -- Step_pure: `%*~>%*`($admininstr_instr(instr)*{instr}, $admininstr_instr(instr')*{instr'}) - ;; 6-reduction.watsup:11.1-13.37 + ;; 6-reduction.watsup:13.1-15.37 rule read {instr* : instr*, instr'* : instr*, z : state}: `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) -- Step_read: `%~>%*`(`%;%*`(z, $admininstr_instr(instr)*{instr}), $admininstr_instr(instr')*{instr'}) - ;; 6-reduction.watsup:168.1-169.60 + ;; 6-reduction.watsup:188.1-189.60 rule local.set {val : val, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_val(val) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) - ;; 6-reduction.watsup:178.1-179.62 + ;; 6-reduction.watsup:200.1-201.62 rule global.set {val : val, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_val(val) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) - ;; 6-reduction.watsup:190.1-192.33 + ;; 6-reduction.watsup:214.1-216.33 rule table.set-trap {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:194.1-196.32 + ;; 6-reduction.watsup:218.1-220.32 rule table.set-val {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 6-reduction.watsup:204.1-206.47 + ;; 6-reduction.watsup:228.1-230.47 rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state, o0 : tableinst}: `%~>%`(`%;%*`(z, [$admininstr_ref(ref) 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) = $grow_table($table(z, x), n, ref) -- where ti = o0 - ;; 6-reduction.watsup:208.1-209.64 + ;; 6-reduction.watsup:232.1-233.64 rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, - 1)])) - ;; 6-reduction.watsup:267.1-268.59 + ;; 6-reduction.watsup:291.1-292.59 rule elem.drop {x : idx, z : state}: `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) - ;; 6-reduction.watsup:288.1-290.53 + ;; 6-reduction.watsup:314.1-316.53 rule store-num-trap {c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), n_A, n_O)]), `%;%*`(z, [TRAP_admininstr])) -- where ?(o0) = $size($valtype_numtype(nt)) -- if (((i + n_O) + (o0 / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:292.1-294.35 + ;; 6-reduction.watsup:318.1-320.35 rule store-num-val {b* : byte*, c : c_numtype, i : nat, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat, o1 : nat}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), n_A, n_O)]), `%;%*`($with_mem(z, 0, (i + n_O), (o0 / 8), b*{b}), [])) -- where ?(o0) = $size($valtype_numtype(nt)) -- where ?(o1) = $size($valtype_numtype(nt)) -- where b*{b} = $bytes_(o1, c) - ;; 6-reduction.watsup:296.1-298.45 + ;; 6-reduction.watsup:322.1-324.45 rule store-pack-trap {c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), n_A, n_O)]), `%;%*`(z, [TRAP_admininstr])) -- if (((i + n_O) + (n / 8)) > |$mem(z, 0).DATA_meminst|) - ;; 6-reduction.watsup:300.1-302.50 + ;; 6-reduction.watsup:326.1-328.50 rule store-pack-val {b* : byte*, c : c_numtype, i : nat, n : n, n_A : n, n_O : n, nt : numtype, z : state, o0 : nat}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), n_A, n_O)]), `%;%*`($with_mem(z, 0, (i + n_O), (n / 8), b*{b}), [])) -- where ?(o0) = $size($valtype_numtype(nt)) -- where b*{b} = $bytes_(n, $wrap_((o0, n), c)) - ;; 6-reduction.watsup:310.1-312.41 + ;; 6-reduction.watsup:336.1-338.41 rule memory.grow-succeed {mi : meminst, n : n, z : state, o0 : meminst}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr]), `%;%*`($with_meminst(z, 0, mi), [CONST_admininstr(I32_numtype, (|$mem(z, 0).DATA_meminst| / (64 * $Ki)))])) -- where ?(o0) = $grow_memory($mem(z, 0), n) -- where mi = o0 - ;; 6-reduction.watsup:314.1-315.59 + ;; 6-reduction.watsup:340.1-341.59 rule memory.grow-fail {n : n, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr]), `%;%*`(z, [CONST_admininstr(I32_numtype, - 1)])) - ;; 6-reduction.watsup:373.1-374.59 + ;; 6-reduction.watsup:399.1-400.59 rule data.drop {x : idx, z : state}: `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) -;; 7-module.watsup:4.1-4.35 +;; 7-module.watsup:5.1-5.35 rec { -;; 7-module.watsup:4.1-4.35 +;; 7-module.watsup:5.1-5.35 def funcs : externval* -> funcaddr* - ;; 7-module.watsup:5.1-5.30 + ;; 7-module.watsup:6.1-6.30 def funcs([]) = [] - ;; 7-module.watsup:6.1-6.59 + ;; 7-module.watsup:7.1-7.59 def {externval'* : externval*, fa : funcaddr} funcs([FUNC_externval(fa)] :: externval'*{externval'}) = [fa] :: $funcs(externval'*{externval'}) - ;; 7-module.watsup:7.1-8.15 + ;; 7-module.watsup:8.1-9.15 def {externval : externval, externval'* : externval*} funcs([externval] :: externval'*{externval'}) = $funcs(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:10.1-10.39 +;; 7-module.watsup:11.1-11.39 rec { -;; 7-module.watsup:10.1-10.39 +;; 7-module.watsup:11.1-11.39 def globals : externval* -> globaladdr* - ;; 7-module.watsup:11.1-11.32 + ;; 7-module.watsup:12.1-12.32 def globals([]) = [] - ;; 7-module.watsup:12.1-12.65 + ;; 7-module.watsup:13.1-13.65 def {externval'* : externval*, ga : globaladdr} globals([GLOBAL_externval(ga)] :: externval'*{externval'}) = [ga] :: $globals(externval'*{externval'}) - ;; 7-module.watsup:13.1-14.15 + ;; 7-module.watsup:14.1-15.15 def {externval : externval, externval'* : externval*} globals([externval] :: externval'*{externval'}) = $globals(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:16.1-16.37 +;; 7-module.watsup:17.1-17.37 rec { -;; 7-module.watsup:16.1-16.37 +;; 7-module.watsup:17.1-17.37 def tables : externval* -> tableaddr* - ;; 7-module.watsup:17.1-17.31 + ;; 7-module.watsup:18.1-18.31 def tables([]) = [] - ;; 7-module.watsup:18.1-18.62 + ;; 7-module.watsup:19.1-19.62 def {externval'* : externval*, ta : tableaddr} tables([TABLE_externval(ta)] :: externval'*{externval'}) = [ta] :: $tables(externval'*{externval'}) - ;; 7-module.watsup:19.1-20.15 + ;; 7-module.watsup:20.1-21.15 def {externval : externval, externval'* : externval*} tables([externval] :: externval'*{externval'}) = $tables(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:22.1-22.33 +;; 7-module.watsup:23.1-23.33 rec { -;; 7-module.watsup:22.1-22.33 +;; 7-module.watsup:23.1-23.33 def mems : externval* -> memaddr* - ;; 7-module.watsup:23.1-23.29 + ;; 7-module.watsup:24.1-24.29 def mems([]) = [] - ;; 7-module.watsup:24.1-24.56 + ;; 7-module.watsup:25.1-25.56 def {externval'* : externval*, ma : memaddr} mems([MEM_externval(ma)] :: externval'*{externval'}) = [ma] :: $mems(externval'*{externval'}) - ;; 7-module.watsup:25.1-26.15 + ;; 7-module.watsup:26.1-27.15 def {externval : externval, externval'* : externval*} mems([externval] :: externval'*{externval'}) = $mems(externval'*{externval'}) -- otherwise } -;; 7-module.watsup:29.1-29.83 -def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst - ;; 7-module.watsup:30.1-30.95 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externuse(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} - ;; 7-module.watsup:31.1-31.99 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externuse(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} - ;; 7-module.watsup:32.1-32.97 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externuse(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} - ;; 7-module.watsup:33.1-33.93 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externuse(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} - ;; 7-module.watsup:36.1-36.60 def allocfunc : (store, moduleinst, func) -> (store, funcaddr) ;; 7-module.watsup:37.1-38.37 @@ -14236,9 +14225,20 @@ def allocdatas : (store, byte**) -> (store, dataaddr*) -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) } -;; 7-module.watsup:97.1-97.81 +;; 7-module.watsup:99.1-99.83 +def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst + ;; 7-module.watsup:100.1-100.95 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externuse(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} + ;; 7-module.watsup:101.1-101.99 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externuse(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} + ;; 7-module.watsup:102.1-102.97 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externuse(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} + ;; 7-module.watsup:103.1-103.93 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externuse(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} + +;; 7-module.watsup:106.1-106.81 def allocmodule : (store, module, externval*, val*, ref**) -> (store, moduleinst) - ;; 7-module.watsup:98.1-135.54 + ;; 7-module.watsup:107.1-144.54 def {byte*^n_data : byte*^n_data, da* : dataaddr*, datamode?^n_data : datamode?^n_data, ea* : elemaddr*, elemmode?^n_elem : elemmode?^n_elem, export* : export*, expr_1^n_global : expr^n_global, expr_2*^n_elem : expr*^n_elem, externval* : externval*, fa* : funcaddr*, fa_ex* : funcaddr*, func^n_func : func^n_func, ga* : globaladdr*, ga_ex* : globaladdr*, globaltype^n_global : globaltype^n_global, i_data^n_data : nat^n_data, i_elem^n_elem : nat^n_elem, i_func^n_func : nat^n_func, i_global^n_global : nat^n_global, i_mem^n_mem : nat^n_mem, i_table^n_table : nat^n_table, import* : import*, m : moduleinst, ma* : memaddr*, ma_ex* : memaddr*, memtype^n_mem : memtype^n_mem, module : module, n_data : n, n_elem : n, n_func : n, n_global : n, n_mem : n, n_table : n, ref** : ref**, rt^n_elem : reftype^n_elem, s : store, s_1 : store, s_2 : store, s_3 : store, s_4 : store, s_5 : store, s_6 : store, start? : start?, ta* : tableaddr*, ta_ex* : tableaddr*, tabletype^n_table : tabletype^n_table, val* : val*, xi* : exportinst*} allocmodule(s, module, externval*{externval}, val*{val}, ref*{ref}*{ref}) = (s_6, m) -- if (module = `MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func^n_func{func}, GLOBAL(globaltype, expr_1)^n_global{expr_1 globaltype}, TABLE(tabletype)^n_table{tabletype}, MEMORY(memtype)^n_mem{memtype}, `ELEM%%*%?`(rt, expr_2*{expr_2}, elemmode?{elemmode})^n_elem{elemmode expr_2 rt}, `DATA%*%?`(byte*{byte}, datamode?{datamode})^n_data{byte datamode}, start?{start}, export*{export})) -- if (fa_ex*{fa_ex} = $funcs(externval*{externval})) @@ -14260,39 +14260,39 @@ def allocmodule : (store, module, externval*, val*, ref**) -> (store, moduleinst -- if ((s_5, ea*{ea}) = $allocelems(s_4, rt^n_elem{rt}, ref*{ref}*{ref})) -- if ((s_6, da*{da}) = $allocdatas(s_5, byte*{byte}^n_data{byte})) -;; 7-module.watsup:138.1-138.33 +;; 7-module.watsup:151.1-151.36 +rec { + +;; 7-module.watsup:151.1-151.36 +def concat_instr : instr** -> instr* + ;; 7-module.watsup:152.1-152.37 + def concat_instr([]) = [] + ;; 7-module.watsup:153.1-153.68 + def {instr* : instr*, instr'** : instr**} concat_instr([instr]*{instr} :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) +} + +;; 7-module.watsup:155.1-155.33 def runelem : (elem, idx) -> instr* - ;; 7-module.watsup:139.1-139.46 + ;; 7-module.watsup:156.1-156.46 def {expr* : expr*, i : nat, reftype : reftype} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?()), i) = [] - ;; 7-module.watsup:140.1-140.62 + ;; 7-module.watsup:157.1-157.62 def {expr* : expr*, i : nat, reftype : reftype} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?(DECLARE_elemmode)), i) = [ELEM.DROP_instr(i)] - ;; 7-module.watsup:141.1-143.20 + ;; 7-module.watsup:158.1-160.20 def {expr* : expr*, i : nat, instr* : instr*, n : n, reftype : reftype, x : idx} runelem(`ELEM%%*%?`(reftype, expr*{expr}, ?(TABLE_elemmode(x, instr*{instr}))), i) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, n) TABLE.INIT_instr(x, i) ELEM.DROP_instr(i)] -- if (n = |expr*{expr}|) -;; 7-module.watsup:145.1-145.33 +;; 7-module.watsup:162.1-162.33 def rundata : (data, idx) -> instr* - ;; 7-module.watsup:146.1-146.38 + ;; 7-module.watsup:163.1-163.38 def {byte* : byte*, i : nat} rundata(`DATA%*%?`(byte*{byte}, ?()), i) = [] - ;; 7-module.watsup:147.1-149.20 + ;; 7-module.watsup:164.1-166.20 def {byte* : byte*, i : nat, instr* : instr*, n : n} rundata(`DATA%*%?`(byte*{byte}, ?(MEMORY_datamode(0, instr*{instr}))), i) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, n) MEMORY.INIT_instr(i) DATA.DROP_instr(i)] -- if (n = |byte*{byte}|) -;; 7-module.watsup:152.1-152.36 -rec { - -;; 7-module.watsup:152.1-152.36 -def concat_instr : instr** -> instr* - ;; 7-module.watsup:153.1-153.37 - def concat_instr([]) = [] - ;; 7-module.watsup:154.1-154.68 - def {instr* : instr*, instr'** : instr**} concat_instr([instr]*{instr} :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) -} - -;; 7-module.watsup:157.1-157.55 -def instantiation : (store, module, externval*) -> config - ;; 7-module.watsup:158.1-180.28 - def {data* : data*, elem* : elem*, elemmode?* : elemmode?*, export* : export*, externval* : externval*, f : frame, f_init : frame, func* : func*, global* : global*, globaltype* : globaltype*, i^n_elem : nat^n_elem, import* : import*, instr_1** : instr**, instr_2*** : instr***, instr_data* : instr*, instr_elem* : instr*, j^n_data : nat^n_data, m : moduleinst, m_init : moduleinst, mem* : mem*, module : module, n_data : n, n_elem : n, ref** : ref**, reftype* : reftype*, s : store, s' : store, start? : start?, table* : table*, val* : val*, x? : idx?} instantiation(s, module, externval*{externval}) = `%;%*`(`%;%`(s', f), $admininstr_instr(instr_elem)*{instr_elem} :: $admininstr_instr(instr_data)*{instr_data} :: CALL_admininstr(x)?{x}) +;; 7-module.watsup:168.1-168.53 +def instantiate : (store, module, externval*) -> config + ;; 7-module.watsup:169.1-191.28 + def {data* : data*, elem* : elem*, elemmode?* : elemmode?*, export* : export*, externval* : externval*, f : frame, f_init : frame, func* : func*, global* : global*, globaltype* : globaltype*, i^n_elem : nat^n_elem, import* : import*, instr_1** : instr**, instr_2*** : instr***, instr_data* : instr*, instr_elem* : instr*, j^n_data : nat^n_data, m : moduleinst, m_init : moduleinst, mem* : mem*, module : module, n_data : n, n_elem : n, ref** : ref**, reftype* : reftype*, s : store, s' : store, start? : start?, table* : table*, val* : val*, x? : idx?} instantiate(s, module, externval*{externval}) = `%;%*`(`%;%`(s', f), $admininstr_instr(instr_elem)*{instr_elem} :: $admininstr_instr(instr_data)*{instr_data} :: CALL_admininstr(x)?{x}) -- if (module = `MODULE%*%*%*%*%*%*%*%?%*`(import*{import}, func*{func}, global*{global}, table*{table}, mem*{mem}, elem*{elem}, data*{data}, start?{start}, export*{export})) -- if (m_init = {FUNC $funcs(externval*{externval}), GLOBAL $globals(externval*{externval}), TABLE [], MEM [], ELEM [], DATA [], EXPORT []}) -- if (f_init = {LOCAL [], MODULE m_init}) @@ -14308,10 +14308,10 @@ def instantiation : (store, module, externval*) -> config -- if (instr_data*{instr_data} = $concat_instr($rundata(data*{data}[j], j)^(j config - ;; 7-module.watsup:184.1-196.52 - def {expr : expr, f : frame, fa : funcaddr, functype : functype, k : nat, m : moduleinst, n : n, s : store, val^n : val^n, valtype* : valtype*, valtype_param^n : valtype^n, valtype_res^k : valtype^k} invocation(s, fa, val^n{val}) = `%;%*`(`%;%`(s, f), $admininstr_val(val)^n{val} :: [CALL_ADDR_admininstr(fa)]) +;; 7-module.watsup:198.1-198.44 +def invoke : (store, funcaddr, val*) -> config + ;; 7-module.watsup:199.1-211.52 + def {expr : expr, f : frame, fa : funcaddr, functype : functype, k : nat, m : moduleinst, n : n, s : store, val^n : val^n, valtype* : valtype*, valtype_param^n : valtype^n, valtype_res^k : valtype^k} invoke(s, fa, val^n{val}) = `%;%*`(`%;%`(s, f), $admininstr_val(val)^n{val} :: [CALL_ADDR_admininstr(fa)]) -- if (m = {FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], EXPORT []}) -- if (f = {LOCAL [], MODULE m}) -- if ($funcinst(`%;%`(s, f))[fa].CODE_funcinst = `FUNC%%*%`(functype, valtype*{valtype}, expr))