From 6277b9add0b1414e4c4fdae5ade585a46e0f7afe Mon Sep 17 00:00:00 2001 From: Wonho Date: Tue, 6 Aug 2024 16:18:10 +0900 Subject: [PATCH 01/26] Fix AL validation --- spectec/src/al/valid.ml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spectec/src/al/valid.ml b/spectec/src/al/valid.ml index 07abd6bd9a..e4fb2b0dc9 100644 --- a/spectec/src/al/valid.ml +++ b/spectec/src/al/valid.ml @@ -374,12 +374,13 @@ let valid_expr (walker: unit_walker) (expr: expr) : unit = check_context source expr.note; check_num source expr1.note; check_match source expr2.note (iterT (varT "instr") List) - | BoolE _ | GetCurStateE | GetCurFrameE | GetCurLabelE | GetCurContextE - | IsCaseOfE _ | IsValidE _ | MatchE _ | HasTypeE _ | TopFrameE | TopLabelE -> + | GetCurStateE | GetCurFrameE | GetCurLabelE | GetCurContextE -> + check_context source expr.note + | BoolE _ | IsCaseOfE _ | IsValidE _ | MatchE _ | HasTypeE _ | TopFrameE | TopLabelE -> check_bool source expr.note | ContE expr1 -> check_match source expr.note (iterT (varT "instr") List); - check_match source expr1.note (iterT (varT "instr") List) + check_match source expr1.note (varT "label") | ChooseE expr1 -> check_list source expr1.note; check_match source expr1.note (iterT expr.note List) | ContextKindE _ -> () (* TODO: Not used anymore *) @@ -387,7 +388,7 @@ let valid_expr (walker: unit_walker) (expr: expr) : unit = check_opt source expr1.note; check_bool source expr.note | TopValueE expr_opt -> check_bool source expr.note; - Option.iter (fun expr1 -> check_match source expr1.note (varT "val")) expr_opt + Option.iter (fun expr1 -> check_match source expr1.note (varT "valtype")) expr_opt | TopValuesE expr1 -> check_bool source expr.note; check_num source expr1.note | SubE _ | YetE _ -> error_valid "invalid expression" source "" From a6fb33e662857bfa80c85d6b3e3e8f100eae7e0c Mon Sep 17 00:00:00 2001 From: jaehyun1ee <99jaehyunlee@kaist.ac.kr> Date: Tue, 6 Aug 2024 16:25:50 +0900 Subject: [PATCH 02/26] Remove unused modules in backend-prose --- spectec/src/backend-prose/dune | 1 - spectec/src/backend-prose/render.ml | 7 +- spectec/src/backend-prose/render.mli | 2 +- spectec/src/backend-prose/symbol.ml | 135 --------------------------- spectec/src/backend-prose/symbol.mli | 26 ------ spectec/src/backend-splice/splice.ml | 2 +- 6 files changed, 4 insertions(+), 169 deletions(-) delete mode 100644 spectec/src/backend-prose/symbol.ml delete mode 100644 spectec/src/backend-prose/symbol.mli diff --git a/spectec/src/backend-prose/dune b/spectec/src/backend-prose/dune index 68c35f6182..0e5e4d5eb6 100644 --- a/spectec/src/backend-prose/dune +++ b/spectec/src/backend-prose/dune @@ -7,6 +7,5 @@ gen render macro - symbol langs) ) diff --git a/spectec/src/backend-prose/render.ml b/spectec/src/backend-prose/render.ml index c3c7c07875..e6a1c3b540 100644 --- a/spectec/src/backend-prose/render.ml +++ b/spectec/src/backend-prose/render.ml @@ -15,16 +15,13 @@ module Map = Map.Make(String) type env = { - prose: prose; render_latex: Backend_latex.Render.env; - symbol: Symbol.env; macro: Macro.env; } -let env inputs outputs render_latex el prose : env = - let symbol = Symbol.env el in +let env inputs outputs render_latex : env = let macro = Macro.env inputs outputs in - let env = { prose; render_latex; symbol; macro; } in + let env = { render_latex; macro; } in env (* Helpers *) diff --git a/spectec/src/backend-prose/render.mli b/spectec/src/backend-prose/render.mli index 04146bff79..5260d6b55a 100644 --- a/spectec/src/backend-prose/render.mli +++ b/spectec/src/backend-prose/render.mli @@ -5,7 +5,7 @@ open Al.Ast type env -val env : string list -> string list -> Backend_latex.Render.env -> El.Ast.script -> Prose.prose -> env +val env : string list -> string list -> Backend_latex.Render.env -> env (* Generators *) diff --git a/spectec/src/backend-prose/symbol.ml b/spectec/src/backend-prose/symbol.ml deleted file mode 100644 index cfb76e54f7..0000000000 --- a/spectec/src/backend-prose/symbol.ml +++ /dev/null @@ -1,135 +0,0 @@ -open Util.Source - -module Set = Set.Make(String) -module Map = Map.Make(String) - -let to_set l = List.fold_left (fun s e -> Set.add e s) Set.empty l - - -(* Environment *) - -type env = - { - atoms: (Set.t * Set.t) Map.t ref; - funcs: Set.t ref; - } - - -(* Extracting Macro from DSL *) - -let extract_typ_atom = function - | El.Ast.Nl -> None - | El.Ast.Elem typ -> (match typ.it with - | El.Ast.VarT (id, _) -> Some id.it - | _ -> None) - -let extract_typcase_atom = function - | El.Ast.Nl -> None - | El.Ast.Elem (atom, _, _) -> (match atom.it with - | El.Atom.Atom id -> Some id - | _ -> None) - -let extract_typfield_atom = function - | El.Ast.Nl -> None - | El.Ast.Elem (atom, _, _) -> (match atom.it with - | El.Atom.Atom id -> Some id - | _ -> None) - -let rec extract_typ_atoms typ = - match typ.it with - | El.Ast.AtomT atom -> (match atom.it with - | El.Atom.Atom id -> [ id ] - | _ -> []) - | El.Ast.IterT (typ_inner, _) -> extract_typ_atoms typ_inner - | El.Ast.StrT typfields -> List.filter_map extract_typfield_atom typfields - | El.Ast.CaseT (_, typs, typcases, _) -> - let ids = List.filter_map extract_typ_atom typs in - let typcases = List.filter_map extract_typcase_atom typcases in - ids @ typcases - | El.Ast.SeqT tl -> List.concat_map (fun t -> extract_typ_atoms t) tl - | _ -> [] - -let extract_syntax_atoms' def = - match def.it with - | El.Ast.TypD (id, subid, _, typ, _) -> - let topsyntax, syntax = - if subid.it = "" then (None, id.it) - else (Some id.it, id.it ^ "-" ^ subid.it) - in - let variants = extract_typ_atoms typ |> to_set in - let (terminals, nonterminals) = Set.partition (fun word -> String.uppercase_ascii word = word) variants in - Some (topsyntax, syntax, terminals, nonterminals) - | _ -> None - -let extract_syntax_atoms el = - List.fold_left - (fun acc def -> match extract_syntax_atoms' def with - | Some (topsyntax, syntax, terminals, nonterminals) -> - (* Update atom mapping from syntax to terminals and nonterminals *) - let terminals', nonterminals' = - (match Map.find_opt syntax acc with - | Some (s_terminals, s_nonterminals) -> - (Set.union terminals s_terminals, Set.union nonterminals s_nonterminals) - | None -> (terminals, nonterminals)) - in - let acc = Map.add syntax (terminals', nonterminals') acc in - (* Add level of indirection for subid-ed grammer *) - (match topsyntax with - | Some topsyntax -> - let terminals'', nonterminals'' = - (match Map.find_opt topsyntax acc with - | Some (t_terminals, t_nonterminals) -> (t_terminals, Set.add syntax t_nonterminals) - | None -> (Set.empty, Set.singleton syntax)) - in - Map.add topsyntax (terminals'', nonterminals'') acc - | None -> acc) - | _ -> acc) - Map.empty el - -let extract_func_atoms' def = - match def.it with - | El.Ast.DecD (id, _, _, _) -> [ id.it ] - | _ -> [] - -let extract_func_atoms el = - let funcs = List.concat_map extract_func_atoms' el in - to_set funcs - -(* Environment Construction *) - -let env el = - let atoms = extract_syntax_atoms el in - let funcs = extract_func_atoms el in - { atoms = ref atoms; funcs = ref funcs; } - -(* Environment Getters *) - -let atoms env = !(env.atoms) -let funcs env = !(env.funcs) - -(* Environment Lookup *) - -let rec narrow_atom' env nonterminals variant = match nonterminals with - | nonterminal :: rest -> (match narrow_atom env nonterminal variant with - | Some s -> Some s - | None -> narrow_atom' env rest variant) - | _ -> None - -and narrow_atom env syntax variant = - match Map.find_opt syntax !(env.atoms) with - | Some (terminals, nonterminals) -> - if Set.mem variant terminals then - Some (variant, syntax) - else - narrow_atom' env (Set.elements nonterminals) variant - | _ -> None - -(* Narrows the given keyword if it exists in the grammar. - * The returned keyword is a tuple of variant name, and its - * shallowest nonterminal that defines the variant. *) -let narrow_atom env atom = - let variant = Al.Print.string_of_atom atom in - let syntax = atom.note.def in - narrow_atom env syntax variant - -let find_func env fname = Set.mem fname !(env.funcs) diff --git a/spectec/src/backend-prose/symbol.mli b/spectec/src/backend-prose/symbol.mli deleted file mode 100644 index 729e038c76..0000000000 --- a/spectec/src/backend-prose/symbol.mli +++ /dev/null @@ -1,26 +0,0 @@ -open Al.Ast - -(* Set module with string elements *) - -module Set : Set.S with type elt = String.t - -(* Map module with string keys *) - -module Map : Map.S with type key = String.t - - -(* Environment *) - -type env - -val env : El.Ast.script -> env - -val atoms : env -> (Set.t * Set.t) Map.t -val funcs : env -> Set.t - - -(* Lookups *) - -val narrow_atom : env -> atom -> (string * string) option - -val find_func : env -> id -> bool diff --git a/spectec/src/backend-splice/splice.ml b/spectec/src/backend-splice/splice.ml index 5e2aa5c84d..73fa5fa899 100644 --- a/spectec/src/backend-splice/splice.ml +++ b/spectec/src/backend-splice/splice.ml @@ -111,7 +111,7 @@ let env_prose env prose = let env (config : config) pdsts odsts elab el pr : env = let latex = Backend_latex.Render.env config.latex el in - let prose = Backend_prose.Render.env pdsts odsts latex el pr in + let prose = Backend_prose.Render.env pdsts odsts latex in let env = { elab; config; latex; prose; syn = Map.empty; From b8686141c205654eb99b598e5dcedb864beb135e Mon Sep 17 00:00:00 2001 From: jaehyun1ee <99jaehyunlee@kaist.ac.kr> Date: Tue, 6 Aug 2024 17:42:07 +0900 Subject: [PATCH 03/26] Add prose in rst to backend-prose/TEST.md --- spectec/src/backend-prose/config.ml | 9 + spectec/src/backend-prose/dune | 1 + spectec/src/backend-prose/gen.ml | 14 +- spectec/src/backend-prose/gen.mli | 3 +- spectec/src/backend-prose/print.ml | 6 + spectec/src/backend-prose/print.mli | 1 + spectec/src/backend-prose/render.ml | 11 +- spectec/src/backend-prose/render.mli | 2 +- spectec/src/backend-splice/config.ml | 5 + spectec/src/backend-splice/splice.ml | 2 +- spectec/src/exe-watsup/main.ml | 43 +- spectec/test-prose/TEST.md | 24610 +++++++++++++++++++++---- 12 files changed, 21119 insertions(+), 3588 deletions(-) create mode 100644 spectec/src/backend-prose/config.ml diff --git a/spectec/src/backend-prose/config.ml b/spectec/src/backend-prose/config.ml new file mode 100644 index 0000000000..70bae51a94 --- /dev/null +++ b/spectec/src/backend-prose/config.ml @@ -0,0 +1,9 @@ +type config = + { + (* Abort rendering if the renderer fails *) + panic_on_error : bool; + } + +type t = config + +let default = { panic_on_error = true } diff --git a/spectec/src/backend-prose/dune b/spectec/src/backend-prose/dune index 0e5e4d5eb6..a77e425d0a 100644 --- a/spectec/src/backend-prose/dune +++ b/spectec/src/backend-prose/dune @@ -2,6 +2,7 @@ (name backend_prose) (libraries util el il il2al backend_latex backend_interpreter) (modules + config prose print gen diff --git a/spectec/src/backend-prose/gen.ml b/spectec/src/backend-prose/gen.ml index dc707b30ce..b8b87bcf16 100644 --- a/spectec/src/backend-prose/gen.ml +++ b/spectec/src/backend-prose/gen.ml @@ -1,5 +1,4 @@ open Prose -open Print open Il open Al.Al_util open Il2al.Translate @@ -490,4 +489,15 @@ let gen_prose el il al = validation_prose @ execution_prose (** Main entry for generating stringified prose **) -let gen_string el il al = string_of_prose (gen_prose el il al) +let gen_string cfg_latex cfg_prose el il al = + let env_latex = Backend_latex.Render.env cfg_latex el in + let prose = gen_prose el il al in + let env_prose = Render.env cfg_prose [] [] env_latex in + Render.render_prose env_prose prose + +(** Main entry for generating prose file **) +let gen_file cfg_latex cfg_prose file el il al = + let prose = gen_string cfg_latex cfg_prose el il al in + let oc = Out_channel.open_text file in + Fun.protect (fun () -> Out_channel.output_string oc prose) + ~finally:(fun () -> Out_channel.close oc) diff --git a/spectec/src/backend-prose/gen.mli b/spectec/src/backend-prose/gen.mli index 113cee1472..f2fdef16cd 100644 --- a/spectec/src/backend-prose/gen.mli +++ b/spectec/src/backend-prose/gen.mli @@ -1,2 +1,3 @@ -val gen_string : El.Ast.script -> Il.Ast.script -> Al.Ast.script -> string val gen_prose : El.Ast.script -> Il.Ast.script -> Al.Ast.script -> Prose.prose +val gen_string : Backend_latex.Config.config -> Config.config -> El.Ast.script -> Il.Ast.script -> Al.Ast.script -> string +val gen_file : Backend_latex.Config.config -> Config.config -> string -> El.Ast.script -> Il.Ast.script -> Al.Ast.script -> unit diff --git a/spectec/src/backend-prose/print.ml b/spectec/src/backend-prose/print.ml index 404ebfc396..0582743b42 100644 --- a/spectec/src/backend-prose/print.ml +++ b/spectec/src/backend-prose/print.ml @@ -459,3 +459,9 @@ let string_of_def = function | Algo algo -> string_of_algorithm algo let string_of_prose prose = List.map string_of_def prose |> String.concat "\n" + +let file_of_prose file prose = + let prose = string_of_prose prose in + let oc = Out_channel.open_text file in + Fun.protect (fun () -> Out_channel.output_string oc prose) + ~finally:(fun () -> Out_channel.close oc) diff --git a/spectec/src/backend-prose/print.mli b/spectec/src/backend-prose/print.mli index 40066b4789..ca548a5ea5 100644 --- a/spectec/src/backend-prose/print.mli +++ b/spectec/src/backend-prose/print.mli @@ -3,3 +3,4 @@ open Prose val string_of_instr : instr -> string val string_of_def : def -> string val string_of_prose : prose -> string +val file_of_prose : string -> prose -> unit diff --git a/spectec/src/backend-prose/render.ml b/spectec/src/backend-prose/render.ml index e6a1c3b540..dbca01f584 100644 --- a/spectec/src/backend-prose/render.ml +++ b/spectec/src/backend-prose/render.ml @@ -15,13 +15,14 @@ module Map = Map.Make(String) type env = { + config : Config.config; render_latex: Backend_latex.Render.env; macro: Macro.env; } -let env inputs outputs render_latex : env = +let env config inputs outputs render_latex : env = let macro = Macro.env inputs outputs in - let env = { render_latex; macro; } in + let env = { config; render_latex; macro; } in env (* Helpers *) @@ -447,8 +448,10 @@ and render_expr' env expr = sprintf "%s matches %s" se1 se2 | _ -> let se = "`" ^ (Al.Print.string_of_expr expr) ^ "`" in - let msg = sprintf "expr cannot be rendered %s" se in - error expr.at msg + if env.config.panic_on_error then ( + let msg = sprintf "expr cannot be rendered %s" se in + error expr.at msg); + se and render_path env path = match path.it with diff --git a/spectec/src/backend-prose/render.mli b/spectec/src/backend-prose/render.mli index 5260d6b55a..46b29ab478 100644 --- a/spectec/src/backend-prose/render.mli +++ b/spectec/src/backend-prose/render.mli @@ -5,7 +5,7 @@ open Al.Ast type env -val env : string list -> string list -> Backend_latex.Render.env -> env +val env : Config.config -> string list -> string list -> Backend_latex.Render.env -> env (* Generators *) diff --git a/spectec/src/backend-splice/config.ml b/spectec/src/backend-splice/config.ml index ef09241616..f89a25c111 100644 --- a/spectec/src/backend-splice/config.ml +++ b/spectec/src/backend-splice/config.ml @@ -14,6 +14,9 @@ type config = (* Latex *) latex : Backend_latex.Config.t; + + (* Prose *) + prose : Backend_prose.Config.t; } type t = config @@ -24,6 +27,7 @@ let latex = {token = "##"; prefix = "$$\n"; suffix = "\n$$"; newline = true; indent = ""}; ]; latex = Backend_latex.Config.default; + prose = Backend_prose.Config.default; } let sphinx = @@ -32,4 +36,5 @@ let sphinx = {token = "$$"; prefix = ".. math::\n"; suffix = ""; newline = true; indent = " "}; ]; latex = Backend_latex.Config.default; + prose = Backend_prose.Config.default; } diff --git a/spectec/src/backend-splice/splice.ml b/spectec/src/backend-splice/splice.ml index 73fa5fa899..37f1909494 100644 --- a/spectec/src/backend-splice/splice.ml +++ b/spectec/src/backend-splice/splice.ml @@ -111,7 +111,7 @@ let env_prose env prose = let env (config : config) pdsts odsts elab el pr : env = let latex = Backend_latex.Render.env config.latex el in - let prose = Backend_prose.Render.env pdsts odsts latex in + let prose = Backend_prose.Render.env config.prose pdsts odsts latex in let env = { elab; config; latex; prose; syn = Map.empty; diff --git a/spectec/src/exe-watsup/main.ml b/spectec/src/exe-watsup/main.ml index c407c2231a..68fb2fc07c 100644 --- a/spectec/src/exe-watsup/main.ml +++ b/spectec/src/exe-watsup/main.ml @@ -9,7 +9,7 @@ let version = "0.4" type target = | Check | Latex - | Prose + | Prose of bool | Splice of Backend_splice.Config.t | Interpreter of string list @@ -129,7 +129,8 @@ let argspec = Arg.align " Splice Sphinx"; "--splice-sphinx", Arg.Unit (fun () -> target := Splice Backend_splice.Config.sphinx), " Splice Sphinx"; - "--prose", Arg.Unit (fun () -> target := Prose), " Generate prose"; + "--prose", Arg.Unit (fun () -> target := Prose true), " Generate prose"; + "--prose-rst", Arg.Unit (fun () -> target := Prose false), " Generate prose"; "--interpreter", Arg.Rest_all (fun args -> target := Interpreter args), " Generate interpreter"; @@ -172,7 +173,7 @@ let () = Il.Valid.valid il; (match !target with - | Prose | Splice _ | Interpreter _ -> + | Prose _ | Splice _ | Interpreter _ -> enable_pass Sideconditions; | _ when !print_al || !print_al_o <> "" -> enable_pass Sideconditions; @@ -241,22 +242,28 @@ let () = exit 2 ) - | Prose -> + | Prose as_plaintext -> log "Prose Generation..."; - let prose = Backend_prose.Gen.gen_prose el il al in - let oc = - match !odsts with - | [] -> stdout - | [odst] -> open_out odst - | _ -> - prerr_endline "too many output file names"; - exit 2 - in - output_string oc "=================\n"; - output_string oc " Generated prose \n"; - output_string oc "=================\n"; - output_string oc (Backend_prose.Print.string_of_prose prose); - if oc != stdout then close_out oc + let config_latex = Backend_latex.Config.default in + let config_prose = Backend_prose.Config.{panic_on_error = false} in + (match !odsts with + | [] -> + if as_plaintext then + Backend_prose.Gen.gen_prose el il al + |> Backend_prose.Print.string_of_prose + |> print_endline + else + print_endline (Backend_prose.Gen.gen_string config_latex config_prose el il al) + | [odst] -> + if as_plaintext then + Backend_prose.Gen.gen_prose el il al + |> Backend_prose.Print.file_of_prose odst + else + Backend_prose.Gen.gen_file config_latex config_prose odst el il al + | _ -> + prerr_endline "too many output file names"; + exit 2 + ) | Splice config -> if !in_place then diff --git a/spectec/test-prose/TEST.md b/spectec/test-prose/TEST.md index 1e2f0cca5f..1606a077bb 100644 --- a/spectec/test-prose/TEST.md +++ b/spectec/test-prose/TEST.md @@ -4,6 +4,7 @@ $ for v in 1 2 3; do ( \ > echo "Generating prose for Wasm $v.0..." && \ > cd ../spec/wasm-$v.0 && \ +> ../../src/exe-watsup/main.exe *.watsup -v -l --prose-rst && \ > ../../src/exe-watsup/main.exe *.watsup -v -l --prose \ > ) done Generating prose for Wasm 1.0... @@ -15,2637 +16,10753 @@ watsup 0.4 generator == IL Validation after pass sideconditions... == Translating to AL... == Prose Generation... -================= - Generated prose -================= -Limits_ok -- the limits (n, m) is valid with the nat k if and only if: - - n is less than or equal to m. - - m is less than or equal to k. -Functype_ok -- the function type (t_1* -> t_2?) is valid. +* :math:`(n, m)` is valid with type :math:`k` if and only if: -Globaltype_ok -- the global type ((MUT ()?), t) is valid. -Tabletype_ok -- the table type limits is valid if and only if: - - the limits limits is valid with the nat ((2 ^ 32) - 1). + * :math:`n` must be less than or equal to :math:`m`. -Memtype_ok -- the memory type limits is valid if and only if: - - the limits limits is valid with the nat (2 ^ 16). + * :math:`m` must be less than or equal to :math:`k`. -Externtype_ok -- the external type externtype_u0 is valid if and only if: - - Either: - - externtype_u0 is (FUNC functype). - - the function type functype is valid. - - Or: - - externtype_u0 is (GLOBAL globaltype). - - the global type globaltype is valid. - - Or: - - externtype_u0 is (TABLE tabletype). - - the table type tabletype is valid. - - Or: - - externtype_u0 is (MEM memtype). - - the memory type memtype is valid. -Limits_sub -- the limits (n_11, n_12) matches the limits (n_21, n_22) if and only if: - - n_11 is greater than or equal to n_21. - - n_12 is less than or equal to n_22. +* :math:`{t_1^\ast} \rightarrow {t_2^?}` is valid. -Functype_sub -- the function type ft matches the function type ft. -Globaltype_sub -- the global type gt matches the global type gt. +* :math:`((\mathsf{mut}~{()^?}), t)` is valid. -Tabletype_sub -- the table type lim_1 matches the table type lim_2 if and only if: - - the limits lim_1 matches the limits lim_2. -Memtype_sub -- the memory type lim_1 matches the memory type lim_2 if and only if: - - the limits lim_1 matches the limits lim_2. +* :math:`{\mathit{limits}}` is valid if and only if: -Externtype_sub -- the external type externtype_u0 matches the external type externtype_u1 if and only if: - - Either: - - externtype_u0 is (FUNC ft_1). - - externtype_u1 is (FUNC ft_2). - - the function type ft_1 matches the function type ft_2. - - Or: - - externtype_u0 is (GLOBAL gt_1). - - externtype_u1 is (GLOBAL gt_2). - - the global type gt_1 matches the global type gt_2. - - Or: - - externtype_u0 is (TABLE tt_1). - - externtype_u1 is (TABLE tt_2). - - the table type tt_1 matches the table type tt_2. - - Or: - - externtype_u0 is (MEM mt_1). - - externtype_u1 is (MEM mt_2). - - the memory type mt_1 matches the memory type mt_2. -Instr_ok/nop -- the instr NOP is valid with the function type ([] -> []). + * :math:`{\mathit{limits}}` is valid with type :math:`{2^{32}} - 1`. -Instr_ok/unreachable -- the instr UNREACHABLE is valid with the function type (t_1* -> t_2*). -Instr_ok/drop -- the instr DROP is valid with the function type ([t] -> []). +* :math:`{\mathit{limits}}` is valid if and only if: -Instr_ok/select -- the instr SELECT is valid with the function type ([t, t, I32] -> [t]). -Instr_ok/block -- the instr (BLOCK t? instr*) is valid with the function type ([] -> t?) if and only if: - - Under the context C with .LABELS prepended by [t?], the instr sequence instr* is valid with the function type ([] -> t?). + * :math:`{\mathit{limits}}` is valid with type :math:`{2^{16}}`. -Instr_ok/loop -- the instr (LOOP t? instr*) is valid with the function type ([] -> t?) if and only if: - - Under the context C with .LABELS prepended by [?()], the instr sequence instr* is valid with the function type ([] -> []). -Instr_ok/if -- the instr (IF t? instr_1* instr_2*) is valid with the function type ([I32] -> t?) if and only if: - - Under the context C with .LABELS prepended by [t?], the instr sequence instr_1* is valid with the function type ([] -> t?). - - Under the context C with .LABELS prepended by [t?], the instr sequence instr_2* is valid with the function type ([] -> t?). +* :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid if and only if: -Instr_ok/br -- the instr (BR l) is valid with the function type (t_1* ++ t? -> t_2*) if and only if: - - |C.LABELS| is greater than l. - - C.LABELS[l] is t?. -Instr_ok/br_if -- the instr (BR_IF l) is valid with the function type (t? ++ [I32] -> t?) if and only if: - - |C.LABELS| is greater than l. - - C.LABELS[l] is t?. + * Either: -Instr_ok/br_table -- the instr (BR_TABLE l* l') is valid with the function type (t_1* ++ t? -> t_2*) if and only if: - - |C.LABELS| is greater than l'. - - For all l in l*, - - |C.LABELS| is greater than l. - - t? is C.LABELS[l']. - - For all l in l*, - - t? is C.LABELS[l]. + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{func}~{\mathit{functype}})`. -Instr_ok/call -- the instr (CALL x) is valid with the function type (t_1* -> t_2?) if and only if: - - |C.FUNCS| is greater than x. - - C.FUNCS[x] is (t_1* -> t_2?). + * :math:`{\mathit{functype}}` is valid. -Instr_ok/call_indirect -- the instr (CALL_INDIRECT x) is valid with the function type (t_1* ++ [I32] -> t_2?) if and only if: - - |C.TYPES| is greater than x. - - C.TYPES[x] is (t_1* -> t_2?). + * Or: -Instr_ok/return -- the instr RETURN is valid with the function type (t_1* ++ t? -> t_2*) if and only if: - - C.RETURN is ?(t?). + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{global}~{\mathit{globaltype}})`. -Instr_ok/const -- the instr (t.CONST c_t) is valid with the function type ([] -> [t]). + * :math:`{\mathit{globaltype}}` is valid. * Or: -Instr_ok/unop -- the instr (UNOP t unop_t) is valid with the function type ([t] -> [t]). + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{table}~{\mathit{tabletype}})`. -Instr_ok/binop -- the instr (BINOP t binop_t) is valid with the function type ([t, t] -> [t]). + * :math:`{\mathit{tabletype}}` is valid. * Or: -Instr_ok/testop -- the instr (TESTOP t testop_t) is valid with the function type ([t] -> [I32]). + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{mem}~{\mathit{memtype}})`. -Instr_ok/relop -- the instr (RELOP t relop_t) is valid with the function type ([t, t] -> [I32]). + * :math:`{\mathit{memtype}}` is valid. -Instr_ok/cvtop -- the instr (CVTOP nt_1 nt_2 REINTERPRET) is valid with the function type ([nt_2] -> [nt_1]) if and only if: - - $size(nt_1) is $size(nt_2). -Instr_ok/local.get -- the instr (LOCAL.GET x) is valid with the function type ([] -> [t]) if and only if: - - |C.LOCALS| is greater than x. - - C.LOCALS[x] is t. +* :math:`(n_{11}, n_{12})` matches :math:`(n_{21}, n_{22})` if and only if: -Instr_ok/local.set -- the instr (LOCAL.SET x) is valid with the function type ([t] -> []) if and only if: - - |C.LOCALS| is greater than x. - - C.LOCALS[x] is t. -Instr_ok/local.tee -- the instr (LOCAL.TEE x) is valid with the function type ([t] -> [t]) if and only if: - - |C.LOCALS| is greater than x. - - C.LOCALS[x] is t. + * :math:`n_{11}` must be greater than or equal to :math:`n_{21}`. -Instr_ok/global.get -- the instr (GLOBAL.GET x) is valid with the function type ([] -> [t]) if and only if: - - |C.GLOBALS| is greater than x. - - C.GLOBALS[x] is (mut, t). + * :math:`n_{12}` must be less than or equal to :math:`n_{22}`. -Instr_ok/global.set -- the instr (GLOBAL.SET x) is valid with the function type ([t] -> []) if and only if: - - |C.GLOBALS| is greater than x. - - C.GLOBALS[x] is ((MUT ?(())), t). -Instr_ok/memory.size -- the instr MEMORY.SIZE is valid with the function type ([] -> [I32]) if and only if: - - |C.MEMS| is greater than 0. - - C.MEMS[0] is mt. +* :math:`{\mathit{ft}}` matches :math:`{\mathit{ft}}`. -Instr_ok/memory.grow -- the instr MEMORY.GROW is valid with the function type ([I32] -> [I32]) if and only if: - - |C.MEMS| is greater than 0. - - C.MEMS[0] is mt. -Instr_ok/load -- the instr (LOAD nt (n, sx)? memarg) is valid with the function type ([I32] -> [nt]) if and only if: - - |C.MEMS| is greater than 0. - - ((sx? is ?())) if and only if ((n? is ?())). - - C.MEMS[0] is mt. - - (2 ^ memarg.ALIGN) is less than or equal to ($size(nt) / 8). - - If n is defined, - - (2 ^ memarg.ALIGN) is less than or equal to (n / 8). - - (n / 8) is less than ($size(nt) / 8). - - If n is defined, - - nt is Inn. +* :math:`{\mathit{gt}}` matches :math:`{\mathit{gt}}`. -Instr_ok/store -- the instr (STORE nt n? memarg) is valid with the function type ([I32, nt] -> []) if and only if: - - |C.MEMS| is greater than 0. - - C.MEMS[0] is mt. - - (2 ^ memarg.ALIGN) is less than or equal to ($size(nt) / 8). - - If n is defined, - - (2 ^ memarg.ALIGN) is less than or equal to (n / 8). - - (n / 8) is less than ($size(nt) / 8). - - If n is defined, - - nt is Inn. -Instrs_ok -- the instr sequence instr_u0* is valid with the function type (valtype_u1* -> valtype_u2*) if and only if: - - Either: - - instr_u0* is []. - - valtype_u1* is []. - - valtype_u2* is []. - - Or: - - instr_u0* is [instr_1] ++ instr_2*. - - valtype_u1* is t_1*. - - valtype_u2* is t_3*. - - the instr instr_1 is valid with the function type (t_1* -> t_2*). - - the instr sequence [instr_2] is valid with the function type (t_2* -> t_3*). - - Or: - - instr_u0* is instr*. - - valtype_u1* is t* ++ t_1*. - - valtype_u2* is t* ++ t_2*. - - the instr sequence instr* is valid with the function type (t_1* -> t_2*). +* :math:`{\mathit{lim}}_1` matches :math:`{\mathit{lim}}_2` if and only if: -Expr_ok -- the expression instr* is valid with the result type t? if and only if: - - the instr sequence instr* is valid with the function type ([] -> t?). -Instr_const -- the instr instr_u0 is constant if and only if: - - Either: - - instr_u0 is (t.CONST c). - - Or: - - instr_u0 is (GLOBAL.GET x). - - |C.GLOBALS| is greater than x. - - C.GLOBALS[x] is ((MUT ?()), t). + * :math:`{\mathit{lim}}_1` matches :math:`{\mathit{lim}}_2`. -Expr_const -- the expression instr* is constant if and only if: - - For all instr in instr*, - - the instr instr is constant. -Type_ok -- the type (TYPE ft) is valid with the function type ft if and only if: - - the function type ft is valid. +* :math:`{\mathit{lim}}_1` matches :math:`{\mathit{lim}}_2` if and only if: -Func_ok -- the function (FUNC x (LOCAL t)* expr) is valid with the function type (t_1* -> t_2?) if and only if: - - |C.TYPES| is greater than x. - - C.TYPES[x] is (t_1* -> t_2?). - - Under the context C with .LOCALS appended by t_1* ++ t* with .LABELS appended by [t_2?] with .RETURN appended by ?(t_2?), the expression expr is valid with the result type t_2?. -Global_ok -- the global (GLOBAL gt expr) is valid with the global type gt if and only if: - - the global type gt is valid. - - gt is (mut, t). - - the expression expr is valid with the number type sequence ?(t). - - the expression expr is constant. + * :math:`{\mathit{lim}}_1` matches :math:`{\mathit{lim}}_2`. -Table_ok -- the table (TABLE tt) is valid with the table type tt if and only if: - - the table type tt is valid. -Mem_ok -- the memory (MEMORY mt) is valid with the memory type mt if and only if: - - the memory type mt is valid. +* :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` matches :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` if and only if: -Elem_ok -- the table segment (ELEM expr x*) is valid if and only if: - - |C.TABLES| is greater than 0. - - |x*| is |ft*|. - - For all x in x*, - - |C.FUNCS| is greater than x. - - C.TABLES[0] is lim. - - the expression expr is valid with the number type sequence ?(I32). - - the expression expr is constant. - - For all ft in ft* and x in x*, - - C.FUNCS[x] is ft. -Data_ok -- the memory segment (DATA expr b*) is valid if and only if: - - |C.MEMS| is greater than 0. - - C.MEMS[0] is lim. - - the expression expr is valid with the number type sequence ?(I32). - - the expression expr is constant. + * Either: -Start_ok -- the start function (START x) is valid if and only if: - - |C.FUNCS| is greater than x. - - C.FUNCS[x] is ([] -> []). + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{func}~{\mathit{ft}}_1)`. -Import_ok -- the import (IMPORT name_1 name_2 xt) is valid with the external type xt if and only if: - - the external type xt is valid. + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{func}~{\mathit{ft}}_2)`. -Externidx_ok -- the external index externidx_u0 is valid with the external type externtype_u1 if and only if: - - Either: - - externidx_u0 is (FUNC x). - - externtype_u1 is (FUNC ft). - - |C.FUNCS| is greater than x. - - C.FUNCS[x] is ft. - - Or: - - externidx_u0 is (GLOBAL x). - - externtype_u1 is (GLOBAL gt). - - |C.GLOBALS| is greater than x. - - C.GLOBALS[x] is gt. - - Or: - - externidx_u0 is (TABLE x). - - externtype_u1 is (TABLE tt). - - |C.TABLES| is greater than x. - - C.TABLES[x] is tt. - - Or: - - externidx_u0 is (MEM x). - - externtype_u1 is (MEM mt). - - |C.MEMS| is greater than x. - - C.MEMS[x] is mt. + * :math:`{\mathit{ft}}_1` matches :math:`{\mathit{ft}}_2`. -Export_ok -- the export (EXPORT name externidx) is valid with the external type xt if and only if: - - the external index externidx is valid with the external type xt. + * Or: -Module_ok -- the module (MODULE type* import* func* global* table* mem* elem* data* start? export*) is valid if and only if: - - |type*| is |ft'*|. - - |ixt*| is |import*|. - - |gt*| is |global*|. - - |func*| is |ft*|. - - |tt*| is |table*|. - - |mt*| is |mem*|. - - |xt*| is |export*|. - - For all ft' in ft'* and type in type*, - - the type type is valid with the function type ft'. - - For all import in import* and ixt in ixt*, - - Under the context { TYPES: ft'*; FUNCS: []; GLOBALS: []; TABLES: []; MEMS: []; LOCALS: []; LABELS: []; RETURN: ?(); }, the import import is valid with the external type ixt. - - For all global in global* and gt in gt*, - - Under the context C', the global global is valid with the global type gt. - - For all ft in ft* and func in func*, - - the function func is valid with the function type ft. - - For all table in table* and tt in tt*, - - the table table is valid with the table type tt. - - For all mem in mem* and mt in mt*, - - the memory mem is valid with the memory type mt. - - For all elem in elem*, - - the table segment elem is valid. - - For all data in data*, - - the memory segment data is valid. - - If start is defined, - - the start function start is valid. - - For all export in export* and xt in xt*, - - the export export is valid with the external type xt. - - |tt*| is less than or equal to 1. - - |mt*| is less than or equal to 1. - - C is { TYPES: ft'*; FUNCS: ift* ++ ft*; GLOBALS: igt* ++ gt*; TABLES: itt* ++ tt*; MEMS: imt* ++ mt*; LOCALS: []; LABELS: []; RETURN: ?(); }. - - C' is { TYPES: ft'*; FUNCS: ift* ++ ft*; GLOBALS: igt*; TABLES: []; MEMS: []; LOCALS: []; LABELS: []; RETURN: ?(); }. - - ift* is $funcsxt(ixt*). - - igt* is $globalsxt(ixt*). - - itt* is $tablesxt(ixt*). - - imt* is $memsxt(ixt*). + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{global}~{\mathit{gt}}_1)`. -Ki -1. Return 1024. + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{global}~{\mathit{gt}}_2)`. -min n_u0 n_u1 -1. If (n_u0 is 0), then: - a. Return 0. -2. If (n_u1 is 0), then: - a. Return 0. -3. Assert: Due to validation, (n_u0 ≥ 1). -4. Let i be (n_u0 - 1). -5. Assert: Due to validation, (n_u1 ≥ 1). -6. Let j be (n_u1 - 1). -7. Return $min(i, j). + * :math:`{\mathit{gt}}_1` matches :math:`{\mathit{gt}}_2`. * Or: -sum n_u0* -1. If (n_u0* is []), then: - a. Return 0. -2. Let [n] ++ n'* be n_u0*. -3. Return (n + $sum(n'*)). + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{table}~{\mathit{tt}}_1)`. -opt_ X X_u0* -1. If (X_u0* is []), then: - a. Return ?(). -2. Assert: Due to validation, (|X_u0*| is 1). -3. Let [w] be X_u0*. -4. Return ?(w). + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{table}~{\mathit{tt}}_2)`. -list_ X X_u0? -1. If X_u0? is not defined, then: - a. Return []. -2. Let ?(w) be X_u0?. -3. Return [w]. + * :math:`{\mathit{tt}}_1` matches :math:`{\mathit{tt}}_2`. * Or: -concat_ X X_u0* -1. If (X_u0* is []), then: - a. Return []. -2. Let [w*] ++ w'** be X_u0*. -3. Return w* ++ $concat_(X, w'**). + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{mem}~{\mathit{mt}}_1)`. -signif N_u0 -1. If (N_u0 is 32), then: - a. Return 23. -2. Assert: Due to validation, (N_u0 is 64). -3. Return 52. + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{mem}~{\mathit{mt}}_2)`. -expon N_u0 -1. If (N_u0 is 32), then: - a. Return 8. -2. Assert: Due to validation, (N_u0 is 64). -3. Return 11. + * :math:`{\mathit{mt}}_1` matches :math:`{\mathit{mt}}_2`. -M N -1. Return $signif(N). -E N -1. Return $expon(N). +* :math:`\mathsf{nop}` is valid with type :math:`\epsilon \rightarrow \epsilon`. -fzero N -1. Return (POS (SUBNORM 0)). -fone N -1. Return (POS (NORM 1 0)). +* :math:`\mathsf{unreachable}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. -canon_ N -1. Return (2 ^ ($signif(N) - 1)). -size valtype_u0 -1. If (valtype_u0 is I32), then: - a. Return 32. -2. If (valtype_u0 is I64), then: - a. Return 64. -3. If (valtype_u0 is F32), then: - a. Return 32. -4. If (valtype_u0 is F64), then: - a. Return 64. +* :math:`\mathsf{drop}` is valid with type :math:`t \rightarrow \epsilon`. -funcsxt externtype_u0* -1. If (externtype_u0* is []), then: - a. Return []. -2. Let [externtype_0] ++ xt* be externtype_u0*. -3. If externtype_0 is of the case FUNC, then: - a. Let (FUNC ft) be externtype_0. - b. Return [ft] ++ $funcsxt(xt*). -4. Let [externtype] ++ xt* be externtype_u0*. -5. Return $funcsxt(xt*). -globalsxt externtype_u0* -1. If (externtype_u0* is []), then: - a. Return []. -2. Let [externtype_0] ++ xt* be externtype_u0*. -3. If externtype_0 is of the case GLOBAL, then: - a. Let (GLOBAL gt) be externtype_0. - b. Return [gt] ++ $globalsxt(xt*). -4. Let [externtype] ++ xt* be externtype_u0*. -5. Return $globalsxt(xt*). +* :math:`\mathsf{select}` is valid with type :math:`t~t~\mathsf{i{\scriptstyle 32}} \rightarrow t`. -tablesxt externtype_u0* -1. If (externtype_u0* is []), then: - a. Return []. -2. Let [externtype_0] ++ xt* be externtype_u0*. -3. If externtype_0 is of the case TABLE, then: - a. Let (TABLE tt) be externtype_0. - b. Return [tt] ++ $tablesxt(xt*). -4. Let [externtype] ++ xt* be externtype_u0*. -5. Return $tablesxt(xt*). -memsxt externtype_u0* -1. If (externtype_u0* is []), then: - a. Return []. -2. Let [externtype_0] ++ xt* be externtype_u0*. -3. If externtype_0 is of the case MEM, then: - a. Let (MEM mt) be externtype_0. - b. Return [mt] ++ $memsxt(xt*). -4. Let [externtype] ++ xt* be externtype_u0*. -5. Return $memsxt(xt*). +* :math:`(\mathsf{block}~{t^?}~{{\mathit{instr}}^\ast})` is valid with type :math:`\epsilon \rightarrow {t^?}` if and only if: -memarg0 -1. Return { ALIGN: 0; OFFSET: 0; }. -signed_ N i -1. If (0 ≤ (2 ^ (N - 1))), then: - a. Return i. -2. Assert: Due to validation, ((2 ^ (N - 1)) ≤ i). -3. Assert: Due to validation, (i < (2 ^ N)). -4. Return (i - (2 ^ N)). + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t^?}]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`\epsilon \rightarrow {t^?}`. -invsigned_ N ii -1. Let j be $signed__1^-1(N, ii). -2. Return j. -unop_ valtype_u1 unop__u0 val__u3 -1. If ((unop__u0 is CLZ) and the type of valtype_u1 is Inn), then: - a. Let Inn be valtype_u1. - b. Let iN be val__u3. - c. Return [$iclz_($size(Inn), iN)]. -2. If ((unop__u0 is CTZ) and the type of valtype_u1 is Inn), then: - a. Let Inn be valtype_u1. - b. Let iN be val__u3. - c. Return [$ictz_($size(Inn), iN)]. -3. If ((unop__u0 is POPCNT) and the type of valtype_u1 is Inn), then: - a. Let Inn be valtype_u1. - b. Let iN be val__u3. - c. Return [$ipopcnt_($size(Inn), iN)]. -4. If ((unop__u0 is ABS) and the type of valtype_u1 is Fnn), then: - a. Let Fnn be valtype_u1. - b. Let fN be val__u3. - c. Return $fabs_($size(Fnn), fN). -5. If ((unop__u0 is NEG) and the type of valtype_u1 is Fnn), then: - a. Let Fnn be valtype_u1. - b. Let fN be val__u3. - c. Return $fneg_($size(Fnn), fN). -6. If ((unop__u0 is SQRT) and the type of valtype_u1 is Fnn), then: - a. Let Fnn be valtype_u1. - b. Let fN be val__u3. - c. Return $fsqrt_($size(Fnn), fN). -7. If ((unop__u0 is CEIL) and the type of valtype_u1 is Fnn), then: - a. Let Fnn be valtype_u1. - b. Let fN be val__u3. - c. Return $fceil_($size(Fnn), fN). -8. If ((unop__u0 is FLOOR) and the type of valtype_u1 is Fnn), then: - a. Let Fnn be valtype_u1. - b. Let fN be val__u3. - c. Return $ffloor_($size(Fnn), fN). -9. If ((unop__u0 is TRUNC) and the type of valtype_u1 is Fnn), then: - a. Let Fnn be valtype_u1. - b. Let fN be val__u3. - c. Return $ftrunc_($size(Fnn), fN). -10. Assert: Due to validation, (unop__u0 is NEAREST). -11. Assert: Due to validation, the type of valtype_u1 is Fnn. -12. Let Fnn be valtype_u1. -13. Let fN be val__u3. -14. Return $fnearest_($size(Fnn), fN). +* :math:`(\mathsf{loop}~{t^?}~{{\mathit{instr}}^\ast})` is valid with type :math:`\epsilon \rightarrow {t^?}` if and only if: -binop_ valtype_u1 binop__u0 val__u3 val__u5 -1. If ((binop__u0 is ADD) and the type of valtype_u1 is Inn), then: - a. Let Inn be valtype_u1. - b. Let iN_1 be val__u3. - c. Let iN_2 be val__u5. - d. Return [$iadd_($size(Inn), iN_1, iN_2)]. -2. If ((binop__u0 is SUB) and the type of valtype_u1 is Inn), then: - a. Let Inn be valtype_u1. - b. Let iN_1 be val__u3. - c. Let iN_2 be val__u5. - d. Return [$isub_($size(Inn), iN_1, iN_2)]. -3. If ((binop__u0 is MUL) and the type of valtype_u1 is Inn), then: - a. Let Inn be valtype_u1. - b. Let iN_1 be val__u3. - c. Let iN_2 be val__u5. - d. Return [$imul_($size(Inn), iN_1, iN_2)]. -4. If the type of valtype_u1 is Inn, then: - a. Let Inn be valtype_u1. - b. Let iN_1 be val__u3. - c. Let iN_2 be val__u5. - d. If binop__u0 is of the case DIV, then: - 1) Let (DIV sx) be binop__u0. - 2) Return $list_(val_((Inn : Inn <: valtype)), $idiv_($size(Inn), sx, iN_1, iN_2)). - e. If binop__u0 is of the case REM, then: - 1) Let (REM sx) be binop__u0. - 2) Return $list_(val_((Inn : Inn <: valtype)), $irem_($size(Inn), sx, iN_1, iN_2)). -5. If ((binop__u0 is AND) and the type of valtype_u1 is Inn), then: - a. Let Inn be valtype_u1. - b. Let iN_1 be val__u3. - c. Let iN_2 be val__u5. - d. Return [$iand_($size(Inn), iN_1, iN_2)]. -6. If ((binop__u0 is OR) and the type of valtype_u1 is Inn), then: - a. Let Inn be valtype_u1. - b. Let iN_1 be val__u3. - c. Let iN_2 be val__u5. - d. Return [$ior_($size(Inn), iN_1, iN_2)]. -7. If ((binop__u0 is XOR) and the type of valtype_u1 is Inn), then: - a. Let Inn be valtype_u1. - b. Let iN_1 be val__u3. - c. Let iN_2 be val__u5. - d. Return [$ixor_($size(Inn), iN_1, iN_2)]. -8. If ((binop__u0 is SHL) and the type of valtype_u1 is Inn), then: - a. Let Inn be valtype_u1. - b. Let iN_1 be val__u3. - c. Let iN_2 be val__u5. - d. Return [$ishl_($size(Inn), iN_1, iN_2)]. -9. If the type of valtype_u1 is Inn, then: - a. Let Inn be valtype_u1. - b. Let iN_1 be val__u3. - c. Let iN_2 be val__u5. - d. If binop__u0 is of the case SHR, then: - 1) Let (SHR sx) be binop__u0. - 2) Return [$ishr_($size(Inn), sx, iN_1, iN_2)]. -10. If ((binop__u0 is ROTL) and the type of valtype_u1 is Inn), then: - a. Let Inn be valtype_u1. - b. Let iN_1 be val__u3. - c. Let iN_2 be val__u5. - d. Return [$irotl_($size(Inn), iN_1, iN_2)]. -11. If ((binop__u0 is ROTR) and the type of valtype_u1 is Inn), then: - a. Let Inn be valtype_u1. - b. Let iN_1 be val__u3. - c. Let iN_2 be val__u5. - d. Return [$irotr_($size(Inn), iN_1, iN_2)]. -12. If ((binop__u0 is ADD) and the type of valtype_u1 is Fnn), then: - a. Let Fnn be valtype_u1. - b. Let fN_1 be val__u3. - c. Let fN_2 be val__u5. - d. Return $fadd_($size(Fnn), fN_1, fN_2). -13. If ((binop__u0 is SUB) and the type of valtype_u1 is Fnn), then: - a. Let Fnn be valtype_u1. - b. Let fN_1 be val__u3. - c. Let fN_2 be val__u5. - d. Return $fsub_($size(Fnn), fN_1, fN_2). -14. If ((binop__u0 is MUL) and the type of valtype_u1 is Fnn), then: - a. Let Fnn be valtype_u1. - b. Let fN_1 be val__u3. - c. Let fN_2 be val__u5. - d. Return $fmul_($size(Fnn), fN_1, fN_2). -15. If ((binop__u0 is DIV) and the type of valtype_u1 is Fnn), then: - a. Let Fnn be valtype_u1. - b. Let fN_1 be val__u3. - c. Let fN_2 be val__u5. - d. Return $fdiv_($size(Fnn), fN_1, fN_2). -16. If ((binop__u0 is MIN) and the type of valtype_u1 is Fnn), then: - a. Let Fnn be valtype_u1. - b. Let fN_1 be val__u3. - c. Let fN_2 be val__u5. - d. Return $fmin_($size(Fnn), fN_1, fN_2). -17. If ((binop__u0 is MAX) and the type of valtype_u1 is Fnn), then: - a. Let Fnn be valtype_u1. - b. Let fN_1 be val__u3. - c. Let fN_2 be val__u5. - d. Return $fmax_($size(Fnn), fN_1, fN_2). -18. Assert: Due to validation, (binop__u0 is COPYSIGN). -19. Assert: Due to validation, the type of valtype_u1 is Fnn. -20. Let Fnn be valtype_u1. -21. Let fN_1 be val__u3. -22. Let fN_2 be val__u5. -23. Return $fcopysign_($size(Fnn), fN_1, fN_2). -testop_ Inn EQZ iN -1. Return $ieqz_($size(Inn), iN). + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} \epsilon]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`\epsilon \rightarrow \epsilon`. -relop_ valtype_u1 relop__u0 val__u3 val__u5 -1. If ((relop__u0 is EQ) and the type of valtype_u1 is Inn), then: - a. Let Inn be valtype_u1. - b. Let iN_1 be val__u3. - c. Let iN_2 be val__u5. - d. Return $ieq_($size(Inn), iN_1, iN_2). -2. If ((relop__u0 is NE) and the type of valtype_u1 is Inn), then: - a. Let Inn be valtype_u1. - b. Let iN_1 be val__u3. - c. Let iN_2 be val__u5. - d. Return $ine_($size(Inn), iN_1, iN_2). -3. If the type of valtype_u1 is Inn, then: - a. Let Inn be valtype_u1. - b. Let iN_1 be val__u3. - c. Let iN_2 be val__u5. - d. If relop__u0 is of the case LT, then: - 1) Let (LT sx) be relop__u0. - 2) Return $ilt_($size(Inn), sx, iN_1, iN_2). - e. If relop__u0 is of the case GT, then: - 1) Let (GT sx) be relop__u0. - 2) Return $igt_($size(Inn), sx, iN_1, iN_2). - f. If relop__u0 is of the case LE, then: - 1) Let (LE sx) be relop__u0. - 2) Return $ile_($size(Inn), sx, iN_1, iN_2). - g. If relop__u0 is of the case GE, then: - 1) Let (GE sx) be relop__u0. - 2) Return $ige_($size(Inn), sx, iN_1, iN_2). -4. If ((relop__u0 is EQ) and the type of valtype_u1 is Fnn), then: - a. Let Fnn be valtype_u1. - b. Let fN_1 be val__u3. - c. Let fN_2 be val__u5. - d. Return $feq_($size(Fnn), fN_1, fN_2). -5. If ((relop__u0 is NE) and the type of valtype_u1 is Fnn), then: - a. Let Fnn be valtype_u1. - b. Let fN_1 be val__u3. - c. Let fN_2 be val__u5. - d. Return $fne_($size(Fnn), fN_1, fN_2). -6. If ((relop__u0 is LT) and the type of valtype_u1 is Fnn), then: - a. Let Fnn be valtype_u1. - b. Let fN_1 be val__u3. - c. Let fN_2 be val__u5. - d. Return $flt_($size(Fnn), fN_1, fN_2). -7. If ((relop__u0 is GT) and the type of valtype_u1 is Fnn), then: - a. Let Fnn be valtype_u1. - b. Let fN_1 be val__u3. - c. Let fN_2 be val__u5. - d. Return $fgt_($size(Fnn), fN_1, fN_2). -8. If ((relop__u0 is LE) and the type of valtype_u1 is Fnn), then: - a. Let Fnn be valtype_u1. - b. Let fN_1 be val__u3. - c. Let fN_2 be val__u5. - d. Return $fle_($size(Fnn), fN_1, fN_2). -9. Assert: Due to validation, (relop__u0 is GE). -10. Assert: Due to validation, the type of valtype_u1 is Fnn. -11. Let Fnn be valtype_u1. -12. Let fN_1 be val__u3. -13. Let fN_2 be val__u5. -14. Return $fge_($size(Fnn), fN_1, fN_2). -cvtop__ valtype_u0 valtype_u1 cvtop_u2 val__u4 -1. If ((valtype_u0 is I32) and (valtype_u1 is I64)), then: - a. Let iN be val__u4. - b. If cvtop_u2 is of the case EXTEND, then: - 1) Let (EXTEND sx) be cvtop_u2. - 2) Return [$extend__(32, 64, sx, iN)]. -2. If ((valtype_u0 is I64) and ((valtype_u1 is I32) and (cvtop_u2 is WRAP))), then: - a. Let iN be val__u4. - b. Return [$wrap__(64, 32, iN)]. -3. If the type of valtype_u0 is Fnn, then: - a. Let Fnn be valtype_u0. - b. If the type of valtype_u1 is Inn, then: - 1) Let Inn be valtype_u1. - 2) Let fN be val__u4. - 3) If cvtop_u2 is of the case TRUNC, then: - a) Let (TRUNC sx) be cvtop_u2. - b) Return $list_(val_((Inn : Inn <: valtype)), $trunc__($size(Fnn), $size(Inn), sx, fN)). -4. If ((valtype_u0 is F32) and ((valtype_u1 is F64) and (cvtop_u2 is PROMOTE))), then: - a. Let fN be val__u4. - b. Return $promote__(32, 64, fN). -5. If ((valtype_u0 is F64) and ((valtype_u1 is F32) and (cvtop_u2 is DEMOTE))), then: - a. Let fN be val__u4. - b. Return $demote__(64, 32, fN). -6. If the type of valtype_u1 is Fnn, then: - a. Let Fnn be valtype_u1. - b. If the type of valtype_u0 is Inn, then: - 1) Let Inn be valtype_u0. - 2) Let iN be val__u4. - 3) If cvtop_u2 is of the case CONVERT, then: - a) Let (CONVERT sx) be cvtop_u2. - b) Return [$convert__($size(Inn), $size(Fnn), sx, iN)]. -7. Assert: Due to validation, (cvtop_u2 is REINTERPRET). -8. If the type of valtype_u1 is Fnn, then: - a. Let Fnn be valtype_u1. - b. If the type of valtype_u0 is Inn, then: - 1) Let Inn be valtype_u0. - 2) Let iN be val__u4. - 3) If ($size(Inn) is $size(Fnn)), then: - a) Return [$reinterpret__(Inn, Fnn, iN)]. -9. Assert: Due to validation, the type of valtype_u0 is Fnn. -10. Let Fnn be valtype_u0. -11. Assert: Due to validation, the type of valtype_u1 is Inn. -12. Let Inn be valtype_u1. -13. Let fN be val__u4. -14. Assert: Due to validation, ($size(Inn) is $size(Fnn)). -15. Return [$reinterpret__(Fnn, Inn, fN)]. +* :math:`(\mathsf{if}~{t^?}~{{\mathit{instr}}_1^\ast}~{{\mathit{instr}}_2^\ast})` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow {t^?}` if and only if: -invibytes_ N b* -1. Let n be $ibytes__1^-1(N, b*). -2. Return n. -invfbytes_ N b* -1. Let p be $fbytes__1^-1(N, b*). -2. Return p. + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t^?}]`, :math:`{{\mathit{instr}}_1^\ast}` is valid with type :math:`\epsilon \rightarrow {t^?}`. -default_ valtype_u0 -1. If (valtype_u0 is I32), then: - a. Return (I32.CONST 0). -2. If (valtype_u0 is I64), then: - a. Return (I64.CONST 0). -3. If (valtype_u0 is F32), then: - a. Return (F32.CONST $fzero(32)). -4. Assert: Due to validation, (valtype_u0 is F64). -5. Return (F64.CONST $fzero(64)). + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t^?}]`, :math:`{{\mathit{instr}}_2^\ast}` is valid with type :math:`\epsilon \rightarrow {t^?}`. -funcsxv externval_u0* -1. If (externval_u0* is []), then: - a. Return []. -2. Let [externval_0] ++ xv* be externval_u0*. -3. If externval_0 is of the case FUNC, then: - a. Let (FUNC fa) be externval_0. - b. Return [fa] ++ $funcsxv(xv*). -4. Let [externval] ++ xv* be externval_u0*. -5. Return $funcsxv(xv*). -globalsxv externval_u0* -1. If (externval_u0* is []), then: - a. Return []. -2. Let [externval_0] ++ xv* be externval_u0*. -3. If externval_0 is of the case GLOBAL, then: - a. Let (GLOBAL ga) be externval_0. - b. Return [ga] ++ $globalsxv(xv*). -4. Let [externval] ++ xv* be externval_u0*. -5. Return $globalsxv(xv*). +* :math:`(\mathsf{br}~l)` is valid with type :math:`{t_1^\ast}~{t^?} \rightarrow {t_2^\ast}` if and only if: -tablesxv externval_u0* -1. If (externval_u0* is []), then: - a. Return []. -2. Let [externval_0] ++ xv* be externval_u0*. -3. If externval_0 is of the case TABLE, then: - a. Let (TABLE ta) be externval_0. - b. Return [ta] ++ $tablesxv(xv*). -4. Let [externval] ++ xv* be externval_u0*. -5. Return $tablesxv(xv*). -memsxv externval_u0* -1. If (externval_u0* is []), then: - a. Return []. -2. Let [externval_0] ++ xv* be externval_u0*. -3. If externval_0 is of the case MEM, then: - a. Let (MEM ma) be externval_0. - b. Return [ma] ++ $memsxv(xv*). -4. Let [externval] ++ xv* be externval_u0*. -5. Return $memsxv(xv*). + * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. -store -1. Return. + * :math:`C{.}\mathsf{labels}{}[l]` must be equal to :math:`{t^?}`. -frame -1. Let f be the current frame. -2. Return f. -funcaddr -1. Let f be the current frame. -2. Return f.MODULE.FUNCS. +* :math:`(\mathsf{br\_if}~l)` is valid with type :math:`{t^?}~\mathsf{i{\scriptstyle 32}} \rightarrow {t^?}` if and only if: -funcinst -1. Return s.FUNCS. -globalinst -1. Return s.GLOBALS. + * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. -tableinst -1. Return s.TABLES. + * :math:`C{.}\mathsf{labels}{}[l]` must be equal to :math:`{t^?}`. -meminst -1. Return s.MEMS. -moduleinst -1. Let f be the current frame. -2. Return f.MODULE. +* :math:`(\mathsf{br\_table}~{l^\ast}~{l'})` is valid with type :math:`{t_1^\ast}~{t^?} \rightarrow {t_2^\ast}` if and only if: -type x -1. Let f be the current frame. -2. Return f.MODULE.TYPES[x]. -func x -1. Let f be the current frame. -2. Return s.FUNCS[f.MODULE.FUNCS[x]]. + * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`{l'}`. -global x -1. Let f be the current frame. -2. Return s.GLOBALS[f.MODULE.GLOBALS[x]]. + * For all :math:`l` in :math:`{l^\ast}`, -table x -1. Let f be the current frame. -2. Return s.TABLES[f.MODULE.TABLES[x]]. + * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. -mem x -1. Let f be the current frame. -2. Return s.MEMS[f.MODULE.MEMS[x]]. + * :math:`{t^?}` must be equal to :math:`C{.}\mathsf{labels}{}[{l'}]`. -local x -1. Let f be the current frame. -2. Return f.LOCALS[x]. + * For all :math:`l` in :math:`{l^\ast}`, -with_local x v -1. Let f be the current frame. -2. Replace f.LOCALS[x] with v. + * :math:`{t^?}` must be equal to :math:`C{.}\mathsf{labels}{}[l]`. -with_global x v -1. Let f be the current frame. -2. Replace s.GLOBALS[f.MODULE.GLOBALS[x]].VALUE with v. -with_table x i a -1. Let f be the current frame. -2. Replace s.TABLES[f.MODULE.TABLES[x]].REFS[i] with ?(a). +* :math:`(\mathsf{call}~x)` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^?}` if and only if: -with_tableinst x ti -1. Let f be the current frame. -2. Replace s.TABLES[f.MODULE.TABLES[x]] with ti. -with_mem x i j b* -1. Let f be the current frame. -2. Replace s.MEMS[f.MODULE.MEMS[x]].BYTES[i : j] with b*. + * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. -with_meminst x mi -1. Let f be the current frame. -2. Replace s.MEMS[f.MODULE.MEMS[x]] with mi. + * :math:`C{.}\mathsf{funcs}{}[x]` must be equal to :math:`{t_1^\ast} \rightarrow {t_2^?}`. -growtable ti n -1. Let { TYPE: (i, j); REFS: ?(a)*; } be ti. -2. Let i' be (|a*| + n). -3. If (i' ≤ j), then: - a. Let ti' be { TYPE: (i', j); REFS: ?(a)* ++ ?()^n; }. - b. Return ti'. -growmemory mi n -1. Let { TYPE: (i, j); BYTES: b*; } be mi. -2. Let i' be ((|b*| / (64 · $Ki())) + n). -3. If (i' ≤ j), then: - a. Let mi' be { TYPE: (i', j); BYTES: b* ++ 0^(n · (64 · $Ki())); }. - b. Return mi'. +* :math:`(\mathsf{call\_indirect}~x)` is valid with type :math:`{t_1^\ast}~\mathsf{i{\scriptstyle 32}} \rightarrow {t_2^?}` if and only if: -funcs externval_u0* -1. If (externval_u0* is []), then: - a. Return []. -2. Let [externval_0] ++ externval'* be externval_u0*. -3. If externval_0 is of the case FUNC, then: - a. Let (FUNC fa) be externval_0. - b. Return [fa] ++ $funcs(externval'*). -4. Let [externval] ++ externval'* be externval_u0*. -5. Return $funcs(externval'*). -globals externval_u0* -1. If (externval_u0* is []), then: - a. Return []. -2. Let [externval_0] ++ externval'* be externval_u0*. -3. If externval_0 is of the case GLOBAL, then: - a. Let (GLOBAL ga) be externval_0. - b. Return [ga] ++ $globals(externval'*). -4. Let [externval] ++ externval'* be externval_u0*. -5. Return $globals(externval'*). + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. -tables externval_u0* -1. If (externval_u0* is []), then: - a. Return []. -2. Let [externval_0] ++ externval'* be externval_u0*. -3. If externval_0 is of the case TABLE, then: - a. Let (TABLE ta) be externval_0. - b. Return [ta] ++ $tables(externval'*). -4. Let [externval] ++ externval'* be externval_u0*. -5. Return $tables(externval'*). + * :math:`C{.}\mathsf{types}{}[x]` must be equal to :math:`{t_1^\ast} \rightarrow {t_2^?}`. -mems externval_u0* -1. If (externval_u0* is []), then: - a. Return []. -2. Let [externval_0] ++ externval'* be externval_u0*. -3. If externval_0 is of the case MEM, then: - a. Let (MEM ma) be externval_0. - b. Return [ma] ++ $mems(externval'*). -4. Let [externval] ++ externval'* be externval_u0*. -5. Return $mems(externval'*). -allocfunc moduleinst func -1. Assert: Due to validation, func is of the case FUNC. -2. Let (FUNC x local* expr) be func. -3. Let fi be { TYPE: moduleinst.TYPES[x]; MODULE: moduleinst; CODE: func; }. -4. Let a be |s.FUNCS|. -5. Append fi to the s.FUNCS. -6. Return a. +* :math:`\mathsf{return}` is valid with type :math:`{t_1^\ast}~{t^?} \rightarrow {t_2^\ast}` if and only if: -allocfuncs moduleinst func_u0* -1. If (func_u0* is []), then: - a. Return []. -2. Let [func] ++ func'* be func_u0*. -3. Let fa be $allocfunc(moduleinst, func). -4. Let fa'* be $allocfuncs(moduleinst, func'*). -5. Return [fa] ++ fa'*. -allocglobal globaltype val -1. Let gi be { TYPE: globaltype; VALUE: val; }. -2. Let a be |s.GLOBALS|. -3. Append gi to the s.GLOBALS. -4. Return a. + * :math:`C{.}\mathsf{return}` must be equal to :math:`{t^?}`. -allocglobals globaltype_u0* val_u1* -1. If (globaltype_u0* is []), then: - a. Assert: Due to validation, (val_u1* is []). - b. Return []. -2. Else: - a. Let [globaltype] ++ globaltype'* be globaltype_u0*. - b. Assert: Due to validation, (|val_u1*| ≥ 1). - c. Let [val] ++ val'* be val_u1*. - d. Let ga be $allocglobal(globaltype, val). - e. Let ga'* be $allocglobals(globaltype'*, val'*). - f. Return [ga] ++ ga'*. -alloctable (i, j) -1. Let ti be { TYPE: (i, j); REFS: ?()^i; }. -2. Let a be |s.TABLES|. -3. Append ti to the s.TABLES. -4. Return a. +* :math:`(t{.}\mathsf{const}~c_t)` is valid with type :math:`\epsilon \rightarrow t`. -alloctables tabletype_u0* -1. If (tabletype_u0* is []), then: - a. Return []. -2. Let [tabletype] ++ tabletype'* be tabletype_u0*. -3. Let ta be $alloctable(tabletype). -4. Let ta'* be $alloctables(tabletype'*). -5. Return [ta] ++ ta'*. -allocmem (i, j) -1. Let mi be { TYPE: (i, j); BYTES: 0^(i · (64 · $Ki())); }. -2. Let a be |s.MEMS|. -3. Append mi to the s.MEMS. -4. Return a. +* :math:`(t {.} {\mathit{unop}}_t)` is valid with type :math:`t \rightarrow t`. -allocmems memtype_u0* -1. If (memtype_u0* is []), then: - a. Return []. -2. Let [memtype] ++ memtype'* be memtype_u0*. -3. Let ma be $allocmem(memtype). -4. Let ma'* be $allocmems(memtype'*). -5. Return [ma] ++ ma'*. -instexport fa* ga* ta* ma* (EXPORT name externidx_u0) -1. If externidx_u0 is of the case FUNC, then: - a. Let (FUNC x) be externidx_u0. - b. Return { NAME: name; VALUE: (FUNC fa*[x]); }. -2. If externidx_u0 is of the case GLOBAL, then: - a. Let (GLOBAL x) be externidx_u0. - b. Return { NAME: name; VALUE: (GLOBAL ga*[x]); }. -3. If externidx_u0 is of the case TABLE, then: - a. Let (TABLE x) be externidx_u0. - b. Return { NAME: name; VALUE: (TABLE ta*[x]); }. -4. Assert: Due to validation, externidx_u0 is of the case MEM. -5. Let (MEM x) be externidx_u0. -6. Return { NAME: name; VALUE: (MEM ma*[x]); }. +* :math:`(t {.} {\mathit{binop}}_t)` is valid with type :math:`t~t \rightarrow t`. -allocmodule module externval* val* -1. Let fa_ex* be $funcs(externval*). -2. Let ga_ex* be $globals(externval*). -3. Let ma_ex* be $mems(externval*). -4. Let ta_ex* be $tables(externval*). -5. Assert: Due to validation, module is of the case MODULE. -6. Let (MODULE type_0 import* func^n_func global_1 table_2 mem_3 elem* data* start? export*) be module. -7. Assert: Due to validation, mem_3 is of the case MEMORY. -8. Let (MEMORY memtype)^n_mem be mem_3. -9. Assert: Due to validation, table_2 is of the case TABLE. -10. Let (TABLE tabletype)^n_table be table_2. -11. Assert: Due to validation, global_1 is of the case GLOBAL. -12. Let (GLOBAL globaltype expr_1)^n_global be global_1. -13. Assert: Due to validation, type_0 is of the case TYPE. -14. Let (TYPE ft)* be type_0. -15. Let fa* be (|s.FUNCS| + i_func)^(i_func t_2*) be $funcinst()[fa].TYPE. -4. Pop the activation of _f from the stack. -5. Let k be |t_2*|. -6. Push the activation of f with arity k to the stack. -7. Push the values val^n to the stack. -8. Execute the instruction (CALL_ADDR fa). -9. Pop all values val* from the top of the stack. -10. Pop the activation of f with arity k from the stack. -11. Push the values val* to the stack. -12. Pop the values val^k from the stack. -13. Return val^k. -Step_pure/unreachable -1. Trap. +* :math:`({\mathit{nt}}_1 {.} {\mathsf{reinterpret}}{\mathsf{\_}}{{\mathit{nt}}_2})` is valid with type :math:`{\mathit{nt}}_2 \rightarrow {\mathit{nt}}_1` if and only if: -Step_pure/nop -1. Do nothing. -Step_pure/drop -1. Assert: Due to validation, a value is on the top of the stack. -2. Pop the value val from the stack. -3. Do nothing. + * :math:`{|{\mathit{nt}}_1|}` must be equal to :math:`{|{\mathit{nt}}_2|}`. -Step_pure/select -1. Assert: Due to validation, a value of value type I32 is on the top of the stack. -2. Pop the value (I32.CONST c) from the stack. -3. Assert: Due to validation, a value is on the top of the stack. -4. Pop the value val_2 from the stack. -5. Assert: Due to validation, a value is on the top of the stack. -6. Pop the value val_1 from the stack. -7. If (c is not 0), then: - a. Push the value val_1 to the stack. -8. Else: - a. Push the value val_2 to the stack. -Step_pure/if t? instr_1* instr_2* -1. Assert: Due to validation, a value of value type I32 is on the top of the stack. -2. Pop the value (I32.CONST c) from the stack. -3. If (c is not 0), then: - a. Execute the instruction (BLOCK t? instr_1*). -4. Else: - a. Execute the instruction (BLOCK t? instr_2*). +* :math:`(\mathsf{local{.}get}~x)` is valid with type :math:`\epsilon \rightarrow t` if and only if: -Step_pure/label -1. Pop all values val* from the top of the stack. -2. Assert: Due to validation, a label is now on the top of the stack. -3. Pop the current label from the stack. -4. Push the values val* to the stack. -Step_pure/br n_u0 -1. Pop all values val* from the top of the stack. -2. Let L be the current label. -3. Let n be the arity of L. -4. Let instr'* be the continuation of L. -5. Pop the current label from the stack. -6. Let admininstr_u1* be val*. -7. If ((n_u0 is 0) and (|admininstr_u1*| ≥ n)), then: - a. Let val'* ++ val^n be admininstr_u1*. - b. Push the values val^n to the stack. - c. Execute the instruction instr'*. -8. If (n_u0 ≥ 1), then: - a. Let l be (n_u0 - 1). - b. If the type of admininstr_u1 is val*, then: - 1) Let val* be admininstr_u1*. - 2) Push the values val* to the stack. - 3) Execute the instruction (BR l). + * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. -Step_pure/br_if l -1. Assert: Due to validation, a value of value type I32 is on the top of the stack. -2. Pop the value (I32.CONST c) from the stack. -3. If (c is not 0), then: - a. Execute the instruction (BR l). -4. Else: - a. Do nothing. + * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`t`. -Step_pure/br_table l* l' -1. Assert: Due to validation, a value of value type I32 is on the top of the stack. -2. Pop the value (I32.CONST i) from the stack. -3. If (i < |l*|), then: - a. Execute the instruction (BR l*[i]). -4. Else: - a. Execute the instruction (BR l'). -Step_pure/frame -1. Let f be the current frame. -2. Let n be the arity of f. -3. Assert: Due to validation, there are at least n values on the top of the stack. -4. Assert: Due to validation, there are at least n values on the top of the stack. -5. Pop the values val^n from the stack. -6. Assert: Due to validation, a frame is now on the top of the stack. -7. Pop the current frame from the stack. -8. Push the values val^n to the stack. +* :math:`(\mathsf{local{.}set}~x)` is valid with type :math:`t \rightarrow \epsilon` if and only if: -Step_pure/return -1. Pop all values val* from the top of the stack. -2. If a frame is now on the top of the stack, then: - a. Let f be the current frame. - b. Let n be the arity of f. - c. Pop the current frame from the stack. - d. Let val'* ++ val^n be val*. - e. Push the values val^n to the stack. -3. Else if a label is now on the top of the stack, then: - a. Pop the current label from the stack. - b. Push the values val* to the stack. - c. Execute the instruction RETURN. -Step_pure/trap -1. YetI: TODO: It is likely that the value stack of two rules are different. + * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. -Step_pure/unop t unop -1. Assert: Due to validation, a value of value type t is on the top of the stack. -2. Pop the value (t.CONST c_1) from the stack. -3. If (|$unop_(t, unop, c_1)| ≤ 0), then: - a. Trap. -4. Let c be an element of $unop_(t, unop, c_1). -5. Push the value (t.CONST c) to the stack. + * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`t`. -Step_pure/binop t binop -1. Assert: Due to validation, a value of value type t is on the top of the stack. -2. Pop the value (t.CONST c_2) from the stack. -3. Assert: Due to validation, a value of value type t is on the top of the stack. -4. Pop the value (t.CONST c_1) from the stack. -5. If (|$binop_(t, binop, c_1, c_2)| ≤ 0), then: - a. Trap. -6. Let c be an element of $binop_(t, binop, c_1, c_2). -7. Push the value (t.CONST c) to the stack. -Step_pure/testop t testop -1. Assert: Due to validation, a value of value type t is on the top of the stack. -2. Pop the value (t.CONST c_1) from the stack. -3. Let c be $testop_(t, testop, c_1). -4. Push the value (I32.CONST c) to the stack. +* :math:`(\mathsf{local{.}tee}~x)` is valid with type :math:`t \rightarrow t` if and only if: -Step_pure/relop t relop -1. Assert: Due to validation, a value of value type t is on the top of the stack. -2. Pop the value (t.CONST c_2) from the stack. -3. Assert: Due to validation, a value of value type t is on the top of the stack. -4. Pop the value (t.CONST c_1) from the stack. -5. Let c be $relop_(t, relop, c_1, c_2). -6. Push the value (I32.CONST c) to the stack. -Step_pure/cvtop t_2 t_1 cvtop -1. Assert: Due to validation, a value of value type t_1 is on the top of the stack. -2. Pop the value (t_1.CONST c_1) from the stack. -3. If (|$cvtop__(t_1, t_2, cvtop, c_1)| ≤ 0), then: - a. Trap. -4. Let c be an element of $cvtop__(t_1, t_2, cvtop, c_1). -5. Push the value (t_2.CONST c) to the stack. + * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. -Step_pure/local.tee x -1. Assert: Due to validation, a value is on the top of the stack. -2. Pop the value val from the stack. -3. Push the value val to the stack. -4. Push the value val to the stack. -5. Execute the instruction (LOCAL.SET x). + * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`t`. -Step_read/block t? instr* -1. If t? is not defined, then: - a. Let n be 0. -2. Else: - a. Let n be 1. -3. Let L be the label_n{[]}. -4. Enter instr* with label L. -Step_read/loop t? instr* -1. Let L be the label_0{[(LOOP t? instr*)]}. -2. Enter instr* with label L. +* :math:`(\mathsf{global{.}get}~x)` is valid with type :math:`\epsilon \rightarrow t` if and only if: -Step_read/call x -1. Let z be the current state. -2. Assert: Due to validation, (x < |$funcaddr(z)|). -3. Execute the instruction (CALL_ADDR $funcaddr(z)[x]). -Step_read/call_indirect x -1. Let z be the current state. -2. Assert: Due to validation, a value of value type I32 is on the top of the stack. -3. Pop the value (I32.CONST i) from the stack. -4. If (i ≥ |$table(z, 0).REFS|), then: - a. Trap. -5. If $table(z, 0).REFS[i] is not defined, then: - a. Trap. -6. Let ?(a) be $table(z, 0).REFS[i]. -7. If (a ≥ |$funcinst(z)|), then: - a. Trap. -8. If ($type(z, x) is not $funcinst(z)[a].TYPE), then: - a. Trap. -9. Execute the instruction (CALL_ADDR a). + * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. -Step_read/call_addr a -1. Let z be the current state. -2. Assert: Due to validation, (a < |$funcinst(z)|). -3. Let { TYPE: (t_1^k -> t_2^n); MODULE: mm; CODE: func; } be $funcinst(z)[a]. -4. Assert: Due to validation, there are at least k values on the top of the stack. -5. Pop the values val^k from the stack. -6. Assert: Due to validation, func is of the case FUNC. -7. Let (FUNC x local_0 instr*) be func. -8. Assert: Due to validation, local_0 is of the case LOCAL. -9. Let (LOCAL t)* be local_0. -10. Let f be { LOCALS: val^k ++ $default_(t)*; MODULE: mm; }. -11. Let F be the activation of f with arity n. -12. Push F to the stack. -13. Let L be the label_n{[]}. -14. Enter instr* with label L. + * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`({\mathit{mut}}, t)`. -Step_read/local.get x -1. Let z be the current state. -2. Push the value $local(z, x) to the stack. -Step_read/global.get x -1. Let z be the current state. -2. Push the value $global(z, x).VALUE to the stack. +* :math:`(\mathsf{global{.}set}~x)` is valid with type :math:`t \rightarrow \epsilon` if and only if: -Step_read/load valtype_u0 sz_sx_u1? ao -1. Let z be the current state. -2. Assert: Due to validation, a value of value type I32 is on the top of the stack. -3. Pop the value (I32.CONST i) from the stack. -4. If sz_sx_u1? is not defined, then: - a. Let t be valtype_u0. - b. If (((i + ao.OFFSET) + ($size(t) / 8)) > |$mem(z, 0).BYTES|), then: - 1) Trap. - c. Let c be $bytes__1^-1(t, $mem(z, 0).BYTES[(i + ao.OFFSET) : ($size(t) / 8)]). - d. Push the value (t.CONST c) to the stack. -5. If the type of valtype_u0 is Inn, then: - a. If sz_sx_u1? is defined, then: - 1) Let ?(sz_sx_0) be sz_sx_u1?. - 2) Let (n, sx) be sz_sx_0. - 3) If (((i + ao.OFFSET) + (n / 8)) > |$mem(z, 0).BYTES|), then: - a) Trap. - b. Let Inn be valtype_u0. - c. If sz_sx_u1? is defined, then: - 1) Let ?(sz_sx_0) be sz_sx_u1?. - 2) Let (n, sx) be sz_sx_0. - 3) Let c be $ibytes__1^-1(n, $mem(z, 0).BYTES[(i + ao.OFFSET) : (n / 8)]). - 4) Push the value (Inn.CONST $extend__(n, $size(Inn), sx, c)) to the stack. -Step_read/memory.size -1. Let z be the current state. -2. Let ((n · 64) · $Ki()) be |$mem(z, 0).BYTES|. -3. Push the value (I32.CONST n) to the stack. + * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. -Step/ctxt -1. YetI: TODO: It is likely that the value stack of two rules are different. + * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`((\mathsf{mut}~()), t)`. -Step/local.set x -1. Let z be the current state. -2. Assert: Due to validation, a value is on the top of the stack. -3. Pop the value val from the stack. -4. Perform $with_local(z, x, val). -Step/global.set x -1. Let z be the current state. -2. Assert: Due to validation, a value is on the top of the stack. -3. Pop the value val from the stack. -4. Perform $with_global(z, x, val). +* :math:`\mathsf{memory{.}size}` is valid with type :math:`\epsilon \rightarrow \mathsf{i{\scriptstyle 32}}` if and only if: -Step/store valtype_u1 sz_u2? ao -1. Let z be the current state. -2. Assert: Due to validation, a value of value type valtype_u0 is on the top of the stack. -3. Pop the value (valtype_u0.CONST c) from the stack. -4. Assert: Due to validation, a value of value type I32 is on the top of the stack. -5. Pop the value (I32.CONST i) from the stack. -6. If sz_u2? is not defined, then: - a. Let t be valtype_u1. - b. If (valtype_u0 is t), then: - 1) If (((i + ao.OFFSET) + ($size(t) / 8)) > |$mem(z, 0).BYTES|), then: - a) Trap. - 2) Let b* be $bytes_(t, c). - 3) Perform $with_mem(z, 0, (i + ao.OFFSET), ($size(t) / 8), b*). -7. Else: - a. Let ?(n) be sz_u2?. - b. If the type of valtype_u1 is Inn, then: - 1) Let Inn be valtype_u1. - 2) If (valtype_u0 is Inn), then: - a) If (((i + ao.OFFSET) + (n / 8)) > |$mem(z, 0).BYTES|), then: - 1. Trap. - b) Let b* be $ibytes_(n, $wrap__($size(Inn), n, c)). - c) Perform $with_mem(z, 0, (i + ao.OFFSET), (n / 8), b*). -Step/memory.grow -1. Let z be the current state. -2. Assert: Due to validation, a value of value type I32 is on the top of the stack. -3. Pop the value (I32.CONST n) from the stack. -4. Either: - a. Let mi be $growmemory($mem(z, 0), n). - b. Push the value (I32.CONST (|$mem(z, 0).BYTES| / (64 · $Ki()))) to the stack. - c. Perform $with_meminst(z, 0, mi). -5. Or: - a. Push the value (I32.CONST $invsigned_(32, (- 1))) to the stack. + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. -eval_expr instr* -1. Execute the instruction instr*. -2. Pop the value val from the stack. -3. Return [val]. -== Complete. -Generating prose for Wasm 2.0... -watsup 0.4 generator -== Parsing... -== Elaboration... -== IL Validation... -== Running pass sideconditions... -== IL Validation after pass sideconditions... -== Translating to AL... -== Prose Generation... -================= - Generated prose -================= -Limits_ok -- the limits (n, m) is valid with the nat k if and only if: - - n is less than or equal to m. - - m is less than or equal to k. + * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. -Functype_ok -- the function type (t_1* -> t_2*) is valid. -Globaltype_ok -- the global type ((MUT ()?), t) is valid. +* :math:`\mathsf{memory{.}grow}` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow \mathsf{i{\scriptstyle 32}}` if and only if: -Tabletype_ok -- the table type (limits, reftype) is valid if and only if: - - the limits limits is valid with the nat ((2 ^ 32) - 1). -Memtype_ok -- the memory type (PAGE limits) is valid if and only if: - - the limits limits is valid with the nat (2 ^ 16). + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. -Externtype_ok -- the external type externtype_u0 is valid if and only if: - - Either: - - externtype_u0 is (FUNC functype). - - the function type functype is valid. - - Or: - - externtype_u0 is (GLOBAL globaltype). - - the global type globaltype is valid. - - Or: - - externtype_u0 is (TABLE tabletype). - - the table type tabletype is valid. - - Or: - - externtype_u0 is (MEM memtype). - - the memory type memtype is valid. + * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. -Valtype_sub -- the value type valtype_u0 matches the value type t if and only if: - - Either: - - valtype_u0 is t. - - Or: - - valtype_u0 is BOT. -Resulttype_sub -- the value type sequence t_1* matches the value type sequence t_2* if and only if: - - |t_2*| is |t_1*|. - - For all t_1 in t_1* and t_2 in t_2*, - - the value type t_1 matches the value type t_2. +* :math:`({\mathit{nt}}{.}\mathsf{load}~{(n, {\mathit{sx}})^?}~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow {\mathit{nt}}` if and only if: -Limits_sub -- the limits (n_11, n_12) matches the limits (n_21, n_22) if and only if: - - n_11 is greater than or equal to n_21. - - n_12 is less than or equal to n_22. -Functype_sub -- the function type ft matches the function type ft. + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. -Globaltype_sub -- the global type gt matches the global type gt. + * :math:`{n^?}` is :math:`\epsilon` if and only if :math:`{{\mathit{sx}}^?}` is :math:`\epsilon`. -Tabletype_sub -- the table type (lim_1, rt) matches the table type (lim_2, rt) if and only if: - - the limits lim_1 matches the limits lim_2. + * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. -Memtype_sub -- the memory type (PAGE lim_1) matches the memory type (PAGE lim_2) if and only if: - - the limits lim_1 matches the limits lim_2. + * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`{|{\mathit{nt}}|} / 8`. -Externtype_sub -- the external type externtype_u0 matches the external type externtype_u1 if and only if: - - Either: - - externtype_u0 is (FUNC ft_1). - - externtype_u1 is (FUNC ft_2). - - the function type ft_1 matches the function type ft_2. - - Or: - - externtype_u0 is (GLOBAL gt_1). - - externtype_u1 is (GLOBAL gt_2). - - the global type gt_1 matches the global type gt_2. - - Or: - - externtype_u0 is (TABLE tt_1). - - externtype_u1 is (TABLE tt_2). - - the table type tt_1 matches the table type tt_2. - - Or: - - externtype_u0 is (MEM mt_1). - - externtype_u1 is (MEM mt_2). - - the memory type mt_1 matches the memory type mt_2. + * If :math:`n` is defined, -Blocktype_ok -- the block type blocktype_u0 is valid with the function type (valtype_u1* -> valtype_u2*) if and only if: - - Either: - - blocktype_u0 is (_RESULT valtype?). - - valtype_u1* is []. - - valtype_u2* is valtype?. - - Or: - - blocktype_u0 is (_IDX typeidx). - - valtype_u1* is t_1*. - - valtype_u2* is t_2*. - - |C.TYPES| is greater than typeidx. - - C.TYPES[typeidx] is (t_1* -> t_2*). + * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`n / 8`. -Instr_ok/nop -- the instr NOP is valid with the function type ([] -> []). + * :math:`n / 8` must be less than :math:`{|{\mathit{nt}}|} / 8`. -Instr_ok/unreachable -- the instr UNREACHABLE is valid with the function type (t_1* -> t_2*). + * If :math:`n` is defined, -Instr_ok/drop -- the instr DROP is valid with the function type ([t] -> []). + * :math:`{\mathit{nt}}` must be equal to :math:`{\mathsf{i}}{n}`. -Instr_ok/select -- the instr (SELECT ?([t])) is valid with the function type ([t, t, I32] -> [t]). -Instr_ok/block -- the instr (BLOCK bt instr*) is valid with the function type (t_1* -> t_2*) if and only if: - - the block type bt is valid with the function type (t_1* -> t_2*). - - Under the context C with .LABELS prepended by [t_2*], the instr sequence instr* is valid with the function type (t_1* -> t_2*). +* :math:`({\mathit{nt}}{.}\mathsf{store}~{n^?}~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~{\mathit{nt}} \rightarrow \epsilon` if and only if: -Instr_ok/loop -- the instr (LOOP bt instr*) is valid with the function type (t_1* -> t_2*) if and only if: - - the block type bt is valid with the function type (t_1* -> t_2*). - - Under the context C with .LABELS prepended by [t_1*], the instr sequence instr* is valid with the function type (t_1* -> t_2*). -Instr_ok/if -- the instr (IF bt instr_1* instr_2*) is valid with the function type (t_1* ++ [I32] -> t_2*) if and only if: - - the block type bt is valid with the function type (t_1* -> t_2*). - - Under the context C with .LABELS prepended by [t_2*], the instr sequence instr_1* is valid with the function type (t_1* -> t_2*). - - Under the context C with .LABELS prepended by [t_2*], the instr sequence instr_2* is valid with the function type (t_1* -> t_2*). + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. -Instr_ok/br -- the instr (BR l) is valid with the function type (t_1* ++ t* -> t_2*) if and only if: - - |C.LABELS| is greater than l. - - C.LABELS[l] is t*. + * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. -Instr_ok/br_if -- the instr (BR_IF l) is valid with the function type (t* ++ [I32] -> t*) if and only if: - - |C.LABELS| is greater than l. - - C.LABELS[l] is t*. + * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`{|{\mathit{nt}}|} / 8`. -Instr_ok/br_table -- the instr (BR_TABLE l* l') is valid with the function type (t_1* ++ t* -> t_2*) if and only if: - - For all l in l*, - - |C.LABELS| is greater than l. - - |C.LABELS| is greater than l'. - - For all l in l*, - - the value type sequence t* matches the result type C.LABELS[l]. - - the value type sequence t* matches the result type C.LABELS[l']. + * If :math:`n` is defined, -Instr_ok/call -- the instr (CALL x) is valid with the function type (t_1* -> t_2*) if and only if: - - |C.FUNCS| is greater than x. - - C.FUNCS[x] is (t_1* -> t_2*). + * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`n / 8`. -Instr_ok/call_indirect -- the instr (CALL_INDIRECT x y) is valid with the function type (t_1* ++ [I32] -> t_2*) if and only if: - - |C.TABLES| is greater than x. - - |C.TYPES| is greater than y. - - C.TABLES[x] is (lim, FUNCREF). - - C.TYPES[y] is (t_1* -> t_2*). + * :math:`n / 8` must be less than :math:`{|{\mathit{nt}}|} / 8`. -Instr_ok/return -- the instr RETURN is valid with the function type (t_1* ++ t* -> t_2*) if and only if: - - C.RETURN is ?(t*). + * If :math:`n` is defined, -Instr_ok/const -- the instr (nt.CONST c_nt) is valid with the function type ([] -> [nt]). + * :math:`{\mathit{nt}}` must be equal to :math:`{\mathsf{i}}{n}`. -Instr_ok/unop -- the instr (UNOP nt unop_nt) is valid with the function type ([nt] -> [nt]). -Instr_ok/binop -- the instr (BINOP nt binop_nt) is valid with the function type ([nt, nt] -> [nt]). +* :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is valid with type :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast} \rightarrow {{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` if and only if: -Instr_ok/testop -- the instr (TESTOP nt testop_nt) is valid with the function type ([nt] -> [I32]). -Instr_ok/relop -- the instr (RELOP nt relop_nt) is valid with the function type ([nt, nt] -> [I32]). + * Either: -Instr_ok/cvtop -- the instr (CVTOP nt_1 nt_2 REINTERPRET) is valid with the function type ([nt_2] -> [nt_1]) if and only if: - - $size(nt_1) is $size(nt_2). + * :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`\epsilon`. -Instr_ok/ref.null -- the instr (REF.NULL rt) is valid with the function type ([] -> [rt]). + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` must be equal to :math:`\epsilon`. -Instr_ok/ref.func -- the instr (REF.FUNC x) is valid with the function type ([] -> [FUNCREF]) if and only if: - - |C.FUNCS| is greater than x. - - C.FUNCS[x] is ft. + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` must be equal to :math:`\epsilon`. -Instr_ok/ref.is_null -- the instr REF.IS_NULL is valid with the function type ([rt] -> [I32]). + * Or: -Instr_ok/vconst -- the instr (V128.CONST c) is valid with the function type ([] -> [V128]). + * :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`{\mathit{instr}}_1~{{\mathit{instr}}_2^\ast}`. -Instr_ok/vvunop -- the instr (VVUNOP V128 vvunop) is valid with the function type ([V128] -> [V128]). + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` must be equal to :math:`{t_1^\ast}`. -Instr_ok/vvbinop -- the instr (VVBINOP V128 vvbinop) is valid with the function type ([V128, V128] -> [V128]). + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` must be equal to :math:`{t_3^\ast}`. -Instr_ok/vvternop -- the instr (VVTERNOP V128 vvternop) is valid with the function type ([V128, V128, V128] -> [V128]). + * :math:`{\mathit{instr}}_1` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. -Instr_ok/vvtestop -- the instr (VVTESTOP V128 vvtestop) is valid with the function type ([V128] -> [I32]). + * :math:`{\mathit{instr}}_2` is valid with type :math:`{t_2^\ast} \rightarrow {t_3^\ast}`. * Or: -Instr_ok/vunop -- the instr (VUNOP sh vunop_sh) is valid with the function type ([V128] -> [V128]). + * :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`{{\mathit{instr}}^\ast}`. -Instr_ok/vbinop -- the instr (VBINOP sh vbinop_sh) is valid with the function type ([V128, V128] -> [V128]). + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` must be equal to :math:`{t^\ast}~{t_1^\ast}`. -Instr_ok/vtestop -- the instr (VTESTOP sh vtestop_sh) is valid with the function type ([V128] -> [I32]). + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` must be equal to :math:`{t^\ast}~{t_2^\ast}`. -Instr_ok/vrelop -- the instr (VRELOP sh vrelop_sh) is valid with the function type ([V128, V128] -> [V128]). + * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. -Instr_ok/vshiftop -- the instr (VSHIFTOP sh vshiftop_sh) is valid with the function type ([V128, I32] -> [V128]). -Instr_ok/vbitmask -- the instr (VBITMASK sh) is valid with the function type ([V128] -> [I32]). +* :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t^?}` if and only if: -Instr_ok/vswizzle -- the instr (VSWIZZLE sh) is valid with the function type ([V128, V128] -> [V128]). -Instr_ok/vshuffle -- the instr (VSHUFFLE sh i*) is valid with the function type ([V128, V128] -> [V128]) if and only if: - - For all i in i*, - - i is less than (2 · $dim(sh)). + * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`\epsilon \rightarrow {t^?}`. -Instr_ok/vsplat -- the instr (VSPLAT sh) is valid with the function type ([$shunpack(sh)] -> [V128]). -Instr_ok/vextract_lane -- the instr (VEXTRACT_LANE sh sx? i) is valid with the function type ([V128] -> [$shunpack(sh)]) if and only if: - - i is less than $dim(sh). +* :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is const if and only if: -Instr_ok/vreplace_lane -- the instr (VREPLACE_LANE sh i) is valid with the function type ([V128, $shunpack(sh)] -> [V128]) if and only if: - - i is less than $dim(sh). -Instr_ok/vextunop -- the instr (VEXTUNOP sh_1 sh_2 vextunop) is valid with the function type ([V128] -> [V128]). + * Either: -Instr_ok/vextbinop -- the instr (VEXTBINOP sh_1 sh_2 vextbinop) is valid with the function type ([V128, V128] -> [V128]). + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(t{.}\mathsf{const}~c)`. -Instr_ok/vnarrow -- the instr (VNARROW sh_1 sh_2 sx) is valid with the function type ([V128, V128] -> [V128]). + * Or: -Instr_ok/vcvtop -- the instr (VCVTOP sh_1 sh_2 vcvtop hf? zero?) is valid with the function type ([V128] -> [V128]). + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{global{.}get}~x)`. -Instr_ok/local.get -- the instr (LOCAL.GET x) is valid with the function type ([] -> [t]) if and only if: - - |C.LOCALS| is greater than x. - - C.LOCALS[x] is t. + * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. -Instr_ok/local.set -- the instr (LOCAL.SET x) is valid with the function type ([t] -> []) if and only if: - - |C.LOCALS| is greater than x. - - C.LOCALS[x] is t. + * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`((\mathsf{mut}~\epsilon), t)`. -Instr_ok/local.tee -- the instr (LOCAL.TEE x) is valid with the function type ([t] -> [t]) if and only if: - - |C.LOCALS| is greater than x. - - C.LOCALS[x] is t. -Instr_ok/global.get -- the instr (GLOBAL.GET x) is valid with the function type ([] -> [t]) if and only if: - - |C.GLOBALS| is greater than x. - - C.GLOBALS[x] is (mut, t). +* :math:`{{\mathit{instr}}^\ast}` is const if and only if: -Instr_ok/global.set -- the instr (GLOBAL.SET x) is valid with the function type ([t] -> []) if and only if: - - |C.GLOBALS| is greater than x. - - C.GLOBALS[x] is ((MUT ?(())), t). -Instr_ok/table.get -- the instr (TABLE.GET x) is valid with the function type ([I32] -> [rt]) if and only if: - - |C.TABLES| is greater than x. - - C.TABLES[x] is (lim, rt). + * For all :math:`{\mathit{instr}}` in :math:`{{\mathit{instr}}^\ast}`, -Instr_ok/table.set -- the instr (TABLE.SET x) is valid with the function type ([I32, rt] -> []) if and only if: - - |C.TABLES| is greater than x. - - C.TABLES[x] is (lim, rt). + * :math:`{\mathit{instr}}` is const. -Instr_ok/table.size -- the instr (TABLE.SIZE x) is valid with the function type ([] -> [I32]) if and only if: - - |C.TABLES| is greater than x. - - C.TABLES[x] is (lim, rt). -Instr_ok/table.grow -- the instr (TABLE.GROW x) is valid with the function type ([rt, I32] -> [I32]) if and only if: - - |C.TABLES| is greater than x. - - C.TABLES[x] is (lim, rt). +* :math:`(\mathsf{type}~{\mathit{ft}})` is valid with type :math:`{\mathit{ft}}` if and only if: -Instr_ok/table.fill -- the instr (TABLE.FILL x) is valid with the function type ([I32, rt, I32] -> []) if and only if: - - |C.TABLES| is greater than x. - - C.TABLES[x] is (lim, rt). -Instr_ok/table.copy -- the instr (TABLE.COPY x_1 x_2) is valid with the function type ([I32, I32, I32] -> []) if and only if: - - |C.TABLES| is greater than x_1. - - |C.TABLES| is greater than x_2. - - C.TABLES[x_1] is (lim_1, rt). - - C.TABLES[x_2] is (lim_2, rt). + * :math:`{\mathit{ft}}` is valid. -Instr_ok/table.init -- the instr (TABLE.INIT x_1 x_2) is valid with the function type ([I32, I32, I32] -> []) if and only if: - - |C.TABLES| is greater than x_1. - - |C.ELEMS| is greater than x_2. - - C.TABLES[x_1] is (lim, rt). - - C.ELEMS[x_2] is rt. -Instr_ok/elem.drop -- the instr (ELEM.DROP x) is valid with the function type ([] -> []) if and only if: - - |C.ELEMS| is greater than x. - - C.ELEMS[x] is rt. +* :math:`(\mathsf{func}~x~{(\mathsf{local}~t)^\ast}~{\mathit{expr}})` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^?}` if and only if: -Instr_ok/memory.size -- the instr MEMORY.SIZE is valid with the function type ([] -> [I32]) if and only if: - - |C.MEMS| is greater than 0. - - C.MEMS[0] is mt. -Instr_ok/memory.grow -- the instr MEMORY.GROW is valid with the function type ([I32] -> [I32]) if and only if: - - |C.MEMS| is greater than 0. - - C.MEMS[0] is mt. + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. -Instr_ok/memory.fill -- the instr MEMORY.FILL is valid with the function type ([I32, I32, I32] -> []) if and only if: - - |C.MEMS| is greater than 0. - - C.MEMS[0] is mt. + * :math:`C{.}\mathsf{types}{}[x]` must be equal to :math:`{t_1^\ast} \rightarrow {t_2^?}`. -Instr_ok/memory.copy -- the instr MEMORY.COPY is valid with the function type ([I32, I32, I32] -> []) if and only if: - - |C.MEMS| is greater than 0. - - C.MEMS[0] is mt. + * Under the context :math:`C{}[{.}\mathsf{locals} \mathrel{{=}{\oplus}} {t_1^\ast}~{t^\ast}]{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^?}]{}[{.}\mathsf{return} \mathrel{{=}{\oplus}} {t_2^?}]`, :math:`{\mathit{expr}}` is valid with type :math:`{t_2^?}`. -Instr_ok/memory.init -- the instr (MEMORY.INIT x) is valid with the function type ([I32, I32, I32] -> []) if and only if: - - |C.MEMS| is greater than 0. - - |C.DATAS| is greater than x. - - C.MEMS[0] is mt. - - C.DATAS[x] is OK. -Instr_ok/data.drop -- the instr (DATA.DROP x) is valid with the function type ([] -> []) if and only if: - - |C.DATAS| is greater than x. - - C.DATAS[x] is OK. +* :math:`(\mathsf{global}~{\mathit{gt}}~{\mathit{expr}})` is valid with type :math:`{\mathit{gt}}` if and only if: -Instr_ok/load -- the instr (LOAD nt (n, sx)? memarg) is valid with the function type ([I32] -> [nt]) if and only if: - - |C.MEMS| is greater than 0. - - ((sx? is ?())) if and only if ((n? is ?())). - - C.MEMS[0] is mt. - - (2 ^ memarg.ALIGN) is less than or equal to ($size(nt) / 8). - - If n is defined, - - (2 ^ memarg.ALIGN) is less than or equal to (n / 8). - - (n / 8) is less than ($size(nt) / 8). - - If n is defined, - - nt is Inn. -Instr_ok/store -- the instr (STORE nt n? memarg) is valid with the function type ([I32, nt] -> []) if and only if: - - |C.MEMS| is greater than 0. - - C.MEMS[0] is mt. - - (2 ^ memarg.ALIGN) is less than or equal to ($size(nt) / 8). - - If n is defined, - - (2 ^ memarg.ALIGN) is less than or equal to (n / 8). - - (n / 8) is less than ($size(nt) / 8). - - If n is defined, - - nt is Inn. + * :math:`{\mathit{gt}}` is valid. -Instr_ok/vload -- the instr (VLOAD V128 ?((SHAPE M N sx)) memarg) is valid with the function type ([I32] -> [V128]) if and only if: - - |C.MEMS| is greater than 0. - - C.MEMS[0] is mt. - - (2 ^ memarg.ALIGN) is less than or equal to ((M / 8) · N). + * :math:`{\mathit{gt}}` must be equal to :math:`({\mathit{mut}}, t)`. -Instr_ok/vload_lane -- the instr (VLOAD_LANE V128 n memarg laneidx) is valid with the function type ([I32, V128] -> [V128]) if and only if: - - |C.MEMS| is greater than 0. - - C.MEMS[0] is mt. - - (2 ^ memarg.ALIGN) is less than or equal to (n / 8). - - laneidx is less than (128 / n). + * :math:`{\mathit{expr}}` is valid with type :math:`t`. -Instr_ok/vstore -- the instr (VSTORE V128 memarg) is valid with the function type ([I32, V128] -> []) if and only if: - - |C.MEMS| is greater than 0. - - C.MEMS[0] is mt. - - (2 ^ memarg.ALIGN) is less than or equal to ($size(V128) / 8). + * :math:`{\mathit{expr}}` is const. -Instr_ok/vstore_lane -- the instr (VSTORE_LANE V128 n memarg laneidx) is valid with the function type ([I32, V128] -> []) if and only if: - - |C.MEMS| is greater than 0. - - C.MEMS[0] is mt. - - (2 ^ memarg.ALIGN) is less than or equal to (n / 8). - - laneidx is less than (128 / n). -Instrs_ok -- the instr sequence instr_u0* is valid with the function type (valtype_u1* -> valtype_u2*) if and only if: - - Either: - - instr_u0* is []. - - valtype_u1* is []. - - valtype_u2* is []. - - Or: - - instr_u0* is [instr_1] ++ instr_2*. - - valtype_u1* is t_1*. - - valtype_u2* is t_3*. - - the instr instr_1 is valid with the function type (t_1* -> t_2*). - - the instr sequence [instr_2] is valid with the function type (t_2* -> t_3*). - - Or: - - instr_u0* is instr*. - - valtype_u1* is t'_1*. - - valtype_u2* is t'_2*. - - the instr sequence instr* is valid with the function type (t_1* -> t_2*). - - the value type sequence t'_1* matches the value type sequence t_1*. - - the value type sequence t_2* matches the value type sequence t'_2*. - - Or: - - instr_u0* is instr*. - - valtype_u1* is t* ++ t_1*. - - valtype_u2* is t* ++ t_2*. - - the instr sequence instr* is valid with the function type (t_1* -> t_2*). +* :math:`(\mathsf{table}~{\mathit{tt}})` is valid with type :math:`{\mathit{tt}}` if and only if: -Expr_ok -- the expression instr* is valid with the value type sequence t* if and only if: - - the instr sequence instr* is valid with the function type ([] -> t*). -Instr_const -- the instr instr_u0 is constant if and only if: - - Either: - - instr_u0 is (nt.CONST c). - - Or: - - instr_u0 is (vt.CONST vc). - - Or: - - instr_u0 is (REF.NULL rt). - - Or: - - instr_u0 is (REF.FUNC x). - - Or: - - instr_u0 is (GLOBAL.GET x). - - |C.GLOBALS| is greater than x. - - C.GLOBALS[x] is ((MUT ?()), t). + * :math:`{\mathit{tt}}` is valid. -Expr_const -- the expression instr* is constant if and only if: - - For all instr in instr*, - - the instr instr is constant. -Type_ok -- the type (TYPE ft) is valid with the function type ft if and only if: - - the function type ft is valid. +* :math:`(\mathsf{memory}~{\mathit{mt}})` is valid with type :math:`{\mathit{mt}}` if and only if: -Func_ok -- the function (FUNC x (LOCAL t)* expr) is valid with the function type (t_1* -> t_2*) if and only if: - - |C.TYPES| is greater than x. - - C.TYPES[x] is (t_1* -> t_2*). - - Under the context C with .LOCALS appended by t_1* ++ t* with .LABELS appended by [t_2*] with .RETURN appended by ?(t_2*), the expression expr is valid with the value type sequence t_2*. -Global_ok -- the global (GLOBAL gt expr) is valid with the global type gt if and only if: - - the global type gt is valid. - - gt is (mut, t). - - the expression expr is valid with the value type t. - - the expression expr is constant. + * :math:`{\mathit{mt}}` is valid. -Table_ok -- the table (TABLE tt) is valid with the table type tt if and only if: - - the table type tt is valid. -Mem_ok -- the memory (MEMORY mt) is valid with the memory type mt if and only if: - - the memory type mt is valid. +* :math:`(\mathsf{elem}~{\mathit{expr}}~{x^\ast})` is valid if and only if: -Elemmode_ok -- the elemmode elemmode_u0 is valid with the reference type rt if and only if: - - Either: - - elemmode_u0 is (ACTIVE x expr). - - |C.TABLES| is greater than x. - - C.TABLES[x] is (lim, rt). - - the expression expr is valid with the value type I32. - - the expression expr is constant. - - Or: - - elemmode_u0 is PASSIVE. - - Or: - - elemmode_u0 is DECLARE. -Elem_ok -- the table segment (ELEM rt expr* elemmode) is valid with the reference type rt if and only if: - - For all expr in expr*, - - the expression expr is valid with the value type rt. - - the expression expr is constant. - - the elemmode elemmode is valid with the reference type rt. + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`0`. -Datamode_ok -- the datamode datamode_u0 is valid if and only if: - - Either: - - datamode_u0 is (ACTIVE 0 expr). - - |C.MEMS| is greater than 0. - - C.MEMS[0] is mt. - - the expression expr is valid with the value type I32. - - the expression expr is constant. - - Or: - - datamode_u0 is PASSIVE. + * :math:`{|{x^\ast}|}` must be equal to :math:`{|{{\mathit{ft}}^\ast}|}`. -Data_ok -- the memory segment (DATA b* datamode) is valid if and only if: - - the datamode datamode is valid. + * For all :math:`x` in :math:`{x^\ast}`, -Start_ok -- the start function (START x) is valid if and only if: - - |C.FUNCS| is greater than x. - - C.FUNCS[x] is ([] -> []). + * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. -Import_ok -- the import (IMPORT name_1 name_2 xt) is valid with the external type xt if and only if: - - the external type xt is valid. + * :math:`C{.}\mathsf{tables}{}[0]` must be equal to :math:`{\mathit{lim}}`. -Externidx_ok -- the external index externidx_u0 is valid with the external type externtype_u1 if and only if: - - Either: - - externidx_u0 is (FUNC x). - - externtype_u1 is (FUNC ft). - - |C.FUNCS| is greater than x. - - C.FUNCS[x] is ft. - - Or: - - externidx_u0 is (GLOBAL x). - - externtype_u1 is (GLOBAL gt). - - |C.GLOBALS| is greater than x. - - C.GLOBALS[x] is gt. - - Or: - - externidx_u0 is (TABLE x). - - externtype_u1 is (TABLE tt). - - |C.TABLES| is greater than x. - - C.TABLES[x] is tt. - - Or: - - externidx_u0 is (MEM x). - - externtype_u1 is (MEM mt). - - |C.MEMS| is greater than x. - - C.MEMS[x] is mt. + * :math:`{\mathit{expr}}` is valid with type :math:`\mathsf{i{\scriptstyle 32}}`. -Export_ok -- the export (EXPORT name externidx) is valid with the external type xt if and only if: - - the external index externidx is valid with the external type xt. + * :math:`{\mathit{expr}}` is const. -Module_ok -- the module (MODULE type* import* func* global* table* mem* elem* data^n start? export*) is valid if and only if: - - |type*| is |ft'*|. - - |ixt*| is |import*|. - - |gt*| is |global*|. - - |tt*| is |table*|. - - |mt*| is |mem*|. - - |rt*| is |elem*|. - - |func*| is |ft*|. - - |xt*| is |export*|. - - For all ft' in ft'* and type in type*, - - the type type is valid with the function type ft'. - - For all import in import* and ixt in ixt*, - - Under the context { TYPES: ft'*; FUNCS: []; GLOBALS: []; TABLES: []; MEMS: []; ELEMS: []; DATAS: []; LOCALS: []; LABELS: []; RETURN: ?(); }, the import import is valid with the external type ixt. - - For all global in global* and gt in gt*, - - Under the context C', the global global is valid with the global type gt. - - For all table in table* and tt in tt*, - - Under the context C', the table table is valid with the table type tt. - - For all mem in mem* and mt in mt*, - - Under the context C', the memory mem is valid with the memory type mt. - - For all elem in elem* and rt in rt*, - - Under the context C', the table segment elem is valid with the reference type rt. - - For all data in data*, - - Under the context C', the memory segment data is valid. - - For all ft in ft* and func in func*, - - the function func is valid with the function type ft. - - If start is defined, - - the start function start is valid. - - For all export in export* and xt in xt*, - - the export export is valid with the external type xt. - - |mt*| is less than or equal to 1. - - C is { TYPES: ft'*; FUNCS: ift* ++ ft*; GLOBALS: igt* ++ gt*; TABLES: itt* ++ tt*; MEMS: imt* ++ mt*; ELEMS: rt*; DATAS: OK^n; LOCALS: []; LABELS: []; RETURN: ?(); }. - - C' is { TYPES: ft'*; FUNCS: ift* ++ ft*; GLOBALS: igt*; TABLES: itt* ++ tt*; MEMS: imt* ++ mt*; ELEMS: []; DATAS: []; LOCALS: []; LABELS: []; RETURN: ?(); }. - - ift* is $funcsxt(ixt*). - - igt* is $globalsxt(ixt*). - - itt* is $tablesxt(ixt*). - - imt* is $memsxt(ixt*). + * For all :math:`{\mathit{ft}}` in :math:`{{\mathit{ft}}^\ast}` and :math:`x` in :math:`{x^\ast}`, -Ki -1. Return 1024. + * :math:`C{.}\mathsf{funcs}{}[x]` must be equal to :math:`{\mathit{ft}}`. -min n_u0 n_u1 -1. If (n_u0 is 0), then: - a. Return 0. -2. If (n_u1 is 0), then: - a. Return 0. -3. Assert: Due to validation, (n_u0 ≥ 1). -4. Let i be (n_u0 - 1). -5. Assert: Due to validation, (n_u1 ≥ 1). -6. Let j be (n_u1 - 1). -7. Return $min(i, j). -sum n_u0* -1. If (n_u0* is []), then: - a. Return 0. -2. Let [n] ++ n'* be n_u0*. -3. Return (n + $sum(n'*)). +* :math:`(\mathsf{data}~{\mathit{expr}}~{b^\ast})` is valid if and only if: -opt_ X X_u0* -1. If (X_u0* is []), then: - a. Return ?(). -2. Assert: Due to validation, (|X_u0*| is 1). -3. Let [w] be X_u0*. -4. Return ?(w). -list_ X X_u0? -1. If X_u0? is not defined, then: - a. Return []. -2. Let ?(w) be X_u0?. -3. Return [w]. + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. -concat_ X X_u0* -1. If (X_u0* is []), then: - a. Return []. -2. Let [w*] ++ w'** be X_u0*. -3. Return w* ++ $concat_(X, w'**). + * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{lim}}`. -setproduct2_ X w_1 X_u0* -1. If (X_u0* is []), then: - a. Return []. -2. Let [w'*] ++ w** be X_u0*. -3. Return [[w_1] ++ w'*] ++ $setproduct2_(X, w_1, w**). + * :math:`{\mathit{expr}}` is valid with type :math:`\mathsf{i{\scriptstyle 32}}`. -setproduct1_ X X_u0* w** -1. If (X_u0* is []), then: - a. Return []. -2. Let [w_1] ++ w'* be X_u0*. -3. Return $setproduct2_(X, w_1, w**) ++ $setproduct1_(X, w'*, w**). + * :math:`{\mathit{expr}}` is const. -setproduct_ X X_u0* -1. If (X_u0* is []), then: - a. Return [[]]. -2. Let [w_1*] ++ w** be X_u0*. -3. Return $setproduct1_(X, w_1*, $setproduct_(X, w**)). -signif N_u0 -1. If (N_u0 is 32), then: - a. Return 23. -2. Assert: Due to validation, (N_u0 is 64). -3. Return 52. +* :math:`(\mathsf{start}~x)` is valid if and only if: -expon N_u0 -1. If (N_u0 is 32), then: - a. Return 8. -2. Assert: Due to validation, (N_u0 is 64). -3. Return 11. -M N -1. Return $signif(N). + * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. -E N -1. Return $expon(N). + * :math:`C{.}\mathsf{funcs}{}[x]` must be equal to :math:`\epsilon \rightarrow \epsilon`. -fzero N -1. Return (POS (SUBNORM 0)). -fone N -1. Return (POS (NORM 1 0)). +* :math:`(\mathsf{import}~{\mathit{name}}_1~{\mathit{name}}_2~{\mathit{xt}})` is valid with type :math:`{\mathit{xt}}` if and only if: -canon_ N -1. Return (2 ^ ($signif(N) - 1)). -size valtype_u0 -1. If (valtype_u0 is I32), then: - a. Return 32. -2. If (valtype_u0 is I64), then: - a. Return 64. -3. If (valtype_u0 is F32), then: - a. Return 32. -4. If (valtype_u0 is F64), then: - a. Return 64. -5. If (valtype_u0 is V128), then: - a. Return 128. + * :math:`{\mathit{xt}}` is valid. -isize Inn -1. Return $size(Inn). -psize packtype_u0 -1. If (packtype_u0 is I8), then: - a. Return 8. -2. Assert: Due to validation, (packtype_u0 is I16). -3. Return 16. +* :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid with type :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` if and only if: -lsize lanetype_u0 -1. If the type of lanetype_u0 is numtype, then: - a. Let numtype be lanetype_u0. - b. Return $size(numtype). -2. Assert: Due to validation, the type of lanetype_u0 is packtype. -3. Let packtype be lanetype_u0. -4. Return $psize(packtype). -lanetype (Lnn X N) -1. Return Lnn. + * Either: -sizenn nt -1. Return $size(nt). + * :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{func}~x)`. -sizenn1 nt -1. Return $size(nt). + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{func}~{\mathit{ft}})`. -sizenn2 nt -1. Return $size(nt). + * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. -lsizenn lt -1. Return $lsize(lt). + * :math:`C{.}\mathsf{funcs}{}[x]` must be equal to :math:`{\mathit{ft}}`. -lsizenn1 lt -1. Return $lsize(lt). + * Or: -lsizenn2 lt -1. Return $lsize(lt). + * :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{global}~x)`. -zero numtype_u0 -1. If the type of numtype_u0 is Inn, then: - a. Return 0. -2. Assert: Due to validation, the type of numtype_u0 is Fnn. -3. Let Fnn be numtype_u0. -4. Return $fzero($size(Fnn)). + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{global}~{\mathit{gt}})`. -dim (Lnn X N) -1. Return N. + * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. -shsize (Lnn X N) -1. Return ($lsize(Lnn) · N). + * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`{\mathit{gt}}`. * Or: -concat_bytes byte_u0* -1. If (byte_u0* is []), then: - a. Return []. -2. Let [b*] ++ b'** be byte_u0*. -3. Return b* ++ $concat_bytes(b'**). + * :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{table}~x)`. -unpack lanetype_u0 -1. If the type of lanetype_u0 is numtype, then: - a. Let numtype be lanetype_u0. - b. Return numtype. -2. Assert: Due to validation, the type of lanetype_u0 is packtype. -3. Return I32. + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{table}~{\mathit{tt}})`. -shunpack (Lnn X N) -1. Return $unpack(Lnn). + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. -funcsxt externtype_u0* -1. If (externtype_u0* is []), then: - a. Return []. -2. Let [externtype_0] ++ xt* be externtype_u0*. -3. If externtype_0 is of the case FUNC, then: - a. Let (FUNC ft) be externtype_0. - b. Return [ft] ++ $funcsxt(xt*). -4. Let [externtype] ++ xt* be externtype_u0*. -5. Return $funcsxt(xt*). + * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`{\mathit{tt}}`. * Or: -globalsxt externtype_u0* -1. If (externtype_u0* is []), then: - a. Return []. -2. Let [externtype_0] ++ xt* be externtype_u0*. -3. If externtype_0 is of the case GLOBAL, then: - a. Let (GLOBAL gt) be externtype_0. - b. Return [gt] ++ $globalsxt(xt*). -4. Let [externtype] ++ xt* be externtype_u0*. -5. Return $globalsxt(xt*). + * :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{mem}~x)`. -tablesxt externtype_u0* -1. If (externtype_u0* is []), then: - a. Return []. -2. Let [externtype_0] ++ xt* be externtype_u0*. -3. If externtype_0 is of the case TABLE, then: - a. Let (TABLE tt) be externtype_0. - b. Return [tt] ++ $tablesxt(xt*). -4. Let [externtype] ++ xt* be externtype_u0*. -5. Return $tablesxt(xt*). + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{mem}~{\mathit{mt}})`. -memsxt externtype_u0* -1. If (externtype_u0* is []), then: - a. Return []. -2. Let [externtype_0] ++ xt* be externtype_u0*. -3. If externtype_0 is of the case MEM, then: - a. Let (MEM mt) be externtype_0. - b. Return [mt] ++ $memsxt(xt*). -4. Let [externtype] ++ xt* be externtype_u0*. -5. Return $memsxt(xt*). + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. -dataidx_instr instr_u0 -1. If instr_u0 is of the case MEMORY.INIT, then: - a. Let (MEMORY.INIT x) be instr_u0. - b. Return [x]. -2. If instr_u0 is of the case DATA.DROP, then: - a. Let (DATA.DROP x) be instr_u0. - b. Return [x]. -3. Return []. + * :math:`C{.}\mathsf{mems}{}[x]` must be equal to :math:`{\mathit{mt}}`. -dataidx_instrs instr_u0* -1. If (instr_u0* is []), then: - a. Return []. -2. Let [instr] ++ instr'* be instr_u0*. -3. Return $dataidx_instr(instr) ++ $dataidx_instrs(instr'*). -dataidx_expr in* -1. Return $dataidx_instrs(in*). +* :math:`(\mathsf{export}~{\mathit{name}}~{\mathit{externidx}})` is valid with type :math:`{\mathit{xt}}` if and only if: -dataidx_func (FUNC x loc* e) -1. Return $dataidx_expr(e). -dataidx_funcs func_u0* -1. If (func_u0* is []), then: - a. Return []. -2. Let [func] ++ func'* be func_u0*. -3. Return $dataidx_func(func) ++ $dataidx_funcs(func'*). + * :math:`{\mathit{externidx}}` is valid with type :math:`{\mathit{xt}}`. -memarg0 -1. Return { ALIGN: 0; OFFSET: 0; }. -signed_ N i -1. If (0 ≤ (2 ^ (N - 1))), then: - a. Return i. -2. Assert: Due to validation, ((2 ^ (N - 1)) ≤ i). -3. Assert: Due to validation, (i < (2 ^ N)). -4. Return (i - (2 ^ N)). +* :math:`(\mathsf{module}~{{\mathit{type}}^\ast}~{{\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})` is valid if and only if: -invsigned_ N i -1. Let j be $signed__1^-1(N, i). -2. Return j. -unop_ numtype_u1 unop__u0 num__u3 -1. If ((unop__u0 is CLZ) and the type of numtype_u1 is Inn), then: - a. Let Inn be numtype_u1. - b. Let iN be num__u3. - c. Return [$iclz_($sizenn(Inn), iN)]. -2. If ((unop__u0 is CTZ) and the type of numtype_u1 is Inn), then: - a. Let Inn be numtype_u1. - b. Let iN be num__u3. - c. Return [$ictz_($sizenn(Inn), iN)]. -3. If ((unop__u0 is POPCNT) and the type of numtype_u1 is Inn), then: - a. Let Inn be numtype_u1. - b. Let iN be num__u3. - c. Return [$ipopcnt_($sizenn(Inn), iN)]. -4. If the type of numtype_u1 is Inn, then: - a. Let Inn be numtype_u1. - b. Assert: Due to validation, unop__u0 is of the case EXTEND. - c. Let (EXTEND M) be unop__u0. - d. Let iN be num__u3. - e. Return [$extend__(M, $sizenn(Inn), S, $wrap__($sizenn(Inn), M, iN))]. -5. If ((unop__u0 is ABS) and the type of numtype_u1 is Fnn), then: - a. Let Fnn be numtype_u1. - b. Let fN be num__u3. - c. Return $fabs_($sizenn(Fnn), fN). -6. If ((unop__u0 is NEG) and the type of numtype_u1 is Fnn), then: - a. Let Fnn be numtype_u1. - b. Let fN be num__u3. - c. Return $fneg_($sizenn(Fnn), fN). -7. If ((unop__u0 is SQRT) and the type of numtype_u1 is Fnn), then: - a. Let Fnn be numtype_u1. - b. Let fN be num__u3. - c. Return $fsqrt_($sizenn(Fnn), fN). -8. If ((unop__u0 is CEIL) and the type of numtype_u1 is Fnn), then: - a. Let Fnn be numtype_u1. - b. Let fN be num__u3. - c. Return $fceil_($sizenn(Fnn), fN). -9. If ((unop__u0 is FLOOR) and the type of numtype_u1 is Fnn), then: - a. Let Fnn be numtype_u1. - b. Let fN be num__u3. - c. Return $ffloor_($sizenn(Fnn), fN). -10. If ((unop__u0 is TRUNC) and the type of numtype_u1 is Fnn), then: - a. Let Fnn be numtype_u1. - b. Let fN be num__u3. - c. Return $ftrunc_($sizenn(Fnn), fN). -11. Assert: Due to validation, (unop__u0 is NEAREST). -12. Assert: Due to validation, the type of numtype_u1 is Fnn. -13. Let Fnn be numtype_u1. -14. Let fN be num__u3. -15. Return $fnearest_($sizenn(Fnn), fN). + * :math:`{|{{\mathit{type}}^\ast}|}` must be equal to :math:`{|{{\mathit{ft}'}^\ast}|}`. -binop_ numtype_u1 binop__u0 num__u3 num__u5 -1. If ((binop__u0 is ADD) and the type of numtype_u1 is Inn), then: - a. Let Inn be numtype_u1. - b. Let iN_1 be num__u3. - c. Let iN_2 be num__u5. - d. Return [$iadd_($sizenn(Inn), iN_1, iN_2)]. -2. If ((binop__u0 is SUB) and the type of numtype_u1 is Inn), then: - a. Let Inn be numtype_u1. - b. Let iN_1 be num__u3. - c. Let iN_2 be num__u5. - d. Return [$isub_($sizenn(Inn), iN_1, iN_2)]. -3. If ((binop__u0 is MUL) and the type of numtype_u1 is Inn), then: - a. Let Inn be numtype_u1. - b. Let iN_1 be num__u3. - c. Let iN_2 be num__u5. - d. Return [$imul_($sizenn(Inn), iN_1, iN_2)]. -4. If the type of numtype_u1 is Inn, then: - a. Let Inn be numtype_u1. - b. Let iN_1 be num__u3. - c. Let iN_2 be num__u5. - d. If binop__u0 is of the case DIV, then: - 1) Let (DIV sx) be binop__u0. - 2) Return $list_(num_((Inn : Inn <: numtype)), $idiv_($sizenn(Inn), sx, iN_1, iN_2)). - e. If binop__u0 is of the case REM, then: - 1) Let (REM sx) be binop__u0. - 2) Return $list_(num_((Inn : Inn <: numtype)), $irem_($sizenn(Inn), sx, iN_1, iN_2)). -5. If ((binop__u0 is AND) and the type of numtype_u1 is Inn), then: - a. Let Inn be numtype_u1. - b. Let iN_1 be num__u3. - c. Let iN_2 be num__u5. - d. Return [$iand_($sizenn(Inn), iN_1, iN_2)]. -6. If ((binop__u0 is OR) and the type of numtype_u1 is Inn), then: - a. Let Inn be numtype_u1. - b. Let iN_1 be num__u3. - c. Let iN_2 be num__u5. - d. Return [$ior_($sizenn(Inn), iN_1, iN_2)]. -7. If ((binop__u0 is XOR) and the type of numtype_u1 is Inn), then: - a. Let Inn be numtype_u1. - b. Let iN_1 be num__u3. - c. Let iN_2 be num__u5. - d. Return [$ixor_($sizenn(Inn), iN_1, iN_2)]. -8. If ((binop__u0 is SHL) and the type of numtype_u1 is Inn), then: - a. Let Inn be numtype_u1. - b. Let iN_1 be num__u3. - c. Let iN_2 be num__u5. - d. Return [$ishl_($sizenn(Inn), iN_1, iN_2)]. -9. If the type of numtype_u1 is Inn, then: - a. Let Inn be numtype_u1. - b. Let iN_1 be num__u3. - c. Let iN_2 be num__u5. - d. If binop__u0 is of the case SHR, then: - 1) Let (SHR sx) be binop__u0. - 2) Return [$ishr_($sizenn(Inn), sx, iN_1, iN_2)]. -10. If ((binop__u0 is ROTL) and the type of numtype_u1 is Inn), then: - a. Let Inn be numtype_u1. - b. Let iN_1 be num__u3. - c. Let iN_2 be num__u5. - d. Return [$irotl_($sizenn(Inn), iN_1, iN_2)]. -11. If ((binop__u0 is ROTR) and the type of numtype_u1 is Inn), then: - a. Let Inn be numtype_u1. - b. Let iN_1 be num__u3. - c. Let iN_2 be num__u5. - d. Return [$irotr_($sizenn(Inn), iN_1, iN_2)]. -12. If ((binop__u0 is ADD) and the type of numtype_u1 is Fnn), then: - a. Let Fnn be numtype_u1. - b. Let fN_1 be num__u3. - c. Let fN_2 be num__u5. - d. Return $fadd_($sizenn(Fnn), fN_1, fN_2). -13. If ((binop__u0 is SUB) and the type of numtype_u1 is Fnn), then: - a. Let Fnn be numtype_u1. - b. Let fN_1 be num__u3. - c. Let fN_2 be num__u5. - d. Return $fsub_($sizenn(Fnn), fN_1, fN_2). -14. If ((binop__u0 is MUL) and the type of numtype_u1 is Fnn), then: - a. Let Fnn be numtype_u1. - b. Let fN_1 be num__u3. - c. Let fN_2 be num__u5. - d. Return $fmul_($sizenn(Fnn), fN_1, fN_2). -15. If ((binop__u0 is DIV) and the type of numtype_u1 is Fnn), then: - a. Let Fnn be numtype_u1. - b. Let fN_1 be num__u3. - c. Let fN_2 be num__u5. - d. Return $fdiv_($sizenn(Fnn), fN_1, fN_2). -16. If ((binop__u0 is MIN) and the type of numtype_u1 is Fnn), then: - a. Let Fnn be numtype_u1. - b. Let fN_1 be num__u3. - c. Let fN_2 be num__u5. - d. Return $fmin_($sizenn(Fnn), fN_1, fN_2). -17. If ((binop__u0 is MAX) and the type of numtype_u1 is Fnn), then: - a. Let Fnn be numtype_u1. - b. Let fN_1 be num__u3. - c. Let fN_2 be num__u5. - d. Return $fmax_($sizenn(Fnn), fN_1, fN_2). -18. Assert: Due to validation, (binop__u0 is COPYSIGN). -19. Assert: Due to validation, the type of numtype_u1 is Fnn. -20. Let Fnn be numtype_u1. -21. Let fN_1 be num__u3. -22. Let fN_2 be num__u5. -23. Return $fcopysign_($sizenn(Fnn), fN_1, fN_2). + * :math:`{|{{\mathit{ixt}}^\ast}|}` must be equal to :math:`{|{{\mathit{import}}^\ast}|}`. -testop_ Inn EQZ iN -1. Return $ieqz_($sizenn(Inn), iN). + * :math:`{|{{\mathit{gt}}^\ast}|}` must be equal to :math:`{|{{\mathit{global}}^\ast}|}`. -relop_ numtype_u1 relop__u0 num__u3 num__u5 -1. If ((relop__u0 is EQ) and the type of numtype_u1 is Inn), then: - a. Let Inn be numtype_u1. - b. Let iN_1 be num__u3. - c. Let iN_2 be num__u5. - d. Return $ieq_($sizenn(Inn), iN_1, iN_2). -2. If ((relop__u0 is NE) and the type of numtype_u1 is Inn), then: - a. Let Inn be numtype_u1. - b. Let iN_1 be num__u3. - c. Let iN_2 be num__u5. - d. Return $ine_($sizenn(Inn), iN_1, iN_2). -3. If the type of numtype_u1 is Inn, then: - a. Let Inn be numtype_u1. - b. Let iN_1 be num__u3. - c. Let iN_2 be num__u5. - d. If relop__u0 is of the case LT, then: - 1) Let (LT sx) be relop__u0. - 2) Return $ilt_($sizenn(Inn), sx, iN_1, iN_2). - e. If relop__u0 is of the case GT, then: - 1) Let (GT sx) be relop__u0. - 2) Return $igt_($sizenn(Inn), sx, iN_1, iN_2). - f. If relop__u0 is of the case LE, then: - 1) Let (LE sx) be relop__u0. - 2) Return $ile_($sizenn(Inn), sx, iN_1, iN_2). - g. If relop__u0 is of the case GE, then: - 1) Let (GE sx) be relop__u0. - 2) Return $ige_($sizenn(Inn), sx, iN_1, iN_2). -4. If ((relop__u0 is EQ) and the type of numtype_u1 is Fnn), then: - a. Let Fnn be numtype_u1. - b. Let fN_1 be num__u3. - c. Let fN_2 be num__u5. - d. Return $feq_($sizenn(Fnn), fN_1, fN_2). -5. If ((relop__u0 is NE) and the type of numtype_u1 is Fnn), then: - a. Let Fnn be numtype_u1. - b. Let fN_1 be num__u3. - c. Let fN_2 be num__u5. - d. Return $fne_($sizenn(Fnn), fN_1, fN_2). -6. If ((relop__u0 is LT) and the type of numtype_u1 is Fnn), then: - a. Let Fnn be numtype_u1. - b. Let fN_1 be num__u3. - c. Let fN_2 be num__u5. - d. Return $flt_($sizenn(Fnn), fN_1, fN_2). -7. If ((relop__u0 is GT) and the type of numtype_u1 is Fnn), then: - a. Let Fnn be numtype_u1. - b. Let fN_1 be num__u3. - c. Let fN_2 be num__u5. - d. Return $fgt_($sizenn(Fnn), fN_1, fN_2). -8. If ((relop__u0 is LE) and the type of numtype_u1 is Fnn), then: - a. Let Fnn be numtype_u1. - b. Let fN_1 be num__u3. - c. Let fN_2 be num__u5. - d. Return $fle_($sizenn(Fnn), fN_1, fN_2). -9. Assert: Due to validation, (relop__u0 is GE). -10. Assert: Due to validation, the type of numtype_u1 is Fnn. -11. Let Fnn be numtype_u1. -12. Let fN_1 be num__u3. -13. Let fN_2 be num__u5. -14. Return $fge_($sizenn(Fnn), fN_1, fN_2). + * :math:`{|{{\mathit{func}}^\ast}|}` must be equal to :math:`{|{{\mathit{ft}}^\ast}|}`. -cvtop__ numtype_u1 numtype_u4 cvtop_u0 num__u3 -1. If the type of numtype_u1 is Inn, then: - a. Let Inn_1 be numtype_u1. - b. If the type of numtype_u4 is Inn, then: - 1) Let Inn_2 be numtype_u4. - 2) Let iN_1 be num__u3. - 3) If cvtop_u0 is of the case EXTEND, then: - a) Let (EXTEND sx) be cvtop_u0. - b) Return [$extend__($sizenn1(Inn_1), $sizenn2(Inn_2), sx, iN_1)]. -2. If ((cvtop_u0 is WRAP) and the type of numtype_u1 is Inn), then: - a. Let Inn_1 be numtype_u1. - b. If the type of numtype_u4 is Inn, then: - 1) Let Inn_2 be numtype_u4. - 2) Let iN_1 be num__u3. - 3) Return [$wrap__($sizenn1(Inn_1), $sizenn2(Inn_2), iN_1)]. -3. If the type of numtype_u1 is Fnn, then: - a. Let Fnn_1 be numtype_u1. - b. If the type of numtype_u4 is Inn, then: - 1) Let Inn_2 be numtype_u4. - 2) Let fN_1 be num__u3. - 3) If cvtop_u0 is of the case TRUNC, then: - a) Let (TRUNC sx) be cvtop_u0. - b) Return $list_(num_((Inn_2 : Inn <: numtype)), $trunc__($sizenn1(Fnn_1), $sizenn2(Inn_2), sx, fN_1)). - 4) If cvtop_u0 is of the case TRUNC_SAT, then: - a) Let (TRUNC_SAT sx) be cvtop_u0. - b) Return $list_(num_((Inn_2 : Inn <: numtype)), $trunc_sat__($sizenn1(Fnn_1), $sizenn2(Inn_2), sx, fN_1)). -4. If the type of numtype_u4 is Fnn, then: - a. Let Fnn_2 be numtype_u4. - b. If the type of numtype_u1 is Inn, then: - 1) Let Inn_1 be numtype_u1. - 2) Let iN_1 be num__u3. - 3) If cvtop_u0 is of the case CONVERT, then: - a) Let (CONVERT sx) be cvtop_u0. - b) Return [$convert__($sizenn1(Inn_1), $sizenn2(Fnn_2), sx, iN_1)]. -5. If ((cvtop_u0 is PROMOTE) and the type of numtype_u1 is Fnn), then: - a. Let Fnn_1 be numtype_u1. - b. If the type of numtype_u4 is Fnn, then: - 1) Let Fnn_2 be numtype_u4. - 2) Let fN_1 be num__u3. - 3) Return $promote__($sizenn1(Fnn_1), $sizenn2(Fnn_2), fN_1). -6. If ((cvtop_u0 is DEMOTE) and the type of numtype_u1 is Fnn), then: - a. Let Fnn_1 be numtype_u1. - b. If the type of numtype_u4 is Fnn, then: - 1) Let Fnn_2 be numtype_u4. - 2) Let fN_1 be num__u3. - 3) Return $demote__($sizenn1(Fnn_1), $sizenn2(Fnn_2), fN_1). -7. Assert: Due to validation, (cvtop_u0 is REINTERPRET). -8. If the type of numtype_u4 is Fnn, then: - a. Let Fnn_2 be numtype_u4. - b. If the type of numtype_u1 is Inn, then: - 1) Let Inn_1 be numtype_u1. - 2) Let iN_1 be num__u3. - 3) If ($size(Inn_1) is $size(Fnn_2)), then: - a) Return [$reinterpret__(Inn_1, Fnn_2, iN_1)]. -9. Assert: Due to validation, the type of numtype_u1 is Fnn. -10. Let Fnn_1 be numtype_u1. -11. Assert: Due to validation, the type of numtype_u4 is Inn. -12. Let Inn_2 be numtype_u4. -13. Let fN_1 be num__u3. -14. Assert: Due to validation, ($size(Fnn_1) is $size(Inn_2)). -15. Return [$reinterpret__(Fnn_1, Inn_2, fN_1)]. + * :math:`{|{{\mathit{tt}}^\ast}|}` must be equal to :math:`{|{{\mathit{table}}^\ast}|}`. -invibytes_ N b* -1. Let n be $ibytes__1^-1(N, b*). -2. Return n. + * :math:`{|{{\mathit{mt}}^\ast}|}` must be equal to :math:`{|{{\mathit{mem}}^\ast}|}`. -invfbytes_ N b* -1. Let p be $fbytes__1^-1(N, b*). -2. Return p. + * :math:`{|{{\mathit{xt}}^\ast}|}` must be equal to :math:`{|{{\mathit{export}}^\ast}|}`. -packnum_ lanetype_u0 c -1. If the type of lanetype_u0 is numtype, then: - a. Return c. -2. Assert: Due to validation, the type of lanetype_u0 is packtype. -3. Let packtype be lanetype_u0. -4. Return $wrap__($size($unpack(packtype)), $psize(packtype), c). + * For all :math:`{\mathit{ft}'}` in :math:`{{\mathit{ft}'}^\ast}` and :math:`{\mathit{type}}` in :math:`{{\mathit{type}}^\ast}`, -unpacknum_ lanetype_u0 c -1. If the type of lanetype_u0 is numtype, then: - a. Return c. -2. Assert: Due to validation, the type of lanetype_u0 is packtype. -3. Let packtype be lanetype_u0. -4. Return $extend__($psize(packtype), $size($unpack(packtype)), U, c). + * :math:`{\mathit{type}}` is valid with type :math:`{\mathit{ft}'}`. -invlanes_ sh c* -1. Let vc be $lanes__1^-1(sh, c*). -2. Return vc. + * For all :math:`{\mathit{import}}` in :math:`{{\mathit{import}}^\ast}` and :math:`{\mathit{ixt}}` in :math:`{{\mathit{ixt}}^\ast}`, -half half_u0 i j -1. If (half_u0 is LOW), then: - a. Return i. -2. Assert: Due to validation, (half_u0 is HIGH). -3. Return j. + * Under the context :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~{{\mathit{ft}'}^\ast},\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon,\; \mathsf{return}~\epsilon \}\end{array}`, :math:`{\mathit{import}}` is valid with type :math:`{\mathit{ixt}}`. -vvunop_ V128 NOT v128 -1. Return $inot_($size(V128), v128). + * For all :math:`{\mathit{global}}` in :math:`{{\mathit{global}}^\ast}` and :math:`{\mathit{gt}}` in :math:`{{\mathit{gt}}^\ast}`, -vvbinop_ V128 vvbinop_u0 v128_1 v128_2 -1. If (vvbinop_u0 is AND), then: - a. Return $iand_($size(V128), v128_1, v128_2). -2. If (vvbinop_u0 is ANDNOT), then: - a. Return $iandnot_($size(V128), v128_1, v128_2). -3. If (vvbinop_u0 is OR), then: - a. Return $ior_($size(V128), v128_1, v128_2). -4. Assert: Due to validation, (vvbinop_u0 is XOR). -5. Return $ixor_($size(V128), v128_1, v128_2). + * Under the context :math:`{C'}`, :math:`{\mathit{global}}` is valid with type :math:`{\mathit{gt}}`. -vvternop_ V128 BITSELECT v128_1 v128_2 v128_3 -1. Return $ibitselect_($size(V128), v128_1, v128_2, v128_3). + * For all :math:`{\mathit{ft}}` in :math:`{{\mathit{ft}}^\ast}` and :math:`{\mathit{func}}` in :math:`{{\mathit{func}}^\ast}`, -vunop_ (lanetype_u1 X M) vunop__u0 v128_1 -1. If ((vunop__u0 is ABS) and the type of lanetype_u1 is Jnn), then: - a. Let Jnn be lanetype_u1. - b. Let lane_1* be $lanes_((Jnn X M), v128_1). - c. Let v128 be $invlanes_((Jnn X M), $iabs_($lsizenn(Jnn), lane_1)*). - d. Return [v128]. -2. If ((vunop__u0 is NEG) and the type of lanetype_u1 is Jnn), then: - a. Let Jnn be lanetype_u1. - b. Let lane_1* be $lanes_((Jnn X M), v128_1). - c. Let v128 be $invlanes_((Jnn X M), $ineg_($lsizenn(Jnn), lane_1)*). - d. Return [v128]. -3. If ((vunop__u0 is POPCNT) and the type of lanetype_u1 is Jnn), then: - a. Let Jnn be lanetype_u1. - b. Let lane_1* be $lanes_((Jnn X M), v128_1). - c. Let v128 be $invlanes_((Jnn X M), $ipopcnt_($lsizenn(Jnn), lane_1)*). - d. Return [v128]. -4. If ((vunop__u0 is ABS) and the type of lanetype_u1 is Fnn), then: - a. Let Fnn be lanetype_u1. - b. Let lane_1* be $lanes_((Fnn X M), v128_1). - c. Let lane** be $setproduct_(lane_((Fnn : Fnn <: lanetype)), $fabs_($sizenn(Fnn), lane_1)*). - d. Let v128* be $invlanes_((Fnn X M), lane*)*. - e. Return v128*. -5. If ((vunop__u0 is NEG) and the type of lanetype_u1 is Fnn), then: - a. Let Fnn be lanetype_u1. - b. Let lane_1* be $lanes_((Fnn X M), v128_1). - c. Let lane** be $setproduct_(lane_((Fnn : Fnn <: lanetype)), $fneg_($sizenn(Fnn), lane_1)*). - d. Let v128* be $invlanes_((Fnn X M), lane*)*. - e. Return v128*. -6. If ((vunop__u0 is SQRT) and the type of lanetype_u1 is Fnn), then: - a. Let Fnn be lanetype_u1. - b. Let lane_1* be $lanes_((Fnn X M), v128_1). - c. Let lane** be $setproduct_(lane_((Fnn : Fnn <: lanetype)), $fsqrt_($sizenn(Fnn), lane_1)*). - d. Let v128* be $invlanes_((Fnn X M), lane*)*. - e. Return v128*. -7. If ((vunop__u0 is CEIL) and the type of lanetype_u1 is Fnn), then: - a. Let Fnn be lanetype_u1. - b. Let lane_1* be $lanes_((Fnn X M), v128_1). - c. Let lane** be $setproduct_(lane_((Fnn : Fnn <: lanetype)), $fceil_($sizenn(Fnn), lane_1)*). - d. Let v128* be $invlanes_((Fnn X M), lane*)*. - e. Return v128*. -8. If ((vunop__u0 is FLOOR) and the type of lanetype_u1 is Fnn), then: - a. Let Fnn be lanetype_u1. - b. Let lane_1* be $lanes_((Fnn X M), v128_1). - c. Let lane** be $setproduct_(lane_((Fnn : Fnn <: lanetype)), $ffloor_($sizenn(Fnn), lane_1)*). - d. Let v128* be $invlanes_((Fnn X M), lane*)*. - e. Return v128*. -9. If ((vunop__u0 is TRUNC) and the type of lanetype_u1 is Fnn), then: - a. Let Fnn be lanetype_u1. - b. Let lane_1* be $lanes_((Fnn X M), v128_1). - c. Let lane** be $setproduct_(lane_((Fnn : Fnn <: lanetype)), $ftrunc_($sizenn(Fnn), lane_1)*). - d. Let v128* be $invlanes_((Fnn X M), lane*)*. - e. Return v128*. -10. Assert: Due to validation, (vunop__u0 is NEAREST). -11. Assert: Due to validation, the type of lanetype_u1 is Fnn. -12. Let Fnn be lanetype_u1. -13. Let lane_1* be $lanes_((Fnn X M), v128_1). -14. Let lane** be $setproduct_(lane_((Fnn : Fnn <: lanetype)), $fnearest_($sizenn(Fnn), lane_1)*). -15. Let v128* be $invlanes_((Fnn X M), lane*)*. -16. Return v128*. + * :math:`{\mathit{func}}` is valid with type :math:`{\mathit{ft}}`. -vbinop_ (lanetype_u1 X M) vbinop__u0 v128_1 v128_2 -1. If ((vbinop__u0 is ADD) and the type of lanetype_u1 is Jnn), then: - a. Let Jnn be lanetype_u1. - b. Let lane_1* be $lanes_((Jnn X M), v128_1). - c. Let lane_2* be $lanes_((Jnn X M), v128_2). - d. Let v128 be $invlanes_((Jnn X M), $iadd_($lsizenn(Jnn), lane_1, lane_2)*). - e. Return [v128]. -2. If ((vbinop__u0 is SUB) and the type of lanetype_u1 is Jnn), then: - a. Let Jnn be lanetype_u1. - b. Let lane_1* be $lanes_((Jnn X M), v128_1). + * For all :math:`{\mathit{table}}` in :math:`{{\mathit{table}}^\ast}` and :math:`{\mathit{tt}}` in :math:`{{\mathit{tt}}^\ast}`, + + * :math:`{\mathit{table}}` is valid with type :math:`{\mathit{tt}}`. + + * For all :math:`{\mathit{mem}}` in :math:`{{\mathit{mem}}^\ast}` and :math:`{\mathit{mt}}` in :math:`{{\mathit{mt}}^\ast}`, + + * :math:`{\mathit{mem}}` is valid with type :math:`{\mathit{mt}}`. + + * For all :math:`{\mathit{elem}}` in :math:`{{\mathit{elem}}^\ast}`, + + * :math:`{\mathit{elem}}` is valid. + + * For all :math:`{\mathit{data}}` in :math:`{{\mathit{data}}^\ast}`, + + * :math:`{\mathit{data}}` is valid. + + * If :math:`{\mathit{start}}` is defined, + + * :math:`{\mathit{start}}` is valid. + + * For all :math:`{\mathit{export}}` in :math:`{{\mathit{export}}^\ast}` and :math:`{\mathit{xt}}` in :math:`{{\mathit{xt}}^\ast}`, + + * :math:`{\mathit{export}}` is valid with type :math:`{\mathit{xt}}`. + + * :math:`{|{{\mathit{tt}}^\ast}|}` must be less than or equal to :math:`1`. + + * :math:`{|{{\mathit{mt}}^\ast}|}` must be less than or equal to :math:`1`. + + * :math:`C` must be equal to :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~{{\mathit{ft}'}^\ast},\; \mathsf{funcs}~{{\mathit{ift}}^\ast}~{{\mathit{ft}}^\ast},\; \mathsf{globals}~{{\mathit{igt}}^\ast}~{{\mathit{gt}}^\ast},\; \mathsf{tables}~{{\mathit{itt}}^\ast}~{{\mathit{tt}}^\ast},\; \mathsf{mems}~{{\mathit{imt}}^\ast}~{{\mathit{mt}}^\ast},\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon,\; \mathsf{return}~\epsilon \}\end{array}`. + + * :math:`{C'}` must be equal to :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~{{\mathit{ft}'}^\ast},\; \mathsf{funcs}~{{\mathit{ift}}^\ast}~{{\mathit{ft}}^\ast},\; \mathsf{globals}~{{\mathit{igt}}^\ast},\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon,\; \mathsf{return}~\epsilon \}\end{array}`. + + * :math:`{{\mathit{ift}}^\ast}` must be equal to :math:`{\mathrm{funcs}}({{\mathit{ixt}}^\ast})`. + + * :math:`{{\mathit{igt}}^\ast}` must be equal to :math:`{\mathrm{globals}}({{\mathit{ixt}}^\ast})`. + + * :math:`{{\mathit{itt}}^\ast}` must be equal to :math:`{\mathrm{tables}}({{\mathit{ixt}}^\ast})`. + + * :math:`{{\mathit{imt}}^\ast}` must be equal to :math:`{\mathrm{mems}}({{\mathit{ixt}}^\ast})`. + + +:math:`{\mathrm{Ki}}` +..................... + + +1. Return :math:`1024`. + + +:math:`{\mathrm{min}}(n_{\mathit{u{\kern-0.1em\scriptstyle 0}}}, n_{\mathit{u{\kern-0.1em\scriptstyle 1}}})` +............................................................................................................ + + +1. If :math:`n_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`0`, then: + + a. Return :math:`0`. + +#. If :math:`n_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is :math:`0`, then: + + a. Return :math:`0`. + +#. Assert: Due to validation, :math:`n_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is greater than or equal to :math:`1`. + +#. Let :math:`i` be :math:`n_{\mathit{u{\kern-0.1em\scriptstyle 0}}} - 1`. + +#. Assert: Due to validation, :math:`n_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is greater than or equal to :math:`1`. + +#. Let :math:`j` be :math:`n_{\mathit{u{\kern-0.1em\scriptstyle 1}}} - 1`. + +#. Return :math:`{\mathrm{min}}(i, j)`. + + +:math:`{\mathrm{sum}}({n_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +........................................................................ + + +1. If :math:`{n_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`0`. + +#. Let :math:`n~{{n'}^\ast}` be :math:`{n_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`n + {\mathrm{sum}}({{n'}^\ast})`. + + +:math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` +........................................................ + + +1. If :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Assert: Due to validation, :math:`{|{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}|}` is :math:`1`. + +#. Let :math:`w` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`w`. + + +:math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}` +..................................................... + + +1. If :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}` is not defined, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`w` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}`. + +#. Return :math:`w`. + + +:math:`{\mathrm{concat}}({X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +........................................................................... + + +1. If :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{w^\ast}~{{{w'}^\ast}^\ast}` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{w^\ast}~{\mathrm{concat}}({{{w'}^\ast}^\ast})`. + + +:math:`{\mathrm{signif}}(N_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +.................................................................... + + +1. If :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`32`, then: + + a. Return :math:`23`. + +#. Assert: Due to validation, :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`64`. + +#. Return :math:`52`. + + +:math:`{\mathrm{expon}}(N_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +................................................................... + + +1. If :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`32`, then: + + a. Return :math:`8`. + +#. Assert: Due to validation, :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`64`. + +#. Return :math:`11`. + + +:math:`M` +......... + + +1. Return :math:`{\mathrm{signif}}(N)`. + + +:math:`E` +......... + + +1. Return :math:`{\mathrm{expon}}(N)`. + + +:math:`{+0}` +............ + + +1. Return :math:`({+((0 + 0 \cdot {2^{{-M}}}) \cdot {2^{n}})})`. + + +:math:`{+1}` +............ + + +1. Return :math:`({+((1 + 1 \cdot {2^{{-M}}}) \cdot {2^{0}})})`. + + +:math:`{{\mathrm{canon}}}_{N}` +.............................. + + +1. Return :math:`{2^{{\mathrm{signif}}(N) - 1}}`. + + +:math:`{|{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}|}` +...................................................................... + + +1. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{i{\scriptstyle 32}}`, then: + + a. Return :math:`32`. + +#. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{i{\scriptstyle 64}}`, then: + + a. Return :math:`64`. + +#. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{f{\scriptstyle 32}}`, then: + + a. Return :math:`32`. + +#. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{f{\scriptstyle 64}}`, then: + + a. Return :math:`64`. + + +:math:`{\mathrm{funcs}}({{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +.............................................................................................. + + +1. If :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externtype}}_0~{{\mathit{xt}}^\ast}` be :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externtype}}_0` is of the case :math:`\mathsf{func}`, then: + + a. Let :math:`(\mathsf{func}~{\mathit{ft}})` be :math:`{\mathit{externtype}}_0`. + + #. Return :math:`{\mathit{ft}}~{\mathrm{funcs}}({{\mathit{xt}}^\ast})`. + +#. Let :math:`{\mathit{externtype}}~{{\mathit{xt}}^\ast}` be :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{funcs}}({{\mathit{xt}}^\ast})`. + + +:math:`{\mathrm{globals}}({{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +................................................................................................ + + +1. If :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externtype}}_0~{{\mathit{xt}}^\ast}` be :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externtype}}_0` is of the case :math:`\mathsf{global}`, then: + + a. Let :math:`(\mathsf{global}~{\mathit{gt}})` be :math:`{\mathit{externtype}}_0`. + + #. Return :math:`{\mathit{gt}}~{\mathrm{globals}}({{\mathit{xt}}^\ast})`. + +#. Let :math:`{\mathit{externtype}}~{{\mathit{xt}}^\ast}` be :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{globals}}({{\mathit{xt}}^\ast})`. + + +:math:`{\mathrm{tables}}({{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................... + + +1. If :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externtype}}_0~{{\mathit{xt}}^\ast}` be :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externtype}}_0` is of the case :math:`\mathsf{table}`, then: + + a. Let :math:`(\mathsf{table}~{\mathit{tt}})` be :math:`{\mathit{externtype}}_0`. + + #. Return :math:`{\mathit{tt}}~{\mathrm{tables}}({{\mathit{xt}}^\ast})`. + +#. Let :math:`{\mathit{externtype}}~{{\mathit{xt}}^\ast}` be :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{tables}}({{\mathit{xt}}^\ast})`. + + +:math:`{\mathrm{mems}}({{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................. + + +1. If :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externtype}}_0~{{\mathit{xt}}^\ast}` be :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externtype}}_0` is of the case :math:`\mathsf{mem}`, then: + + a. Let :math:`(\mathsf{mem}~{\mathit{mt}})` be :math:`{\mathit{externtype}}_0`. + + #. Return :math:`{\mathit{mt}}~{\mathrm{mems}}({{\mathit{xt}}^\ast})`. + +#. Let :math:`{\mathit{externtype}}~{{\mathit{xt}}^\ast}` be :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{mems}}({{\mathit{xt}}^\ast})`. + + + + + + +1. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{align}~0,\; \mathsf{offset}~0 \}\end{array}`. + + +:math:`{{\mathrm{signed}}}_{N}(i)` +.................................. + + +1. If :math:`0` is less than or equal to :math:`{2^{N - 1}}`, then: + + a. Return :math:`i`. + +#. Assert: Due to validation, :math:`{2^{N - 1}}` is less than or equal to :math:`i`. + +#. Assert: Due to validation, :math:`i` is less than :math:`{2^{N}}`. + +#. Return :math:`i - {2^{N}}`. + + +:math:`{{{{\mathrm{signed}}}_{N}^{{-1}}}}{(i)}` +............................................... + + +1. Let :math:`j` be the result for which :math:`{{\mathrm{signed}}}_{N}(j)` :math:`=` :math:`i`. + +#. Return :math:`j`. + + +:math:`{{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}}{({\mathit{val\_u{\kern-0.1em\scriptstyle 3}}})}` +........................................................................................................................................................................ + + +1. If :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{clz}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Return :math:`{{\mathrm{iclz}}}_{{|{\mathsf{i}}{n}|}}({\mathit{iN}})`. + +#. If :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{ctz}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Return :math:`{{\mathrm{ictz}}}_{{|{\mathsf{i}}{n}|}}({\mathit{iN}})`. + +#. If :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{popcnt}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Return :math:`{{\mathrm{ipopcnt}}}_{{|{\mathsf{i}}{n}|}}({\mathit{iN}})`. + +#. If :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{abs}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Return :math:`{{\mathrm{fabs}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}})`. + +#. If :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{neg}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Return :math:`{{\mathrm{fneg}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}})`. + +#. If :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{sqrt}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Return :math:`{{\mathrm{fsqrt}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}})`. + +#. If :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{ceil}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Return :math:`{{\mathrm{fceil}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}})`. + +#. If :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{floor}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Return :math:`{{\mathrm{ffloor}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}})`. + +#. If :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{trunc}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Return :math:`{{\mathrm{ftrunc}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}})`. + +#. Assert: Due to validation, :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{nearest}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn. + +#. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + +#. Let :math:`{\mathit{fN}}` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + +#. Return :math:`{{\mathrm{fnearest}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}})`. + + +:math:`{{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}}{({\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}, {\mathit{val\_u{\kern-0.1em\scriptstyle 5}}})}` +....................................................................................................................................................................................................................... + + +1. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{add}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{iadd}}}_{{|{\mathsf{i}}{n}|}}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{sub}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{isub}}}_{{|{\mathsf{i}}{n}|}}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{mul}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{imul}}}_{{|{\mathsf{i}}{n}|}}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{div}`, then: + + 1) Let :math:`({\mathsf{div}}{{\mathit{sx}}})` be :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Return :math:`{{{{\mathrm{idiv}}}_{{|{\mathsf{i}}{n}|}}^{{\mathit{sx}}}}}{({\mathit{iN}}_1, {\mathit{iN}}_2)}`. + + #. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{rem}`, then: + + 1) Let :math:`({\mathsf{rem}}{{\mathit{sx}}})` be :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Return :math:`{{{{\mathrm{irem}}}_{{|{\mathsf{i}}{n}|}}^{{\mathit{sx}}}}}{({\mathit{iN}}_1, {\mathit{iN}}_2)}`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{and}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{iand}}}_{{|{\mathsf{i}}{n}|}}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{or}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{ior}}}_{{|{\mathsf{i}}{n}|}}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{xor}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{ixor}}}_{{|{\mathsf{i}}{n}|}}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{shl}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{ishl}}}_{{|{\mathsf{i}}{n}|}}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{shr}`, then: + + 1) Let :math:`({\mathsf{shr}}{{\mathit{sx}}})` be :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Return :math:`{{{{\mathrm{ishr}}}_{{|{\mathsf{i}}{n}|}}^{{\mathit{sx}}}}}{({\mathit{iN}}_1, {\mathit{iN}}_2)}`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{rotl}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{irotl}}}_{{|{\mathsf{i}}{n}|}}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{rotr}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{irotr}}}_{{|{\mathsf{i}}{n}|}}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{add}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{fadd}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{sub}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{fsub}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{mul}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{fmul}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{div}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{fdiv}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{min}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{fmin}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{max}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{fmax}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. Assert: Due to validation, :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{copysign}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn. + +#. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + +#. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + +#. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + +#. Return :math:`{{\mathrm{fcopysign}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + + +:math:`{\mathsf{eqz}}{{}_{{\mathsf{i}}{n}}}{({\mathit{iN}})}` +............................................................. + + +1. Return :math:`{{\mathrm{ieqz}}}_{{|{\mathsf{i}}{n}|}}({\mathit{iN}})`. + + +:math:`{{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}}{({\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}, {\mathit{val\_u{\kern-0.1em\scriptstyle 5}}})}` +....................................................................................................................................................................................................................... + + +1. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{eq}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{ieq}}}_{{|{\mathsf{i}}{n}|}}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{ne}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{ine}}}_{{|{\mathsf{i}}{n}|}}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{lt}`, then: + + 1) Let :math:`({\mathsf{lt}}{{\mathit{sx}}})` be :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Return :math:`{{{{\mathrm{ilt}}}_{{|{\mathsf{i}}{n}|}}^{{\mathit{sx}}}}}{({\mathit{iN}}_1, {\mathit{iN}}_2)}`. + + #. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{gt}`, then: + + 1) Let :math:`({\mathsf{gt}}{{\mathit{sx}}})` be :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Return :math:`{{{{\mathrm{igt}}}_{{|{\mathsf{i}}{n}|}}^{{\mathit{sx}}}}}{({\mathit{iN}}_1, {\mathit{iN}}_2)}`. + + #. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{le}`, then: + + 1) Let :math:`({\mathsf{le}}{{\mathit{sx}}})` be :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Return :math:`{{{{\mathrm{ile}}}_{{|{\mathsf{i}}{n}|}}^{{\mathit{sx}}}}}{({\mathit{iN}}_1, {\mathit{iN}}_2)}`. + + #. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{ge}`, then: + + 1) Let :math:`({\mathsf{ge}}{{\mathit{sx}}})` be :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Return :math:`{{{{\mathrm{ige}}}_{{|{\mathsf{i}}{n}|}}^{{\mathit{sx}}}}}{({\mathit{iN}}_1, {\mathit{iN}}_2)}`. + +#. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{eq}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{feq}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{ne}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{fne}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{lt}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{flt}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{gt}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{fgt}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{le}` and the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{fle}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. Assert: Due to validation, :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{ge}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn. + +#. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + +#. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 3}}}`. + +#. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 5}}}`. + +#. Return :math:`{{\mathrm{fge}}}_{{|{\mathsf{f}}{n}|}}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + + +:math:`{{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}}{{}_{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}, {\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}}{({\mathit{val\_u{\kern-0.1em\scriptstyle 4}}})}` +............................................................................................................................................................................................................................................... + + +1. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{i{\scriptstyle 32}}` and :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is :math:`\mathsf{i{\scriptstyle 64}}`, then: + + a. Let :math:`{\mathit{iN}}` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 4}}}`. + + #. If :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}` is of the case :math:`\mathsf{extend}`, then: + + 1) Let :math:`(\mathsf{extend}~{\mathit{sx}})` be :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}`. + + #) Return :math:`{{{{\mathrm{extend}}}_{32, 64}^{{\mathit{sx}}}}}{({\mathit{iN}})}`. + +#. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{i{\scriptstyle 64}}` and :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is :math:`\mathsf{i{\scriptstyle 32}}` and :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}` is :math:`\mathsf{wrap}`, then: + + a. Let :math:`{\mathit{iN}}` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 4}}}`. + + #. Return :math:`{{\mathrm{wrap}}}_{64, 32}({\mathit{iN}})`. + +#. If the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. If the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + 1) Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #) Let :math:`{\mathit{fN}}` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 4}}}`. + + #) If :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}` is of the case :math:`\mathsf{trunc}`, then: + + a) Let :math:`(\mathsf{trunc}~{\mathit{sx}})` be :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}`. + + #) Return :math:`{{{{\mathrm{trunc}}}_{{|{\mathsf{f}}{n}|}, {|{\mathsf{i}}{n}|}}^{{\mathit{sx}}}}}{({\mathit{fN}})}`. + +#. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{f{\scriptstyle 32}}` and :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is :math:`\mathsf{f{\scriptstyle 64}}` and :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}` is :math:`\mathsf{promote}`, then: + + a. Let :math:`{\mathit{fN}}` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 4}}}`. + + #. Return :math:`{{\mathrm{promote}}}_{32, 64}({\mathit{fN}})`. + +#. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{f{\scriptstyle 64}}` and :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is :math:`\mathsf{f{\scriptstyle 32}}` and :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}` is :math:`\mathsf{demote}`, then: + + a. Let :math:`{\mathit{fN}}` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 4}}}`. + + #. Return :math:`{{\mathrm{demote}}}_{64, 32}({\mathit{fN}})`. + +#. If the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. If the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is Inn, then: + + 1) Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #) Let :math:`{\mathit{iN}}` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 4}}}`. + + #) If :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}` is of the case :math:`\mathsf{convert}`, then: + + a) Let :math:`(\mathsf{convert}~{\mathit{sx}})` be :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}`. + + #) Return :math:`{{{{\mathrm{convert}}}_{{|{\mathsf{i}}{n}|}, {|{\mathsf{f}}{n}|}}^{{\mathit{sx}}}}}{({\mathit{iN}})}`. + +#. Assert: Due to validation, :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}` is :math:`\mathsf{reinterpret}`. + +#. If the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. If the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is Inn, then: + + 1) Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #) Let :math:`{\mathit{iN}}` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 4}}}`. + + #) If :math:`{|{\mathsf{i}}{n}|}` is :math:`{|{\mathsf{f}}{n}|}`, then: + + a) Return :math:`{{\mathrm{reinterpret}}}_{{\mathsf{i}}{n}, {\mathsf{f}}{n}}({\mathit{iN}})`. + +#. Assert: Due to validation, the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is Fnn. + +#. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn. + +#. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + +#. Let :math:`{\mathit{fN}}` be :math:`{\mathit{val\_u{\kern-0.1em\scriptstyle 4}}}`. + +#. Assert: Due to validation, :math:`{|{\mathsf{i}}{n}|}` is :math:`{|{\mathsf{f}}{n}|}`. + +#. Return :math:`{{\mathrm{reinterpret}}}_{{\mathsf{f}}{n}, {\mathsf{i}}{n}}({\mathit{fN}})`. + + +:math:`{{\mathrm{invibytes}}}_{N}({b^\ast})` +............................................ + + +1. Let :math:`n` be the result for which :math:`{{\mathrm{bytes}}}_{{\mathsf{i}}{N}}(n)` :math:`=` :math:`{b^\ast}`. + +#. Return :math:`n`. + + +:math:`{{\mathrm{invfbytes}}}_{N}({b^\ast})` +............................................ + + +1. Let :math:`p` be the result for which :math:`{{\mathrm{bytes}}}_{{\mathsf{f}}{N}}(p)` :math:`=` :math:`{b^\ast}`. + +#. Return :math:`p`. + + +:math:`{{\mathrm{default}}}_{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}` +......................................................................................... + + +1. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{i{\scriptstyle 32}}`, then: + + a. Return :math:`(\mathsf{i{\scriptstyle 32}}{.}\mathsf{const}~0)`. + +#. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{i{\scriptstyle 64}}`, then: + + a. Return :math:`(\mathsf{i{\scriptstyle 64}}{.}\mathsf{const}~0)`. + +#. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{f{\scriptstyle 32}}`, then: + + a. Return :math:`(\mathsf{f{\scriptstyle 32}}{.}\mathsf{const}~{+0})`. + +#. Assert: Due to validation, :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{f{\scriptstyle 64}}`. + +#. Return :math:`(\mathsf{f{\scriptstyle 64}}{.}\mathsf{const}~{+0})`. + + +:math:`{\mathrm{funcs}}({{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................. + + +1. If :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externval}}_0~{{\mathit{xv}}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externval}}_0` is of the case :math:`\mathsf{func}`, then: + + a. Let :math:`(\mathsf{func}~{\mathit{fa}})` be :math:`{\mathit{externval}}_0`. + + #. Return :math:`{\mathit{fa}}~{\mathrm{funcs}}({{\mathit{xv}}^\ast})`. + +#. Let :math:`{\mathit{externval}}~{{\mathit{xv}}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{funcs}}({{\mathit{xv}}^\ast})`. + + +:math:`{\mathrm{globals}}({{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................... + + +1. If :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externval}}_0~{{\mathit{xv}}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externval}}_0` is of the case :math:`\mathsf{global}`, then: + + a. Let :math:`(\mathsf{global}~{\mathit{ga}})` be :math:`{\mathit{externval}}_0`. + + #. Return :math:`{\mathit{ga}}~{\mathrm{globals}}({{\mathit{xv}}^\ast})`. + +#. Let :math:`{\mathit{externval}}~{{\mathit{xv}}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{globals}}({{\mathit{xv}}^\ast})`. + + +:math:`{\mathrm{tables}}({{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +.............................................................................................. + + +1. If :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externval}}_0~{{\mathit{xv}}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externval}}_0` is of the case :math:`\mathsf{table}`, then: + + a. Let :math:`(\mathsf{table}~{\mathit{ta}})` be :math:`{\mathit{externval}}_0`. + + #. Return :math:`{\mathit{ta}}~{\mathrm{tables}}({{\mathit{xv}}^\ast})`. + +#. Let :math:`{\mathit{externval}}~{{\mathit{xv}}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{tables}}({{\mathit{xv}}^\ast})`. + + +:math:`{\mathrm{mems}}({{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................ + + +1. If :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externval}}_0~{{\mathit{xv}}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externval}}_0` is of the case :math:`\mathsf{mem}`, then: + + a. Let :math:`(\mathsf{mem}~{\mathit{ma}})` be :math:`{\mathit{externval}}_0`. + + #. Return :math:`{\mathit{ma}}~{\mathrm{mems}}({{\mathit{xv}}^\ast})`. + +#. Let :math:`{\mathit{externval}}~{{\mathit{xv}}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{mems}}({{\mathit{xv}}^\ast})`. + + +:math:`{\mathrm{store}}` +........................ + + +1. Return. + + +:math:`{\mathrm{frame}}` +........................ + + +1. Let :math:`f` be the current frame. + +#. Return :math:`f`. + + +:math:`{\mathrm{funcaddr}}` +........................... + + +1. Let :math:`f` be the current frame. + +#. Return :math:`f{.}\mathsf{module}{.}\mathsf{funcs}`. + + +:math:`{\mathrm{funcinst}}` +........................... + + +1. Return :math:`s{.}\mathsf{funcs}`. + + +:math:`{\mathrm{globalinst}}` +............................. + + +1. Return :math:`s{.}\mathsf{globals}`. + + +:math:`{\mathrm{tableinst}}` +............................ + + +1. Return :math:`s{.}\mathsf{tables}`. + + +:math:`{\mathrm{meminst}}` +.......................... + + +1. Return :math:`s{.}\mathsf{mems}`. + + +:math:`{\mathrm{moduleinst}}` +............................. + + +1. Let :math:`f` be the current frame. + +#. Return :math:`f{.}\mathsf{module}`. + + +:math:`{\mathrm{type}}(x)` +.......................... + + +1. Let :math:`f` be the current frame. + +#. Return :math:`f{.}\mathsf{module}{.}\mathsf{types}{}[x]`. + + +:math:`{\mathrm{func}}(x)` +.......................... + + +1. Let :math:`f` be the current frame. + +#. Return :math:`s{.}\mathsf{funcs}{}[f{.}\mathsf{module}{.}\mathsf{funcs}{}[x]]`. + + +:math:`{\mathrm{global}}(x)` +............................ + + +1. Let :math:`f` be the current frame. + +#. Return :math:`s{.}\mathsf{globals}{}[f{.}\mathsf{module}{.}\mathsf{globals}{}[x]]`. + + +:math:`{\mathrm{table}}(x)` +........................... + + +1. Let :math:`f` be the current frame. + +#. Return :math:`s{.}\mathsf{tables}{}[f{.}\mathsf{module}{.}\mathsf{tables}{}[x]]`. + + +:math:`{\mathrm{mem}}(x)` +......................... + + +1. Let :math:`f` be the current frame. + +#. Return :math:`s{.}\mathsf{mems}{}[f{.}\mathsf{module}{.}\mathsf{mems}{}[x]]`. + + +:math:`{\mathrm{local}}(x)` +........................... + + +1. Let :math:`f` be the current frame. + +#. Return :math:`f{.}\mathsf{locals}{}[x]`. + + +:math:`{\mathrm{with}}_{\mathit{local}}(x, v)` +.............................................. + + +1. Let :math:`f` be the current frame. + +#. Replace :math:`f{.}\mathsf{locals}{}[x]` with :math:`v`. + + +:math:`{\mathrm{with}}_{\mathit{global}}(x, v)` +............................................... + + +1. Let :math:`f` be the current frame. + +#. Replace :math:`s{.}\mathsf{globals}{}[f{.}\mathsf{module}{.}\mathsf{globals}{}[x]]{.}\mathsf{value}` with :math:`v`. + + +:math:`{\mathrm{with}}_{\mathit{table}}(x, i, a)` +................................................. + + +1. Let :math:`f` be the current frame. + +#. Replace :math:`s{.}\mathsf{tables}{}[f{.}\mathsf{module}{.}\mathsf{tables}{}[x]]{.}\mathsf{refs}{}[i]` with :math:`a`. + + +:math:`{\mathrm{with}}_{\mathit{tableinst}}(x, {\mathit{ti}})` +.............................................................. + + +1. Let :math:`f` be the current frame. + +#. Replace :math:`s{.}\mathsf{tables}{}[f{.}\mathsf{module}{.}\mathsf{tables}{}[x]]` with :math:`{\mathit{ti}}`. + + +:math:`{\mathrm{with}}_{\mathit{mem}}(x, i, j, {b^\ast})` +......................................................... + + +1. Let :math:`f` be the current frame. + +#. Replace :math:`s{.}\mathsf{mems}{}[f{.}\mathsf{module}{.}\mathsf{mems}{}[x]]{.}\mathsf{bytes}{}[i : j]` with :math:`{b^\ast}`. + + +:math:`{\mathrm{with}}_{\mathit{meminst}}(x, {\mathit{mi}})` +............................................................ + + +1. Let :math:`f` be the current frame. + +#. Replace :math:`s{.}\mathsf{mems}{}[f{.}\mathsf{module}{.}\mathsf{mems}{}[x]]` with :math:`{\mathit{mi}}`. + + +:math:`{\mathrm{growtable}}({\mathit{ti}}, n)` +.............................................. + + +1. Let :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~(i, j),\; \mathsf{refs}~{a^\ast} \}\end{array}` be :math:`{\mathit{ti}}`. + +#. Let :math:`{i'}` be :math:`{|{a^\ast}|} + n`. + +#. If :math:`{i'}` is less than or equal to :math:`j`, then: + + a. Let :math:`{\mathit{ti}'}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~({i'}, j),\; \mathsf{refs}~{a^\ast}~{\epsilon^{n}} \}\end{array}`. + + #. Return :math:`{\mathit{ti}'}`. + + +:math:`{\mathrm{growmemory}}({\mathit{mi}}, n)` +............................................... + + +1. Let :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~(i, j),\; \mathsf{bytes}~{b^\ast} \}\end{array}` be :math:`{\mathit{mi}}`. + +#. Let :math:`{i'}` be :math:`{|{b^\ast}|} / 64 \, {\mathrm{Ki}} + n`. + +#. If :math:`{i'}` is less than or equal to :math:`j`, then: + + a. Let :math:`{\mathit{mi}'}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~({i'}, j),\; \mathsf{bytes}~{b^\ast}~{0^{n \cdot 64 \, {\mathrm{Ki}}}} \}\end{array}`. + + #. Return :math:`{\mathit{mi}'}`. + + +:math:`{\mathrm{funcs}}({{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................. + + +1. If :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externval}}_0~{{\mathit{externval}'}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externval}}_0` is of the case :math:`\mathsf{func}`, then: + + a. Let :math:`(\mathsf{func}~{\mathit{fa}})` be :math:`{\mathit{externval}}_0`. + + #. Return :math:`{\mathit{fa}}~{\mathrm{funcs}}({{\mathit{externval}'}^\ast})`. + +#. Let :math:`{\mathit{externval}}~{{\mathit{externval}'}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{funcs}}({{\mathit{externval}'}^\ast})`. + + +:math:`{\mathrm{globals}}({{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................... + + +1. If :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externval}}_0~{{\mathit{externval}'}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externval}}_0` is of the case :math:`\mathsf{global}`, then: + + a. Let :math:`(\mathsf{global}~{\mathit{ga}})` be :math:`{\mathit{externval}}_0`. + + #. Return :math:`{\mathit{ga}}~{\mathrm{globals}}({{\mathit{externval}'}^\ast})`. + +#. Let :math:`{\mathit{externval}}~{{\mathit{externval}'}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{globals}}({{\mathit{externval}'}^\ast})`. + + +:math:`{\mathrm{tables}}({{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +.............................................................................................. + + +1. If :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externval}}_0~{{\mathit{externval}'}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externval}}_0` is of the case :math:`\mathsf{table}`, then: + + a. Let :math:`(\mathsf{table}~{\mathit{ta}})` be :math:`{\mathit{externval}}_0`. + + #. Return :math:`{\mathit{ta}}~{\mathrm{tables}}({{\mathit{externval}'}^\ast})`. + +#. Let :math:`{\mathit{externval}}~{{\mathit{externval}'}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{tables}}({{\mathit{externval}'}^\ast})`. + + +:math:`{\mathrm{mems}}({{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................ + + +1. If :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externval}}_0~{{\mathit{externval}'}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externval}}_0` is of the case :math:`\mathsf{mem}`, then: + + a. Let :math:`(\mathsf{mem}~{\mathit{ma}})` be :math:`{\mathit{externval}}_0`. + + #. Return :math:`{\mathit{ma}}~{\mathrm{mems}}({{\mathit{externval}'}^\ast})`. + +#. Let :math:`{\mathit{externval}}~{{\mathit{externval}'}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{mems}}({{\mathit{externval}'}^\ast})`. + + +:math:`{\mathrm{allocfunc}}({\mathit{moduleinst}}, {\mathit{func}})` +.................................................................... + + +1. Assert: Due to validation, :math:`{\mathit{func}}` is of the case :math:`\mathsf{func}`. + +#. Let :math:`(\mathsf{func}~x~{{\mathit{local}}^\ast}~{\mathit{expr}})` be :math:`{\mathit{func}}`. + +#. Let :math:`{\mathit{fi}}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~{\mathit{moduleinst}}{.}\mathsf{types}{}[x],\; \mathsf{module}~{\mathit{moduleinst}},\; \mathsf{code}~{\mathit{func}} \}\end{array}`. + +#. Let :math:`a` be :math:`{|s{.}\mathsf{funcs}|}`. + +#. Append :math:`{\mathit{fi}}` to the :math:`s{.}\mathsf{funcs}`. + +#. Return :math:`a`. + + +:math:`{\mathrm{allocfuncs}}({\mathit{moduleinst}}, {{\mathit{func}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +.................................................................................................................... + + +1. If :math:`{{\mathit{func}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{func}}~{{\mathit{func}'}^\ast}` be :math:`{{\mathit{func}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Let :math:`{\mathit{fa}}` be :math:`{\mathrm{allocfunc}}({\mathit{moduleinst}}, {\mathit{func}})`. + +#. Let :math:`{{\mathit{fa}'}^\ast}` be :math:`{\mathrm{allocfuncs}}({\mathit{moduleinst}}, {{\mathit{func}'}^\ast})`. + +#. Return :math:`{\mathit{fa}}~{{\mathit{fa}'}^\ast}`. + + +:math:`{\mathrm{allocglobal}}({\mathit{globaltype}}, {\mathit{val}})` +..................................................................... + + +1. Let :math:`{\mathit{gi}}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~{\mathit{globaltype}},\; \mathsf{value}~{\mathit{val}} \}\end{array}`. + +#. Let :math:`a` be :math:`{|s{.}\mathsf{globals}|}`. + +#. Append :math:`{\mathit{gi}}` to the :math:`s{.}\mathsf{globals}`. + +#. Return :math:`a`. + + +:math:`{\mathrm{allocglobals}}({{\mathit{globaltype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}, {{\mathit{val}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast})` +.................................................................................................................................................................... + + +1. If :math:`{{\mathit{globaltype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Assert: Due to validation, :math:`{{\mathit{val}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` is :math:`\epsilon`. + + #. Return :math:`\epsilon`. + +#. Else: + + a. Let :math:`{\mathit{globaltype}}~{{\mathit{globaltype}'}^\ast}` be :math:`{{\mathit{globaltype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + + #. Assert: Due to validation, :math:`{|{{\mathit{val}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}|}` is greater than or equal to :math:`1`. + + #. Let :math:`{\mathit{val}}~{{\mathit{val}'}^\ast}` be :math:`{{\mathit{val}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}`. + + #. Let :math:`{\mathit{ga}}` be :math:`{\mathrm{allocglobal}}({\mathit{globaltype}}, {\mathit{val}})`. + + #. Let :math:`{{\mathit{ga}'}^\ast}` be :math:`{\mathrm{allocglobals}}({{\mathit{globaltype}'}^\ast}, {{\mathit{val}'}^\ast})`. + + #. Return :math:`{\mathit{ga}}~{{\mathit{ga}'}^\ast}`. + + +:math:`{\mathrm{alloctable}}((i, j))` +..................................... + + +1. Let :math:`{\mathit{ti}}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~(i, j),\; \mathsf{refs}~{\epsilon^{i}} \}\end{array}`. + +#. Let :math:`a` be :math:`{|s{.}\mathsf{tables}|}`. + +#. Append :math:`{\mathit{ti}}` to the :math:`s{.}\mathsf{tables}`. + +#. Return :math:`a`. + + +:math:`{\mathrm{alloctables}}({{\mathit{tabletype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +................................................................................................... + + +1. If :math:`{{\mathit{tabletype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{tabletype}}~{{\mathit{tabletype}'}^\ast}` be :math:`{{\mathit{tabletype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Let :math:`{\mathit{ta}}` be :math:`{\mathrm{alloctable}}({\mathit{tabletype}})`. + +#. Let :math:`{{\mathit{ta}'}^\ast}` be :math:`{\mathrm{alloctables}}({{\mathit{tabletype}'}^\ast})`. + +#. Return :math:`{\mathit{ta}}~{{\mathit{ta}'}^\ast}`. + + +:math:`{\mathrm{allocmem}}((i, j))` +................................... + + +1. Let :math:`{\mathit{mi}}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~(i, j),\; \mathsf{bytes}~{0^{i \cdot 64 \, {\mathrm{Ki}}}} \}\end{array}`. + +#. Let :math:`a` be :math:`{|s{.}\mathsf{mems}|}`. + +#. Append :math:`{\mathit{mi}}` to the :math:`s{.}\mathsf{mems}`. + +#. Return :math:`a`. + + +:math:`{\mathrm{allocmems}}({{\mathit{memtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................... + + +1. If :math:`{{\mathit{memtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{memtype}}~{{\mathit{memtype}'}^\ast}` be :math:`{{\mathit{memtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Let :math:`{\mathit{ma}}` be :math:`{\mathrm{allocmem}}({\mathit{memtype}})`. + +#. Let :math:`{{\mathit{ma}'}^\ast}` be :math:`{\mathrm{allocmems}}({{\mathit{memtype}'}^\ast})`. + +#. Return :math:`{\mathit{ma}}~{{\mathit{ma}'}^\ast}`. + + +:math:`{\mathrm{instexport}}({{\mathit{fa}}^\ast}, {{\mathit{ga}}^\ast}, {{\mathit{ta}}^\ast}, {{\mathit{ma}}^\ast}, (\mathsf{export}~{\mathit{name}}~{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}))` +..................................................................................................................................................................................................................... + + +1. If :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{func}`, then: + + a. Let :math:`(\mathsf{func}~x)` be :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{name}~{\mathit{name}},\; \mathsf{value}~(\mathsf{func}~{{\mathit{fa}}^\ast}{}[x]) \}\end{array}`. + +#. If :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{global}`, then: + + a. Let :math:`(\mathsf{global}~x)` be :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{name}~{\mathit{name}},\; \mathsf{value}~(\mathsf{global}~{{\mathit{ga}}^\ast}{}[x]) \}\end{array}`. + +#. If :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{table}`, then: + + a. Let :math:`(\mathsf{table}~x)` be :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{name}~{\mathit{name}},\; \mathsf{value}~(\mathsf{table}~{{\mathit{ta}}^\ast}{}[x]) \}\end{array}`. + +#. Assert: Due to validation, :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{mem}`. + +#. Let :math:`(\mathsf{mem}~x)` be :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{name}~{\mathit{name}},\; \mathsf{value}~(\mathsf{mem}~{{\mathit{ma}}^\ast}{}[x]) \}\end{array}`. + + +:math:`{\mathrm{allocmodule}}({\mathit{module}}, {{\mathit{externval}}^\ast}, {{\mathit{val}}^\ast})` +..................................................................................................... + + +1. Let :math:`{{\mathit{fa}}_{\mathit{ex}}^\ast}` be :math:`{\mathrm{funcs}}({{\mathit{externval}}^\ast})`. + +#. Let :math:`{{\mathit{ga}}_{\mathit{ex}}^\ast}` be :math:`{\mathrm{globals}}({{\mathit{externval}}^\ast})`. + +#. Let :math:`{{\mathit{ma}}_{\mathit{ex}}^\ast}` be :math:`{\mathrm{mems}}({{\mathit{externval}}^\ast})`. + +#. Let :math:`{{\mathit{ta}}_{\mathit{ex}}^\ast}` be :math:`{\mathrm{tables}}({{\mathit{externval}}^\ast})`. + +#. Assert: Due to validation, :math:`{\mathit{module}}` is of the case :math:`\mathsf{module}`. + +#. Let :math:`(\mathsf{module}~{\mathit{type}}_0~{{\mathit{import}}^\ast}~{{\mathit{func}}^{n_{\mathit{func}}}}~{\mathit{global}}_1~{\mathit{table}}_2~{\mathit{mem}}_3~{{\mathit{elem}}^\ast}~{{\mathit{data}}^\ast}~{{\mathit{start}}^?}~{{\mathit{export}}^\ast})` be :math:`{\mathit{module}}`. + +#. Assert: Due to validation, :math:`{\mathit{mem}}_3` is of the case :math:`\mathsf{memory}`. + +#. Let :math:`{(\mathsf{memory}~{\mathit{memtype}})^{n_{\mathit{mem}}}}` be :math:`{\mathit{mem}}_3`. + +#. Assert: Due to validation, :math:`{\mathit{table}}_2` is of the case :math:`\mathsf{table}`. + +#. Let :math:`{(\mathsf{table}~{\mathit{tabletype}})^{n_{\mathit{table}}}}` be :math:`{\mathit{table}}_2`. + +#. Assert: Due to validation, :math:`{\mathit{global}}_1` is of the case :math:`\mathsf{global}`. + +#. Let :math:`{(\mathsf{global}~{\mathit{globaltype}}~{\mathit{expr}}_1)^{n_{\mathit{global}}}}` be :math:`{\mathit{global}}_1`. + +#. Assert: Due to validation, :math:`{\mathit{type}}_0` is of the case :math:`\mathsf{type}`. + +#. Let :math:`{(\mathsf{type}~{\mathit{ft}})^\ast}` be :math:`{\mathit{type}}_0`. + +#. Let :math:`{{\mathit{fa}}^\ast}` be :math:`{{|s{.}\mathsf{funcs}|} + i_{\mathit{func}}^{i_{\mathit{func}} t_2?) is valid. + +Globaltype_ok +- the global type ((MUT ()?), t) is valid. + +Tabletype_ok +- the table type limits is valid if and only if: + - the limits limits is valid with the nat ((2 ^ 32) - 1). + +Memtype_ok +- the memory type limits is valid if and only if: + - the limits limits is valid with the nat (2 ^ 16). + +Externtype_ok +- the external type externtype_u0 is valid if and only if: + - Either: + - externtype_u0 is (FUNC functype). + - the function type functype is valid. + - Or: + - externtype_u0 is (GLOBAL globaltype). + - the global type globaltype is valid. + - Or: + - externtype_u0 is (TABLE tabletype). + - the table type tabletype is valid. + - Or: + - externtype_u0 is (MEM memtype). + - the memory type memtype is valid. + +Limits_sub +- the limits (n_11, n_12) matches the limits (n_21, n_22) if and only if: + - n_11 is greater than or equal to n_21. + - n_12 is less than or equal to n_22. + +Functype_sub +- the function type ft matches the function type ft. + +Globaltype_sub +- the global type gt matches the global type gt. + +Tabletype_sub +- the table type lim_1 matches the table type lim_2 if and only if: + - the limits lim_1 matches the limits lim_2. + +Memtype_sub +- the memory type lim_1 matches the memory type lim_2 if and only if: + - the limits lim_1 matches the limits lim_2. + +Externtype_sub +- the external type externtype_u0 matches the external type externtype_u1 if and only if: + - Either: + - externtype_u0 is (FUNC ft_1). + - externtype_u1 is (FUNC ft_2). + - the function type ft_1 matches the function type ft_2. + - Or: + - externtype_u0 is (GLOBAL gt_1). + - externtype_u1 is (GLOBAL gt_2). + - the global type gt_1 matches the global type gt_2. + - Or: + - externtype_u0 is (TABLE tt_1). + - externtype_u1 is (TABLE tt_2). + - the table type tt_1 matches the table type tt_2. + - Or: + - externtype_u0 is (MEM mt_1). + - externtype_u1 is (MEM mt_2). + - the memory type mt_1 matches the memory type mt_2. + +Instr_ok/nop +- the instr NOP is valid with the function type ([] -> []). + +Instr_ok/unreachable +- the instr UNREACHABLE is valid with the function type (t_1* -> t_2*). + +Instr_ok/drop +- the instr DROP is valid with the function type ([t] -> []). + +Instr_ok/select +- the instr SELECT is valid with the function type ([t, t, I32] -> [t]). + +Instr_ok/block +- the instr (BLOCK t? instr*) is valid with the function type ([] -> t?) if and only if: + - Under the context C with .LABELS prepended by [t?], the instr sequence instr* is valid with the function type ([] -> t?). + +Instr_ok/loop +- the instr (LOOP t? instr*) is valid with the function type ([] -> t?) if and only if: + - Under the context C with .LABELS prepended by [?()], the instr sequence instr* is valid with the function type ([] -> []). + +Instr_ok/if +- the instr (IF t? instr_1* instr_2*) is valid with the function type ([I32] -> t?) if and only if: + - Under the context C with .LABELS prepended by [t?], the instr sequence instr_1* is valid with the function type ([] -> t?). + - Under the context C with .LABELS prepended by [t?], the instr sequence instr_2* is valid with the function type ([] -> t?). + +Instr_ok/br +- the instr (BR l) is valid with the function type (t_1* ++ t? -> t_2*) if and only if: + - |C.LABELS| is greater than l. + - C.LABELS[l] is t?. + +Instr_ok/br_if +- the instr (BR_IF l) is valid with the function type (t? ++ [I32] -> t?) if and only if: + - |C.LABELS| is greater than l. + - C.LABELS[l] is t?. + +Instr_ok/br_table +- the instr (BR_TABLE l* l') is valid with the function type (t_1* ++ t? -> t_2*) if and only if: + - |C.LABELS| is greater than l'. + - For all l in l*, + - |C.LABELS| is greater than l. + - t? is C.LABELS[l']. + - For all l in l*, + - t? is C.LABELS[l]. + +Instr_ok/call +- the instr (CALL x) is valid with the function type (t_1* -> t_2?) if and only if: + - |C.FUNCS| is greater than x. + - C.FUNCS[x] is (t_1* -> t_2?). + +Instr_ok/call_indirect +- the instr (CALL_INDIRECT x) is valid with the function type (t_1* ++ [I32] -> t_2?) if and only if: + - |C.TYPES| is greater than x. + - C.TYPES[x] is (t_1* -> t_2?). + +Instr_ok/return +- the instr RETURN is valid with the function type (t_1* ++ t? -> t_2*) if and only if: + - C.RETURN is ?(t?). + +Instr_ok/const +- the instr (t.CONST c_t) is valid with the function type ([] -> [t]). + +Instr_ok/unop +- the instr (UNOP t unop_t) is valid with the function type ([t] -> [t]). + +Instr_ok/binop +- the instr (BINOP t binop_t) is valid with the function type ([t, t] -> [t]). + +Instr_ok/testop +- the instr (TESTOP t testop_t) is valid with the function type ([t] -> [I32]). + +Instr_ok/relop +- the instr (RELOP t relop_t) is valid with the function type ([t, t] -> [I32]). + +Instr_ok/cvtop +- the instr (CVTOP nt_1 nt_2 REINTERPRET) is valid with the function type ([nt_2] -> [nt_1]) if and only if: + - $size(nt_1) is $size(nt_2). + +Instr_ok/local.get +- the instr (LOCAL.GET x) is valid with the function type ([] -> [t]) if and only if: + - |C.LOCALS| is greater than x. + - C.LOCALS[x] is t. + +Instr_ok/local.set +- the instr (LOCAL.SET x) is valid with the function type ([t] -> []) if and only if: + - |C.LOCALS| is greater than x. + - C.LOCALS[x] is t. + +Instr_ok/local.tee +- the instr (LOCAL.TEE x) is valid with the function type ([t] -> [t]) if and only if: + - |C.LOCALS| is greater than x. + - C.LOCALS[x] is t. + +Instr_ok/global.get +- the instr (GLOBAL.GET x) is valid with the function type ([] -> [t]) if and only if: + - |C.GLOBALS| is greater than x. + - C.GLOBALS[x] is (mut, t). + +Instr_ok/global.set +- the instr (GLOBAL.SET x) is valid with the function type ([t] -> []) if and only if: + - |C.GLOBALS| is greater than x. + - C.GLOBALS[x] is ((MUT ?(())), t). + +Instr_ok/memory.size +- the instr MEMORY.SIZE is valid with the function type ([] -> [I32]) if and only if: + - |C.MEMS| is greater than 0. + - C.MEMS[0] is mt. + +Instr_ok/memory.grow +- the instr MEMORY.GROW is valid with the function type ([I32] -> [I32]) if and only if: + - |C.MEMS| is greater than 0. + - C.MEMS[0] is mt. + +Instr_ok/load +- the instr (LOAD nt (n, sx)? memarg) is valid with the function type ([I32] -> [nt]) if and only if: + - |C.MEMS| is greater than 0. + - ((sx? is ?())) if and only if ((n? is ?())). + - C.MEMS[0] is mt. + - (2 ^ memarg.ALIGN) is less than or equal to ($size(nt) / 8). + - If n is defined, + - (2 ^ memarg.ALIGN) is less than or equal to (n / 8). + - (n / 8) is less than ($size(nt) / 8). + - If n is defined, + - nt is Inn. + +Instr_ok/store +- the instr (STORE nt n? memarg) is valid with the function type ([I32, nt] -> []) if and only if: + - |C.MEMS| is greater than 0. + - C.MEMS[0] is mt. + - (2 ^ memarg.ALIGN) is less than or equal to ($size(nt) / 8). + - If n is defined, + - (2 ^ memarg.ALIGN) is less than or equal to (n / 8). + - (n / 8) is less than ($size(nt) / 8). + - If n is defined, + - nt is Inn. + +Instrs_ok +- the instr sequence instr_u0* is valid with the function type (valtype_u1* -> valtype_u2*) if and only if: + - Either: + - instr_u0* is []. + - valtype_u1* is []. + - valtype_u2* is []. + - Or: + - instr_u0* is [instr_1] ++ instr_2*. + - valtype_u1* is t_1*. + - valtype_u2* is t_3*. + - the instr instr_1 is valid with the function type (t_1* -> t_2*). + - the instr sequence [instr_2] is valid with the function type (t_2* -> t_3*). + - Or: + - instr_u0* is instr*. + - valtype_u1* is t* ++ t_1*. + - valtype_u2* is t* ++ t_2*. + - the instr sequence instr* is valid with the function type (t_1* -> t_2*). + +Expr_ok +- the expression instr* is valid with the result type t? if and only if: + - the instr sequence instr* is valid with the function type ([] -> t?). + +Instr_const +- the instr instr_u0 is constant if and only if: + - Either: + - instr_u0 is (t.CONST c). + - Or: + - instr_u0 is (GLOBAL.GET x). + - |C.GLOBALS| is greater than x. + - C.GLOBALS[x] is ((MUT ?()), t). + +Expr_const +- the expression instr* is constant if and only if: + - For all instr in instr*, + - the instr instr is constant. + +Type_ok +- the type (TYPE ft) is valid with the function type ft if and only if: + - the function type ft is valid. + +Func_ok +- the function (FUNC x (LOCAL t)* expr) is valid with the function type (t_1* -> t_2?) if and only if: + - |C.TYPES| is greater than x. + - C.TYPES[x] is (t_1* -> t_2?). + - Under the context C with .LOCALS appended by t_1* ++ t* with .LABELS appended by [t_2?] with .RETURN appended by ?(t_2?), the expression expr is valid with the result type t_2?. + +Global_ok +- the global (GLOBAL gt expr) is valid with the global type gt if and only if: + - the global type gt is valid. + - gt is (mut, t). + - the expression expr is valid with the number type sequence ?(t). + - the expression expr is constant. + +Table_ok +- the table (TABLE tt) is valid with the table type tt if and only if: + - the table type tt is valid. + +Mem_ok +- the memory (MEMORY mt) is valid with the memory type mt if and only if: + - the memory type mt is valid. + +Elem_ok +- the table segment (ELEM expr x*) is valid if and only if: + - |C.TABLES| is greater than 0. + - |x*| is |ft*|. + - For all x in x*, + - |C.FUNCS| is greater than x. + - C.TABLES[0] is lim. + - the expression expr is valid with the number type sequence ?(I32). + - the expression expr is constant. + - For all ft in ft* and x in x*, + - C.FUNCS[x] is ft. + +Data_ok +- the memory segment (DATA expr b*) is valid if and only if: + - |C.MEMS| is greater than 0. + - C.MEMS[0] is lim. + - the expression expr is valid with the number type sequence ?(I32). + - the expression expr is constant. + +Start_ok +- the start function (START x) is valid if and only if: + - |C.FUNCS| is greater than x. + - C.FUNCS[x] is ([] -> []). + +Import_ok +- the import (IMPORT name_1 name_2 xt) is valid with the external type xt if and only if: + - the external type xt is valid. + +Externidx_ok +- the external index externidx_u0 is valid with the external type externtype_u1 if and only if: + - Either: + - externidx_u0 is (FUNC x). + - externtype_u1 is (FUNC ft). + - |C.FUNCS| is greater than x. + - C.FUNCS[x] is ft. + - Or: + - externidx_u0 is (GLOBAL x). + - externtype_u1 is (GLOBAL gt). + - |C.GLOBALS| is greater than x. + - C.GLOBALS[x] is gt. + - Or: + - externidx_u0 is (TABLE x). + - externtype_u1 is (TABLE tt). + - |C.TABLES| is greater than x. + - C.TABLES[x] is tt. + - Or: + - externidx_u0 is (MEM x). + - externtype_u1 is (MEM mt). + - |C.MEMS| is greater than x. + - C.MEMS[x] is mt. + +Export_ok +- the export (EXPORT name externidx) is valid with the external type xt if and only if: + - the external index externidx is valid with the external type xt. + +Module_ok +- the module (MODULE type* import* func* global* table* mem* elem* data* start? export*) is valid if and only if: + - |type*| is |ft'*|. + - |ixt*| is |import*|. + - |gt*| is |global*|. + - |func*| is |ft*|. + - |tt*| is |table*|. + - |mt*| is |mem*|. + - |xt*| is |export*|. + - For all ft' in ft'* and type in type*, + - the type type is valid with the function type ft'. + - For all import in import* and ixt in ixt*, + - Under the context { TYPES: ft'*; FUNCS: []; GLOBALS: []; TABLES: []; MEMS: []; LOCALS: []; LABELS: []; RETURN: ?(); }, the import import is valid with the external type ixt. + - For all global in global* and gt in gt*, + - Under the context C', the global global is valid with the global type gt. + - For all ft in ft* and func in func*, + - the function func is valid with the function type ft. + - For all table in table* and tt in tt*, + - the table table is valid with the table type tt. + - For all mem in mem* and mt in mt*, + - the memory mem is valid with the memory type mt. + - For all elem in elem*, + - the table segment elem is valid. + - For all data in data*, + - the memory segment data is valid. + - If start is defined, + - the start function start is valid. + - For all export in export* and xt in xt*, + - the export export is valid with the external type xt. + - |tt*| is less than or equal to 1. + - |mt*| is less than or equal to 1. + - C is { TYPES: ft'*; FUNCS: ift* ++ ft*; GLOBALS: igt* ++ gt*; TABLES: itt* ++ tt*; MEMS: imt* ++ mt*; LOCALS: []; LABELS: []; RETURN: ?(); }. + - C' is { TYPES: ft'*; FUNCS: ift* ++ ft*; GLOBALS: igt*; TABLES: []; MEMS: []; LOCALS: []; LABELS: []; RETURN: ?(); }. + - ift* is $funcsxt(ixt*). + - igt* is $globalsxt(ixt*). + - itt* is $tablesxt(ixt*). + - imt* is $memsxt(ixt*). + +Ki +1. Return 1024. + +min n_u0 n_u1 +1. If (n_u0 is 0), then: + a. Return 0. +2. If (n_u1 is 0), then: + a. Return 0. +3. Assert: Due to validation, (n_u0 ≥ 1). +4. Let i be (n_u0 - 1). +5. Assert: Due to validation, (n_u1 ≥ 1). +6. Let j be (n_u1 - 1). +7. Return $min(i, j). + +sum n_u0* +1. If (n_u0* is []), then: + a. Return 0. +2. Let [n] ++ n'* be n_u0*. +3. Return (n + $sum(n'*)). + +opt_ X X_u0* +1. If (X_u0* is []), then: + a. Return ?(). +2. Assert: Due to validation, (|X_u0*| is 1). +3. Let [w] be X_u0*. +4. Return ?(w). + +list_ X X_u0? +1. If X_u0? is not defined, then: + a. Return []. +2. Let ?(w) be X_u0?. +3. Return [w]. + +concat_ X X_u0* +1. If (X_u0* is []), then: + a. Return []. +2. Let [w*] ++ w'** be X_u0*. +3. Return w* ++ $concat_(X, w'**). + +signif N_u0 +1. If (N_u0 is 32), then: + a. Return 23. +2. Assert: Due to validation, (N_u0 is 64). +3. Return 52. + +expon N_u0 +1. If (N_u0 is 32), then: + a. Return 8. +2. Assert: Due to validation, (N_u0 is 64). +3. Return 11. + +M N +1. Return $signif(N). + +E N +1. Return $expon(N). + +fzero N +1. Return (POS (SUBNORM 0)). + +fone N +1. Return (POS (NORM 1 0)). + +canon_ N +1. Return (2 ^ ($signif(N) - 1)). + +size valtype_u0 +1. If (valtype_u0 is I32), then: + a. Return 32. +2. If (valtype_u0 is I64), then: + a. Return 64. +3. If (valtype_u0 is F32), then: + a. Return 32. +4. If (valtype_u0 is F64), then: + a. Return 64. + +funcsxt externtype_u0* +1. If (externtype_u0* is []), then: + a. Return []. +2. Let [externtype_0] ++ xt* be externtype_u0*. +3. If externtype_0 is of the case FUNC, then: + a. Let (FUNC ft) be externtype_0. + b. Return [ft] ++ $funcsxt(xt*). +4. Let [externtype] ++ xt* be externtype_u0*. +5. Return $funcsxt(xt*). + +globalsxt externtype_u0* +1. If (externtype_u0* is []), then: + a. Return []. +2. Let [externtype_0] ++ xt* be externtype_u0*. +3. If externtype_0 is of the case GLOBAL, then: + a. Let (GLOBAL gt) be externtype_0. + b. Return [gt] ++ $globalsxt(xt*). +4. Let [externtype] ++ xt* be externtype_u0*. +5. Return $globalsxt(xt*). + +tablesxt externtype_u0* +1. If (externtype_u0* is []), then: + a. Return []. +2. Let [externtype_0] ++ xt* be externtype_u0*. +3. If externtype_0 is of the case TABLE, then: + a. Let (TABLE tt) be externtype_0. + b. Return [tt] ++ $tablesxt(xt*). +4. Let [externtype] ++ xt* be externtype_u0*. +5. Return $tablesxt(xt*). + +memsxt externtype_u0* +1. If (externtype_u0* is []), then: + a. Return []. +2. Let [externtype_0] ++ xt* be externtype_u0*. +3. If externtype_0 is of the case MEM, then: + a. Let (MEM mt) be externtype_0. + b. Return [mt] ++ $memsxt(xt*). +4. Let [externtype] ++ xt* be externtype_u0*. +5. Return $memsxt(xt*). + +memarg0 +1. Return { ALIGN: 0; OFFSET: 0; }. + +signed_ N i +1. If (0 ≤ (2 ^ (N - 1))), then: + a. Return i. +2. Assert: Due to validation, ((2 ^ (N - 1)) ≤ i). +3. Assert: Due to validation, (i < (2 ^ N)). +4. Return (i - (2 ^ N)). + +invsigned_ N ii +1. Let j be $signed__1^-1(N, ii). +2. Return j. + +unop_ valtype_u1 unop__u0 val__u3 +1. If ((unop__u0 is CLZ) and the type of valtype_u1 is Inn), then: + a. Let Inn be valtype_u1. + b. Let iN be val__u3. + c. Return [$iclz_($size(Inn), iN)]. +2. If ((unop__u0 is CTZ) and the type of valtype_u1 is Inn), then: + a. Let Inn be valtype_u1. + b. Let iN be val__u3. + c. Return [$ictz_($size(Inn), iN)]. +3. If ((unop__u0 is POPCNT) and the type of valtype_u1 is Inn), then: + a. Let Inn be valtype_u1. + b. Let iN be val__u3. + c. Return [$ipopcnt_($size(Inn), iN)]. +4. If ((unop__u0 is ABS) and the type of valtype_u1 is Fnn), then: + a. Let Fnn be valtype_u1. + b. Let fN be val__u3. + c. Return $fabs_($size(Fnn), fN). +5. If ((unop__u0 is NEG) and the type of valtype_u1 is Fnn), then: + a. Let Fnn be valtype_u1. + b. Let fN be val__u3. + c. Return $fneg_($size(Fnn), fN). +6. If ((unop__u0 is SQRT) and the type of valtype_u1 is Fnn), then: + a. Let Fnn be valtype_u1. + b. Let fN be val__u3. + c. Return $fsqrt_($size(Fnn), fN). +7. If ((unop__u0 is CEIL) and the type of valtype_u1 is Fnn), then: + a. Let Fnn be valtype_u1. + b. Let fN be val__u3. + c. Return $fceil_($size(Fnn), fN). +8. If ((unop__u0 is FLOOR) and the type of valtype_u1 is Fnn), then: + a. Let Fnn be valtype_u1. + b. Let fN be val__u3. + c. Return $ffloor_($size(Fnn), fN). +9. If ((unop__u0 is TRUNC) and the type of valtype_u1 is Fnn), then: + a. Let Fnn be valtype_u1. + b. Let fN be val__u3. + c. Return $ftrunc_($size(Fnn), fN). +10. Assert: Due to validation, (unop__u0 is NEAREST). +11. Assert: Due to validation, the type of valtype_u1 is Fnn. +12. Let Fnn be valtype_u1. +13. Let fN be val__u3. +14. Return $fnearest_($size(Fnn), fN). + +binop_ valtype_u1 binop__u0 val__u3 val__u5 +1. If ((binop__u0 is ADD) and the type of valtype_u1 is Inn), then: + a. Let Inn be valtype_u1. + b. Let iN_1 be val__u3. + c. Let iN_2 be val__u5. + d. Return [$iadd_($size(Inn), iN_1, iN_2)]. +2. If ((binop__u0 is SUB) and the type of valtype_u1 is Inn), then: + a. Let Inn be valtype_u1. + b. Let iN_1 be val__u3. + c. Let iN_2 be val__u5. + d. Return [$isub_($size(Inn), iN_1, iN_2)]. +3. If ((binop__u0 is MUL) and the type of valtype_u1 is Inn), then: + a. Let Inn be valtype_u1. + b. Let iN_1 be val__u3. + c. Let iN_2 be val__u5. + d. Return [$imul_($size(Inn), iN_1, iN_2)]. +4. If the type of valtype_u1 is Inn, then: + a. Let Inn be valtype_u1. + b. Let iN_1 be val__u3. + c. Let iN_2 be val__u5. + d. If binop__u0 is of the case DIV, then: + 1) Let (DIV sx) be binop__u0. + 2) Return $list_(val_((Inn : Inn <: valtype)), $idiv_($size(Inn), sx, iN_1, iN_2)). + e. If binop__u0 is of the case REM, then: + 1) Let (REM sx) be binop__u0. + 2) Return $list_(val_((Inn : Inn <: valtype)), $irem_($size(Inn), sx, iN_1, iN_2)). +5. If ((binop__u0 is AND) and the type of valtype_u1 is Inn), then: + a. Let Inn be valtype_u1. + b. Let iN_1 be val__u3. + c. Let iN_2 be val__u5. + d. Return [$iand_($size(Inn), iN_1, iN_2)]. +6. If ((binop__u0 is OR) and the type of valtype_u1 is Inn), then: + a. Let Inn be valtype_u1. + b. Let iN_1 be val__u3. + c. Let iN_2 be val__u5. + d. Return [$ior_($size(Inn), iN_1, iN_2)]. +7. If ((binop__u0 is XOR) and the type of valtype_u1 is Inn), then: + a. Let Inn be valtype_u1. + b. Let iN_1 be val__u3. + c. Let iN_2 be val__u5. + d. Return [$ixor_($size(Inn), iN_1, iN_2)]. +8. If ((binop__u0 is SHL) and the type of valtype_u1 is Inn), then: + a. Let Inn be valtype_u1. + b. Let iN_1 be val__u3. + c. Let iN_2 be val__u5. + d. Return [$ishl_($size(Inn), iN_1, iN_2)]. +9. If the type of valtype_u1 is Inn, then: + a. Let Inn be valtype_u1. + b. Let iN_1 be val__u3. + c. Let iN_2 be val__u5. + d. If binop__u0 is of the case SHR, then: + 1) Let (SHR sx) be binop__u0. + 2) Return [$ishr_($size(Inn), sx, iN_1, iN_2)]. +10. If ((binop__u0 is ROTL) and the type of valtype_u1 is Inn), then: + a. Let Inn be valtype_u1. + b. Let iN_1 be val__u3. + c. Let iN_2 be val__u5. + d. Return [$irotl_($size(Inn), iN_1, iN_2)]. +11. If ((binop__u0 is ROTR) and the type of valtype_u1 is Inn), then: + a. Let Inn be valtype_u1. + b. Let iN_1 be val__u3. + c. Let iN_2 be val__u5. + d. Return [$irotr_($size(Inn), iN_1, iN_2)]. +12. If ((binop__u0 is ADD) and the type of valtype_u1 is Fnn), then: + a. Let Fnn be valtype_u1. + b. Let fN_1 be val__u3. + c. Let fN_2 be val__u5. + d. Return $fadd_($size(Fnn), fN_1, fN_2). +13. If ((binop__u0 is SUB) and the type of valtype_u1 is Fnn), then: + a. Let Fnn be valtype_u1. + b. Let fN_1 be val__u3. + c. Let fN_2 be val__u5. + d. Return $fsub_($size(Fnn), fN_1, fN_2). +14. If ((binop__u0 is MUL) and the type of valtype_u1 is Fnn), then: + a. Let Fnn be valtype_u1. + b. Let fN_1 be val__u3. + c. Let fN_2 be val__u5. + d. Return $fmul_($size(Fnn), fN_1, fN_2). +15. If ((binop__u0 is DIV) and the type of valtype_u1 is Fnn), then: + a. Let Fnn be valtype_u1. + b. Let fN_1 be val__u3. + c. Let fN_2 be val__u5. + d. Return $fdiv_($size(Fnn), fN_1, fN_2). +16. If ((binop__u0 is MIN) and the type of valtype_u1 is Fnn), then: + a. Let Fnn be valtype_u1. + b. Let fN_1 be val__u3. + c. Let fN_2 be val__u5. + d. Return $fmin_($size(Fnn), fN_1, fN_2). +17. If ((binop__u0 is MAX) and the type of valtype_u1 is Fnn), then: + a. Let Fnn be valtype_u1. + b. Let fN_1 be val__u3. + c. Let fN_2 be val__u5. + d. Return $fmax_($size(Fnn), fN_1, fN_2). +18. Assert: Due to validation, (binop__u0 is COPYSIGN). +19. Assert: Due to validation, the type of valtype_u1 is Fnn. +20. Let Fnn be valtype_u1. +21. Let fN_1 be val__u3. +22. Let fN_2 be val__u5. +23. Return $fcopysign_($size(Fnn), fN_1, fN_2). + +testop_ Inn EQZ iN +1. Return $ieqz_($size(Inn), iN). + +relop_ valtype_u1 relop__u0 val__u3 val__u5 +1. If ((relop__u0 is EQ) and the type of valtype_u1 is Inn), then: + a. Let Inn be valtype_u1. + b. Let iN_1 be val__u3. + c. Let iN_2 be val__u5. + d. Return $ieq_($size(Inn), iN_1, iN_2). +2. If ((relop__u0 is NE) and the type of valtype_u1 is Inn), then: + a. Let Inn be valtype_u1. + b. Let iN_1 be val__u3. + c. Let iN_2 be val__u5. + d. Return $ine_($size(Inn), iN_1, iN_2). +3. If the type of valtype_u1 is Inn, then: + a. Let Inn be valtype_u1. + b. Let iN_1 be val__u3. + c. Let iN_2 be val__u5. + d. If relop__u0 is of the case LT, then: + 1) Let (LT sx) be relop__u0. + 2) Return $ilt_($size(Inn), sx, iN_1, iN_2). + e. If relop__u0 is of the case GT, then: + 1) Let (GT sx) be relop__u0. + 2) Return $igt_($size(Inn), sx, iN_1, iN_2). + f. If relop__u0 is of the case LE, then: + 1) Let (LE sx) be relop__u0. + 2) Return $ile_($size(Inn), sx, iN_1, iN_2). + g. If relop__u0 is of the case GE, then: + 1) Let (GE sx) be relop__u0. + 2) Return $ige_($size(Inn), sx, iN_1, iN_2). +4. If ((relop__u0 is EQ) and the type of valtype_u1 is Fnn), then: + a. Let Fnn be valtype_u1. + b. Let fN_1 be val__u3. + c. Let fN_2 be val__u5. + d. Return $feq_($size(Fnn), fN_1, fN_2). +5. If ((relop__u0 is NE) and the type of valtype_u1 is Fnn), then: + a. Let Fnn be valtype_u1. + b. Let fN_1 be val__u3. + c. Let fN_2 be val__u5. + d. Return $fne_($size(Fnn), fN_1, fN_2). +6. If ((relop__u0 is LT) and the type of valtype_u1 is Fnn), then: + a. Let Fnn be valtype_u1. + b. Let fN_1 be val__u3. + c. Let fN_2 be val__u5. + d. Return $flt_($size(Fnn), fN_1, fN_2). +7. If ((relop__u0 is GT) and the type of valtype_u1 is Fnn), then: + a. Let Fnn be valtype_u1. + b. Let fN_1 be val__u3. + c. Let fN_2 be val__u5. + d. Return $fgt_($size(Fnn), fN_1, fN_2). +8. If ((relop__u0 is LE) and the type of valtype_u1 is Fnn), then: + a. Let Fnn be valtype_u1. + b. Let fN_1 be val__u3. + c. Let fN_2 be val__u5. + d. Return $fle_($size(Fnn), fN_1, fN_2). +9. Assert: Due to validation, (relop__u0 is GE). +10. Assert: Due to validation, the type of valtype_u1 is Fnn. +11. Let Fnn be valtype_u1. +12. Let fN_1 be val__u3. +13. Let fN_2 be val__u5. +14. Return $fge_($size(Fnn), fN_1, fN_2). + +cvtop__ valtype_u0 valtype_u1 cvtop_u2 val__u4 +1. If ((valtype_u0 is I32) and (valtype_u1 is I64)), then: + a. Let iN be val__u4. + b. If cvtop_u2 is of the case EXTEND, then: + 1) Let (EXTEND sx) be cvtop_u2. + 2) Return [$extend__(32, 64, sx, iN)]. +2. If ((valtype_u0 is I64) and ((valtype_u1 is I32) and (cvtop_u2 is WRAP))), then: + a. Let iN be val__u4. + b. Return [$wrap__(64, 32, iN)]. +3. If the type of valtype_u0 is Fnn, then: + a. Let Fnn be valtype_u0. + b. If the type of valtype_u1 is Inn, then: + 1) Let Inn be valtype_u1. + 2) Let fN be val__u4. + 3) If cvtop_u2 is of the case TRUNC, then: + a) Let (TRUNC sx) be cvtop_u2. + b) Return $list_(val_((Inn : Inn <: valtype)), $trunc__($size(Fnn), $size(Inn), sx, fN)). +4. If ((valtype_u0 is F32) and ((valtype_u1 is F64) and (cvtop_u2 is PROMOTE))), then: + a. Let fN be val__u4. + b. Return $promote__(32, 64, fN). +5. If ((valtype_u0 is F64) and ((valtype_u1 is F32) and (cvtop_u2 is DEMOTE))), then: + a. Let fN be val__u4. + b. Return $demote__(64, 32, fN). +6. If the type of valtype_u1 is Fnn, then: + a. Let Fnn be valtype_u1. + b. If the type of valtype_u0 is Inn, then: + 1) Let Inn be valtype_u0. + 2) Let iN be val__u4. + 3) If cvtop_u2 is of the case CONVERT, then: + a) Let (CONVERT sx) be cvtop_u2. + b) Return [$convert__($size(Inn), $size(Fnn), sx, iN)]. +7. Assert: Due to validation, (cvtop_u2 is REINTERPRET). +8. If the type of valtype_u1 is Fnn, then: + a. Let Fnn be valtype_u1. + b. If the type of valtype_u0 is Inn, then: + 1) Let Inn be valtype_u0. + 2) Let iN be val__u4. + 3) If ($size(Inn) is $size(Fnn)), then: + a) Return [$reinterpret__(Inn, Fnn, iN)]. +9. Assert: Due to validation, the type of valtype_u0 is Fnn. +10. Let Fnn be valtype_u0. +11. Assert: Due to validation, the type of valtype_u1 is Inn. +12. Let Inn be valtype_u1. +13. Let fN be val__u4. +14. Assert: Due to validation, ($size(Inn) is $size(Fnn)). +15. Return [$reinterpret__(Fnn, Inn, fN)]. + +invibytes_ N b* +1. Let n be $ibytes__1^-1(N, b*). +2. Return n. + +invfbytes_ N b* +1. Let p be $fbytes__1^-1(N, b*). +2. Return p. + +default_ valtype_u0 +1. If (valtype_u0 is I32), then: + a. Return (I32.CONST 0). +2. If (valtype_u0 is I64), then: + a. Return (I64.CONST 0). +3. If (valtype_u0 is F32), then: + a. Return (F32.CONST $fzero(32)). +4. Assert: Due to validation, (valtype_u0 is F64). +5. Return (F64.CONST $fzero(64)). + +funcsxv externval_u0* +1. If (externval_u0* is []), then: + a. Return []. +2. Let [externval_0] ++ xv* be externval_u0*. +3. If externval_0 is of the case FUNC, then: + a. Let (FUNC fa) be externval_0. + b. Return [fa] ++ $funcsxv(xv*). +4. Let [externval] ++ xv* be externval_u0*. +5. Return $funcsxv(xv*). + +globalsxv externval_u0* +1. If (externval_u0* is []), then: + a. Return []. +2. Let [externval_0] ++ xv* be externval_u0*. +3. If externval_0 is of the case GLOBAL, then: + a. Let (GLOBAL ga) be externval_0. + b. Return [ga] ++ $globalsxv(xv*). +4. Let [externval] ++ xv* be externval_u0*. +5. Return $globalsxv(xv*). + +tablesxv externval_u0* +1. If (externval_u0* is []), then: + a. Return []. +2. Let [externval_0] ++ xv* be externval_u0*. +3. If externval_0 is of the case TABLE, then: + a. Let (TABLE ta) be externval_0. + b. Return [ta] ++ $tablesxv(xv*). +4. Let [externval] ++ xv* be externval_u0*. +5. Return $tablesxv(xv*). + +memsxv externval_u0* +1. If (externval_u0* is []), then: + a. Return []. +2. Let [externval_0] ++ xv* be externval_u0*. +3. If externval_0 is of the case MEM, then: + a. Let (MEM ma) be externval_0. + b. Return [ma] ++ $memsxv(xv*). +4. Let [externval] ++ xv* be externval_u0*. +5. Return $memsxv(xv*). + +store +1. Return. + +frame +1. Let f be the current frame. +2. Return f. + +funcaddr +1. Let f be the current frame. +2. Return f.MODULE.FUNCS. + +funcinst +1. Return s.FUNCS. + +globalinst +1. Return s.GLOBALS. + +tableinst +1. Return s.TABLES. + +meminst +1. Return s.MEMS. + +moduleinst +1. Let f be the current frame. +2. Return f.MODULE. + +type x +1. Let f be the current frame. +2. Return f.MODULE.TYPES[x]. + +func x +1. Let f be the current frame. +2. Return s.FUNCS[f.MODULE.FUNCS[x]]. + +global x +1. Let f be the current frame. +2. Return s.GLOBALS[f.MODULE.GLOBALS[x]]. + +table x +1. Let f be the current frame. +2. Return s.TABLES[f.MODULE.TABLES[x]]. + +mem x +1. Let f be the current frame. +2. Return s.MEMS[f.MODULE.MEMS[x]]. + +local x +1. Let f be the current frame. +2. Return f.LOCALS[x]. + +with_local x v +1. Let f be the current frame. +2. Replace f.LOCALS[x] with v. + +with_global x v +1. Let f be the current frame. +2. Replace s.GLOBALS[f.MODULE.GLOBALS[x]].VALUE with v. + +with_table x i a +1. Let f be the current frame. +2. Replace s.TABLES[f.MODULE.TABLES[x]].REFS[i] with ?(a). + +with_tableinst x ti +1. Let f be the current frame. +2. Replace s.TABLES[f.MODULE.TABLES[x]] with ti. + +with_mem x i j b* +1. Let f be the current frame. +2. Replace s.MEMS[f.MODULE.MEMS[x]].BYTES[i : j] with b*. + +with_meminst x mi +1. Let f be the current frame. +2. Replace s.MEMS[f.MODULE.MEMS[x]] with mi. + +growtable ti n +1. Let { TYPE: (i, j); REFS: ?(a)*; } be ti. +2. Let i' be (|a*| + n). +3. If (i' ≤ j), then: + a. Let ti' be { TYPE: (i', j); REFS: ?(a)* ++ ?()^n; }. + b. Return ti'. + +growmemory mi n +1. Let { TYPE: (i, j); BYTES: b*; } be mi. +2. Let i' be ((|b*| / (64 · $Ki())) + n). +3. If (i' ≤ j), then: + a. Let mi' be { TYPE: (i', j); BYTES: b* ++ 0^(n · (64 · $Ki())); }. + b. Return mi'. + +funcs externval_u0* +1. If (externval_u0* is []), then: + a. Return []. +2. Let [externval_0] ++ externval'* be externval_u0*. +3. If externval_0 is of the case FUNC, then: + a. Let (FUNC fa) be externval_0. + b. Return [fa] ++ $funcs(externval'*). +4. Let [externval] ++ externval'* be externval_u0*. +5. Return $funcs(externval'*). + +globals externval_u0* +1. If (externval_u0* is []), then: + a. Return []. +2. Let [externval_0] ++ externval'* be externval_u0*. +3. If externval_0 is of the case GLOBAL, then: + a. Let (GLOBAL ga) be externval_0. + b. Return [ga] ++ $globals(externval'*). +4. Let [externval] ++ externval'* be externval_u0*. +5. Return $globals(externval'*). + +tables externval_u0* +1. If (externval_u0* is []), then: + a. Return []. +2. Let [externval_0] ++ externval'* be externval_u0*. +3. If externval_0 is of the case TABLE, then: + a. Let (TABLE ta) be externval_0. + b. Return [ta] ++ $tables(externval'*). +4. Let [externval] ++ externval'* be externval_u0*. +5. Return $tables(externval'*). + +mems externval_u0* +1. If (externval_u0* is []), then: + a. Return []. +2. Let [externval_0] ++ externval'* be externval_u0*. +3. If externval_0 is of the case MEM, then: + a. Let (MEM ma) be externval_0. + b. Return [ma] ++ $mems(externval'*). +4. Let [externval] ++ externval'* be externval_u0*. +5. Return $mems(externval'*). + +allocfunc moduleinst func +1. Assert: Due to validation, func is of the case FUNC. +2. Let (FUNC x local* expr) be func. +3. Let fi be { TYPE: moduleinst.TYPES[x]; MODULE: moduleinst; CODE: func; }. +4. Let a be |s.FUNCS|. +5. Append fi to the s.FUNCS. +6. Return a. + +allocfuncs moduleinst func_u0* +1. If (func_u0* is []), then: + a. Return []. +2. Let [func] ++ func'* be func_u0*. +3. Let fa be $allocfunc(moduleinst, func). +4. Let fa'* be $allocfuncs(moduleinst, func'*). +5. Return [fa] ++ fa'*. + +allocglobal globaltype val +1. Let gi be { TYPE: globaltype; VALUE: val; }. +2. Let a be |s.GLOBALS|. +3. Append gi to the s.GLOBALS. +4. Return a. + +allocglobals globaltype_u0* val_u1* +1. If (globaltype_u0* is []), then: + a. Assert: Due to validation, (val_u1* is []). + b. Return []. +2. Else: + a. Let [globaltype] ++ globaltype'* be globaltype_u0*. + b. Assert: Due to validation, (|val_u1*| ≥ 1). + c. Let [val] ++ val'* be val_u1*. + d. Let ga be $allocglobal(globaltype, val). + e. Let ga'* be $allocglobals(globaltype'*, val'*). + f. Return [ga] ++ ga'*. + +alloctable (i, j) +1. Let ti be { TYPE: (i, j); REFS: ?()^i; }. +2. Let a be |s.TABLES|. +3. Append ti to the s.TABLES. +4. Return a. + +alloctables tabletype_u0* +1. If (tabletype_u0* is []), then: + a. Return []. +2. Let [tabletype] ++ tabletype'* be tabletype_u0*. +3. Let ta be $alloctable(tabletype). +4. Let ta'* be $alloctables(tabletype'*). +5. Return [ta] ++ ta'*. + +allocmem (i, j) +1. Let mi be { TYPE: (i, j); BYTES: 0^(i · (64 · $Ki())); }. +2. Let a be |s.MEMS|. +3. Append mi to the s.MEMS. +4. Return a. + +allocmems memtype_u0* +1. If (memtype_u0* is []), then: + a. Return []. +2. Let [memtype] ++ memtype'* be memtype_u0*. +3. Let ma be $allocmem(memtype). +4. Let ma'* be $allocmems(memtype'*). +5. Return [ma] ++ ma'*. + +instexport fa* ga* ta* ma* (EXPORT name externidx_u0) +1. If externidx_u0 is of the case FUNC, then: + a. Let (FUNC x) be externidx_u0. + b. Return { NAME: name; VALUE: (FUNC fa*[x]); }. +2. If externidx_u0 is of the case GLOBAL, then: + a. Let (GLOBAL x) be externidx_u0. + b. Return { NAME: name; VALUE: (GLOBAL ga*[x]); }. +3. If externidx_u0 is of the case TABLE, then: + a. Let (TABLE x) be externidx_u0. + b. Return { NAME: name; VALUE: (TABLE ta*[x]); }. +4. Assert: Due to validation, externidx_u0 is of the case MEM. +5. Let (MEM x) be externidx_u0. +6. Return { NAME: name; VALUE: (MEM ma*[x]); }. + +allocmodule module externval* val* +1. Let fa_ex* be $funcs(externval*). +2. Let ga_ex* be $globals(externval*). +3. Let ma_ex* be $mems(externval*). +4. Let ta_ex* be $tables(externval*). +5. Assert: Due to validation, module is of the case MODULE. +6. Let (MODULE type_0 import* func^n_func global_1 table_2 mem_3 elem* data* start? export*) be module. +7. Assert: Due to validation, mem_3 is of the case MEMORY. +8. Let (MEMORY memtype)^n_mem be mem_3. +9. Assert: Due to validation, table_2 is of the case TABLE. +10. Let (TABLE tabletype)^n_table be table_2. +11. Assert: Due to validation, global_1 is of the case GLOBAL. +12. Let (GLOBAL globaltype expr_1)^n_global be global_1. +13. Assert: Due to validation, type_0 is of the case TYPE. +14. Let (TYPE ft)* be type_0. +15. Let fa* be (|s.FUNCS| + i_func)^(i_func t_2*) be $funcinst()[fa].TYPE. +4. Pop the activation of _f from the stack. +5. Let k be |t_2*|. +6. Push the activation of f with arity k to the stack. +7. Push the values val^n to the stack. +8. Execute the instruction (CALL_ADDR fa). +9. Pop all values val* from the top of the stack. +10. Pop the activation of f with arity k from the stack. +11. Push the values val* to the stack. +12. Pop the values val^k from the stack. +13. Return val^k. + +Step_pure/unreachable +1. Trap. + +Step_pure/nop +1. Do nothing. + +Step_pure/drop +1. Assert: Due to validation, a value is on the top of the stack. +2. Pop the value val from the stack. +3. Do nothing. + +Step_pure/select +1. Assert: Due to validation, a value of value type I32 is on the top of the stack. +2. Pop the value (I32.CONST c) from the stack. +3. Assert: Due to validation, a value is on the top of the stack. +4. Pop the value val_2 from the stack. +5. Assert: Due to validation, a value is on the top of the stack. +6. Pop the value val_1 from the stack. +7. If (c is not 0), then: + a. Push the value val_1 to the stack. +8. Else: + a. Push the value val_2 to the stack. + +Step_pure/if t? instr_1* instr_2* +1. Assert: Due to validation, a value of value type I32 is on the top of the stack. +2. Pop the value (I32.CONST c) from the stack. +3. If (c is not 0), then: + a. Execute the instruction (BLOCK t? instr_1*). +4. Else: + a. Execute the instruction (BLOCK t? instr_2*). + +Step_pure/label +1. Pop all values val* from the top of the stack. +2. Assert: Due to validation, a label is now on the top of the stack. +3. Pop the current label from the stack. +4. Push the values val* to the stack. + +Step_pure/br n_u0 +1. Pop all values val* from the top of the stack. +2. Let L be the current label. +3. Let n be the arity of L. +4. Let instr'* be the continuation of L. +5. Pop the current label from the stack. +6. Let admininstr_u1* be val*. +7. If ((n_u0 is 0) and (|admininstr_u1*| ≥ n)), then: + a. Let val'* ++ val^n be admininstr_u1*. + b. Push the values val^n to the stack. + c. Execute the instruction instr'*. +8. If (n_u0 ≥ 1), then: + a. Let l be (n_u0 - 1). + b. If the type of admininstr_u1 is val*, then: + 1) Let val* be admininstr_u1*. + 2) Push the values val* to the stack. + 3) Execute the instruction (BR l). + +Step_pure/br_if l +1. Assert: Due to validation, a value of value type I32 is on the top of the stack. +2. Pop the value (I32.CONST c) from the stack. +3. If (c is not 0), then: + a. Execute the instruction (BR l). +4. Else: + a. Do nothing. + +Step_pure/br_table l* l' +1. Assert: Due to validation, a value of value type I32 is on the top of the stack. +2. Pop the value (I32.CONST i) from the stack. +3. If (i < |l*|), then: + a. Execute the instruction (BR l*[i]). +4. Else: + a. Execute the instruction (BR l'). + +Step_pure/frame +1. Let f be the current frame. +2. Let n be the arity of f. +3. Assert: Due to validation, there are at least n values on the top of the stack. +4. Assert: Due to validation, there are at least n values on the top of the stack. +5. Pop the values val^n from the stack. +6. Assert: Due to validation, a frame is now on the top of the stack. +7. Pop the current frame from the stack. +8. Push the values val^n to the stack. + +Step_pure/return +1. Pop all values val* from the top of the stack. +2. If a frame is now on the top of the stack, then: + a. Let f be the current frame. + b. Let n be the arity of f. + c. Pop the current frame from the stack. + d. Let val'* ++ val^n be val*. + e. Push the values val^n to the stack. +3. Else if a label is now on the top of the stack, then: + a. Pop the current label from the stack. + b. Push the values val* to the stack. + c. Execute the instruction RETURN. + +Step_pure/trap +1. YetI: TODO: It is likely that the value stack of two rules are different. + +Step_pure/unop t unop +1. Assert: Due to validation, a value of value type t is on the top of the stack. +2. Pop the value (t.CONST c_1) from the stack. +3. If (|$unop_(t, unop, c_1)| ≤ 0), then: + a. Trap. +4. Let c be an element of $unop_(t, unop, c_1). +5. Push the value (t.CONST c) to the stack. + +Step_pure/binop t binop +1. Assert: Due to validation, a value of value type t is on the top of the stack. +2. Pop the value (t.CONST c_2) from the stack. +3. Assert: Due to validation, a value of value type t is on the top of the stack. +4. Pop the value (t.CONST c_1) from the stack. +5. If (|$binop_(t, binop, c_1, c_2)| ≤ 0), then: + a. Trap. +6. Let c be an element of $binop_(t, binop, c_1, c_2). +7. Push the value (t.CONST c) to the stack. + +Step_pure/testop t testop +1. Assert: Due to validation, a value of value type t is on the top of the stack. +2. Pop the value (t.CONST c_1) from the stack. +3. Let c be $testop_(t, testop, c_1). +4. Push the value (I32.CONST c) to the stack. + +Step_pure/relop t relop +1. Assert: Due to validation, a value of value type t is on the top of the stack. +2. Pop the value (t.CONST c_2) from the stack. +3. Assert: Due to validation, a value of value type t is on the top of the stack. +4. Pop the value (t.CONST c_1) from the stack. +5. Let c be $relop_(t, relop, c_1, c_2). +6. Push the value (I32.CONST c) to the stack. + +Step_pure/cvtop t_2 t_1 cvtop +1. Assert: Due to validation, a value of value type t_1 is on the top of the stack. +2. Pop the value (t_1.CONST c_1) from the stack. +3. If (|$cvtop__(t_1, t_2, cvtop, c_1)| ≤ 0), then: + a. Trap. +4. Let c be an element of $cvtop__(t_1, t_2, cvtop, c_1). +5. Push the value (t_2.CONST c) to the stack. + +Step_pure/local.tee x +1. Assert: Due to validation, a value is on the top of the stack. +2. Pop the value val from the stack. +3. Push the value val to the stack. +4. Push the value val to the stack. +5. Execute the instruction (LOCAL.SET x). + +Step_read/block t? instr* +1. If t? is not defined, then: + a. Let n be 0. +2. Else: + a. Let n be 1. +3. Let L be the label_n{[]}. +4. Enter instr* with label L. + +Step_read/loop t? instr* +1. Let L be the label_0{[(LOOP t? instr*)]}. +2. Enter instr* with label L. + +Step_read/call x +1. Let z be the current state. +2. Assert: Due to validation, (x < |$funcaddr(z)|). +3. Execute the instruction (CALL_ADDR $funcaddr(z)[x]). + +Step_read/call_indirect x +1. Let z be the current state. +2. Assert: Due to validation, a value of value type I32 is on the top of the stack. +3. Pop the value (I32.CONST i) from the stack. +4. If (i ≥ |$table(z, 0).REFS|), then: + a. Trap. +5. If $table(z, 0).REFS[i] is not defined, then: + a. Trap. +6. Let ?(a) be $table(z, 0).REFS[i]. +7. If (a ≥ |$funcinst(z)|), then: + a. Trap. +8. If ($type(z, x) is not $funcinst(z)[a].TYPE), then: + a. Trap. +9. Execute the instruction (CALL_ADDR a). + +Step_read/call_addr a +1. Let z be the current state. +2. Assert: Due to validation, (a < |$funcinst(z)|). +3. Let { TYPE: (t_1^k -> t_2^n); MODULE: mm; CODE: func; } be $funcinst(z)[a]. +4. Assert: Due to validation, there are at least k values on the top of the stack. +5. Pop the values val^k from the stack. +6. Assert: Due to validation, func is of the case FUNC. +7. Let (FUNC x local_0 instr*) be func. +8. Assert: Due to validation, local_0 is of the case LOCAL. +9. Let (LOCAL t)* be local_0. +10. Let f be { LOCALS: val^k ++ $default_(t)*; MODULE: mm; }. +11. Let F be the activation of f with arity n. +12. Push F to the stack. +13. Let L be the label_n{[]}. +14. Enter instr* with label L. + +Step_read/local.get x +1. Let z be the current state. +2. Push the value $local(z, x) to the stack. + +Step_read/global.get x +1. Let z be the current state. +2. Push the value $global(z, x).VALUE to the stack. + +Step_read/load valtype_u0 sz_sx_u1? ao +1. Let z be the current state. +2. Assert: Due to validation, a value of value type I32 is on the top of the stack. +3. Pop the value (I32.CONST i) from the stack. +4. If sz_sx_u1? is not defined, then: + a. Let t be valtype_u0. + b. If (((i + ao.OFFSET) + ($size(t) / 8)) > |$mem(z, 0).BYTES|), then: + 1) Trap. + c. Let c be $bytes__1^-1(t, $mem(z, 0).BYTES[(i + ao.OFFSET) : ($size(t) / 8)]). + d. Push the value (t.CONST c) to the stack. +5. If the type of valtype_u0 is Inn, then: + a. If sz_sx_u1? is defined, then: + 1) Let ?(sz_sx_0) be sz_sx_u1?. + 2) Let (n, sx) be sz_sx_0. + 3) If (((i + ao.OFFSET) + (n / 8)) > |$mem(z, 0).BYTES|), then: + a) Trap. + b. Let Inn be valtype_u0. + c. If sz_sx_u1? is defined, then: + 1) Let ?(sz_sx_0) be sz_sx_u1?. + 2) Let (n, sx) be sz_sx_0. + 3) Let c be $ibytes__1^-1(n, $mem(z, 0).BYTES[(i + ao.OFFSET) : (n / 8)]). + 4) Push the value (Inn.CONST $extend__(n, $size(Inn), sx, c)) to the stack. + +Step_read/memory.size +1. Let z be the current state. +2. Let ((n · 64) · $Ki()) be |$mem(z, 0).BYTES|. +3. Push the value (I32.CONST n) to the stack. + +Step/ctxt +1. YetI: TODO: It is likely that the value stack of two rules are different. + +Step/local.set x +1. Let z be the current state. +2. Assert: Due to validation, a value is on the top of the stack. +3. Pop the value val from the stack. +4. Perform $with_local(z, x, val). + +Step/global.set x +1. Let z be the current state. +2. Assert: Due to validation, a value is on the top of the stack. +3. Pop the value val from the stack. +4. Perform $with_global(z, x, val). + +Step/store valtype_u1 sz_u2? ao +1. Let z be the current state. +2. Assert: Due to validation, a value of value type valtype_u0 is on the top of the stack. +3. Pop the value (valtype_u0.CONST c) from the stack. +4. Assert: Due to validation, a value of value type I32 is on the top of the stack. +5. Pop the value (I32.CONST i) from the stack. +6. If sz_u2? is not defined, then: + a. Let t be valtype_u1. + b. If (valtype_u0 is t), then: + 1) If (((i + ao.OFFSET) + ($size(t) / 8)) > |$mem(z, 0).BYTES|), then: + a) Trap. + 2) Let b* be $bytes_(t, c). + 3) Perform $with_mem(z, 0, (i + ao.OFFSET), ($size(t) / 8), b*). +7. Else: + a. Let ?(n) be sz_u2?. + b. If the type of valtype_u1 is Inn, then: + 1) Let Inn be valtype_u1. + 2) If (valtype_u0 is Inn), then: + a) If (((i + ao.OFFSET) + (n / 8)) > |$mem(z, 0).BYTES|), then: + 1. Trap. + b) Let b* be $ibytes_(n, $wrap__($size(Inn), n, c)). + c) Perform $with_mem(z, 0, (i + ao.OFFSET), (n / 8), b*). + +Step/memory.grow +1. Let z be the current state. +2. Assert: Due to validation, a value of value type I32 is on the top of the stack. +3. Pop the value (I32.CONST n) from the stack. +4. Either: + a. Let mi be $growmemory($mem(z, 0), n). + b. Push the value (I32.CONST (|$mem(z, 0).BYTES| / (64 · $Ki()))) to the stack. + c. Perform $with_meminst(z, 0, mi). +5. Or: + a. Push the value (I32.CONST $invsigned_(32, (- 1))) to the stack. + +eval_expr instr* +1. Execute the instruction instr*. +2. Pop the value val from the stack. +3. Return [val]. + +== Complete. +Generating prose for Wasm 2.0... +watsup 0.4 generator +== Parsing... +== Elaboration... +== IL Validation... +== Running pass sideconditions... +== IL Validation after pass sideconditions... +== Translating to AL... +== Prose Generation... + +* :math:`(n, m)` is valid with type :math:`k` if and only if: + + + * :math:`n` must be less than or equal to :math:`m`. + + * :math:`m` must be less than or equal to :math:`k`. + + +* :math:`{t_1^\ast} \rightarrow {t_2^\ast}` is valid. + + +* :math:`((\mathsf{mut}~{()^?}), t)` is valid. + + +* :math:`({\mathit{limits}}, {\mathit{reftype}})` is valid if and only if: + + + * :math:`{\mathit{limits}}` is valid with type :math:`{2^{32}} - 1`. + + +* :math:`(\mathsf{page}~{\mathit{limits}})` is valid if and only if: + + + * :math:`{\mathit{limits}}` is valid with type :math:`{2^{16}}`. + + +* :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid if and only if: + + + * Either: + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{func}~{\mathit{functype}})`. + + * :math:`{\mathit{functype}}` is valid. + + * Or: + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{global}~{\mathit{globaltype}})`. + + * :math:`{\mathit{globaltype}}` is valid. * Or: + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{table}~{\mathit{tabletype}})`. + + * :math:`{\mathit{tabletype}}` is valid. * Or: + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{mem}~{\mathit{memtype}})`. + + * :math:`{\mathit{memtype}}` is valid. + + +* :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` matches :math:`t` if and only if: + + + * Either: + + * :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`t`. + + * Or: + + * :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{bot}`. + + +* :math:`{t_1^\ast}` matches :math:`{t_2^\ast}` if and only if: + + + * :math:`{|{t_2^\ast}|}` must be equal to :math:`{|{t_1^\ast}|}`. + + * For all :math:`t_1` in :math:`{t_1^\ast}` and :math:`t_2` in :math:`{t_2^\ast}`, + + * :math:`t_1` matches :math:`t_2`. + + +* :math:`(n_{11}, n_{12})` matches :math:`(n_{21}, n_{22})` if and only if: + + + * :math:`n_{11}` must be greater than or equal to :math:`n_{21}`. + + * :math:`n_{12}` must be less than or equal to :math:`n_{22}`. + + +* :math:`{\mathit{ft}}` matches :math:`{\mathit{ft}}`. + + +* :math:`{\mathit{gt}}` matches :math:`{\mathit{gt}}`. + + +* :math:`({\mathit{lim}}_1, {\mathit{rt}})` matches :math:`({\mathit{lim}}_2, {\mathit{rt}})` if and only if: + + + * :math:`{\mathit{lim}}_1` matches :math:`{\mathit{lim}}_2`. + + +* :math:`(\mathsf{page}~{\mathit{lim}}_1)` matches :math:`(\mathsf{page}~{\mathit{lim}}_2)` if and only if: + + + * :math:`{\mathit{lim}}_1` matches :math:`{\mathit{lim}}_2`. + + +* :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` matches :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` if and only if: + + + * Either: + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{func}~{\mathit{ft}}_1)`. + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{func}~{\mathit{ft}}_2)`. + + * :math:`{\mathit{ft}}_1` matches :math:`{\mathit{ft}}_2`. + + * Or: + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{global}~{\mathit{gt}}_1)`. + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{global}~{\mathit{gt}}_2)`. + + * :math:`{\mathit{gt}}_1` matches :math:`{\mathit{gt}}_2`. * Or: + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{table}~{\mathit{tt}}_1)`. + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{table}~{\mathit{tt}}_2)`. + + * :math:`{\mathit{tt}}_1` matches :math:`{\mathit{tt}}_2`. * Or: + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{mem}~{\mathit{mt}}_1)`. + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{mem}~{\mathit{mt}}_2)`. + + * :math:`{\mathit{mt}}_1` matches :math:`{\mathit{mt}}_2`. + + +* :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid with type :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast} \rightarrow {{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` if and only if: + + + * Either: + + * :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{{\mathit{valtype}}^?}`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` must be equal to :math:`\epsilon`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` must be equal to :math:`{{\mathit{valtype}}^?}`. + + * Or: + + * :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{typeidx}}`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` must be equal to :math:`{t_1^\ast}`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` must be equal to :math:`{t_2^\ast}`. + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`{\mathit{typeidx}}`. + + * :math:`C{.}\mathsf{types}{}[{\mathit{typeidx}}]` must be equal to :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + + +* :math:`\mathsf{nop}` is valid with type :math:`\epsilon \rightarrow \epsilon`. + + +* :math:`\mathsf{unreachable}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + + +* :math:`\mathsf{drop}` is valid with type :math:`t \rightarrow \epsilon`. + + +* :math:`(\mathsf{select}~t)` is valid with type :math:`t~t~\mathsf{i{\scriptstyle 32}} \rightarrow t`. + + +* :math:`(\mathsf{block}~{\mathit{bt}}~{{\mathit{instr}}^\ast})` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}` if and only if: + + + * :math:`{\mathit{bt}}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + + +* :math:`(\mathsf{loop}~{\mathit{bt}}~{{\mathit{instr}}^\ast})` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}` if and only if: + + + * :math:`{\mathit{bt}}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_1^\ast}]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + + +* :math:`(\mathsf{if}~{\mathit{bt}}~{{\mathit{instr}}_1^\ast}~{{\mathit{instr}}_2^\ast})` is valid with type :math:`{t_1^\ast}~\mathsf{i{\scriptstyle 32}} \rightarrow {t_2^\ast}` if and only if: + + + * :math:`{\mathit{bt}}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}_1^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}_2^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + + +* :math:`(\mathsf{br}~l)` is valid with type :math:`{t_1^\ast}~{t^\ast} \rightarrow {t_2^\ast}` if and only if: + + + * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. + + * :math:`C{.}\mathsf{labels}{}[l]` must be equal to :math:`{t^\ast}`. + + +* :math:`(\mathsf{br\_if}~l)` is valid with type :math:`{t^\ast}~\mathsf{i{\scriptstyle 32}} \rightarrow {t^\ast}` if and only if: + + + * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. + + * :math:`C{.}\mathsf{labels}{}[l]` must be equal to :math:`{t^\ast}`. + + +* :math:`(\mathsf{br\_table}~{l^\ast}~{l'})` is valid with type :math:`{t_1^\ast}~{t^\ast} \rightarrow {t_2^\ast}` if and only if: + + + * For all :math:`l` in :math:`{l^\ast}`, + + * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. + + * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`{l'}`. + + * For all :math:`l` in :math:`{l^\ast}`, + + * :math:`{t^\ast}` matches :math:`C{.}\mathsf{labels}{}[l]`. + + * :math:`{t^\ast}` matches :math:`C{.}\mathsf{labels}{}[{l'}]`. + + +* :math:`(\mathsf{call}~x)` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}` if and only if: + + + * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{funcs}{}[x]` must be equal to :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + + +* :math:`(\mathsf{call\_indirect}~x~y)` is valid with type :math:`{t_1^\ast}~\mathsf{i{\scriptstyle 32}} \rightarrow {t_2^\ast}` if and only if: + + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`y`. + + * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, \mathsf{funcref})`. + + * :math:`C{.}\mathsf{types}{}[y]` must be equal to :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + + +* :math:`\mathsf{return}` is valid with type :math:`{t_1^\ast}~{t^\ast} \rightarrow {t_2^\ast}` if and only if: + + + * :math:`C{.}\mathsf{return}` must be equal to :math:`{t^\ast}`. + + +* :math:`({\mathit{nt}}{.}\mathsf{const}~c_{\mathit{nt}})` is valid with type :math:`\epsilon \rightarrow {\mathit{nt}}`. + + +* :math:`({\mathit{nt}} {.} {\mathit{unop}}_{\mathit{nt}})` is valid with type :math:`{\mathit{nt}} \rightarrow {\mathit{nt}}`. + + +* :math:`({\mathit{nt}} {.} {\mathit{binop}}_{\mathit{nt}})` is valid with type :math:`{\mathit{nt}}~{\mathit{nt}} \rightarrow {\mathit{nt}}`. + + +* :math:`({\mathit{nt}} {.} {\mathit{testop}}_{\mathit{nt}})` is valid with type :math:`{\mathit{nt}} \rightarrow \mathsf{i{\scriptstyle 32}}`. + + +* :math:`({\mathit{nt}} {.} {\mathit{relop}}_{\mathit{nt}})` is valid with type :math:`{\mathit{nt}}~{\mathit{nt}} \rightarrow \mathsf{i{\scriptstyle 32}}`. + + +* :math:`({\mathit{nt}}_1 {.} {\mathsf{reinterpret}}{\mathsf{\_}}{{\mathit{nt}}_2})` is valid with type :math:`{\mathit{nt}}_2 \rightarrow {\mathit{nt}}_1` if and only if: + + + * :math:`{|{\mathit{nt}}_1|}` must be equal to :math:`{|{\mathit{nt}}_2|}`. + + +* :math:`(\mathsf{ref{.}null}~{\mathit{rt}})` is valid with type :math:`\epsilon \rightarrow {\mathit{rt}}`. + + +* :math:`(\mathsf{ref{.}func}~x)` is valid with type :math:`\epsilon \rightarrow \mathsf{funcref}` if and only if: + + + * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{funcs}{}[x]` must be equal to :math:`{\mathit{ft}}`. + + +* :math:`\mathsf{ref{.}is\_null}` is valid with type :math:`{\mathit{rt}} \rightarrow \mathsf{i{\scriptstyle 32}}`. + + +* :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c)` is valid with type :math:`\epsilon \rightarrow \mathsf{v{\scriptstyle 128}}`. + + +* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvunop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. + + +* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvbinop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. + + +* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvternop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. + + +* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvtestop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{i{\scriptstyle 32}}`. + + +* :math:`({\mathit{sh}} {.} {\mathit{vunop}}_{\mathit{sh}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. + + +* :math:`({\mathit{sh}} {.} {\mathit{vbinop}}_{\mathit{sh}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. + + +* :math:`({\mathit{sh}} {.} {\mathit{vtestop}}_{\mathit{sh}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{i{\scriptstyle 32}}`. + + +* :math:`({\mathit{sh}} {.} {\mathit{vrelop}}_{\mathit{sh}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. + + +* :math:`({\mathit{sh}} {.} {\mathit{vshiftop}}_{\mathit{sh}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{i{\scriptstyle 32}} \rightarrow \mathsf{v{\scriptstyle 128}}`. + + +* :math:`({\mathit{sh}}{.}\mathsf{bitmask})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{i{\scriptstyle 32}}`. + + +* :math:`({\mathit{sh}}{.}\mathsf{swizzle})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. + + +* :math:`({\mathit{sh}}{.}\mathsf{shuffle}~{i^\ast})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}` if and only if: + + + * For all :math:`i` in :math:`{i^\ast}`, + + * :math:`i` must be less than :math:`2 \cdot {\mathrm{dim}}({\mathit{sh}})`. + + +* :math:`({\mathit{sh}}{.}\mathsf{splat})` is valid with type :math:`{\mathrm{unpack}}({\mathit{sh}}) \rightarrow \mathsf{v{\scriptstyle 128}}`. + + +* :math:`({{\mathit{sh}}{.}\mathsf{extract\_lane}}{{{\mathit{sx}}^?}}~i)` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow {\mathrm{unpack}}({\mathit{sh}})` if and only if: + + + * :math:`i` must be less than :math:`{\mathrm{dim}}({\mathit{sh}})`. + + +* :math:`({\mathit{sh}}{.}\mathsf{replace\_lane}~i)` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~{\mathrm{unpack}}({\mathit{sh}}) \rightarrow \mathsf{v{\scriptstyle 128}}` if and only if: + + + * :math:`i` must be less than :math:`{\mathrm{dim}}({\mathit{sh}})`. + + +* :math:`(\mathsf{vextunop}~{\mathit{sh}}_1~{\mathit{sh}}_2~{\mathit{vextunop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. + + +* :math:`(\mathsf{vextbinop}~{\mathit{sh}}_1~{\mathit{sh}}_2~{\mathit{vextbinop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. + + +* :math:`({{\mathit{sh}}_1{.}\mathsf{narrow}}{\mathsf{\_}}{{\mathit{sh}}_2}{\mathsf{\_}}{{\mathit{sx}}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. + + +* :math:`({\mathit{sh}}_1 {.} {{\mathit{sh}}_2}{\mathsf{\_}}{{\mathit{vcvtop}}}{\mathsf{\_}}{{{\mathit{hf}}^?}}{\mathsf{\_}}{{{\mathit{zero}}^?}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. + + +* :math:`(\mathsf{local{.}get}~x)` is valid with type :math:`\epsilon \rightarrow t` if and only if: + + + * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`t`. + + +* :math:`(\mathsf{local{.}set}~x)` is valid with type :math:`t \rightarrow \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`t`. + + +* :math:`(\mathsf{local{.}tee}~x)` is valid with type :math:`t \rightarrow t` if and only if: + + + * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`t`. + + +* :math:`(\mathsf{global{.}get}~x)` is valid with type :math:`\epsilon \rightarrow t` if and only if: + + + * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`({\mathit{mut}}, t)`. + + +* :math:`(\mathsf{global{.}set}~x)` is valid with type :math:`t \rightarrow \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`((\mathsf{mut}~()), t)`. + + +* :math:`(\mathsf{table{.}get}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow {\mathit{rt}}` if and only if: + + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. + + +* :math:`(\mathsf{table{.}set}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~{\mathit{rt}} \rightarrow \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. + + +* :math:`(\mathsf{table{.}size}~x)` is valid with type :math:`\epsilon \rightarrow \mathsf{i{\scriptstyle 32}}` if and only if: + + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. + + +* :math:`(\mathsf{table{.}grow}~x)` is valid with type :math:`{\mathit{rt}}~\mathsf{i{\scriptstyle 32}} \rightarrow \mathsf{i{\scriptstyle 32}}` if and only if: + + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. + + +* :math:`(\mathsf{table{.}fill}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~{\mathit{rt}}~\mathsf{i{\scriptstyle 32}} \rightarrow \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. + + +* :math:`(\mathsf{table{.}copy}~x_1~x_2)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x_1`. + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x_2`. + + * :math:`C{.}\mathsf{tables}{}[x_1]` must be equal to :math:`({\mathit{lim}}_1, {\mathit{rt}})`. + + * :math:`C{.}\mathsf{tables}{}[x_2]` must be equal to :math:`({\mathit{lim}}_2, {\mathit{rt}})`. + + +* :math:`(\mathsf{table{.}init}~x_1~x_2)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x_1`. + + * :math:`{|C{.}\mathsf{elems}|}` must be greater than :math:`x_2`. + + * :math:`C{.}\mathsf{tables}{}[x_1]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. + + * :math:`C{.}\mathsf{elems}{}[x_2]` must be equal to :math:`{\mathit{rt}}`. + + +* :math:`(\mathsf{elem{.}drop}~x)` is valid with type :math:`\epsilon \rightarrow \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{elems}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{elems}{}[x]` must be equal to :math:`{\mathit{rt}}`. + + +* :math:`\mathsf{memory{.}size}` is valid with type :math:`\epsilon \rightarrow \mathsf{i{\scriptstyle 32}}` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. + + * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. + + +* :math:`\mathsf{memory{.}grow}` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow \mathsf{i{\scriptstyle 32}}` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. + + * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. + + +* :math:`\mathsf{memory{.}fill}` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. + + * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. + + +* :math:`\mathsf{memory{.}copy}` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. + + * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. + + +* :math:`(\mathsf{memory{.}init}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. + + * :math:`{|C{.}\mathsf{datas}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. + + * :math:`C{.}\mathsf{datas}{}[x]` must be equal to :math:`\mathsf{ok}`. + + +* :math:`(\mathsf{data{.}drop}~x)` is valid with type :math:`\epsilon \rightarrow \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{datas}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{datas}{}[x]` must be equal to :math:`\mathsf{ok}`. + + +* :math:`({\mathit{nt}}{.}\mathsf{load}~{(n, {\mathit{sx}})^?}~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow {\mathit{nt}}` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. + + * :math:`{n^?}` is :math:`\epsilon` if and only if :math:`{{\mathit{sx}}^?}` is :math:`\epsilon`. + + * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. + + * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`{|{\mathit{nt}}|} / 8`. + + * If :math:`n` is defined, + + * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`n / 8`. + + * :math:`n / 8` must be less than :math:`{|{\mathit{nt}}|} / 8`. + + * If :math:`n` is defined, + + * :math:`{\mathit{nt}}` must be equal to :math:`{\mathsf{i}}{n}`. + + +* :math:`({\mathit{nt}}{.}\mathsf{store}~{n^?}~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~{\mathit{nt}} \rightarrow \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. + + * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. + + * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`{|{\mathit{nt}}|} / 8`. + + * If :math:`n` is defined, + + * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`n / 8`. + + * :math:`n / 8` must be less than :math:`{|{\mathit{nt}}|} / 8`. + + * If :math:`n` is defined, + + * :math:`{\mathit{nt}}` must be equal to :math:`{\mathsf{i}}{n}`. + + +* :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{load}~({M}{\mathsf{x}}{N}{\mathsf{\_}}{{\mathit{sx}}})~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow \mathsf{v{\scriptstyle 128}}` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. + + * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. + + * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`M / 8 \cdot N`. + + +* :math:`(\mathsf{vload\_lane}~\mathsf{v{\scriptstyle 128}}~n~{\mathit{memarg}}~{\mathit{laneidx}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. + + * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. + + * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`n / 8`. + + * :math:`{\mathit{laneidx}}` must be less than :math:`128 / n`. + + +* :math:`(\mathsf{vstore}~\mathsf{v{\scriptstyle 128}}~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{v{\scriptstyle 128}} \rightarrow \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. + + * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. + + * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`{|\mathsf{v{\scriptstyle 128}}|} / 8`. + + +* :math:`(\mathsf{vstore\_lane}~\mathsf{v{\scriptstyle 128}}~n~{\mathit{memarg}}~{\mathit{laneidx}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{v{\scriptstyle 128}} \rightarrow \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. + + * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. + + * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`n / 8`. + + * :math:`{\mathit{laneidx}}` must be less than :math:`128 / n`. + + +* :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is valid with type :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast} \rightarrow {{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` if and only if: + + + * Either: + + * :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`\epsilon`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` must be equal to :math:`\epsilon`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` must be equal to :math:`\epsilon`. + + * Or: + + * :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`{\mathit{instr}}_1~{{\mathit{instr}}_2^\ast}`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` must be equal to :math:`{t_1^\ast}`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` must be equal to :math:`{t_3^\ast}`. + + * :math:`{\mathit{instr}}_1` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + + * :math:`{\mathit{instr}}_2` is valid with type :math:`{t_2^\ast} \rightarrow {t_3^\ast}`. * Or: + + * :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`{{\mathit{instr}}^\ast}`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` must be equal to :math:`{{t'}_1^\ast}`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` must be equal to :math:`{{t'}_2^\ast}`. + + * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + + * :math:`{{t'}_1^\ast}` matches :math:`{t_1^\ast}`. + + * :math:`{t_2^\ast}` matches :math:`{{t'}_2^\ast}`. * Or: + + * :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`{{\mathit{instr}}^\ast}`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` must be equal to :math:`{t^\ast}~{t_1^\ast}`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` must be equal to :math:`{t^\ast}~{t_2^\ast}`. + + * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + + +* :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t^\ast}` if and only if: + + + * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`\epsilon \rightarrow {t^\ast}`. + + +* :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is const if and only if: + + + * Either: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`({\mathit{nt}}{.}\mathsf{const}~c)`. + + * Or: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`({\mathit{vt}}{.}\mathsf{const}~{\mathit{vc}})`. * Or: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{ref{.}null}~{\mathit{rt}})`. * Or: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{ref{.}func}~x)`. * Or: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{global{.}get}~x)`. + + * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`((\mathsf{mut}~\epsilon), t)`. + + +* :math:`{{\mathit{instr}}^\ast}` is const if and only if: + + + * For all :math:`{\mathit{instr}}` in :math:`{{\mathit{instr}}^\ast}`, + + * :math:`{\mathit{instr}}` is const. + + +* :math:`(\mathsf{type}~{\mathit{ft}})` is valid with type :math:`{\mathit{ft}}` if and only if: + + + * :math:`{\mathit{ft}}` is valid. + + +* :math:`(\mathsf{func}~x~{(\mathsf{local}~t)^\ast}~{\mathit{expr}})` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{types}{}[x]` must be equal to :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + + * Under the context :math:`C{}[{.}\mathsf{locals} \mathrel{{=}{\oplus}} {t_1^\ast}~{t^\ast}]{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]{}[{.}\mathsf{return} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{\mathit{expr}}` is valid with type :math:`{t_2^\ast}`. + + +* :math:`(\mathsf{global}~{\mathit{gt}}~{\mathit{expr}})` is valid with type :math:`{\mathit{gt}}` if and only if: + + + * :math:`{\mathit{gt}}` is valid. + + * :math:`{\mathit{gt}}` must be equal to :math:`({\mathit{mut}}, t)`. + + * :math:`{\mathit{expr}}` is valid with type :math:`t`. + + * :math:`{\mathit{expr}}` is const. + + +* :math:`(\mathsf{table}~{\mathit{tt}})` is valid with type :math:`{\mathit{tt}}` if and only if: + + + * :math:`{\mathit{tt}}` is valid. + + +* :math:`(\mathsf{memory}~{\mathit{mt}})` is valid with type :math:`{\mathit{mt}}` if and only if: + + + * :math:`{\mathit{mt}}` is valid. + + +* :math:`{\mathit{elemmode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid with type :math:`{\mathit{rt}}` if and only if: + + + * Either: + + * :math:`{\mathit{elemmode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{active}~x~{\mathit{expr}})`. + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. + + * :math:`{\mathit{expr}}` is valid with type :math:`\mathsf{i{\scriptstyle 32}}`. + + * :math:`{\mathit{expr}}` is const. + + * Or: + + * :math:`{\mathit{elemmode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{passive}`. * Or: + + * :math:`{\mathit{elemmode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{declare}`. + + +* :math:`(\mathsf{elem}~{\mathit{rt}}~{{\mathit{expr}}^\ast}~{\mathit{elemmode}})` is valid with type :math:`{\mathit{rt}}` if and only if: + + + * For all :math:`{\mathit{expr}}` in :math:`{{\mathit{expr}}^\ast}`, + + * :math:`{\mathit{expr}}` is valid with type :math:`{\mathit{rt}}`. + + * :math:`{\mathit{expr}}` is const. + + * :math:`{\mathit{elemmode}}` is valid with type :math:`{\mathit{rt}}`. + + +* :math:`{\mathit{datamode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid if and only if: + + + * Either: + + * :math:`{\mathit{datamode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{active}~0~{\mathit{expr}})`. + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. + + * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. + + * :math:`{\mathit{expr}}` is valid with type :math:`\mathsf{i{\scriptstyle 32}}`. + + * :math:`{\mathit{expr}}` is const. + + * Or: + + * :math:`{\mathit{datamode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{passive}`. + + +* :math:`(\mathsf{data}~{b^\ast}~{\mathit{datamode}})` is valid if and only if: + + + * :math:`{\mathit{datamode}}` is valid. + + +* :math:`(\mathsf{start}~x)` is valid if and only if: + + + * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{funcs}{}[x]` must be equal to :math:`\epsilon \rightarrow \epsilon`. + + +* :math:`(\mathsf{import}~{\mathit{name}}_1~{\mathit{name}}_2~{\mathit{xt}})` is valid with type :math:`{\mathit{xt}}` if and only if: + + + * :math:`{\mathit{xt}}` is valid. + + +* :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid with type :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` if and only if: + + + * Either: + + * :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{func}~x)`. + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{func}~{\mathit{ft}})`. + + * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{funcs}{}[x]` must be equal to :math:`{\mathit{ft}}`. + + * Or: + + * :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{global}~x)`. + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{global}~{\mathit{gt}})`. + + * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`{\mathit{gt}}`. * Or: + + * :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{table}~x)`. + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{table}~{\mathit{tt}})`. + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`{\mathit{tt}}`. * Or: + + * :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{mem}~x)`. + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{mem}~{\mathit{mt}})`. + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{mems}{}[x]` must be equal to :math:`{\mathit{mt}}`. + + +* :math:`(\mathsf{export}~{\mathit{name}}~{\mathit{externidx}})` is valid with type :math:`{\mathit{xt}}` if and only if: + + + * :math:`{\mathit{externidx}}` is valid with type :math:`{\mathit{xt}}`. + + +* :math:`(\mathsf{module}~{{\mathit{type}}^\ast}~{{\mathit{import}}^\ast}~{{\mathit{func}}^\ast}~{{\mathit{global}}^\ast}~{{\mathit{table}}^\ast}~{{\mathit{mem}}^\ast}~{{\mathit{elem}}^\ast}~{{\mathit{data}}^{n}}~{{\mathit{start}}^?}~{{\mathit{export}}^\ast})` is valid if and only if: + + + * :math:`{|{{\mathit{type}}^\ast}|}` must be equal to :math:`{|{{\mathit{ft}'}^\ast}|}`. + + * :math:`{|{{\mathit{ixt}}^\ast}|}` must be equal to :math:`{|{{\mathit{import}}^\ast}|}`. + + * :math:`{|{{\mathit{gt}}^\ast}|}` must be equal to :math:`{|{{\mathit{global}}^\ast}|}`. + + * :math:`{|{{\mathit{tt}}^\ast}|}` must be equal to :math:`{|{{\mathit{table}}^\ast}|}`. + + * :math:`{|{{\mathit{mt}}^\ast}|}` must be equal to :math:`{|{{\mathit{mem}}^\ast}|}`. + + * :math:`{|{{\mathit{rt}}^\ast}|}` must be equal to :math:`{|{{\mathit{elem}}^\ast}|}`. + + * :math:`{|{{\mathit{func}}^\ast}|}` must be equal to :math:`{|{{\mathit{ft}}^\ast}|}`. + + * :math:`{|{{\mathit{xt}}^\ast}|}` must be equal to :math:`{|{{\mathit{export}}^\ast}|}`. + + * For all :math:`{\mathit{ft}'}` in :math:`{{\mathit{ft}'}^\ast}` and :math:`{\mathit{type}}` in :math:`{{\mathit{type}}^\ast}`, + + * :math:`{\mathit{type}}` is valid with type :math:`{\mathit{ft}'}`. + + * For all :math:`{\mathit{import}}` in :math:`{{\mathit{import}}^\ast}` and :math:`{\mathit{ixt}}` in :math:`{{\mathit{ixt}}^\ast}`, + + * Under the context :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~{{\mathit{ft}'}^\ast},\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon,\; \mathsf{return}~\epsilon \}\end{array}`, :math:`{\mathit{import}}` is valid with type :math:`{\mathit{ixt}}`. + + * For all :math:`{\mathit{global}}` in :math:`{{\mathit{global}}^\ast}` and :math:`{\mathit{gt}}` in :math:`{{\mathit{gt}}^\ast}`, + + * Under the context :math:`{C'}`, :math:`{\mathit{global}}` is valid with type :math:`{\mathit{gt}}`. + + * For all :math:`{\mathit{table}}` in :math:`{{\mathit{table}}^\ast}` and :math:`{\mathit{tt}}` in :math:`{{\mathit{tt}}^\ast}`, + + * Under the context :math:`{C'}`, :math:`{\mathit{table}}` is valid with type :math:`{\mathit{tt}}`. + + * For all :math:`{\mathit{mem}}` in :math:`{{\mathit{mem}}^\ast}` and :math:`{\mathit{mt}}` in :math:`{{\mathit{mt}}^\ast}`, + + * Under the context :math:`{C'}`, :math:`{\mathit{mem}}` is valid with type :math:`{\mathit{mt}}`. + + * For all :math:`{\mathit{elem}}` in :math:`{{\mathit{elem}}^\ast}` and :math:`{\mathit{rt}}` in :math:`{{\mathit{rt}}^\ast}`, + + * Under the context :math:`{C'}`, :math:`{\mathit{elem}}` is valid with type :math:`{\mathit{rt}}`. + + * For all :math:`{\mathit{data}}` in :math:`{{\mathit{data}}^\ast}`, + + * Under the context :math:`{C'}`, :math:`{\mathit{data}}` is valid. + + * For all :math:`{\mathit{ft}}` in :math:`{{\mathit{ft}}^\ast}` and :math:`{\mathit{func}}` in :math:`{{\mathit{func}}^\ast}`, + + * :math:`{\mathit{func}}` is valid with type :math:`{\mathit{ft}}`. + + * If :math:`{\mathit{start}}` is defined, + + * :math:`{\mathit{start}}` is valid. + + * For all :math:`{\mathit{export}}` in :math:`{{\mathit{export}}^\ast}` and :math:`{\mathit{xt}}` in :math:`{{\mathit{xt}}^\ast}`, + + * :math:`{\mathit{export}}` is valid with type :math:`{\mathit{xt}}`. + + * :math:`{|{{\mathit{mt}}^\ast}|}` must be less than or equal to :math:`1`. + + * :math:`C` must be equal to :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~{{\mathit{ft}'}^\ast},\; \mathsf{funcs}~{{\mathit{ift}}^\ast}~{{\mathit{ft}}^\ast},\; \mathsf{globals}~{{\mathit{igt}}^\ast}~{{\mathit{gt}}^\ast},\; \mathsf{tables}~{{\mathit{itt}}^\ast}~{{\mathit{tt}}^\ast},\; \mathsf{mems}~{{\mathit{imt}}^\ast}~{{\mathit{mt}}^\ast},\; \mathsf{elems}~{{\mathit{rt}}^\ast},\; \mathsf{datas}~{\mathsf{ok}^{n}},\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon,\; \mathsf{return}~\epsilon \}\end{array}`. + + * :math:`{C'}` must be equal to :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~{{\mathit{ft}'}^\ast},\; \mathsf{funcs}~{{\mathit{ift}}^\ast}~{{\mathit{ft}}^\ast},\; \mathsf{globals}~{{\mathit{igt}}^\ast},\; \mathsf{tables}~{{\mathit{itt}}^\ast}~{{\mathit{tt}}^\ast},\; \mathsf{mems}~{{\mathit{imt}}^\ast}~{{\mathit{mt}}^\ast},\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon,\; \mathsf{return}~\epsilon \}\end{array}`. + + * :math:`{{\mathit{ift}}^\ast}` must be equal to :math:`{\mathrm{funcs}}({{\mathit{ixt}}^\ast})`. + + * :math:`{{\mathit{igt}}^\ast}` must be equal to :math:`{\mathrm{globals}}({{\mathit{ixt}}^\ast})`. + + * :math:`{{\mathit{itt}}^\ast}` must be equal to :math:`{\mathrm{tables}}({{\mathit{ixt}}^\ast})`. + + * :math:`{{\mathit{imt}}^\ast}` must be equal to :math:`{\mathrm{mems}}({{\mathit{ixt}}^\ast})`. + + +:math:`{\mathrm{Ki}}` +..................... + + +1. Return :math:`1024`. + + +:math:`{\mathrm{min}}(n_{\mathit{u{\kern-0.1em\scriptstyle 0}}}, n_{\mathit{u{\kern-0.1em\scriptstyle 1}}})` +............................................................................................................ + + +1. If :math:`n_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`0`, then: + + a. Return :math:`0`. + +#. If :math:`n_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is :math:`0`, then: + + a. Return :math:`0`. + +#. Assert: Due to validation, :math:`n_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is greater than or equal to :math:`1`. + +#. Let :math:`i` be :math:`n_{\mathit{u{\kern-0.1em\scriptstyle 0}}} - 1`. + +#. Assert: Due to validation, :math:`n_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is greater than or equal to :math:`1`. + +#. Let :math:`j` be :math:`n_{\mathit{u{\kern-0.1em\scriptstyle 1}}} - 1`. + +#. Return :math:`{\mathrm{min}}(i, j)`. + + +:math:`{\mathrm{sum}}({n_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +........................................................................ + + +1. If :math:`{n_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`0`. + +#. Let :math:`n~{{n'}^\ast}` be :math:`{n_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`n + {\mathrm{sum}}({{n'}^\ast})`. + + +:math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` +........................................................ + + +1. If :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Assert: Due to validation, :math:`{|{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}|}` is :math:`1`. + +#. Let :math:`w` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`w`. + + +:math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}` +..................................................... + + +1. If :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}` is not defined, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`w` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}`. + +#. Return :math:`w`. + + +:math:`{\mathrm{concat}}({X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +........................................................................... + + +1. If :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{w^\ast}~{{{w'}^\ast}^\ast}` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{w^\ast}~{\mathrm{concat}}({{{w'}^\ast}^\ast})`. + + +:math:`{{\mathrm{setproduct{\kern-0.1em\scriptstyle 2}}}}_{{\mathit{TODO}}}(w_1, {X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +................................................................................................................................... + + +1. If :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{{w'}^\ast}~{{w^\ast}^\ast}` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`w_1~{{w'}^\ast}~{{\mathrm{setproduct{\kern-0.1em\scriptstyle 2}}}}_{{\mathit{TODO}}}(w_1, {{w^\ast}^\ast})`. + + +:math:`{{\mathrm{setproduct{\kern-0.1em\scriptstyle 1}}}}_{{\mathit{TODO}}}({X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}, {{w^\ast}^\ast})` +............................................................................................................................................... + + +1. If :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`w_1~{{w'}^\ast}` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{{\mathrm{setproduct{\kern-0.1em\scriptstyle 2}}}}_{{\mathit{TODO}}}(w_1, {{w^\ast}^\ast})~{{\mathrm{setproduct{\kern-0.1em\scriptstyle 1}}}}_{{\mathit{TODO}}}({{w'}^\ast}, {{w^\ast}^\ast})`. + + +:math:`\Large\times~{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` +..................................................................... + + +1. If :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{w_1^\ast}~{{w^\ast}^\ast}` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{{\mathrm{setproduct{\kern-0.1em\scriptstyle 1}}}}_{{\mathit{TODO}}}({w_1^\ast}, \Large\times~{{w^\ast}^\ast})`. + + +:math:`{\mathrm{signif}}(N_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +.................................................................... + + +1. If :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`32`, then: + + a. Return :math:`23`. + +#. Assert: Due to validation, :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`64`. + +#. Return :math:`52`. + + +:math:`{\mathrm{expon}}(N_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +................................................................... + + +1. If :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`32`, then: + + a. Return :math:`8`. + +#. Assert: Due to validation, :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`64`. + +#. Return :math:`11`. + + +:math:`M` +......... + + +1. Return :math:`{\mathrm{signif}}(N)`. + + +:math:`E` +......... + + +1. Return :math:`{\mathrm{expon}}(N)`. + + +:math:`{+0}` +............ + + +1. Return :math:`({+((0 + 0 \cdot {2^{{-M}}}) \cdot {2^{n}})})`. + + +:math:`{+1}` +............ + + +1. Return :math:`({+((1 + 1 \cdot {2^{{-M}}}) \cdot {2^{0}})})`. + + +:math:`{{\mathrm{canon}}}_{N}` +.............................. + + +1. Return :math:`{2^{{\mathrm{signif}}(N) - 1}}`. + + +:math:`{|{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}|}` +...................................................................... + + +1. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{i{\scriptstyle 32}}`, then: + + a. Return :math:`32`. + +#. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{i{\scriptstyle 64}}`, then: + + a. Return :math:`64`. + +#. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{f{\scriptstyle 32}}`, then: + + a. Return :math:`32`. + +#. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{f{\scriptstyle 64}}`, then: + + a. Return :math:`64`. + +#. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{v{\scriptstyle 128}}`, then: + + a. Return :math:`128`. + + +:math:`{|{\mathsf{i}}{n}|}` +........................... + + +1. Return :math:`{|{\mathsf{i}}{n}|}`. + + +:math:`{|{\mathit{packtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}|}` +....................................................................... + + +1. If :math:`{\mathit{packtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{i{\scriptstyle 8}}`, then: + + a. Return :math:`8`. + +#. Assert: Due to validation, :math:`{\mathit{packtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{i{\scriptstyle 16}}`. + +#. Return :math:`16`. + + +:math:`{|{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}|}` +....................................................................... + + +1. If the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is numtype, then: + + a. Let :math:`{\mathit{numtype}}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{|{\mathit{numtype}}|}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is packtype. + +#. Let :math:`{\mathit{packtype}}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{|{\mathit{packtype}}|}`. + + +:math:`{\mathrm{lanetype}}({{\mathsf{i}}{n}}{\mathsf{x}}{N})` +............................................................. + + +1. Return :math:`{\mathsf{i}}{n}`. + + +:math:`N` +......... + + +1. Return :math:`{|{\mathit{nt}}|}`. + + +:math:`N_1` +........... + + +1. Return :math:`{|{\mathit{nt}}|}`. + + +:math:`N_2` +........... + + +1. Return :math:`{|{\mathit{nt}}|}`. + + +:math:`N` +......... + + +1. Return :math:`{|{\mathit{lt}}|}`. + + +:math:`N_1` +........... + + +1. Return :math:`{|{\mathit{lt}}|}`. + + +:math:`N_2` +........... + + +1. Return :math:`{|{\mathit{lt}}|}`. + + +:math:`{\mathrm{zero}}({\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +................................................................................... + + +1. If the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is Inn, then: + + a. Return :math:`0`. + +#. Assert: Due to validation, the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is Fnn. + +#. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{+0}`. + + +:math:`{\mathrm{dim}}({{\mathsf{i}}{n}}{\mathsf{x}}{N})` +........................................................ + + +1. Return :math:`N`. + + +:math:`{|{{\mathsf{i}}{n}}{\mathsf{x}}{N}|}` +............................................ + + +1. Return :math:`{|{\mathsf{i}}{n}|} \cdot N`. + + +:math:`{\mathrm{concat}}({{\mathit{byte}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +......................................................................................... + + +1. If :math:`{{\mathit{byte}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{b^\ast}~{{{b'}^\ast}^\ast}` be :math:`{{\mathit{byte}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{b^\ast}~{\mathrm{concat}}({{{b'}^\ast}^\ast})`. + + +:math:`{\mathrm{unpack}}({\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +...................................................................................... + + +1. If the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is numtype, then: + + a. Let :math:`{\mathit{numtype}}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathit{numtype}}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is packtype. + +#. Return :math:`\mathsf{i{\scriptstyle 32}}`. + + +:math:`{\mathrm{unpack}}({{\mathsf{i}}{n}}{\mathsf{x}}{N})` +........................................................... + + +1. Return :math:`{\mathrm{unpack}}({\mathsf{i}}{n})`. + + +:math:`{\mathrm{funcs}}({{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +.............................................................................................. + + +1. If :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externtype}}_0~{{\mathit{xt}}^\ast}` be :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externtype}}_0` is of the case :math:`\mathsf{func}`, then: + + a. Let :math:`(\mathsf{func}~{\mathit{ft}})` be :math:`{\mathit{externtype}}_0`. + + #. Return :math:`{\mathit{ft}}~{\mathrm{funcs}}({{\mathit{xt}}^\ast})`. + +#. Let :math:`{\mathit{externtype}}~{{\mathit{xt}}^\ast}` be :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{funcs}}({{\mathit{xt}}^\ast})`. + + +:math:`{\mathrm{globals}}({{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +................................................................................................ + + +1. If :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externtype}}_0~{{\mathit{xt}}^\ast}` be :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externtype}}_0` is of the case :math:`\mathsf{global}`, then: + + a. Let :math:`(\mathsf{global}~{\mathit{gt}})` be :math:`{\mathit{externtype}}_0`. + + #. Return :math:`{\mathit{gt}}~{\mathrm{globals}}({{\mathit{xt}}^\ast})`. + +#. Let :math:`{\mathit{externtype}}~{{\mathit{xt}}^\ast}` be :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{globals}}({{\mathit{xt}}^\ast})`. + + +:math:`{\mathrm{tables}}({{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................... + + +1. If :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externtype}}_0~{{\mathit{xt}}^\ast}` be :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externtype}}_0` is of the case :math:`\mathsf{table}`, then: + + a. Let :math:`(\mathsf{table}~{\mathit{tt}})` be :math:`{\mathit{externtype}}_0`. + + #. Return :math:`{\mathit{tt}}~{\mathrm{tables}}({{\mathit{xt}}^\ast})`. + +#. Let :math:`{\mathit{externtype}}~{{\mathit{xt}}^\ast}` be :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{tables}}({{\mathit{xt}}^\ast})`. + + +:math:`{\mathrm{mems}}({{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................. + + +1. If :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externtype}}_0~{{\mathit{xt}}^\ast}` be :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externtype}}_0` is of the case :math:`\mathsf{mem}`, then: + + a. Let :math:`(\mathsf{mem}~{\mathit{mt}})` be :math:`{\mathit{externtype}}_0`. + + #. Return :math:`{\mathit{mt}}~{\mathrm{mems}}({{\mathit{xt}}^\ast})`. + +#. Let :math:`{\mathit{externtype}}~{{\mathit{xt}}^\ast}` be :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{mems}}({{\mathit{xt}}^\ast})`. + + +:math:`{\mathrm{dataidx}}({\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +.................................................................................... + + +1. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{memory{.}init}`, then: + + a. Let :math:`(\mathsf{memory{.}init}~x)` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`x`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{data{.}drop}`, then: + + a. Let :math:`(\mathsf{data{.}drop}~x)` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`x`. + +#. Return :math:`\epsilon`. + + +:math:`{\mathrm{dataidx}}({{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +........................................................................................... + + +1. If :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{instr}}~{{\mathit{instr}'}^\ast}` be :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{dataidx}}({\mathit{instr}})~{\mathrm{dataidx}}({{\mathit{instr}'}^\ast})`. + + +:math:`{\mathrm{dataidx}}({{\mathit{in}}^\ast})` +................................................ + + +1. Return :math:`{\mathrm{dataidx}}({{\mathit{in}}^\ast})`. + + +:math:`{\mathrm{dataidx}}((\mathsf{func}~x~{{\mathit{loc}}^\ast}~e))` +..................................................................... + + +1. Return :math:`{\mathrm{dataidx}}(e)`. + + +:math:`{\mathrm{dataidx}}({{\mathit{func}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +.......................................................................................... + + +1. If :math:`{{\mathit{func}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{func}}~{{\mathit{func}'}^\ast}` be :math:`{{\mathit{func}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{dataidx}}({\mathit{func}})~{\mathrm{dataidx}}({{\mathit{func}'}^\ast})`. + + + + + + +1. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{align}~0,\; \mathsf{offset}~0 \}\end{array}`. + + +:math:`{{\mathrm{signed}}}_{N}(i)` +.................................. + + +1. If :math:`0` is less than or equal to :math:`{2^{N - 1}}`, then: + + a. Return :math:`i`. + +#. Assert: Due to validation, :math:`{2^{N - 1}}` is less than or equal to :math:`i`. + +#. Assert: Due to validation, :math:`i` is less than :math:`{2^{N}}`. + +#. Return :math:`i - {2^{N}}`. + + +:math:`{{{{\mathrm{signed}}}_{N}^{{-1}}}}{(i)}` +............................................... + + +1. Let :math:`j` be the result for which :math:`{{\mathrm{signed}}}_{N}(j)` :math:`=` :math:`i`. + +#. Return :math:`j`. + + +:math:`{{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}}{({\mathit{num\_u{\kern-0.1em\scriptstyle 3}}})}` +........................................................................................................................................................................ + + +1. If :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{clz}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Return :math:`{{\mathrm{iclz}}}_{N}({\mathit{iN}})`. + +#. If :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{ctz}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Return :math:`{{\mathrm{ictz}}}_{N}({\mathit{iN}})`. + +#. If :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{popcnt}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Return :math:`{{\mathrm{ipopcnt}}}_{N}({\mathit{iN}})`. + +#. If the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Assert: Due to validation, :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{extend}`. + + #. Let :math:`(\mathsf{extend}~M)` be :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #. Let :math:`{\mathit{iN}}` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Return :math:`{{{{\mathrm{extend}}}_{M, N}^{\mathsf{s}}}}{({{\mathrm{wrap}}}_{N, M}({\mathit{iN}}))}`. + +#. If :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{abs}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Return :math:`{{\mathrm{fabs}}}_{N}({\mathit{fN}})`. + +#. If :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{neg}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Return :math:`{{\mathrm{fneg}}}_{N}({\mathit{fN}})`. + +#. If :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{sqrt}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Return :math:`{{\mathrm{fsqrt}}}_{N}({\mathit{fN}})`. + +#. If :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{ceil}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Return :math:`{{\mathrm{fceil}}}_{N}({\mathit{fN}})`. + +#. If :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{floor}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Return :math:`{{\mathrm{ffloor}}}_{N}({\mathit{fN}})`. + +#. If :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{trunc}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Return :math:`{{\mathrm{ftrunc}}}_{N}({\mathit{fN}})`. + +#. Assert: Due to validation, :math:`{\mathit{unop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{nearest}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn. + +#. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + +#. Let :math:`{\mathit{fN}}` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + +#. Return :math:`{{\mathrm{fnearest}}}_{N}({\mathit{fN}})`. + + +:math:`{{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}}{({\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}, {\mathit{num\_u{\kern-0.1em\scriptstyle 5}}})}` +....................................................................................................................................................................................................................... + + +1. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{add}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{iadd}}}_{N}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{sub}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{isub}}}_{N}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{mul}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{imul}}}_{N}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{div}`, then: + + 1) Let :math:`({\mathsf{div}}{{\mathit{sx}}})` be :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Return :math:`{{{{\mathrm{idiv}}}_{N}^{{\mathit{sx}}}}}{({\mathit{iN}}_1, {\mathit{iN}}_2)}`. + + #. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{rem}`, then: + + 1) Let :math:`({\mathsf{rem}}{{\mathit{sx}}})` be :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Return :math:`{{{{\mathrm{irem}}}_{N}^{{\mathit{sx}}}}}{({\mathit{iN}}_1, {\mathit{iN}}_2)}`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{and}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{iand}}}_{N}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{or}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{ior}}}_{N}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{xor}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{ixor}}}_{N}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{shl}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{ishl}}}_{N}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{shr}`, then: + + 1) Let :math:`({\mathsf{shr}}{{\mathit{sx}}})` be :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Return :math:`{{{{\mathrm{ishr}}}_{N}^{{\mathit{sx}}}}}{({\mathit{iN}}_1, {\mathit{iN}}_2)}`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{rotl}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{irotl}}}_{N}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{rotr}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{irotr}}}_{N}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{add}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{fadd}}}_{N}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{sub}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{fsub}}}_{N}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{mul}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{fmul}}}_{N}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{div}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{fdiv}}}_{N}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{min}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{fmin}}}_{N}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. If :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{max}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{fmax}}}_{N}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. Assert: Due to validation, :math:`{\mathit{binop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{copysign}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn. + +#. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + +#. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + +#. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + +#. Return :math:`{{\mathrm{fcopysign}}}_{N}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + + +:math:`{\mathsf{eqz}}{{}_{{\mathsf{i}}{n}}}{({\mathit{iN}})}` +............................................................. + + +1. Return :math:`{{\mathrm{ieqz}}}_{N}({\mathit{iN}})`. + + +:math:`{{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}}{({\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}, {\mathit{num\_u{\kern-0.1em\scriptstyle 5}}})}` +....................................................................................................................................................................................................................... + + +1. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{eq}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{ieq}}}_{N}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{ne}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{ine}}}_{N}({\mathit{iN}}_1, {\mathit{iN}}_2)`. + +#. If the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{iN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{lt}`, then: + + 1) Let :math:`({\mathsf{lt}}{{\mathit{sx}}})` be :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Return :math:`{{{{\mathrm{ilt}}}_{N}^{{\mathit{sx}}}}}{({\mathit{iN}}_1, {\mathit{iN}}_2)}`. + + #. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{gt}`, then: + + 1) Let :math:`({\mathsf{gt}}{{\mathit{sx}}})` be :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Return :math:`{{{{\mathrm{igt}}}_{N}^{{\mathit{sx}}}}}{({\mathit{iN}}_1, {\mathit{iN}}_2)}`. + + #. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{le}`, then: + + 1) Let :math:`({\mathsf{le}}{{\mathit{sx}}})` be :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Return :math:`{{{{\mathrm{ile}}}_{N}^{{\mathit{sx}}}}}{({\mathit{iN}}_1, {\mathit{iN}}_2)}`. + + #. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{ge}`, then: + + 1) Let :math:`({\mathsf{ge}}{{\mathit{sx}}})` be :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Return :math:`{{{{\mathrm{ige}}}_{N}^{{\mathit{sx}}}}}{({\mathit{iN}}_1, {\mathit{iN}}_2)}`. + +#. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{eq}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{feq}}}_{N}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{ne}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{fne}}}_{N}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{lt}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{flt}}}_{N}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{gt}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{fgt}}}_{N}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. If :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{le}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + + #. Return :math:`{{\mathrm{fle}}}_{N}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + +#. Assert: Due to validation, :math:`{\mathit{relop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{ge}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn. + +#. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + +#. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + +#. Let :math:`{\mathit{fN}}_2` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 5}}}`. + +#. Return :math:`{{\mathrm{fge}}}_{N}({\mathit{fN}}_1, {\mathit{fN}}_2)`. + + +:math:`{{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}{{}_{{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}, {\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}}}{({\mathit{num\_u{\kern-0.1em\scriptstyle 3}}})}` +............................................................................................................................................................................................................................................... + + +1. If the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{{\mathsf{i}}{n}}_1` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. If the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}` is Inn, then: + + 1) Let :math:`{{\mathsf{i}}{n}}_2` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}`. + + #) Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #) If :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{extend}`, then: + + a) Let :math:`(\mathsf{extend}~{\mathit{sx}})` be :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #) Return :math:`{{{{\mathrm{extend}}}_{N_1, N_2}^{{\mathit{sx}}}}}{({\mathit{iN}}_1)}`. + +#. If :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{wrap}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + a. Let :math:`{{\mathsf{i}}{n}}_1` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. If the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}` is Inn, then: + + 1) Let :math:`{{\mathsf{i}}{n}}_2` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}`. + + #) Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #) Return :math:`{{\mathrm{wrap}}}_{N_1, N_2}({\mathit{iN}}_1)`. + +#. If the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{{\mathsf{f}}{n}}_1` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. If the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}` is Inn, then: + + 1) Let :math:`{{\mathsf{i}}{n}}_2` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}`. + + #) Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #) If :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{trunc}`, then: + + a) Let :math:`(\mathsf{trunc}~{\mathit{sx}})` be :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #) Return :math:`{{{{\mathrm{trunc}}}_{N_1, N_2}^{{\mathit{sx}}}}}{({\mathit{fN}}_1)}`. + + #) If :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{trunc\_sat}`, then: + + a) Let :math:`(\mathsf{trunc\_sat}~{\mathit{sx}})` be :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #) Return :math:`{{{{\mathrm{trunc\_sat}}}_{N_1, N_2}^{{\mathit{sx}}}}}{({\mathit{fN}}_1)}`. + +#. If the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}` is Fnn, then: + + a. Let :math:`{{\mathsf{f}}{n}}_2` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}`. + + #. If the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + 1) Let :math:`{{\mathsf{i}}{n}}_1` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #) Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #) If :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{convert}`, then: + + a) Let :math:`(\mathsf{convert}~{\mathit{sx}})` be :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #) Return :math:`{{{{\mathrm{convert}}}_{N_1, N_2}^{{\mathit{sx}}}}}{({\mathit{iN}}_1)}`. + +#. If :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{promote}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{{\mathsf{f}}{n}}_1` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. If the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}` is Fnn, then: + + 1) Let :math:`{{\mathsf{f}}{n}}_2` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}`. + + #) Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #) Return :math:`{{\mathrm{promote}}}_{N_1, N_2}({\mathit{fN}}_1)`. + +#. If :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{demote}` and the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{{\mathsf{f}}{n}}_1` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. If the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}` is Fnn, then: + + 1) Let :math:`{{\mathsf{f}}{n}}_2` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}`. + + #) Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #) Return :math:`{{\mathrm{demote}}}_{N_1, N_2}({\mathit{fN}}_1)`. + +#. Assert: Due to validation, :math:`{\mathit{cvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{reinterpret}`. + +#. If the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}` is Fnn, then: + + a. Let :math:`{{\mathsf{f}}{n}}_2` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}`. + + #. If the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Inn, then: + + 1) Let :math:`{{\mathsf{i}}{n}}_1` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #) Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + + #) If :math:`{|{{\mathsf{i}}{n}}_1|}` is :math:`{|{{\mathsf{f}}{n}}_2|}`, then: + + a) Return :math:`{{\mathrm{reinterpret}}}_{{{\mathsf{i}}{n}}_1, {{\mathsf{f}}{n}}_2}({\mathit{iN}}_1)`. + +#. Assert: Due to validation, the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn. + +#. Let :math:`{{\mathsf{f}}{n}}_1` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}` is Inn. + +#. Let :math:`{{\mathsf{i}}{n}}_2` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}`. + +#. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{num\_u{\kern-0.1em\scriptstyle 3}}}`. + +#. Assert: Due to validation, :math:`{|{{\mathsf{f}}{n}}_1|}` is :math:`{|{{\mathsf{i}}{n}}_2|}`. + +#. Return :math:`{{\mathrm{reinterpret}}}_{{{\mathsf{f}}{n}}_1, {{\mathsf{i}}{n}}_2}({\mathit{fN}}_1)`. + + +:math:`{{\mathrm{invibytes}}}_{N}({b^\ast})` +............................................ + + +1. Let :math:`n` be the result for which :math:`{{\mathrm{bytes}}}_{{\mathsf{i}}{N}}(n)` :math:`=` :math:`{b^\ast}`. + +#. Return :math:`n`. + + +:math:`{{\mathrm{invfbytes}}}_{N}({b^\ast})` +............................................ + + +1. Let :math:`p` be the result for which :math:`{{\mathrm{bytes}}}_{{\mathsf{f}}{N}}(p)` :math:`=` :math:`{b^\ast}`. + +#. Return :math:`p`. + + +:math:`{{\mathrm{pack}}}_{{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}(c)` +.......................................................................................... + + +1. If the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is numtype, then: + + a. Return :math:`c`. + +#. Assert: Due to validation, the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is packtype. + +#. Let :math:`{\mathit{packtype}}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{{\mathrm{wrap}}}_{{|{\mathrm{unpack}}({\mathit{packtype}})|}, {|{\mathit{packtype}}|}}(c)`. + + +:math:`{{\mathrm{unpack}}}_{{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}(c)` +............................................................................................ + + +1. If the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is numtype, then: + + a. Return :math:`c`. + +#. Assert: Due to validation, the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is packtype. + +#. Let :math:`{\mathit{packtype}}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{{{{\mathrm{extend}}}_{{|{\mathit{packtype}}|}, {|{\mathrm{unpack}}({\mathit{packtype}})|}}^{\mathsf{u}}}}{(c)}`. + + +:math:`{{\mathrm{invlanes}}}_{{\mathit{sh}}}({c^\ast})` +....................................................... + + +1. Let :math:`{\mathit{vc}}` be the result for which :math:`{{\mathrm{lanes}}}_{{\mathit{sh}}}({\mathit{vc}})` :math:`=` :math:`{c^\ast}`. + +#. Return :math:`{\mathit{vc}}`. + + +:math:`{\mathrm{half}}({\mathit{half}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}, i, j)` +...................................................................................... + + +1. If :math:`{\mathit{half}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{low}`, then: + + a. Return :math:`i`. + +#. Assert: Due to validation, :math:`{\mathit{half}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{high}`. + +#. Return :math:`j`. + + +:math:`{\mathsf{not}}{{}_{\mathsf{v{\scriptstyle 128}}}({\mathit{v{\kern-0.1em\scriptstyle 128}}})}` +.................................................................................................... + + +1. Return :math:`{{\mathrm{inot}}}_{{|\mathsf{v{\scriptstyle 128}}|}}({\mathit{v{\kern-0.1em\scriptstyle 128}}})`. + + +:math:`{{\mathit{vvbinop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}{{}_{\mathsf{v{\scriptstyle 128}}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)}` +................................................................................................................................................................................................. + + +1. If :math:`{\mathit{vvbinop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{and}`, then: + + a. Return :math:`{{\mathrm{iand}}}_{{|\mathsf{v{\scriptstyle 128}}|}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + +#. If :math:`{\mathit{vvbinop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{andnot}`, then: + + a. Return :math:`{{\mathrm{iandnot}}}_{{|\mathsf{v{\scriptstyle 128}}|}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + +#. If :math:`{\mathit{vvbinop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{or}`, then: + + a. Return :math:`{{\mathrm{ior}}}_{{|\mathsf{v{\scriptstyle 128}}|}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + +#. Assert: Due to validation, :math:`{\mathit{vvbinop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{xor}`. + +#. Return :math:`{{\mathrm{ixor}}}_{{|\mathsf{v{\scriptstyle 128}}|}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + +:math:`{\mathsf{bitselect}}{{}_{\mathsf{v{\scriptstyle 128}}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_2, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_3)}` +...................................................................................................................................................................................................... + + +1. Return :math:`{{\mathrm{ibitselect}}}_{{|\mathsf{v{\scriptstyle 128}}|}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_2, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_3)`. + + +:math:`{{\mathit{vunop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{{{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}{\mathsf{x}}{M}}}{({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)}` +.......................................................................................................................................................................................... + + +1. If :math:`{\mathit{vunop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{abs}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{\mathrm{iabs}}}_{N}({\mathit{lane}}_1)^\ast})`. + + #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + +#. If :math:`{\mathit{vunop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{neg}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{\mathrm{ineg}}}_{N}({\mathit{lane}}_1)^\ast})`. + + #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + +#. If :math:`{\mathit{vunop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{popcnt}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{\mathrm{ipopcnt}}}_{N}({\mathit{lane}}_1)^\ast})`. + + #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + +#. If :math:`{\mathit{vunop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{abs}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fabs}}}_{N}({\mathit{lane}}_1)^\ast}`. + + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + + #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. + +#. If :math:`{\mathit{vunop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{neg}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fneg}}}_{N}({\mathit{lane}}_1)^\ast}`. + + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + + #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. + +#. If :math:`{\mathit{vunop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{sqrt}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fsqrt}}}_{N}({\mathit{lane}}_1)^\ast}`. + + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + + #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. + +#. If :math:`{\mathit{vunop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{ceil}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fceil}}}_{N}({\mathit{lane}}_1)^\ast}`. + + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + + #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. + +#. If :math:`{\mathit{vunop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{floor}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{ffloor}}}_{N}({\mathit{lane}}_1)^\ast}`. + + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + + #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. + +#. If :math:`{\mathit{vunop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{trunc}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{ftrunc}}}_{N}({\mathit{lane}}_1)^\ast}`. + + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + + #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. + +#. Assert: Due to validation, :math:`{\mathit{vunop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{nearest}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn. + +#. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + +#. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + +#. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fnearest}}}_{N}({\mathit{lane}}_1)^\ast}`. + +#. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + +#. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. + + +:math:`{{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{{{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}{\mathsf{x}}{M}}}{({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)}` +........................................................................................................................................................................................................................................ + + +1. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{add}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{\mathrm{iadd}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})`. + + #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + +#. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{sub}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{\mathrm{isub}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})`. + + #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + +#. If the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{min}`, then: + + 1) Let :math:`({\mathsf{min}}{\mathsf{\_}}{{\mathit{sx}}})` be :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{\mathrm{imin}}}_{N}({\mathit{sx}}, {\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})`. + + #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + + #. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{max}`, then: + + 1) Let :math:`({\mathsf{max}}{\mathsf{\_}}{{\mathit{sx}}})` be :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{\mathrm{imax}}}_{N}({\mathit{sx}}, {\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})`. + + #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + + #. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{add\_sat}`, then: + + 1) Let :math:`({\mathsf{add\_sat}}{\mathsf{\_}}{{\mathit{sx}}})` be :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{{{\mathrm{iadd\_sat}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})`. + + #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + + #. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{sub\_sat}`, then: + + 1) Let :math:`({\mathsf{sub\_sat}}{\mathsf{\_}}{{\mathit{sx}}})` be :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{{{\mathrm{isub\_sat}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})`. + + #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + +#. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{mul}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{\mathrm{imul}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})`. + + #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + +#. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{avgr}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{{{\mathrm{iavgr}}}_{N}^{\mathsf{u}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})`. + + #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + +#. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{q{\scriptstyle 15}mulr\_sat}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{{{\mathrm{iq{\kern-0.1em\scriptstyle 15\kern-0.1em}mulr\_sat}}}_{N}^{\mathsf{s}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})`. + + #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + +#. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{add}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fadd}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. + + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + + #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. + +#. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{sub}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fsub}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. + + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + + #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. + +#. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{mul}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fmul}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. + + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + + #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. + +#. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{div}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fdiv}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. + + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + + #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. + +#. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{min}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fmin}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. + + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + + #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. + +#. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{max}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fmax}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. + + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + + #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. + +#. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{pmin}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fpmin}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. + + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + + #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. + +#. Assert: Due to validation, :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{pmax}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn. + +#. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + +#. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + +#. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + +#. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fpmax}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. + +#. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + +#. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. + + +:math:`{{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{{{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}{\mathsf{x}}{M}}}{({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)}` +........................................................................................................................................................................................................................................ + + +1. If :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{eq}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #. Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{ieq}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. + + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + + #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + +#. If :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{ne}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #. Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{ine}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. + + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + + #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + +#. If the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: + + a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. If :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{lt}`, then: + + 1) Let :math:`(\mathsf{lt}~{\mathit{sx}})` be :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #) Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{{{\mathrm{ilt}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)})}^\ast}`. + + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + + #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + + #. If :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{gt}`, then: + + 1) Let :math:`(\mathsf{gt}~{\mathit{sx}})` be :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #) Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{{{\mathrm{igt}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)})}^\ast}`. + + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + + #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + + #. If :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{le}`, then: + + 1) Let :math:`(\mathsf{le}~{\mathit{sx}})` be :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #) Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{{{\mathrm{ile}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)})}^\ast}`. + + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + + #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + + #. If :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{ge}`, then: + + 1) Let :math:`(\mathsf{ge}~{\mathit{sx}})` be :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #) Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{{{\mathrm{ige}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)})}^\ast}`. + + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + + #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + +#. If :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{eq}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #. Let :math:`{\mathsf{i}}{n}` be the result for which :math:`{|{\mathsf{i}}{n}|}` :math:`=` :math:`{|{\mathsf{f}}{n}|}`. + + #. Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{feq}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. + + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + + #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + +#. If :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{ne}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #. Let :math:`{\mathsf{i}}{n}` be the result for which :math:`{|{\mathsf{i}}{n}|}` :math:`=` :math:`{|{\mathsf{f}}{n}|}`. + + #. Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{fne}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. + + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + + #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + +#. If :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{lt}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #. Let :math:`{\mathsf{i}}{n}` be the result for which :math:`{|{\mathsf{i}}{n}|}` :math:`=` :math:`{|{\mathsf{f}}{n}|}`. + + #. Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{flt}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. + + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + + #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + +#. If :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{gt}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #. Let :math:`{\mathsf{i}}{n}` be the result for which :math:`{|{\mathsf{i}}{n}|}` :math:`=` :math:`{|{\mathsf{f}}{n}|}`. + + #. Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{fgt}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. + + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + + #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + +#. If :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{le}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn, then: + + a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + + #. Let :math:`{\mathsf{i}}{n}` be the result for which :math:`{|{\mathsf{i}}{n}|}` :math:`=` :math:`{|{\mathsf{f}}{n}|}`. + + #. Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{fle}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. + + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + + #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + +#. Assert: Due to validation, :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{ge}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Fnn. + +#. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + +#. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + +#. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + +#. Let :math:`{\mathsf{i}}{n}` be the result for which :math:`{|{\mathsf{i}}{n}|}` :math:`=` :math:`{|{\mathsf{f}}{n}|}`. + +#. Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{fge}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. + +#. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + +#. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. + + +:math:`{{\mathrm{vcvtop}}}_{{{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}}{\mathsf{x}}{M_1}, {{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}{\mathsf{x}}{M_2}}({\mathit{vcvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}, {\mathit{lane\_u{\kern-0.1em\scriptstyle 4}}})` +...................................................................................................................................................................................................................................................................................................... + + +1. If the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}` is Jnn, then: + + a. Let :math:`{{\mathsf{i}}{n}}_1` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}`. + + #. If the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is Jnn, then: + + 1) Let :math:`{{\mathsf{i}}{n}}_2` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #) Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{lane\_u{\kern-0.1em\scriptstyle 4}}}`. + + #) If :math:`{\mathit{vcvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is of the case :math:`\mathsf{extend}`, then: + + a) Let :math:`(\mathsf{extend}~{\mathit{sx}})` be :math:`{\mathit{vcvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #) Let :math:`{\mathit{iN}}_2` be :math:`{{{{\mathrm{extend}}}_{N_1, N_2}^{{\mathit{sx}}}}}{({\mathit{iN}}_1)}`. + + #) Return :math:`{\mathit{iN}}_2`. + +#. If the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is Fnn, then: + + a. Let :math:`{{\mathsf{f}}{n}}_2` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. If the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}` is Jnn, then: + + 1) Let :math:`{{\mathsf{i}}{n}}_1` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}`. + + #) Let :math:`{\mathit{iN}}_1` be :math:`{\mathit{lane\_u{\kern-0.1em\scriptstyle 4}}}`. + + #) If :math:`{\mathit{vcvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is of the case :math:`\mathsf{convert}`, then: + + a) Let :math:`(\mathsf{convert}~{\mathit{sx}})` be :math:`{\mathit{vcvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #) Let :math:`{\mathit{fN}}_2` be :math:`{{{{\mathrm{convert}}}_{N_1, N_2}^{{\mathit{sx}}}}}{({\mathit{iN}}_1)}`. + + #) Return :math:`{\mathit{fN}}_2`. + +#. If the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}` is Fnn, then: + + a. Let :math:`{{\mathsf{f}}{n}}_1` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}`. + + #. If the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is Inn, then: + + 1) Let :math:`{{\mathsf{i}}{n}}_2` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #) Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{lane\_u{\kern-0.1em\scriptstyle 4}}}`. + + #) If :math:`{\mathit{vcvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is of the case :math:`\mathsf{trunc\_sat}`, then: + + a) Let :math:`(\mathsf{trunc\_sat}~{\mathit{sx}})` be :math:`{\mathit{vcvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #) Let :math:`{{\mathit{iN}}_2^?}` be :math:`{{{{\mathrm{trunc\_sat}}}_{N_1, N_2}^{{\mathit{sx}}}}}{({\mathit{fN}}_1)}`. + + #) Return :math:`{{\mathit{iN}}_2^?}`. + +#. If :math:`{\mathit{vcvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is :math:`\mathsf{demote}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}` is Fnn, then: + + a. Let :math:`{{\mathsf{f}}{n}}_1` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}`. + + #. If the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is Fnn, then: + + 1) Let :math:`{{\mathsf{f}}{n}}_2` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #) Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{lane\_u{\kern-0.1em\scriptstyle 4}}}`. + + #) Let :math:`{{\mathit{fN}}_2^\ast}` be :math:`{{\mathrm{demote}}}_{N_1, N_2}({\mathit{fN}}_1)`. + + #) Return :math:`{{\mathit{fN}}_2^\ast}`. + +#. Assert: Due to validation, :math:`{\mathit{vcvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is :math:`\mathsf{promote}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}` is Fnn. + +#. Let :math:`{{\mathsf{f}}{n}}_1` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is Fnn. + +#. Let :math:`{{\mathsf{f}}{n}}_2` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Let :math:`{\mathit{fN}}_1` be :math:`{\mathit{lane\_u{\kern-0.1em\scriptstyle 4}}}`. + +#. Let :math:`{{\mathit{fN}}_2^\ast}` be :math:`{{\mathrm{promote}}}_{N_1, N_2}({\mathit{fN}}_1)`. + +#. Return :math:`{{\mathit{fN}}_2^\ast}`. + + +:math:`{{\mathrm{vextunop}}}_{{{{\mathsf{i}}{n}}_1}{\mathsf{x}}{M_1}, {{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2}}((\mathsf{extadd\_pairwise}~{\mathit{sx}}), c_1)` +.............................................................................................................................................................. + + +1. Let :math:`{{\mathit{ci}}^\ast}` be :math:`{{\mathrm{lanes}}}_{{{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2}}(c_1)`. + +#. Let :math:`{{\mathit{cj}}_1~{\mathit{cj}}_2^\ast}` be the result for which :math:`{\mathrm{concat}}({{\mathit{cj}}_1~{\mathit{cj}}_2^\ast})` :math:`=` :math:`{{{{{\mathrm{extend}}}_{N_2, N_1}^{{\mathit{sx}}}}}{({\mathit{ci}})}^\ast}`. + +#. Let :math:`c` be :math:`{{\mathrm{invlanes}}}_{{{{\mathsf{i}}{n}}_1}{\mathsf{x}}{M_1}}({{{\mathrm{iadd}}}_{N_1}({\mathit{cj}}_1, {\mathit{cj}}_2)^\ast})`. + +#. Return :math:`c`. + + +:math:`{{\mathrm{vextbinop}}}_{{{{\mathsf{i}}{n}}_1}{\mathsf{x}}{M_1}, {{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2}}({\mathit{vextbinop\_u{\kern-0.1em\scriptstyle 0}}}, c_1, c_2)` +............................................................................................................................................................................. + + +1. If :math:`{\mathit{vextbinop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{extmul}`, then: + + a. Let :math:`({\mathsf{extmul}}{\mathsf{\_}}{{\mathit{sx}}})` be :math:`{\mathit{vextbinop\_u{\kern-0.1em\scriptstyle 0}}}`. + + #. Let :math:`{{\mathit{ci}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2}}(c_1){}[{\mathrm{half}}({\mathit{hf}}, 0, M_1) : M_1]`. + + #. Let :math:`{{\mathit{ci}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2}}(c_2){}[{\mathrm{half}}({\mathit{hf}}, 0, M_1) : M_1]`. + + #. Let :math:`c` be :math:`{{\mathrm{invlanes}}}_{{{{\mathsf{i}}{n}}_1}{\mathsf{x}}{M_1}}({{{\mathrm{imul}}}_{N_1}({{{{\mathrm{extend}}}_{N_2, N_1}^{{\mathit{sx}}}}}{({\mathit{ci}}_1)}, {{{{\mathrm{extend}}}_{N_2, N_1}^{{\mathit{sx}}}}}{({\mathit{ci}}_2)})^\ast})`. + + #. Return :math:`c`. + +#. Assert: Due to validation, :math:`{\mathit{vextbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{dot}`. + +#. Let :math:`{{\mathit{ci}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2}}(c_1)`. + +#. Let :math:`{{\mathit{ci}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2}}(c_2)`. + +#. Let :math:`{{\mathit{cj}}_1~{\mathit{cj}}_2^\ast}` be the result for which :math:`{\mathrm{concat}}({{\mathit{cj}}_1~{\mathit{cj}}_2^\ast})` :math:`=` :math:`{{{\mathrm{imul}}}_{N_1}({{{{\mathrm{extend}}}_{N_2, N_1}^{\mathsf{s}}}}{({\mathit{ci}}_1)}, {{{{\mathrm{extend}}}_{N_2, N_1}^{\mathsf{s}}}}{({\mathit{ci}}_2)})^\ast}`. + +#. Let :math:`c` be :math:`{{\mathrm{invlanes}}}_{{{{\mathsf{i}}{n}}_1}{\mathsf{x}}{M_1}}({{{\mathrm{iadd}}}_{N_1}({\mathit{cj}}_1, {\mathit{cj}}_2)^\ast})`. + +#. Return :math:`c`. + + +:math:`{{{\mathit{vshiftop\_u{\kern-0.1em\scriptstyle 0}}}}{\mathsf{\_}}~{{\mathsf{i}}{n}}{\mathsf{x}}{M}}{({\mathit{lane}}, n)}` +................................................................................................................................. + + +1. If :math:`{\mathit{vshiftop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{shl}`, then: + + a. Return :math:`{{\mathrm{ishl}}}_{N}({\mathit{lane}}, n)`. + +#. Assert: Due to validation, :math:`{\mathit{vshiftop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{shr}`. + +#. Let :math:`(\mathsf{shr}~{\mathit{sx}})` be :math:`{\mathit{vshiftop\_u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{{{{\mathrm{ishr}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}, n)}`. + + +:math:`{{\mathrm{default}}}_{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}` +......................................................................................... + + +1. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{i{\scriptstyle 32}}`, then: + + a. Return :math:`(\mathsf{i{\scriptstyle 32}}{.}\mathsf{const}~0)`. + +#. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{i{\scriptstyle 64}}`, then: + + a. Return :math:`(\mathsf{i{\scriptstyle 64}}{.}\mathsf{const}~0)`. + +#. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{f{\scriptstyle 32}}`, then: + + a. Return :math:`(\mathsf{f{\scriptstyle 32}}{.}\mathsf{const}~{+0})`. + +#. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{f{\scriptstyle 64}}`, then: + + a. Return :math:`(\mathsf{f{\scriptstyle 64}}{.}\mathsf{const}~{+0})`. + +#. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{v{\scriptstyle 128}}`, then: + + a. Return :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~0)`. + +#. If :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{funcref}`, then: + + a. Return :math:`(\mathsf{ref{.}null}~\mathsf{funcref})`. + +#. Assert: Due to validation, :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{externref}`. + +#. Return :math:`(\mathsf{ref{.}null}~\mathsf{externref})`. + + +:math:`{\mathrm{funcs}}({{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................. + + +1. If :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externval}}_0~{{\mathit{xv}}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externval}}_0` is of the case :math:`\mathsf{func}`, then: + + a. Let :math:`(\mathsf{func}~{\mathit{fa}})` be :math:`{\mathit{externval}}_0`. + + #. Return :math:`{\mathit{fa}}~{\mathrm{funcs}}({{\mathit{xv}}^\ast})`. + +#. Let :math:`{\mathit{externval}}~{{\mathit{xv}}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{funcs}}({{\mathit{xv}}^\ast})`. + + +:math:`{\mathrm{globals}}({{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................... + + +1. If :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externval}}_0~{{\mathit{xv}}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externval}}_0` is of the case :math:`\mathsf{global}`, then: + + a. Let :math:`(\mathsf{global}~{\mathit{ga}})` be :math:`{\mathit{externval}}_0`. + + #. Return :math:`{\mathit{ga}}~{\mathrm{globals}}({{\mathit{xv}}^\ast})`. + +#. Let :math:`{\mathit{externval}}~{{\mathit{xv}}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{globals}}({{\mathit{xv}}^\ast})`. + + +:math:`{\mathrm{tables}}({{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +.............................................................................................. + + +1. If :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externval}}_0~{{\mathit{xv}}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externval}}_0` is of the case :math:`\mathsf{table}`, then: + + a. Let :math:`(\mathsf{table}~{\mathit{ta}})` be :math:`{\mathit{externval}}_0`. + + #. Return :math:`{\mathit{ta}}~{\mathrm{tables}}({{\mathit{xv}}^\ast})`. + +#. Let :math:`{\mathit{externval}}~{{\mathit{xv}}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{tables}}({{\mathit{xv}}^\ast})`. + + +:math:`{\mathrm{mems}}({{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................ + + +1. If :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externval}}_0~{{\mathit{xv}}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externval}}_0` is of the case :math:`\mathsf{mem}`, then: + + a. Let :math:`(\mathsf{mem}~{\mathit{ma}})` be :math:`{\mathit{externval}}_0`. + + #. Return :math:`{\mathit{ma}}~{\mathrm{mems}}({{\mathit{xv}}^\ast})`. + +#. Let :math:`{\mathit{externval}}~{{\mathit{xv}}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{mems}}({{\mathit{xv}}^\ast})`. + + +:math:`{\mathrm{store}}` +........................ + + +1. Return. + + +:math:`{\mathrm{frame}}` +........................ + + +1. Let :math:`f` be the current frame. + +#. Return :math:`f`. + + +:math:`{\mathrm{funcaddr}}` +........................... + + +1. Let :math:`f` be the current frame. + +#. Return :math:`f{.}\mathsf{module}{.}\mathsf{funcs}`. + + +:math:`{\mathrm{funcinst}}` +........................... + + +1. Return :math:`s{.}\mathsf{funcs}`. + + +:math:`{\mathrm{globalinst}}` +............................. + + +1. Return :math:`s{.}\mathsf{globals}`. + + +:math:`{\mathrm{tableinst}}` +............................ + + +1. Return :math:`s{.}\mathsf{tables}`. + + +:math:`{\mathrm{meminst}}` +.......................... + + +1. Return :math:`s{.}\mathsf{mems}`. + + +:math:`{\mathrm{eleminst}}` +........................... + + +1. Return :math:`s{.}\mathsf{elems}`. + + +:math:`{\mathrm{datainst}}` +........................... + + +1. Return :math:`s{.}\mathsf{datas}`. + + +:math:`{\mathrm{moduleinst}}` +............................. + + +1. Let :math:`f` be the current frame. + +#. Return :math:`f{.}\mathsf{module}`. + + +:math:`{\mathrm{type}}(x)` +.......................... + + +1. Let :math:`f` be the current frame. + +#. Return :math:`f{.}\mathsf{module}{.}\mathsf{types}{}[x]`. + + +:math:`{\mathrm{func}}(x)` +.......................... + + +1. Let :math:`f` be the current frame. + +#. Return :math:`s{.}\mathsf{funcs}{}[f{.}\mathsf{module}{.}\mathsf{funcs}{}[x]]`. + + +:math:`{\mathrm{global}}(x)` +............................ + + +1. Let :math:`f` be the current frame. + +#. Return :math:`s{.}\mathsf{globals}{}[f{.}\mathsf{module}{.}\mathsf{globals}{}[x]]`. + + +:math:`{\mathrm{table}}(x)` +........................... + + +1. Let :math:`f` be the current frame. + +#. Return :math:`s{.}\mathsf{tables}{}[f{.}\mathsf{module}{.}\mathsf{tables}{}[x]]`. + + +:math:`{\mathrm{mem}}(x)` +......................... + + +1. Let :math:`f` be the current frame. + +#. Return :math:`s{.}\mathsf{mems}{}[f{.}\mathsf{module}{.}\mathsf{mems}{}[x]]`. + + +:math:`{\mathrm{elem}}(x)` +.......................... + + +1. Let :math:`f` be the current frame. + +#. Return :math:`s{.}\mathsf{elems}{}[f{.}\mathsf{module}{.}\mathsf{elems}{}[x]]`. + + +:math:`{\mathrm{data}}(x)` +.......................... + + +1. Let :math:`f` be the current frame. + +#. Return :math:`s{.}\mathsf{datas}{}[f{.}\mathsf{module}{.}\mathsf{datas}{}[x]]`. + + +:math:`{\mathrm{local}}(x)` +........................... + + +1. Let :math:`f` be the current frame. + +#. Return :math:`f{.}\mathsf{locals}{}[x]`. + + +:math:`{\mathrm{with}}_{\mathit{local}}(x, v)` +.............................................. + + +1. Let :math:`f` be the current frame. + +#. Replace :math:`f{.}\mathsf{locals}{}[x]` with :math:`v`. + + +:math:`{\mathrm{with}}_{\mathit{global}}(x, v)` +............................................... + + +1. Let :math:`f` be the current frame. + +#. Replace :math:`s{.}\mathsf{globals}{}[f{.}\mathsf{module}{.}\mathsf{globals}{}[x]]{.}\mathsf{value}` with :math:`v`. + + +:math:`{\mathrm{with}}_{\mathit{table}}(x, i, r)` +................................................. + + +1. Let :math:`f` be the current frame. + +#. Replace :math:`s{.}\mathsf{tables}{}[f{.}\mathsf{module}{.}\mathsf{tables}{}[x]]{.}\mathsf{refs}{}[i]` with :math:`r`. + + +:math:`{\mathrm{with}}_{\mathit{tableinst}}(x, {\mathit{ti}})` +.............................................................. + + +1. Let :math:`f` be the current frame. + +#. Replace :math:`s{.}\mathsf{tables}{}[f{.}\mathsf{module}{.}\mathsf{tables}{}[x]]` with :math:`{\mathit{ti}}`. + + +:math:`{\mathrm{with}}_{\mathit{mem}}(x, i, j, {b^\ast})` +......................................................... + + +1. Let :math:`f` be the current frame. + +#. Replace :math:`s{.}\mathsf{mems}{}[f{.}\mathsf{module}{.}\mathsf{mems}{}[x]]{.}\mathsf{bytes}{}[i : j]` with :math:`{b^\ast}`. + + +:math:`{\mathrm{with}}_{\mathit{meminst}}(x, {\mathit{mi}})` +............................................................ + + +1. Let :math:`f` be the current frame. + +#. Replace :math:`s{.}\mathsf{mems}{}[f{.}\mathsf{module}{.}\mathsf{mems}{}[x]]` with :math:`{\mathit{mi}}`. + + +:math:`{\mathrm{with}}_{\mathit{elem}}(x, {r^\ast})` +.................................................... + + +1. Let :math:`f` be the current frame. + +#. Replace :math:`s{.}\mathsf{elems}{}[f{.}\mathsf{module}{.}\mathsf{elems}{}[x]]{.}\mathsf{refs}` with :math:`{r^\ast}`. + + +:math:`{\mathrm{with}}_{\mathit{data}}(x, {b^\ast})` +.................................................... + + +1. Let :math:`f` be the current frame. + +#. Replace :math:`s{.}\mathsf{datas}{}[f{.}\mathsf{module}{.}\mathsf{datas}{}[x]]{.}\mathsf{bytes}` with :math:`{b^\ast}`. + + +:math:`{\mathrm{growtable}}({\mathit{ti}}, n, r)` +................................................. + + +1. Let :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~((i, j), {\mathit{rt}}),\; \mathsf{refs}~{{r'}^\ast} \}\end{array}` be :math:`{\mathit{ti}}`. + +#. Let :math:`{i'}` be :math:`{|{{r'}^\ast}|} + n`. + +#. If :math:`{i'}` is less than or equal to :math:`j`, then: + + a. Let :math:`{\mathit{ti}'}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~(({i'}, j), {\mathit{rt}}),\; \mathsf{refs}~{{r'}^\ast}~{r^{n}} \}\end{array}`. + + #. Return :math:`{\mathit{ti}'}`. + + +:math:`{\mathrm{growmemory}}({\mathit{mi}}, n)` +............................................... + + +1. Let :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~(\mathsf{page}~(i, j)),\; \mathsf{bytes}~{b^\ast} \}\end{array}` be :math:`{\mathit{mi}}`. + +#. Let :math:`{i'}` be :math:`{|{b^\ast}|} / 64 \, {\mathrm{Ki}} + n`. + +#. If :math:`{i'}` is less than or equal to :math:`j`, then: + + a. Let :math:`{\mathit{mi}'}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~(\mathsf{page}~({i'}, j)),\; \mathsf{bytes}~{b^\ast}~{0^{n \cdot 64 \, {\mathrm{Ki}}}} \}\end{array}`. + + #. Return :math:`{\mathit{mi}'}`. + + +:math:`{\mathrm{blocktype}}({\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}})` +.......................................................................................... + + +1. If :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon \rightarrow \epsilon`. + +#. If :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is of the case , then: + + a. Let :math:`{\mathit{valtype}}_0` be :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + + #. If :math:`{\mathit{valtype}}_0` is defined, then: + + 1) Let :math:`t` be :math:`{\mathit{valtype}}_0`. + + #) Return :math:`\epsilon \rightarrow t`. + +#. Assert: Due to validation, :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is of the case . + +#. Let :math:`x` be :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. + +#. Return :math:`{\mathrm{type}}(x)`. + + +:math:`{\mathrm{funcs}}({{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................. + + +1. If :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externval}}_0~{{\mathit{externval}'}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externval}}_0` is of the case :math:`\mathsf{func}`, then: + + a. Let :math:`(\mathsf{func}~{\mathit{fa}})` be :math:`{\mathit{externval}}_0`. + + #. Return :math:`{\mathit{fa}}~{\mathrm{funcs}}({{\mathit{externval}'}^\ast})`. + +#. Let :math:`{\mathit{externval}}~{{\mathit{externval}'}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{funcs}}({{\mathit{externval}'}^\ast})`. + + +:math:`{\mathrm{globals}}({{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................... + + +1. If :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externval}}_0~{{\mathit{externval}'}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externval}}_0` is of the case :math:`\mathsf{global}`, then: + + a. Let :math:`(\mathsf{global}~{\mathit{ga}})` be :math:`{\mathit{externval}}_0`. + + #. Return :math:`{\mathit{ga}}~{\mathrm{globals}}({{\mathit{externval}'}^\ast})`. + +#. Let :math:`{\mathit{externval}}~{{\mathit{externval}'}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{globals}}({{\mathit{externval}'}^\ast})`. + + +:math:`{\mathrm{tables}}({{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +.............................................................................................. + + +1. If :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externval}}_0~{{\mathit{externval}'}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externval}}_0` is of the case :math:`\mathsf{table}`, then: + + a. Let :math:`(\mathsf{table}~{\mathit{ta}})` be :math:`{\mathit{externval}}_0`. + + #. Return :math:`{\mathit{ta}}~{\mathrm{tables}}({{\mathit{externval}'}^\ast})`. + +#. Let :math:`{\mathit{externval}}~{{\mathit{externval}'}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{tables}}({{\mathit{externval}'}^\ast})`. + + +:math:`{\mathrm{mems}}({{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................ + + +1. If :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{externval}}_0~{{\mathit{externval}'}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`{\mathit{externval}}_0` is of the case :math:`\mathsf{mem}`, then: + + a. Let :math:`(\mathsf{mem}~{\mathit{ma}})` be :math:`{\mathit{externval}}_0`. + + #. Return :math:`{\mathit{ma}}~{\mathrm{mems}}({{\mathit{externval}'}^\ast})`. + +#. Let :math:`{\mathit{externval}}~{{\mathit{externval}'}^\ast}` be :math:`{{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathrm{mems}}({{\mathit{externval}'}^\ast})`. + + +:math:`{\mathrm{allocfunc}}({\mathit{moduleinst}}, {\mathit{func}})` +.................................................................... + + +1. Assert: Due to validation, :math:`{\mathit{func}}` is of the case :math:`\mathsf{func}`. + +#. Let :math:`(\mathsf{func}~x~{{\mathit{local}}^\ast}~{\mathit{expr}})` be :math:`{\mathit{func}}`. + +#. Let :math:`{\mathit{fi}}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~{\mathit{moduleinst}}{.}\mathsf{types}{}[x],\; \mathsf{module}~{\mathit{moduleinst}},\; \mathsf{code}~{\mathit{func}} \}\end{array}`. + +#. Let :math:`a` be :math:`{|s{.}\mathsf{funcs}|}`. + +#. Append :math:`{\mathit{fi}}` to the :math:`s{.}\mathsf{funcs}`. + +#. Return :math:`a`. + + +:math:`{\mathrm{allocfuncs}}({\mathit{moduleinst}}, {{\mathit{func}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +.................................................................................................................... + + +1. If :math:`{{\mathit{func}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{func}}~{{\mathit{func}'}^\ast}` be :math:`{{\mathit{func}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Let :math:`{\mathit{fa}}` be :math:`{\mathrm{allocfunc}}({\mathit{moduleinst}}, {\mathit{func}})`. + +#. Let :math:`{{\mathit{fa}'}^\ast}` be :math:`{\mathrm{allocfuncs}}({\mathit{moduleinst}}, {{\mathit{func}'}^\ast})`. + +#. Return :math:`{\mathit{fa}}~{{\mathit{fa}'}^\ast}`. + + +:math:`{\mathrm{allocglobal}}({\mathit{globaltype}}, {\mathit{val}})` +..................................................................... + + +1. Let :math:`{\mathit{gi}}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~{\mathit{globaltype}},\; \mathsf{value}~{\mathit{val}} \}\end{array}`. + +#. Let :math:`a` be :math:`{|s{.}\mathsf{globals}|}`. + +#. Append :math:`{\mathit{gi}}` to the :math:`s{.}\mathsf{globals}`. + +#. Return :math:`a`. + + +:math:`{\mathrm{allocglobals}}({{\mathit{globaltype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}, {{\mathit{val}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast})` +.................................................................................................................................................................... + + +1. If :math:`{{\mathit{globaltype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Assert: Due to validation, :math:`{{\mathit{val}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` is :math:`\epsilon`. + + #. Return :math:`\epsilon`. + +#. Else: + + a. Let :math:`{\mathit{globaltype}}~{{\mathit{globaltype}'}^\ast}` be :math:`{{\mathit{globaltype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + + #. Assert: Due to validation, :math:`{|{{\mathit{val}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}|}` is greater than or equal to :math:`1`. + + #. Let :math:`{\mathit{val}}~{{\mathit{val}'}^\ast}` be :math:`{{\mathit{val}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}`. + + #. Let :math:`{\mathit{ga}}` be :math:`{\mathrm{allocglobal}}({\mathit{globaltype}}, {\mathit{val}})`. + + #. Let :math:`{{\mathit{ga}'}^\ast}` be :math:`{\mathrm{allocglobals}}({{\mathit{globaltype}'}^\ast}, {{\mathit{val}'}^\ast})`. + + #. Return :math:`{\mathit{ga}}~{{\mathit{ga}'}^\ast}`. + + +:math:`{\mathrm{alloctable}}(((i, j), {\mathit{rt}}))` +...................................................... + + +1. Let :math:`{\mathit{ti}}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~((i, j), {\mathit{rt}}),\; \mathsf{refs}~{(\mathsf{ref{.}null}~{\mathit{rt}})^{i}} \}\end{array}`. + +#. Let :math:`a` be :math:`{|s{.}\mathsf{tables}|}`. + +#. Append :math:`{\mathit{ti}}` to the :math:`s{.}\mathsf{tables}`. + +#. Return :math:`a`. + + +:math:`{\mathrm{alloctables}}({{\mathit{tabletype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +................................................................................................... + + +1. If :math:`{{\mathit{tabletype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{tabletype}}~{{\mathit{tabletype}'}^\ast}` be :math:`{{\mathit{tabletype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Let :math:`{\mathit{ta}}` be :math:`{\mathrm{alloctable}}({\mathit{tabletype}})`. + +#. Let :math:`{{\mathit{ta}'}^\ast}` be :math:`{\mathrm{alloctables}}({{\mathit{tabletype}'}^\ast})`. + +#. Return :math:`{\mathit{ta}}~{{\mathit{ta}'}^\ast}`. + + +:math:`{\mathrm{allocmem}}((\mathsf{page}~(i, j)))` +................................................... + + +1. Let :math:`{\mathit{mi}}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~(\mathsf{page}~(i, j)),\; \mathsf{bytes}~{0^{i \cdot 64 \, {\mathrm{Ki}}}} \}\end{array}`. + +#. Let :math:`a` be :math:`{|s{.}\mathsf{mems}|}`. + +#. Append :math:`{\mathit{mi}}` to the :math:`s{.}\mathsf{mems}`. + +#. Return :math:`a`. + + +:math:`{\mathrm{allocmems}}({{\mathit{memtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................... + + +1. If :math:`{{\mathit{memtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{\mathit{memtype}}~{{\mathit{memtype}'}^\ast}` be :math:`{{\mathit{memtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Let :math:`{\mathit{ma}}` be :math:`{\mathrm{allocmem}}({\mathit{memtype}})`. + +#. Let :math:`{{\mathit{ma}'}^\ast}` be :math:`{\mathrm{allocmems}}({{\mathit{memtype}'}^\ast})`. + +#. Return :math:`{\mathit{ma}}~{{\mathit{ma}'}^\ast}`. + + +:math:`{\mathrm{allocelem}}({\mathit{rt}}, {{\mathit{ref}}^\ast})` +.................................................................. + + +1. Let :math:`{\mathit{ei}}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~{\mathit{rt}},\; \mathsf{refs}~{{\mathit{ref}}^\ast} \}\end{array}`. + +#. Let :math:`a` be :math:`{|s{.}\mathsf{elems}|}`. + +#. Append :math:`{\mathit{ei}}` to the :math:`s{.}\mathsf{elems}`. + +#. Return :math:`a`. + + +:math:`{\mathrm{allocelems}}({{\mathit{reftype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}, {{\mathit{ref}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast})` +............................................................................................................................................................... + + +1. If :math:`{{\mathit{reftype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon` and :math:`{{\mathit{ref}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Assert: Due to validation, :math:`{|{{\mathit{ref}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}|}` is greater than or equal to :math:`1`. + +#. Let :math:`{{\mathit{ref}}^\ast}~{{{\mathit{ref}'}^\ast}^\ast}` be :math:`{{\mathit{ref}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}`. + +#. Assert: Due to validation, :math:`{|{{\mathit{reftype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}|}` is greater than or equal to :math:`1`. + +#. Let :math:`{\mathit{rt}}~{{\mathit{rt}'}^\ast}` be :math:`{{\mathit{reftype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Let :math:`{\mathit{ea}}` be :math:`{\mathrm{allocelem}}({\mathit{rt}}, {{\mathit{ref}}^\ast})`. + +#. Let :math:`{{\mathit{ea}'}^\ast}` be :math:`{\mathrm{allocelems}}({{\mathit{rt}'}^\ast}, {{{\mathit{ref}'}^\ast}^\ast})`. + +#. Return :math:`{\mathit{ea}}~{{\mathit{ea}'}^\ast}`. + + +:math:`{\mathrm{allocdata}}({{\mathit{byte}}^\ast})` +.................................................... + + +1. Let :math:`{\mathit{di}}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{bytes}~{{\mathit{byte}}^\ast} \}\end{array}`. + +#. Let :math:`a` be :math:`{|s{.}\mathsf{datas}|}`. + +#. Append :math:`{\mathit{di}}` to the :math:`s{.}\mathsf{datas}`. + +#. Return :math:`a`. + + +:math:`{\mathrm{allocdatas}}({{\mathit{byte}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................. + + +1. If :math:`{{\mathit{byte}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{{\mathit{byte}}^\ast}~{{{\mathit{byte}'}^\ast}^\ast}` be :math:`{{\mathit{byte}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Let :math:`{\mathit{da}}` be :math:`{\mathrm{allocdata}}({{\mathit{byte}}^\ast})`. + +#. Let :math:`{{\mathit{da}'}^\ast}` be :math:`{\mathrm{allocdatas}}({{{\mathit{byte}'}^\ast}^\ast})`. + +#. Return :math:`{\mathit{da}}~{{\mathit{da}'}^\ast}`. + + +:math:`{\mathrm{instexport}}({{\mathit{fa}}^\ast}, {{\mathit{ga}}^\ast}, {{\mathit{ta}}^\ast}, {{\mathit{ma}}^\ast}, (\mathsf{export}~{\mathit{name}}~{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}))` +..................................................................................................................................................................................................................... + + +1. If :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{func}`, then: + + a. Let :math:`(\mathsf{func}~x)` be :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{name}~{\mathit{name}},\; \mathsf{value}~(\mathsf{func}~{{\mathit{fa}}^\ast}{}[x]) \}\end{array}`. + +#. If :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{global}`, then: + + a. Let :math:`(\mathsf{global}~x)` be :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{name}~{\mathit{name}},\; \mathsf{value}~(\mathsf{global}~{{\mathit{ga}}^\ast}{}[x]) \}\end{array}`. + +#. If :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{table}`, then: + + a. Let :math:`(\mathsf{table}~x)` be :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{name}~{\mathit{name}},\; \mathsf{value}~(\mathsf{table}~{{\mathit{ta}}^\ast}{}[x]) \}\end{array}`. + +#. Assert: Due to validation, :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{mem}`. + +#. Let :math:`(\mathsf{mem}~x)` be :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{name}~{\mathit{name}},\; \mathsf{value}~(\mathsf{mem}~{{\mathit{ma}}^\ast}{}[x]) \}\end{array}`. + + +:math:`{\mathrm{allocmodule}}({\mathit{module}}, {{\mathit{externval}}^\ast}, {{\mathit{val}}^\ast}, {{{\mathit{ref}}^\ast}^\ast})` +................................................................................................................................... + + +1. Let :math:`{{\mathit{fa}}_{\mathit{ex}}^\ast}` be :math:`{\mathrm{funcs}}({{\mathit{externval}}^\ast})`. + +#. Let :math:`{{\mathit{ga}}_{\mathit{ex}}^\ast}` be :math:`{\mathrm{globals}}({{\mathit{externval}}^\ast})`. + +#. Let :math:`{{\mathit{ma}}_{\mathit{ex}}^\ast}` be :math:`{\mathrm{mems}}({{\mathit{externval}}^\ast})`. + +#. Let :math:`{{\mathit{ta}}_{\mathit{ex}}^\ast}` be :math:`{\mathrm{tables}}({{\mathit{externval}}^\ast})`. + +#. Assert: Due to validation, :math:`{\mathit{module}}` is of the case :math:`\mathsf{module}`. + +#. Let :math:`(\mathsf{module}~{\mathit{type}}_0~{{\mathit{import}}^\ast}~{{\mathit{func}}^{n_{\mathit{func}}}}~{\mathit{global}}_1~{\mathit{table}}_2~{\mathit{mem}}_3~{\mathit{elem}}_4~{\mathit{data}}_5~{{\mathit{start}}^?}~{{\mathit{export}}^\ast})` be :math:`{\mathit{module}}`. + +#. Assert: Due to validation, :math:`{\mathit{data}}_5` is of the case :math:`\mathsf{data}`. + +#. Let :math:`{(\mathsf{data}~{{\mathit{byte}}^\ast}~{\mathit{datamode}})^{n_{\mathit{data}}}}` be :math:`{\mathit{data}}_5`. + +#. Assert: Due to validation, :math:`{\mathit{elem}}_4` is of the case :math:`\mathsf{elem}`. + +#. Let :math:`{(\mathsf{elem}~{\mathit{rt}}~{{\mathit{expr}}_2^\ast}~{\mathit{elemmode}})^{n_{\mathit{elem}}}}` be :math:`{\mathit{elem}}_4`. + +#. Assert: Due to validation, :math:`{\mathit{mem}}_3` is of the case :math:`\mathsf{memory}`. + +#. Let :math:`{(\mathsf{memory}~{\mathit{memtype}})^{n_{\mathit{mem}}}}` be :math:`{\mathit{mem}}_3`. + +#. Assert: Due to validation, :math:`{\mathit{table}}_2` is of the case :math:`\mathsf{table}`. + +#. Let :math:`{(\mathsf{table}~{\mathit{tabletype}})^{n_{\mathit{table}}}}` be :math:`{\mathit{table}}_2`. + +#. Assert: Due to validation, :math:`{\mathit{global}}_1` is of the case :math:`\mathsf{global}`. + +#. Let :math:`{(\mathsf{global}~{\mathit{globaltype}}~{\mathit{expr}}_1)^{n_{\mathit{global}}}}` be :math:`{\mathit{global}}_1`. + +#. Assert: Due to validation, :math:`{\mathit{type}}_0` is of the case :math:`\mathsf{type}`. + +#. Let :math:`{(\mathsf{type}~{\mathit{ft}})^\ast}` be :math:`{\mathit{type}}_0`. + +#. Let :math:`{{\mathit{fa}}^\ast}` be :math:`{{|s{.}\mathsf{funcs}|} + i_{\mathit{func}}^{i_{\mathit{func}} t_2*) is valid. + +Globaltype_ok +- the global type ((MUT ()?), t) is valid. + +Tabletype_ok +- the table type (limits, reftype) is valid if and only if: + - the limits limits is valid with the nat ((2 ^ 32) - 1). + +Memtype_ok +- the memory type (PAGE limits) is valid if and only if: + - the limits limits is valid with the nat (2 ^ 16). + +Externtype_ok +- the external type externtype_u0 is valid if and only if: + - Either: + - externtype_u0 is (FUNC functype). + - the function type functype is valid. + - Or: + - externtype_u0 is (GLOBAL globaltype). + - the global type globaltype is valid. + - Or: + - externtype_u0 is (TABLE tabletype). + - the table type tabletype is valid. + - Or: + - externtype_u0 is (MEM memtype). + - the memory type memtype is valid. + +Valtype_sub +- the value type valtype_u0 matches the value type t if and only if: + - Either: + - valtype_u0 is t. + - Or: + - valtype_u0 is BOT. + +Resulttype_sub +- the value type sequence t_1* matches the value type sequence t_2* if and only if: + - |t_2*| is |t_1*|. + - For all t_1 in t_1* and t_2 in t_2*, + - the value type t_1 matches the value type t_2. + +Limits_sub +- the limits (n_11, n_12) matches the limits (n_21, n_22) if and only if: + - n_11 is greater than or equal to n_21. + - n_12 is less than or equal to n_22. + +Functype_sub +- the function type ft matches the function type ft. + +Globaltype_sub +- the global type gt matches the global type gt. + +Tabletype_sub +- the table type (lim_1, rt) matches the table type (lim_2, rt) if and only if: + - the limits lim_1 matches the limits lim_2. + +Memtype_sub +- the memory type (PAGE lim_1) matches the memory type (PAGE lim_2) if and only if: + - the limits lim_1 matches the limits lim_2. + +Externtype_sub +- the external type externtype_u0 matches the external type externtype_u1 if and only if: + - Either: + - externtype_u0 is (FUNC ft_1). + - externtype_u1 is (FUNC ft_2). + - the function type ft_1 matches the function type ft_2. + - Or: + - externtype_u0 is (GLOBAL gt_1). + - externtype_u1 is (GLOBAL gt_2). + - the global type gt_1 matches the global type gt_2. + - Or: + - externtype_u0 is (TABLE tt_1). + - externtype_u1 is (TABLE tt_2). + - the table type tt_1 matches the table type tt_2. + - Or: + - externtype_u0 is (MEM mt_1). + - externtype_u1 is (MEM mt_2). + - the memory type mt_1 matches the memory type mt_2. + +Blocktype_ok +- the block type blocktype_u0 is valid with the function type (valtype_u1* -> valtype_u2*) if and only if: + - Either: + - blocktype_u0 is (_RESULT valtype?). + - valtype_u1* is []. + - valtype_u2* is valtype?. + - Or: + - blocktype_u0 is (_IDX typeidx). + - valtype_u1* is t_1*. + - valtype_u2* is t_2*. + - |C.TYPES| is greater than typeidx. + - C.TYPES[typeidx] is (t_1* -> t_2*). + +Instr_ok/nop +- the instr NOP is valid with the function type ([] -> []). + +Instr_ok/unreachable +- the instr UNREACHABLE is valid with the function type (t_1* -> t_2*). + +Instr_ok/drop +- the instr DROP is valid with the function type ([t] -> []). + +Instr_ok/select +- the instr (SELECT ?([t])) is valid with the function type ([t, t, I32] -> [t]). + +Instr_ok/block +- the instr (BLOCK bt instr*) is valid with the function type (t_1* -> t_2*) if and only if: + - the block type bt is valid with the function type (t_1* -> t_2*). + - Under the context C with .LABELS prepended by [t_2*], the instr sequence instr* is valid with the function type (t_1* -> t_2*). + +Instr_ok/loop +- the instr (LOOP bt instr*) is valid with the function type (t_1* -> t_2*) if and only if: + - the block type bt is valid with the function type (t_1* -> t_2*). + - Under the context C with .LABELS prepended by [t_1*], the instr sequence instr* is valid with the function type (t_1* -> t_2*). + +Instr_ok/if +- the instr (IF bt instr_1* instr_2*) is valid with the function type (t_1* ++ [I32] -> t_2*) if and only if: + - the block type bt is valid with the function type (t_1* -> t_2*). + - Under the context C with .LABELS prepended by [t_2*], the instr sequence instr_1* is valid with the function type (t_1* -> t_2*). + - Under the context C with .LABELS prepended by [t_2*], the instr sequence instr_2* is valid with the function type (t_1* -> t_2*). + +Instr_ok/br +- the instr (BR l) is valid with the function type (t_1* ++ t* -> t_2*) if and only if: + - |C.LABELS| is greater than l. + - C.LABELS[l] is t*. + +Instr_ok/br_if +- the instr (BR_IF l) is valid with the function type (t* ++ [I32] -> t*) if and only if: + - |C.LABELS| is greater than l. + - C.LABELS[l] is t*. + +Instr_ok/br_table +- the instr (BR_TABLE l* l') is valid with the function type (t_1* ++ t* -> t_2*) if and only if: + - For all l in l*, + - |C.LABELS| is greater than l. + - |C.LABELS| is greater than l'. + - For all l in l*, + - the value type sequence t* matches the result type C.LABELS[l]. + - the value type sequence t* matches the result type C.LABELS[l']. + +Instr_ok/call +- the instr (CALL x) is valid with the function type (t_1* -> t_2*) if and only if: + - |C.FUNCS| is greater than x. + - C.FUNCS[x] is (t_1* -> t_2*). + +Instr_ok/call_indirect +- the instr (CALL_INDIRECT x y) is valid with the function type (t_1* ++ [I32] -> t_2*) if and only if: + - |C.TABLES| is greater than x. + - |C.TYPES| is greater than y. + - C.TABLES[x] is (lim, FUNCREF). + - C.TYPES[y] is (t_1* -> t_2*). + +Instr_ok/return +- the instr RETURN is valid with the function type (t_1* ++ t* -> t_2*) if and only if: + - C.RETURN is ?(t*). + +Instr_ok/const +- the instr (nt.CONST c_nt) is valid with the function type ([] -> [nt]). + +Instr_ok/unop +- the instr (UNOP nt unop_nt) is valid with the function type ([nt] -> [nt]). + +Instr_ok/binop +- the instr (BINOP nt binop_nt) is valid with the function type ([nt, nt] -> [nt]). + +Instr_ok/testop +- the instr (TESTOP nt testop_nt) is valid with the function type ([nt] -> [I32]). + +Instr_ok/relop +- the instr (RELOP nt relop_nt) is valid with the function type ([nt, nt] -> [I32]). + +Instr_ok/cvtop +- the instr (CVTOP nt_1 nt_2 REINTERPRET) is valid with the function type ([nt_2] -> [nt_1]) if and only if: + - $size(nt_1) is $size(nt_2). + +Instr_ok/ref.null +- the instr (REF.NULL rt) is valid with the function type ([] -> [rt]). + +Instr_ok/ref.func +- the instr (REF.FUNC x) is valid with the function type ([] -> [FUNCREF]) if and only if: + - |C.FUNCS| is greater than x. + - C.FUNCS[x] is ft. + +Instr_ok/ref.is_null +- the instr REF.IS_NULL is valid with the function type ([rt] -> [I32]). + +Instr_ok/vconst +- the instr (V128.CONST c) is valid with the function type ([] -> [V128]). + +Instr_ok/vvunop +- the instr (VVUNOP V128 vvunop) is valid with the function type ([V128] -> [V128]). + +Instr_ok/vvbinop +- the instr (VVBINOP V128 vvbinop) is valid with the function type ([V128, V128] -> [V128]). + +Instr_ok/vvternop +- the instr (VVTERNOP V128 vvternop) is valid with the function type ([V128, V128, V128] -> [V128]). + +Instr_ok/vvtestop +- the instr (VVTESTOP V128 vvtestop) is valid with the function type ([V128] -> [I32]). + +Instr_ok/vunop +- the instr (VUNOP sh vunop_sh) is valid with the function type ([V128] -> [V128]). + +Instr_ok/vbinop +- the instr (VBINOP sh vbinop_sh) is valid with the function type ([V128, V128] -> [V128]). + +Instr_ok/vtestop +- the instr (VTESTOP sh vtestop_sh) is valid with the function type ([V128] -> [I32]). + +Instr_ok/vrelop +- the instr (VRELOP sh vrelop_sh) is valid with the function type ([V128, V128] -> [V128]). + +Instr_ok/vshiftop +- the instr (VSHIFTOP sh vshiftop_sh) is valid with the function type ([V128, I32] -> [V128]). + +Instr_ok/vbitmask +- the instr (VBITMASK sh) is valid with the function type ([V128] -> [I32]). + +Instr_ok/vswizzle +- the instr (VSWIZZLE sh) is valid with the function type ([V128, V128] -> [V128]). + +Instr_ok/vshuffle +- the instr (VSHUFFLE sh i*) is valid with the function type ([V128, V128] -> [V128]) if and only if: + - For all i in i*, + - i is less than (2 · $dim(sh)). + +Instr_ok/vsplat +- the instr (VSPLAT sh) is valid with the function type ([$shunpack(sh)] -> [V128]). + +Instr_ok/vextract_lane +- the instr (VEXTRACT_LANE sh sx? i) is valid with the function type ([V128] -> [$shunpack(sh)]) if and only if: + - i is less than $dim(sh). + +Instr_ok/vreplace_lane +- the instr (VREPLACE_LANE sh i) is valid with the function type ([V128, $shunpack(sh)] -> [V128]) if and only if: + - i is less than $dim(sh). + +Instr_ok/vextunop +- the instr (VEXTUNOP sh_1 sh_2 vextunop) is valid with the function type ([V128] -> [V128]). + +Instr_ok/vextbinop +- the instr (VEXTBINOP sh_1 sh_2 vextbinop) is valid with the function type ([V128, V128] -> [V128]). + +Instr_ok/vnarrow +- the instr (VNARROW sh_1 sh_2 sx) is valid with the function type ([V128, V128] -> [V128]). + +Instr_ok/vcvtop +- the instr (VCVTOP sh_1 sh_2 vcvtop hf? zero?) is valid with the function type ([V128] -> [V128]). + +Instr_ok/local.get +- the instr (LOCAL.GET x) is valid with the function type ([] -> [t]) if and only if: + - |C.LOCALS| is greater than x. + - C.LOCALS[x] is t. + +Instr_ok/local.set +- the instr (LOCAL.SET x) is valid with the function type ([t] -> []) if and only if: + - |C.LOCALS| is greater than x. + - C.LOCALS[x] is t. + +Instr_ok/local.tee +- the instr (LOCAL.TEE x) is valid with the function type ([t] -> [t]) if and only if: + - |C.LOCALS| is greater than x. + - C.LOCALS[x] is t. + +Instr_ok/global.get +- the instr (GLOBAL.GET x) is valid with the function type ([] -> [t]) if and only if: + - |C.GLOBALS| is greater than x. + - C.GLOBALS[x] is (mut, t). + +Instr_ok/global.set +- the instr (GLOBAL.SET x) is valid with the function type ([t] -> []) if and only if: + - |C.GLOBALS| is greater than x. + - C.GLOBALS[x] is ((MUT ?(())), t). + +Instr_ok/table.get +- the instr (TABLE.GET x) is valid with the function type ([I32] -> [rt]) if and only if: + - |C.TABLES| is greater than x. + - C.TABLES[x] is (lim, rt). + +Instr_ok/table.set +- the instr (TABLE.SET x) is valid with the function type ([I32, rt] -> []) if and only if: + - |C.TABLES| is greater than x. + - C.TABLES[x] is (lim, rt). + +Instr_ok/table.size +- the instr (TABLE.SIZE x) is valid with the function type ([] -> [I32]) if and only if: + - |C.TABLES| is greater than x. + - C.TABLES[x] is (lim, rt). + +Instr_ok/table.grow +- the instr (TABLE.GROW x) is valid with the function type ([rt, I32] -> [I32]) if and only if: + - |C.TABLES| is greater than x. + - C.TABLES[x] is (lim, rt). + +Instr_ok/table.fill +- the instr (TABLE.FILL x) is valid with the function type ([I32, rt, I32] -> []) if and only if: + - |C.TABLES| is greater than x. + - C.TABLES[x] is (lim, rt). + +Instr_ok/table.copy +- the instr (TABLE.COPY x_1 x_2) is valid with the function type ([I32, I32, I32] -> []) if and only if: + - |C.TABLES| is greater than x_1. + - |C.TABLES| is greater than x_2. + - C.TABLES[x_1] is (lim_1, rt). + - C.TABLES[x_2] is (lim_2, rt). + +Instr_ok/table.init +- the instr (TABLE.INIT x_1 x_2) is valid with the function type ([I32, I32, I32] -> []) if and only if: + - |C.TABLES| is greater than x_1. + - |C.ELEMS| is greater than x_2. + - C.TABLES[x_1] is (lim, rt). + - C.ELEMS[x_2] is rt. + +Instr_ok/elem.drop +- the instr (ELEM.DROP x) is valid with the function type ([] -> []) if and only if: + - |C.ELEMS| is greater than x. + - C.ELEMS[x] is rt. + +Instr_ok/memory.size +- the instr MEMORY.SIZE is valid with the function type ([] -> [I32]) if and only if: + - |C.MEMS| is greater than 0. + - C.MEMS[0] is mt. + +Instr_ok/memory.grow +- the instr MEMORY.GROW is valid with the function type ([I32] -> [I32]) if and only if: + - |C.MEMS| is greater than 0. + - C.MEMS[0] is mt. + +Instr_ok/memory.fill +- the instr MEMORY.FILL is valid with the function type ([I32, I32, I32] -> []) if and only if: + - |C.MEMS| is greater than 0. + - C.MEMS[0] is mt. + +Instr_ok/memory.copy +- the instr MEMORY.COPY is valid with the function type ([I32, I32, I32] -> []) if and only if: + - |C.MEMS| is greater than 0. + - C.MEMS[0] is mt. + +Instr_ok/memory.init +- the instr (MEMORY.INIT x) is valid with the function type ([I32, I32, I32] -> []) if and only if: + - |C.MEMS| is greater than 0. + - |C.DATAS| is greater than x. + - C.MEMS[0] is mt. + - C.DATAS[x] is OK. + +Instr_ok/data.drop +- the instr (DATA.DROP x) is valid with the function type ([] -> []) if and only if: + - |C.DATAS| is greater than x. + - C.DATAS[x] is OK. + +Instr_ok/load +- the instr (LOAD nt (n, sx)? memarg) is valid with the function type ([I32] -> [nt]) if and only if: + - |C.MEMS| is greater than 0. + - ((sx? is ?())) if and only if ((n? is ?())). + - C.MEMS[0] is mt. + - (2 ^ memarg.ALIGN) is less than or equal to ($size(nt) / 8). + - If n is defined, + - (2 ^ memarg.ALIGN) is less than or equal to (n / 8). + - (n / 8) is less than ($size(nt) / 8). + - If n is defined, + - nt is Inn. + +Instr_ok/store +- the instr (STORE nt n? memarg) is valid with the function type ([I32, nt] -> []) if and only if: + - |C.MEMS| is greater than 0. + - C.MEMS[0] is mt. + - (2 ^ memarg.ALIGN) is less than or equal to ($size(nt) / 8). + - If n is defined, + - (2 ^ memarg.ALIGN) is less than or equal to (n / 8). + - (n / 8) is less than ($size(nt) / 8). + - If n is defined, + - nt is Inn. + +Instr_ok/vload +- the instr (VLOAD V128 ?((SHAPE M N sx)) memarg) is valid with the function type ([I32] -> [V128]) if and only if: + - |C.MEMS| is greater than 0. + - C.MEMS[0] is mt. + - (2 ^ memarg.ALIGN) is less than or equal to ((M / 8) · N). + +Instr_ok/vload_lane +- the instr (VLOAD_LANE V128 n memarg laneidx) is valid with the function type ([I32, V128] -> [V128]) if and only if: + - |C.MEMS| is greater than 0. + - C.MEMS[0] is mt. + - (2 ^ memarg.ALIGN) is less than or equal to (n / 8). + - laneidx is less than (128 / n). + +Instr_ok/vstore +- the instr (VSTORE V128 memarg) is valid with the function type ([I32, V128] -> []) if and only if: + - |C.MEMS| is greater than 0. + - C.MEMS[0] is mt. + - (2 ^ memarg.ALIGN) is less than or equal to ($size(V128) / 8). + +Instr_ok/vstore_lane +- the instr (VSTORE_LANE V128 n memarg laneidx) is valid with the function type ([I32, V128] -> []) if and only if: + - |C.MEMS| is greater than 0. + - C.MEMS[0] is mt. + - (2 ^ memarg.ALIGN) is less than or equal to (n / 8). + - laneidx is less than (128 / n). + +Instrs_ok +- the instr sequence instr_u0* is valid with the function type (valtype_u1* -> valtype_u2*) if and only if: + - Either: + - instr_u0* is []. + - valtype_u1* is []. + - valtype_u2* is []. + - Or: + - instr_u0* is [instr_1] ++ instr_2*. + - valtype_u1* is t_1*. + - valtype_u2* is t_3*. + - the instr instr_1 is valid with the function type (t_1* -> t_2*). + - the instr sequence [instr_2] is valid with the function type (t_2* -> t_3*). + - Or: + - instr_u0* is instr*. + - valtype_u1* is t'_1*. + - valtype_u2* is t'_2*. + - the instr sequence instr* is valid with the function type (t_1* -> t_2*). + - the value type sequence t'_1* matches the value type sequence t_1*. + - the value type sequence t_2* matches the value type sequence t'_2*. + - Or: + - instr_u0* is instr*. + - valtype_u1* is t* ++ t_1*. + - valtype_u2* is t* ++ t_2*. + - the instr sequence instr* is valid with the function type (t_1* -> t_2*). + +Expr_ok +- the expression instr* is valid with the value type sequence t* if and only if: + - the instr sequence instr* is valid with the function type ([] -> t*). + +Instr_const +- the instr instr_u0 is constant if and only if: + - Either: + - instr_u0 is (nt.CONST c). + - Or: + - instr_u0 is (vt.CONST vc). + - Or: + - instr_u0 is (REF.NULL rt). + - Or: + - instr_u0 is (REF.FUNC x). + - Or: + - instr_u0 is (GLOBAL.GET x). + - |C.GLOBALS| is greater than x. + - C.GLOBALS[x] is ((MUT ?()), t). + +Expr_const +- the expression instr* is constant if and only if: + - For all instr in instr*, + - the instr instr is constant. + +Type_ok +- the type (TYPE ft) is valid with the function type ft if and only if: + - the function type ft is valid. + +Func_ok +- the function (FUNC x (LOCAL t)* expr) is valid with the function type (t_1* -> t_2*) if and only if: + - |C.TYPES| is greater than x. + - C.TYPES[x] is (t_1* -> t_2*). + - Under the context C with .LOCALS appended by t_1* ++ t* with .LABELS appended by [t_2*] with .RETURN appended by ?(t_2*), the expression expr is valid with the value type sequence t_2*. + +Global_ok +- the global (GLOBAL gt expr) is valid with the global type gt if and only if: + - the global type gt is valid. + - gt is (mut, t). + - the expression expr is valid with the value type t. + - the expression expr is constant. + +Table_ok +- the table (TABLE tt) is valid with the table type tt if and only if: + - the table type tt is valid. + +Mem_ok +- the memory (MEMORY mt) is valid with the memory type mt if and only if: + - the memory type mt is valid. + +Elemmode_ok +- the elemmode elemmode_u0 is valid with the reference type rt if and only if: + - Either: + - elemmode_u0 is (ACTIVE x expr). + - |C.TABLES| is greater than x. + - C.TABLES[x] is (lim, rt). + - the expression expr is valid with the value type I32. + - the expression expr is constant. + - Or: + - elemmode_u0 is PASSIVE. + - Or: + - elemmode_u0 is DECLARE. + +Elem_ok +- the table segment (ELEM rt expr* elemmode) is valid with the reference type rt if and only if: + - For all expr in expr*, + - the expression expr is valid with the value type rt. + - the expression expr is constant. + - the elemmode elemmode is valid with the reference type rt. + +Datamode_ok +- the datamode datamode_u0 is valid if and only if: + - Either: + - datamode_u0 is (ACTIVE 0 expr). + - |C.MEMS| is greater than 0. + - C.MEMS[0] is mt. + - the expression expr is valid with the value type I32. + - the expression expr is constant. + - Or: + - datamode_u0 is PASSIVE. + +Data_ok +- the memory segment (DATA b* datamode) is valid if and only if: + - the datamode datamode is valid. + +Start_ok +- the start function (START x) is valid if and only if: + - |C.FUNCS| is greater than x. + - C.FUNCS[x] is ([] -> []). + +Import_ok +- the import (IMPORT name_1 name_2 xt) is valid with the external type xt if and only if: + - the external type xt is valid. + +Externidx_ok +- the external index externidx_u0 is valid with the external type externtype_u1 if and only if: + - Either: + - externidx_u0 is (FUNC x). + - externtype_u1 is (FUNC ft). + - |C.FUNCS| is greater than x. + - C.FUNCS[x] is ft. + - Or: + - externidx_u0 is (GLOBAL x). + - externtype_u1 is (GLOBAL gt). + - |C.GLOBALS| is greater than x. + - C.GLOBALS[x] is gt. + - Or: + - externidx_u0 is (TABLE x). + - externtype_u1 is (TABLE tt). + - |C.TABLES| is greater than x. + - C.TABLES[x] is tt. + - Or: + - externidx_u0 is (MEM x). + - externtype_u1 is (MEM mt). + - |C.MEMS| is greater than x. + - C.MEMS[x] is mt. + +Export_ok +- the export (EXPORT name externidx) is valid with the external type xt if and only if: + - the external index externidx is valid with the external type xt. + +Module_ok +- the module (MODULE type* import* func* global* table* mem* elem* data^n start? export*) is valid if and only if: + - |type*| is |ft'*|. + - |ixt*| is |import*|. + - |gt*| is |global*|. + - |tt*| is |table*|. + - |mt*| is |mem*|. + - |rt*| is |elem*|. + - |func*| is |ft*|. + - |xt*| is |export*|. + - For all ft' in ft'* and type in type*, + - the type type is valid with the function type ft'. + - For all import in import* and ixt in ixt*, + - Under the context { TYPES: ft'*; FUNCS: []; GLOBALS: []; TABLES: []; MEMS: []; ELEMS: []; DATAS: []; LOCALS: []; LABELS: []; RETURN: ?(); }, the import import is valid with the external type ixt. + - For all global in global* and gt in gt*, + - Under the context C', the global global is valid with the global type gt. + - For all table in table* and tt in tt*, + - Under the context C', the table table is valid with the table type tt. + - For all mem in mem* and mt in mt*, + - Under the context C', the memory mem is valid with the memory type mt. + - For all elem in elem* and rt in rt*, + - Under the context C', the table segment elem is valid with the reference type rt. + - For all data in data*, + - Under the context C', the memory segment data is valid. + - For all ft in ft* and func in func*, + - the function func is valid with the function type ft. + - If start is defined, + - the start function start is valid. + - For all export in export* and xt in xt*, + - the export export is valid with the external type xt. + - |mt*| is less than or equal to 1. + - C is { TYPES: ft'*; FUNCS: ift* ++ ft*; GLOBALS: igt* ++ gt*; TABLES: itt* ++ tt*; MEMS: imt* ++ mt*; ELEMS: rt*; DATAS: OK^n; LOCALS: []; LABELS: []; RETURN: ?(); }. + - C' is { TYPES: ft'*; FUNCS: ift* ++ ft*; GLOBALS: igt*; TABLES: itt* ++ tt*; MEMS: imt* ++ mt*; ELEMS: []; DATAS: []; LOCALS: []; LABELS: []; RETURN: ?(); }. + - ift* is $funcsxt(ixt*). + - igt* is $globalsxt(ixt*). + - itt* is $tablesxt(ixt*). + - imt* is $memsxt(ixt*). + +Ki +1. Return 1024. + +min n_u0 n_u1 +1. If (n_u0 is 0), then: + a. Return 0. +2. If (n_u1 is 0), then: + a. Return 0. +3. Assert: Due to validation, (n_u0 ≥ 1). +4. Let i be (n_u0 - 1). +5. Assert: Due to validation, (n_u1 ≥ 1). +6. Let j be (n_u1 - 1). +7. Return $min(i, j). + +sum n_u0* +1. If (n_u0* is []), then: + a. Return 0. +2. Let [n] ++ n'* be n_u0*. +3. Return (n + $sum(n'*)). + +opt_ X X_u0* +1. If (X_u0* is []), then: + a. Return ?(). +2. Assert: Due to validation, (|X_u0*| is 1). +3. Let [w] be X_u0*. +4. Return ?(w). + +list_ X X_u0? +1. If X_u0? is not defined, then: + a. Return []. +2. Let ?(w) be X_u0?. +3. Return [w]. + +concat_ X X_u0* +1. If (X_u0* is []), then: + a. Return []. +2. Let [w*] ++ w'** be X_u0*. +3. Return w* ++ $concat_(X, w'**). + +setproduct2_ X w_1 X_u0* +1. If (X_u0* is []), then: + a. Return []. +2. Let [w'*] ++ w** be X_u0*. +3. Return [[w_1] ++ w'*] ++ $setproduct2_(X, w_1, w**). + +setproduct1_ X X_u0* w** +1. If (X_u0* is []), then: + a. Return []. +2. Let [w_1] ++ w'* be X_u0*. +3. Return $setproduct2_(X, w_1, w**) ++ $setproduct1_(X, w'*, w**). + +setproduct_ X X_u0* +1. If (X_u0* is []), then: + a. Return [[]]. +2. Let [w_1*] ++ w** be X_u0*. +3. Return $setproduct1_(X, w_1*, $setproduct_(X, w**)). + +signif N_u0 +1. If (N_u0 is 32), then: + a. Return 23. +2. Assert: Due to validation, (N_u0 is 64). +3. Return 52. + +expon N_u0 +1. If (N_u0 is 32), then: + a. Return 8. +2. Assert: Due to validation, (N_u0 is 64). +3. Return 11. + +M N +1. Return $signif(N). + +E N +1. Return $expon(N). + +fzero N +1. Return (POS (SUBNORM 0)). + +fone N +1. Return (POS (NORM 1 0)). + +canon_ N +1. Return (2 ^ ($signif(N) - 1)). + +size valtype_u0 +1. If (valtype_u0 is I32), then: + a. Return 32. +2. If (valtype_u0 is I64), then: + a. Return 64. +3. If (valtype_u0 is F32), then: + a. Return 32. +4. If (valtype_u0 is F64), then: + a. Return 64. +5. If (valtype_u0 is V128), then: + a. Return 128. + +isize Inn +1. Return $size(Inn). + +psize packtype_u0 +1. If (packtype_u0 is I8), then: + a. Return 8. +2. Assert: Due to validation, (packtype_u0 is I16). +3. Return 16. + +lsize lanetype_u0 +1. If the type of lanetype_u0 is numtype, then: + a. Let numtype be lanetype_u0. + b. Return $size(numtype). +2. Assert: Due to validation, the type of lanetype_u0 is packtype. +3. Let packtype be lanetype_u0. +4. Return $psize(packtype). + +lanetype (Lnn X N) +1. Return Lnn. + +sizenn nt +1. Return $size(nt). + +sizenn1 nt +1. Return $size(nt). + +sizenn2 nt +1. Return $size(nt). + +lsizenn lt +1. Return $lsize(lt). + +lsizenn1 lt +1. Return $lsize(lt). + +lsizenn2 lt +1. Return $lsize(lt). + +zero numtype_u0 +1. If the type of numtype_u0 is Inn, then: + a. Return 0. +2. Assert: Due to validation, the type of numtype_u0 is Fnn. +3. Let Fnn be numtype_u0. +4. Return $fzero($size(Fnn)). + +dim (Lnn X N) +1. Return N. + +shsize (Lnn X N) +1. Return ($lsize(Lnn) · N). + +concat_bytes byte_u0* +1. If (byte_u0* is []), then: + a. Return []. +2. Let [b*] ++ b'** be byte_u0*. +3. Return b* ++ $concat_bytes(b'**). + +unpack lanetype_u0 +1. If the type of lanetype_u0 is numtype, then: + a. Let numtype be lanetype_u0. + b. Return numtype. +2. Assert: Due to validation, the type of lanetype_u0 is packtype. +3. Return I32. + +shunpack (Lnn X N) +1. Return $unpack(Lnn). + +funcsxt externtype_u0* +1. If (externtype_u0* is []), then: + a. Return []. +2. Let [externtype_0] ++ xt* be externtype_u0*. +3. If externtype_0 is of the case FUNC, then: + a. Let (FUNC ft) be externtype_0. + b. Return [ft] ++ $funcsxt(xt*). +4. Let [externtype] ++ xt* be externtype_u0*. +5. Return $funcsxt(xt*). + +globalsxt externtype_u0* +1. If (externtype_u0* is []), then: + a. Return []. +2. Let [externtype_0] ++ xt* be externtype_u0*. +3. If externtype_0 is of the case GLOBAL, then: + a. Let (GLOBAL gt) be externtype_0. + b. Return [gt] ++ $globalsxt(xt*). +4. Let [externtype] ++ xt* be externtype_u0*. +5. Return $globalsxt(xt*). + +tablesxt externtype_u0* +1. If (externtype_u0* is []), then: + a. Return []. +2. Let [externtype_0] ++ xt* be externtype_u0*. +3. If externtype_0 is of the case TABLE, then: + a. Let (TABLE tt) be externtype_0. + b. Return [tt] ++ $tablesxt(xt*). +4. Let [externtype] ++ xt* be externtype_u0*. +5. Return $tablesxt(xt*). + +memsxt externtype_u0* +1. If (externtype_u0* is []), then: + a. Return []. +2. Let [externtype_0] ++ xt* be externtype_u0*. +3. If externtype_0 is of the case MEM, then: + a. Let (MEM mt) be externtype_0. + b. Return [mt] ++ $memsxt(xt*). +4. Let [externtype] ++ xt* be externtype_u0*. +5. Return $memsxt(xt*). + +dataidx_instr instr_u0 +1. If instr_u0 is of the case MEMORY.INIT, then: + a. Let (MEMORY.INIT x) be instr_u0. + b. Return [x]. +2. If instr_u0 is of the case DATA.DROP, then: + a. Let (DATA.DROP x) be instr_u0. + b. Return [x]. +3. Return []. + +dataidx_instrs instr_u0* +1. If (instr_u0* is []), then: + a. Return []. +2. Let [instr] ++ instr'* be instr_u0*. +3. Return $dataidx_instr(instr) ++ $dataidx_instrs(instr'*). + +dataidx_expr in* +1. Return $dataidx_instrs(in*). + +dataidx_func (FUNC x loc* e) +1. Return $dataidx_expr(e). + +dataidx_funcs func_u0* +1. If (func_u0* is []), then: + a. Return []. +2. Let [func] ++ func'* be func_u0*. +3. Return $dataidx_func(func) ++ $dataidx_funcs(func'*). + +memarg0 +1. Return { ALIGN: 0; OFFSET: 0; }. + +signed_ N i +1. If (0 ≤ (2 ^ (N - 1))), then: + a. Return i. +2. Assert: Due to validation, ((2 ^ (N - 1)) ≤ i). +3. Assert: Due to validation, (i < (2 ^ N)). +4. Return (i - (2 ^ N)). + +invsigned_ N i +1. Let j be $signed__1^-1(N, i). +2. Return j. + +unop_ numtype_u1 unop__u0 num__u3 +1. If ((unop__u0 is CLZ) and the type of numtype_u1 is Inn), then: + a. Let Inn be numtype_u1. + b. Let iN be num__u3. + c. Return [$iclz_($sizenn(Inn), iN)]. +2. If ((unop__u0 is CTZ) and the type of numtype_u1 is Inn), then: + a. Let Inn be numtype_u1. + b. Let iN be num__u3. + c. Return [$ictz_($sizenn(Inn), iN)]. +3. If ((unop__u0 is POPCNT) and the type of numtype_u1 is Inn), then: + a. Let Inn be numtype_u1. + b. Let iN be num__u3. + c. Return [$ipopcnt_($sizenn(Inn), iN)]. +4. If the type of numtype_u1 is Inn, then: + a. Let Inn be numtype_u1. + b. Assert: Due to validation, unop__u0 is of the case EXTEND. + c. Let (EXTEND M) be unop__u0. + d. Let iN be num__u3. + e. Return [$extend__(M, $sizenn(Inn), S, $wrap__($sizenn(Inn), M, iN))]. +5. If ((unop__u0 is ABS) and the type of numtype_u1 is Fnn), then: + a. Let Fnn be numtype_u1. + b. Let fN be num__u3. + c. Return $fabs_($sizenn(Fnn), fN). +6. If ((unop__u0 is NEG) and the type of numtype_u1 is Fnn), then: + a. Let Fnn be numtype_u1. + b. Let fN be num__u3. + c. Return $fneg_($sizenn(Fnn), fN). +7. If ((unop__u0 is SQRT) and the type of numtype_u1 is Fnn), then: + a. Let Fnn be numtype_u1. + b. Let fN be num__u3. + c. Return $fsqrt_($sizenn(Fnn), fN). +8. If ((unop__u0 is CEIL) and the type of numtype_u1 is Fnn), then: + a. Let Fnn be numtype_u1. + b. Let fN be num__u3. + c. Return $fceil_($sizenn(Fnn), fN). +9. If ((unop__u0 is FLOOR) and the type of numtype_u1 is Fnn), then: + a. Let Fnn be numtype_u1. + b. Let fN be num__u3. + c. Return $ffloor_($sizenn(Fnn), fN). +10. If ((unop__u0 is TRUNC) and the type of numtype_u1 is Fnn), then: + a. Let Fnn be numtype_u1. + b. Let fN be num__u3. + c. Return $ftrunc_($sizenn(Fnn), fN). +11. Assert: Due to validation, (unop__u0 is NEAREST). +12. Assert: Due to validation, the type of numtype_u1 is Fnn. +13. Let Fnn be numtype_u1. +14. Let fN be num__u3. +15. Return $fnearest_($sizenn(Fnn), fN). + +binop_ numtype_u1 binop__u0 num__u3 num__u5 +1. If ((binop__u0 is ADD) and the type of numtype_u1 is Inn), then: + a. Let Inn be numtype_u1. + b. Let iN_1 be num__u3. + c. Let iN_2 be num__u5. + d. Return [$iadd_($sizenn(Inn), iN_1, iN_2)]. +2. If ((binop__u0 is SUB) and the type of numtype_u1 is Inn), then: + a. Let Inn be numtype_u1. + b. Let iN_1 be num__u3. + c. Let iN_2 be num__u5. + d. Return [$isub_($sizenn(Inn), iN_1, iN_2)]. +3. If ((binop__u0 is MUL) and the type of numtype_u1 is Inn), then: + a. Let Inn be numtype_u1. + b. Let iN_1 be num__u3. + c. Let iN_2 be num__u5. + d. Return [$imul_($sizenn(Inn), iN_1, iN_2)]. +4. If the type of numtype_u1 is Inn, then: + a. Let Inn be numtype_u1. + b. Let iN_1 be num__u3. + c. Let iN_2 be num__u5. + d. If binop__u0 is of the case DIV, then: + 1) Let (DIV sx) be binop__u0. + 2) Return $list_(num_((Inn : Inn <: numtype)), $idiv_($sizenn(Inn), sx, iN_1, iN_2)). + e. If binop__u0 is of the case REM, then: + 1) Let (REM sx) be binop__u0. + 2) Return $list_(num_((Inn : Inn <: numtype)), $irem_($sizenn(Inn), sx, iN_1, iN_2)). +5. If ((binop__u0 is AND) and the type of numtype_u1 is Inn), then: + a. Let Inn be numtype_u1. + b. Let iN_1 be num__u3. + c. Let iN_2 be num__u5. + d. Return [$iand_($sizenn(Inn), iN_1, iN_2)]. +6. If ((binop__u0 is OR) and the type of numtype_u1 is Inn), then: + a. Let Inn be numtype_u1. + b. Let iN_1 be num__u3. + c. Let iN_2 be num__u5. + d. Return [$ior_($sizenn(Inn), iN_1, iN_2)]. +7. If ((binop__u0 is XOR) and the type of numtype_u1 is Inn), then: + a. Let Inn be numtype_u1. + b. Let iN_1 be num__u3. + c. Let iN_2 be num__u5. + d. Return [$ixor_($sizenn(Inn), iN_1, iN_2)]. +8. If ((binop__u0 is SHL) and the type of numtype_u1 is Inn), then: + a. Let Inn be numtype_u1. + b. Let iN_1 be num__u3. + c. Let iN_2 be num__u5. + d. Return [$ishl_($sizenn(Inn), iN_1, iN_2)]. +9. If the type of numtype_u1 is Inn, then: + a. Let Inn be numtype_u1. + b. Let iN_1 be num__u3. + c. Let iN_2 be num__u5. + d. If binop__u0 is of the case SHR, then: + 1) Let (SHR sx) be binop__u0. + 2) Return [$ishr_($sizenn(Inn), sx, iN_1, iN_2)]. +10. If ((binop__u0 is ROTL) and the type of numtype_u1 is Inn), then: + a. Let Inn be numtype_u1. + b. Let iN_1 be num__u3. + c. Let iN_2 be num__u5. + d. Return [$irotl_($sizenn(Inn), iN_1, iN_2)]. +11. If ((binop__u0 is ROTR) and the type of numtype_u1 is Inn), then: + a. Let Inn be numtype_u1. + b. Let iN_1 be num__u3. + c. Let iN_2 be num__u5. + d. Return [$irotr_($sizenn(Inn), iN_1, iN_2)]. +12. If ((binop__u0 is ADD) and the type of numtype_u1 is Fnn), then: + a. Let Fnn be numtype_u1. + b. Let fN_1 be num__u3. + c. Let fN_2 be num__u5. + d. Return $fadd_($sizenn(Fnn), fN_1, fN_2). +13. If ((binop__u0 is SUB) and the type of numtype_u1 is Fnn), then: + a. Let Fnn be numtype_u1. + b. Let fN_1 be num__u3. + c. Let fN_2 be num__u5. + d. Return $fsub_($sizenn(Fnn), fN_1, fN_2). +14. If ((binop__u0 is MUL) and the type of numtype_u1 is Fnn), then: + a. Let Fnn be numtype_u1. + b. Let fN_1 be num__u3. + c. Let fN_2 be num__u5. + d. Return $fmul_($sizenn(Fnn), fN_1, fN_2). +15. If ((binop__u0 is DIV) and the type of numtype_u1 is Fnn), then: + a. Let Fnn be numtype_u1. + b. Let fN_1 be num__u3. + c. Let fN_2 be num__u5. + d. Return $fdiv_($sizenn(Fnn), fN_1, fN_2). +16. If ((binop__u0 is MIN) and the type of numtype_u1 is Fnn), then: + a. Let Fnn be numtype_u1. + b. Let fN_1 be num__u3. + c. Let fN_2 be num__u5. + d. Return $fmin_($sizenn(Fnn), fN_1, fN_2). +17. If ((binop__u0 is MAX) and the type of numtype_u1 is Fnn), then: + a. Let Fnn be numtype_u1. + b. Let fN_1 be num__u3. + c. Let fN_2 be num__u5. + d. Return $fmax_($sizenn(Fnn), fN_1, fN_2). +18. Assert: Due to validation, (binop__u0 is COPYSIGN). +19. Assert: Due to validation, the type of numtype_u1 is Fnn. +20. Let Fnn be numtype_u1. +21. Let fN_1 be num__u3. +22. Let fN_2 be num__u5. +23. Return $fcopysign_($sizenn(Fnn), fN_1, fN_2). + +testop_ Inn EQZ iN +1. Return $ieqz_($sizenn(Inn), iN). + +relop_ numtype_u1 relop__u0 num__u3 num__u5 +1. If ((relop__u0 is EQ) and the type of numtype_u1 is Inn), then: + a. Let Inn be numtype_u1. + b. Let iN_1 be num__u3. + c. Let iN_2 be num__u5. + d. Return $ieq_($sizenn(Inn), iN_1, iN_2). +2. If ((relop__u0 is NE) and the type of numtype_u1 is Inn), then: + a. Let Inn be numtype_u1. + b. Let iN_1 be num__u3. + c. Let iN_2 be num__u5. + d. Return $ine_($sizenn(Inn), iN_1, iN_2). +3. If the type of numtype_u1 is Inn, then: + a. Let Inn be numtype_u1. + b. Let iN_1 be num__u3. + c. Let iN_2 be num__u5. + d. If relop__u0 is of the case LT, then: + 1) Let (LT sx) be relop__u0. + 2) Return $ilt_($sizenn(Inn), sx, iN_1, iN_2). + e. If relop__u0 is of the case GT, then: + 1) Let (GT sx) be relop__u0. + 2) Return $igt_($sizenn(Inn), sx, iN_1, iN_2). + f. If relop__u0 is of the case LE, then: + 1) Let (LE sx) be relop__u0. + 2) Return $ile_($sizenn(Inn), sx, iN_1, iN_2). + g. If relop__u0 is of the case GE, then: + 1) Let (GE sx) be relop__u0. + 2) Return $ige_($sizenn(Inn), sx, iN_1, iN_2). +4. If ((relop__u0 is EQ) and the type of numtype_u1 is Fnn), then: + a. Let Fnn be numtype_u1. + b. Let fN_1 be num__u3. + c. Let fN_2 be num__u5. + d. Return $feq_($sizenn(Fnn), fN_1, fN_2). +5. If ((relop__u0 is NE) and the type of numtype_u1 is Fnn), then: + a. Let Fnn be numtype_u1. + b. Let fN_1 be num__u3. + c. Let fN_2 be num__u5. + d. Return $fne_($sizenn(Fnn), fN_1, fN_2). +6. If ((relop__u0 is LT) and the type of numtype_u1 is Fnn), then: + a. Let Fnn be numtype_u1. + b. Let fN_1 be num__u3. + c. Let fN_2 be num__u5. + d. Return $flt_($sizenn(Fnn), fN_1, fN_2). +7. If ((relop__u0 is GT) and the type of numtype_u1 is Fnn), then: + a. Let Fnn be numtype_u1. + b. Let fN_1 be num__u3. + c. Let fN_2 be num__u5. + d. Return $fgt_($sizenn(Fnn), fN_1, fN_2). +8. If ((relop__u0 is LE) and the type of numtype_u1 is Fnn), then: + a. Let Fnn be numtype_u1. + b. Let fN_1 be num__u3. + c. Let fN_2 be num__u5. + d. Return $fle_($sizenn(Fnn), fN_1, fN_2). +9. Assert: Due to validation, (relop__u0 is GE). +10. Assert: Due to validation, the type of numtype_u1 is Fnn. +11. Let Fnn be numtype_u1. +12. Let fN_1 be num__u3. +13. Let fN_2 be num__u5. +14. Return $fge_($sizenn(Fnn), fN_1, fN_2). + +cvtop__ numtype_u1 numtype_u4 cvtop_u0 num__u3 +1. If the type of numtype_u1 is Inn, then: + a. Let Inn_1 be numtype_u1. + b. If the type of numtype_u4 is Inn, then: + 1) Let Inn_2 be numtype_u4. + 2) Let iN_1 be num__u3. + 3) If cvtop_u0 is of the case EXTEND, then: + a) Let (EXTEND sx) be cvtop_u0. + b) Return [$extend__($sizenn1(Inn_1), $sizenn2(Inn_2), sx, iN_1)]. +2. If ((cvtop_u0 is WRAP) and the type of numtype_u1 is Inn), then: + a. Let Inn_1 be numtype_u1. + b. If the type of numtype_u4 is Inn, then: + 1) Let Inn_2 be numtype_u4. + 2) Let iN_1 be num__u3. + 3) Return [$wrap__($sizenn1(Inn_1), $sizenn2(Inn_2), iN_1)]. +3. If the type of numtype_u1 is Fnn, then: + a. Let Fnn_1 be numtype_u1. + b. If the type of numtype_u4 is Inn, then: + 1) Let Inn_2 be numtype_u4. + 2) Let fN_1 be num__u3. + 3) If cvtop_u0 is of the case TRUNC, then: + a) Let (TRUNC sx) be cvtop_u0. + b) Return $list_(num_((Inn_2 : Inn <: numtype)), $trunc__($sizenn1(Fnn_1), $sizenn2(Inn_2), sx, fN_1)). + 4) If cvtop_u0 is of the case TRUNC_SAT, then: + a) Let (TRUNC_SAT sx) be cvtop_u0. + b) Return $list_(num_((Inn_2 : Inn <: numtype)), $trunc_sat__($sizenn1(Fnn_1), $sizenn2(Inn_2), sx, fN_1)). +4. If the type of numtype_u4 is Fnn, then: + a. Let Fnn_2 be numtype_u4. + b. If the type of numtype_u1 is Inn, then: + 1) Let Inn_1 be numtype_u1. + 2) Let iN_1 be num__u3. + 3) If cvtop_u0 is of the case CONVERT, then: + a) Let (CONVERT sx) be cvtop_u0. + b) Return [$convert__($sizenn1(Inn_1), $sizenn2(Fnn_2), sx, iN_1)]. +5. If ((cvtop_u0 is PROMOTE) and the type of numtype_u1 is Fnn), then: + a. Let Fnn_1 be numtype_u1. + b. If the type of numtype_u4 is Fnn, then: + 1) Let Fnn_2 be numtype_u4. + 2) Let fN_1 be num__u3. + 3) Return $promote__($sizenn1(Fnn_1), $sizenn2(Fnn_2), fN_1). +6. If ((cvtop_u0 is DEMOTE) and the type of numtype_u1 is Fnn), then: + a. Let Fnn_1 be numtype_u1. + b. If the type of numtype_u4 is Fnn, then: + 1) Let Fnn_2 be numtype_u4. + 2) Let fN_1 be num__u3. + 3) Return $demote__($sizenn1(Fnn_1), $sizenn2(Fnn_2), fN_1). +7. Assert: Due to validation, (cvtop_u0 is REINTERPRET). +8. If the type of numtype_u4 is Fnn, then: + a. Let Fnn_2 be numtype_u4. + b. If the type of numtype_u1 is Inn, then: + 1) Let Inn_1 be numtype_u1. + 2) Let iN_1 be num__u3. + 3) If ($size(Inn_1) is $size(Fnn_2)), then: + a) Return [$reinterpret__(Inn_1, Fnn_2, iN_1)]. +9. Assert: Due to validation, the type of numtype_u1 is Fnn. +10. Let Fnn_1 be numtype_u1. +11. Assert: Due to validation, the type of numtype_u4 is Inn. +12. Let Inn_2 be numtype_u4. +13. Let fN_1 be num__u3. +14. Assert: Due to validation, ($size(Fnn_1) is $size(Inn_2)). +15. Return [$reinterpret__(Fnn_1, Inn_2, fN_1)]. + +invibytes_ N b* +1. Let n be $ibytes__1^-1(N, b*). +2. Return n. + +invfbytes_ N b* +1. Let p be $fbytes__1^-1(N, b*). +2. Return p. + +packnum_ lanetype_u0 c +1. If the type of lanetype_u0 is numtype, then: + a. Return c. +2. Assert: Due to validation, the type of lanetype_u0 is packtype. +3. Let packtype be lanetype_u0. +4. Return $wrap__($size($unpack(packtype)), $psize(packtype), c). + +unpacknum_ lanetype_u0 c +1. If the type of lanetype_u0 is numtype, then: + a. Return c. +2. Assert: Due to validation, the type of lanetype_u0 is packtype. +3. Let packtype be lanetype_u0. +4. Return $extend__($psize(packtype), $size($unpack(packtype)), U, c). + +invlanes_ sh c* +1. Let vc be $lanes__1^-1(sh, c*). +2. Return vc. + +half half_u0 i j +1. If (half_u0 is LOW), then: + a. Return i. +2. Assert: Due to validation, (half_u0 is HIGH). +3. Return j. + +vvunop_ V128 NOT v128 +1. Return $inot_($size(V128), v128). + +vvbinop_ V128 vvbinop_u0 v128_1 v128_2 +1. If (vvbinop_u0 is AND), then: + a. Return $iand_($size(V128), v128_1, v128_2). +2. If (vvbinop_u0 is ANDNOT), then: + a. Return $iandnot_($size(V128), v128_1, v128_2). +3. If (vvbinop_u0 is OR), then: + a. Return $ior_($size(V128), v128_1, v128_2). +4. Assert: Due to validation, (vvbinop_u0 is XOR). +5. Return $ixor_($size(V128), v128_1, v128_2). + +vvternop_ V128 BITSELECT v128_1 v128_2 v128_3 +1. Return $ibitselect_($size(V128), v128_1, v128_2, v128_3). + +vunop_ (lanetype_u1 X M) vunop__u0 v128_1 +1. If ((vunop__u0 is ABS) and the type of lanetype_u1 is Jnn), then: + a. Let Jnn be lanetype_u1. + b. Let lane_1* be $lanes_((Jnn X M), v128_1). + c. Let v128 be $invlanes_((Jnn X M), $iabs_($lsizenn(Jnn), lane_1)*). + d. Return [v128]. +2. If ((vunop__u0 is NEG) and the type of lanetype_u1 is Jnn), then: + a. Let Jnn be lanetype_u1. + b. Let lane_1* be $lanes_((Jnn X M), v128_1). + c. Let v128 be $invlanes_((Jnn X M), $ineg_($lsizenn(Jnn), lane_1)*). + d. Return [v128]. +3. If ((vunop__u0 is POPCNT) and the type of lanetype_u1 is Jnn), then: + a. Let Jnn be lanetype_u1. + b. Let lane_1* be $lanes_((Jnn X M), v128_1). + c. Let v128 be $invlanes_((Jnn X M), $ipopcnt_($lsizenn(Jnn), lane_1)*). + d. Return [v128]. +4. If ((vunop__u0 is ABS) and the type of lanetype_u1 is Fnn), then: + a. Let Fnn be lanetype_u1. + b. Let lane_1* be $lanes_((Fnn X M), v128_1). + c. Let lane** be $setproduct_(lane_((Fnn : Fnn <: lanetype)), $fabs_($sizenn(Fnn), lane_1)*). + d. Let v128* be $invlanes_((Fnn X M), lane*)*. + e. Return v128*. +5. If ((vunop__u0 is NEG) and the type of lanetype_u1 is Fnn), then: + a. Let Fnn be lanetype_u1. + b. Let lane_1* be $lanes_((Fnn X M), v128_1). + c. Let lane** be $setproduct_(lane_((Fnn : Fnn <: lanetype)), $fneg_($sizenn(Fnn), lane_1)*). + d. Let v128* be $invlanes_((Fnn X M), lane*)*. + e. Return v128*. +6. If ((vunop__u0 is SQRT) and the type of lanetype_u1 is Fnn), then: + a. Let Fnn be lanetype_u1. + b. Let lane_1* be $lanes_((Fnn X M), v128_1). + c. Let lane** be $setproduct_(lane_((Fnn : Fnn <: lanetype)), $fsqrt_($sizenn(Fnn), lane_1)*). + d. Let v128* be $invlanes_((Fnn X M), lane*)*. + e. Return v128*. +7. If ((vunop__u0 is CEIL) and the type of lanetype_u1 is Fnn), then: + a. Let Fnn be lanetype_u1. + b. Let lane_1* be $lanes_((Fnn X M), v128_1). + c. Let lane** be $setproduct_(lane_((Fnn : Fnn <: lanetype)), $fceil_($sizenn(Fnn), lane_1)*). + d. Let v128* be $invlanes_((Fnn X M), lane*)*. + e. Return v128*. +8. If ((vunop__u0 is FLOOR) and the type of lanetype_u1 is Fnn), then: + a. Let Fnn be lanetype_u1. + b. Let lane_1* be $lanes_((Fnn X M), v128_1). + c. Let lane** be $setproduct_(lane_((Fnn : Fnn <: lanetype)), $ffloor_($sizenn(Fnn), lane_1)*). + d. Let v128* be $invlanes_((Fnn X M), lane*)*. + e. Return v128*. +9. If ((vunop__u0 is TRUNC) and the type of lanetype_u1 is Fnn), then: + a. Let Fnn be lanetype_u1. + b. Let lane_1* be $lanes_((Fnn X M), v128_1). + c. Let lane** be $setproduct_(lane_((Fnn : Fnn <: lanetype)), $ftrunc_($sizenn(Fnn), lane_1)*). + d. Let v128* be $invlanes_((Fnn X M), lane*)*. + e. Return v128*. +10. Assert: Due to validation, (vunop__u0 is NEAREST). +11. Assert: Due to validation, the type of lanetype_u1 is Fnn. +12. Let Fnn be lanetype_u1. +13. Let lane_1* be $lanes_((Fnn X M), v128_1). +14. Let lane** be $setproduct_(lane_((Fnn : Fnn <: lanetype)), $fnearest_($sizenn(Fnn), lane_1)*). +15. Let v128* be $invlanes_((Fnn X M), lane*)*. +16. Return v128*. + +vbinop_ (lanetype_u1 X M) vbinop__u0 v128_1 v128_2 +1. If ((vbinop__u0 is ADD) and the type of lanetype_u1 is Jnn), then: + a. Let Jnn be lanetype_u1. + b. Let lane_1* be $lanes_((Jnn X M), v128_1). + c. Let lane_2* be $lanes_((Jnn X M), v128_2). + d. Let v128 be $invlanes_((Jnn X M), $iadd_($lsizenn(Jnn), lane_1, lane_2)*). + e. Return [v128]. +2. If ((vbinop__u0 is SUB) and the type of lanetype_u1 is Jnn), then: + a. Let Jnn be lanetype_u1. + b. Let lane_1* be $lanes_((Jnn X M), v128_1). c. Let lane_2* be $lanes_((Jnn X M), v128_2). d. Let v128 be $invlanes_((Jnn X M), $isub_($lsizenn(Jnn), lane_1, lane_2)*). e. Return [v128]. @@ -2751,1385 +10868,10758 @@ vbinop_ (lanetype_u1 X M) vbinop__u0 v128_1 v128_2 20. Let v128* be $invlanes_((Fnn X M), lane*)*. 21. Return v128*. -vrelop_ (lanetype_u1 X M) vrelop__u0 v128_1 v128_2 -1. If ((vrelop__u0 is EQ) and the type of lanetype_u1 is Jnn), then: - a. Let Jnn be lanetype_u1. - b. Let lane_1* be $lanes_((Jnn X M), v128_1). - c. Let lane_2* be $lanes_((Jnn X M), v128_2). - d. Let lane_3* be $extend__(1, $lsizenn(Jnn), S, $ieq_($lsizenn(Jnn), lane_1, lane_2))*. - e. Let v128 be $invlanes_((Jnn X M), lane_3*). - f. Return v128. -2. If ((vrelop__u0 is NE) and the type of lanetype_u1 is Jnn), then: - a. Let Jnn be lanetype_u1. - b. Let lane_1* be $lanes_((Jnn X M), v128_1). - c. Let lane_2* be $lanes_((Jnn X M), v128_2). - d. Let lane_3* be $extend__(1, $lsizenn(Jnn), S, $ine_($lsizenn(Jnn), lane_1, lane_2))*. - e. Let v128 be $invlanes_((Jnn X M), lane_3*). - f. Return v128. -3. If the type of lanetype_u1 is Jnn, then: - a. Let Jnn be lanetype_u1. - b. If vrelop__u0 is of the case LT, then: - 1) Let (LT sx) be vrelop__u0. - 2) Let lane_1* be $lanes_((Jnn X M), v128_1). - 3) Let lane_2* be $lanes_((Jnn X M), v128_2). - 4) Let lane_3* be $extend__(1, $lsizenn(Jnn), S, $ilt_($lsizenn(Jnn), sx, lane_1, lane_2))*. - 5) Let v128 be $invlanes_((Jnn X M), lane_3*). - 6) Return v128. - c. If vrelop__u0 is of the case GT, then: - 1) Let (GT sx) be vrelop__u0. - 2) Let lane_1* be $lanes_((Jnn X M), v128_1). - 3) Let lane_2* be $lanes_((Jnn X M), v128_2). - 4) Let lane_3* be $extend__(1, $lsizenn(Jnn), S, $igt_($lsizenn(Jnn), sx, lane_1, lane_2))*. - 5) Let v128 be $invlanes_((Jnn X M), lane_3*). - 6) Return v128. - d. If vrelop__u0 is of the case LE, then: - 1) Let (LE sx) be vrelop__u0. - 2) Let lane_1* be $lanes_((Jnn X M), v128_1). - 3) Let lane_2* be $lanes_((Jnn X M), v128_2). - 4) Let lane_3* be $extend__(1, $lsizenn(Jnn), S, $ile_($lsizenn(Jnn), sx, lane_1, lane_2))*. - 5) Let v128 be $invlanes_((Jnn X M), lane_3*). - 6) Return v128. - e. If vrelop__u0 is of the case GE, then: - 1) Let (GE sx) be vrelop__u0. - 2) Let lane_1* be $lanes_((Jnn X M), v128_1). - 3) Let lane_2* be $lanes_((Jnn X M), v128_2). - 4) Let lane_3* be $extend__(1, $lsizenn(Jnn), S, $ige_($lsizenn(Jnn), sx, lane_1, lane_2))*. - 5) Let v128 be $invlanes_((Jnn X M), lane_3*). - 6) Return v128. -4. If ((vrelop__u0 is EQ) and the type of lanetype_u1 is Fnn), then: - a. Let Fnn be lanetype_u1. - b. Let lane_1* be $lanes_((Fnn X M), v128_1). - c. Let lane_2* be $lanes_((Fnn X M), v128_2). - d. Let Inn be $isize^-1($size(Fnn)). - e. Let lane_3* be $extend__(1, $sizenn(Fnn), S, $feq_($sizenn(Fnn), lane_1, lane_2))*. - f. Let v128 be $invlanes_((Inn X M), lane_3*). - g. Return v128. -5. If ((vrelop__u0 is NE) and the type of lanetype_u1 is Fnn), then: - a. Let Fnn be lanetype_u1. - b. Let lane_1* be $lanes_((Fnn X M), v128_1). - c. Let lane_2* be $lanes_((Fnn X M), v128_2). - d. Let Inn be $isize^-1($size(Fnn)). - e. Let lane_3* be $extend__(1, $sizenn(Fnn), S, $fne_($sizenn(Fnn), lane_1, lane_2))*. - f. Let v128 be $invlanes_((Inn X M), lane_3*). - g. Return v128. -6. If ((vrelop__u0 is LT) and the type of lanetype_u1 is Fnn), then: - a. Let Fnn be lanetype_u1. - b. Let lane_1* be $lanes_((Fnn X M), v128_1). - c. Let lane_2* be $lanes_((Fnn X M), v128_2). - d. Let Inn be $isize^-1($size(Fnn)). - e. Let lane_3* be $extend__(1, $sizenn(Fnn), S, $flt_($sizenn(Fnn), lane_1, lane_2))*. - f. Let v128 be $invlanes_((Inn X M), lane_3*). - g. Return v128. -7. If ((vrelop__u0 is GT) and the type of lanetype_u1 is Fnn), then: - a. Let Fnn be lanetype_u1. - b. Let lane_1* be $lanes_((Fnn X M), v128_1). - c. Let lane_2* be $lanes_((Fnn X M), v128_2). - d. Let Inn be $isize^-1($size(Fnn)). - e. Let lane_3* be $extend__(1, $sizenn(Fnn), S, $fgt_($sizenn(Fnn), lane_1, lane_2))*. - f. Let v128 be $invlanes_((Inn X M), lane_3*). - g. Return v128. -8. If ((vrelop__u0 is LE) and the type of lanetype_u1 is Fnn), then: - a. Let Fnn be lanetype_u1. - b. Let lane_1* be $lanes_((Fnn X M), v128_1). - c. Let lane_2* be $lanes_((Fnn X M), v128_2). - d. Let Inn be $isize^-1($size(Fnn)). - e. Let lane_3* be $extend__(1, $sizenn(Fnn), S, $fle_($sizenn(Fnn), lane_1, lane_2))*. - f. Let v128 be $invlanes_((Inn X M), lane_3*). - g. Return v128. -9. Assert: Due to validation, (vrelop__u0 is GE). -10. Assert: Due to validation, the type of lanetype_u1 is Fnn. -11. Let Fnn be lanetype_u1. -12. Let lane_1* be $lanes_((Fnn X M), v128_1). -13. Let lane_2* be $lanes_((Fnn X M), v128_2). -14. Let Inn be $isize^-1($size(Fnn)). -15. Let lane_3* be $extend__(1, $sizenn(Fnn), S, $fge_($sizenn(Fnn), lane_1, lane_2))*. -16. Let v128 be $invlanes_((Inn X M), lane_3*). -17. Return v128. +vrelop_ (lanetype_u1 X M) vrelop__u0 v128_1 v128_2 +1. If ((vrelop__u0 is EQ) and the type of lanetype_u1 is Jnn), then: + a. Let Jnn be lanetype_u1. + b. Let lane_1* be $lanes_((Jnn X M), v128_1). + c. Let lane_2* be $lanes_((Jnn X M), v128_2). + d. Let lane_3* be $extend__(1, $lsizenn(Jnn), S, $ieq_($lsizenn(Jnn), lane_1, lane_2))*. + e. Let v128 be $invlanes_((Jnn X M), lane_3*). + f. Return v128. +2. If ((vrelop__u0 is NE) and the type of lanetype_u1 is Jnn), then: + a. Let Jnn be lanetype_u1. + b. Let lane_1* be $lanes_((Jnn X M), v128_1). + c. Let lane_2* be $lanes_((Jnn X M), v128_2). + d. Let lane_3* be $extend__(1, $lsizenn(Jnn), S, $ine_($lsizenn(Jnn), lane_1, lane_2))*. + e. Let v128 be $invlanes_((Jnn X M), lane_3*). + f. Return v128. +3. If the type of lanetype_u1 is Jnn, then: + a. Let Jnn be lanetype_u1. + b. If vrelop__u0 is of the case LT, then: + 1) Let (LT sx) be vrelop__u0. + 2) Let lane_1* be $lanes_((Jnn X M), v128_1). + 3) Let lane_2* be $lanes_((Jnn X M), v128_2). + 4) Let lane_3* be $extend__(1, $lsizenn(Jnn), S, $ilt_($lsizenn(Jnn), sx, lane_1, lane_2))*. + 5) Let v128 be $invlanes_((Jnn X M), lane_3*). + 6) Return v128. + c. If vrelop__u0 is of the case GT, then: + 1) Let (GT sx) be vrelop__u0. + 2) Let lane_1* be $lanes_((Jnn X M), v128_1). + 3) Let lane_2* be $lanes_((Jnn X M), v128_2). + 4) Let lane_3* be $extend__(1, $lsizenn(Jnn), S, $igt_($lsizenn(Jnn), sx, lane_1, lane_2))*. + 5) Let v128 be $invlanes_((Jnn X M), lane_3*). + 6) Return v128. + d. If vrelop__u0 is of the case LE, then: + 1) Let (LE sx) be vrelop__u0. + 2) Let lane_1* be $lanes_((Jnn X M), v128_1). + 3) Let lane_2* be $lanes_((Jnn X M), v128_2). + 4) Let lane_3* be $extend__(1, $lsizenn(Jnn), S, $ile_($lsizenn(Jnn), sx, lane_1, lane_2))*. + 5) Let v128 be $invlanes_((Jnn X M), lane_3*). + 6) Return v128. + e. If vrelop__u0 is of the case GE, then: + 1) Let (GE sx) be vrelop__u0. + 2) Let lane_1* be $lanes_((Jnn X M), v128_1). + 3) Let lane_2* be $lanes_((Jnn X M), v128_2). + 4) Let lane_3* be $extend__(1, $lsizenn(Jnn), S, $ige_($lsizenn(Jnn), sx, lane_1, lane_2))*. + 5) Let v128 be $invlanes_((Jnn X M), lane_3*). + 6) Return v128. +4. If ((vrelop__u0 is EQ) and the type of lanetype_u1 is Fnn), then: + a. Let Fnn be lanetype_u1. + b. Let lane_1* be $lanes_((Fnn X M), v128_1). + c. Let lane_2* be $lanes_((Fnn X M), v128_2). + d. Let Inn be $isize^-1($size(Fnn)). + e. Let lane_3* be $extend__(1, $sizenn(Fnn), S, $feq_($sizenn(Fnn), lane_1, lane_2))*. + f. Let v128 be $invlanes_((Inn X M), lane_3*). + g. Return v128. +5. If ((vrelop__u0 is NE) and the type of lanetype_u1 is Fnn), then: + a. Let Fnn be lanetype_u1. + b. Let lane_1* be $lanes_((Fnn X M), v128_1). + c. Let lane_2* be $lanes_((Fnn X M), v128_2). + d. Let Inn be $isize^-1($size(Fnn)). + e. Let lane_3* be $extend__(1, $sizenn(Fnn), S, $fne_($sizenn(Fnn), lane_1, lane_2))*. + f. Let v128 be $invlanes_((Inn X M), lane_3*). + g. Return v128. +6. If ((vrelop__u0 is LT) and the type of lanetype_u1 is Fnn), then: + a. Let Fnn be lanetype_u1. + b. Let lane_1* be $lanes_((Fnn X M), v128_1). + c. Let lane_2* be $lanes_((Fnn X M), v128_2). + d. Let Inn be $isize^-1($size(Fnn)). + e. Let lane_3* be $extend__(1, $sizenn(Fnn), S, $flt_($sizenn(Fnn), lane_1, lane_2))*. + f. Let v128 be $invlanes_((Inn X M), lane_3*). + g. Return v128. +7. If ((vrelop__u0 is GT) and the type of lanetype_u1 is Fnn), then: + a. Let Fnn be lanetype_u1. + b. Let lane_1* be $lanes_((Fnn X M), v128_1). + c. Let lane_2* be $lanes_((Fnn X M), v128_2). + d. Let Inn be $isize^-1($size(Fnn)). + e. Let lane_3* be $extend__(1, $sizenn(Fnn), S, $fgt_($sizenn(Fnn), lane_1, lane_2))*. + f. Let v128 be $invlanes_((Inn X M), lane_3*). + g. Return v128. +8. If ((vrelop__u0 is LE) and the type of lanetype_u1 is Fnn), then: + a. Let Fnn be lanetype_u1. + b. Let lane_1* be $lanes_((Fnn X M), v128_1). + c. Let lane_2* be $lanes_((Fnn X M), v128_2). + d. Let Inn be $isize^-1($size(Fnn)). + e. Let lane_3* be $extend__(1, $sizenn(Fnn), S, $fle_($sizenn(Fnn), lane_1, lane_2))*. + f. Let v128 be $invlanes_((Inn X M), lane_3*). + g. Return v128. +9. Assert: Due to validation, (vrelop__u0 is GE). +10. Assert: Due to validation, the type of lanetype_u1 is Fnn. +11. Let Fnn be lanetype_u1. +12. Let lane_1* be $lanes_((Fnn X M), v128_1). +13. Let lane_2* be $lanes_((Fnn X M), v128_2). +14. Let Inn be $isize^-1($size(Fnn)). +15. Let lane_3* be $extend__(1, $sizenn(Fnn), S, $fge_($sizenn(Fnn), lane_1, lane_2))*. +16. Let v128 be $invlanes_((Inn X M), lane_3*). +17. Return v128. + +vcvtop__ (lanetype_u2 X M_1) (lanetype_u0 X M_2) vcvtop_u1 lane__u4 +1. If the type of lanetype_u2 is Jnn, then: + a. Let Jnn_1 be lanetype_u2. + b. If the type of lanetype_u0 is Jnn, then: + 1) Let Jnn_2 be lanetype_u0. + 2) Let iN_1 be lane__u4. + 3) If vcvtop_u1 is of the case EXTEND, then: + a) Let (EXTEND sx) be vcvtop_u1. + b) Let iN_2 be $extend__($lsizenn1(Jnn_1), $lsizenn2(Jnn_2), sx, iN_1). + c) Return [iN_2]. +2. If the type of lanetype_u0 is Fnn, then: + a. Let Fnn_2 be lanetype_u0. + b. If the type of lanetype_u2 is Jnn, then: + 1) Let Jnn_1 be lanetype_u2. + 2) Let iN_1 be lane__u4. + 3) If vcvtop_u1 is of the case CONVERT, then: + a) Let (CONVERT sx) be vcvtop_u1. + b) Let fN_2 be $convert__($lsizenn1(Jnn_1), $lsizenn2(Fnn_2), sx, iN_1). + c) Return [fN_2]. +3. If the type of lanetype_u2 is Fnn, then: + a. Let Fnn_1 be lanetype_u2. + b. If the type of lanetype_u0 is Inn, then: + 1) Let Inn_2 be lanetype_u0. + 2) Let fN_1 be lane__u4. + 3) If vcvtop_u1 is of the case TRUNC_SAT, then: + a) Let (TRUNC_SAT sx) be vcvtop_u1. + b) Let iN_2? be $trunc_sat__($lsizenn1(Fnn_1), $lsizenn2(Inn_2), sx, fN_1). + c) Return $list_(lane_((Inn_2 : Inn <: lanetype)), iN_2?). +4. If ((vcvtop_u1 is DEMOTE) and the type of lanetype_u2 is Fnn), then: + a. Let Fnn_1 be lanetype_u2. + b. If the type of lanetype_u0 is Fnn, then: + 1) Let Fnn_2 be lanetype_u0. + 2) Let fN_1 be lane__u4. + 3) Let fN_2* be $demote__($lsizenn1(Fnn_1), $lsizenn2(Fnn_2), fN_1). + 4) Return fN_2*. +5. Assert: Due to validation, (vcvtop_u1 is PROMOTE). +6. Assert: Due to validation, the type of lanetype_u2 is Fnn. +7. Let Fnn_1 be lanetype_u2. +8. Assert: Due to validation, the type of lanetype_u0 is Fnn. +9. Let Fnn_2 be lanetype_u0. +10. Let fN_1 be lane__u4. +11. Let fN_2* be $promote__($lsizenn1(Fnn_1), $lsizenn2(Fnn_2), fN_1). +12. Return fN_2*. + +vextunop__ (Inn_1 X M_1) (Inn_2 X M_2) (EXTADD_PAIRWISE sx) c_1 +1. Let ci* be $lanes_((Inn_2 X M_2), c_1). +2. Let [cj_1, cj_2]* be $concat__1^-1(iN($lsizenn1((Inn_1 : Inn <: lanetype))), $extend__($lsizenn2(Inn_2), $lsizenn1(Inn_1), sx, ci)*). +3. Let c be $invlanes_((Inn_1 X M_1), $iadd_($lsizenn1(Inn_1), cj_1, cj_2)*). +4. Return c. + +vextbinop__ (Inn_1 X M_1) (Inn_2 X M_2) vextbinop__u0 c_1 c_2 +1. If vextbinop__u0 is of the case EXTMUL, then: + a. Let (EXTMUL sx hf) be vextbinop__u0. + b. Let ci_1* be $lanes_((Inn_2 X M_2), c_1)[$half(hf, 0, M_1) : M_1]. + c. Let ci_2* be $lanes_((Inn_2 X M_2), c_2)[$half(hf, 0, M_1) : M_1]. + d. Let c be $invlanes_((Inn_1 X M_1), $imul_($lsizenn1(Inn_1), $extend__($lsizenn2(Inn_2), $lsizenn1(Inn_1), sx, ci_1), $extend__($lsizenn2(Inn_2), $lsizenn1(Inn_1), sx, ci_2))*). + e. Return c. +2. Assert: Due to validation, (vextbinop__u0 is DOT). +3. Let ci_1* be $lanes_((Inn_2 X M_2), c_1). +4. Let ci_2* be $lanes_((Inn_2 X M_2), c_2). +5. Let [cj_1, cj_2]* be $concat__1^-1(iN($lsizenn1((Inn_1 : Inn <: lanetype))), $imul_($lsizenn1(Inn_1), $extend__($lsizenn2(Inn_2), $lsizenn1(Inn_1), S, ci_1), $extend__($lsizenn2(Inn_2), $lsizenn1(Inn_1), S, ci_2))*). +6. Let c be $invlanes_((Inn_1 X M_1), $iadd_($lsizenn1(Inn_1), cj_1, cj_2)*). +7. Return c. + +vshiftop_ (Jnn X M) vshiftop__u0 lane n +1. If (vshiftop__u0 is SHL), then: + a. Return $ishl_($lsizenn(Jnn), lane, n). +2. Assert: Due to validation, vshiftop__u0 is of the case SHR. +3. Let (SHR sx) be vshiftop__u0. +4. Return $ishr_($lsizenn(Jnn), sx, lane, n). + +default_ valtype_u0 +1. If (valtype_u0 is I32), then: + a. Return (I32.CONST 0). +2. If (valtype_u0 is I64), then: + a. Return (I64.CONST 0). +3. If (valtype_u0 is F32), then: + a. Return (F32.CONST $fzero(32)). +4. If (valtype_u0 is F64), then: + a. Return (F64.CONST $fzero(64)). +5. If (valtype_u0 is V128), then: + a. Return (V128.CONST 0). +6. If (valtype_u0 is FUNCREF), then: + a. Return (REF.NULL FUNCREF). +7. Assert: Due to validation, (valtype_u0 is EXTERNREF). +8. Return (REF.NULL EXTERNREF). + +funcsxv externval_u0* +1. If (externval_u0* is []), then: + a. Return []. +2. Let [externval_0] ++ xv* be externval_u0*. +3. If externval_0 is of the case FUNC, then: + a. Let (FUNC fa) be externval_0. + b. Return [fa] ++ $funcsxv(xv*). +4. Let [externval] ++ xv* be externval_u0*. +5. Return $funcsxv(xv*). + +globalsxv externval_u0* +1. If (externval_u0* is []), then: + a. Return []. +2. Let [externval_0] ++ xv* be externval_u0*. +3. If externval_0 is of the case GLOBAL, then: + a. Let (GLOBAL ga) be externval_0. + b. Return [ga] ++ $globalsxv(xv*). +4. Let [externval] ++ xv* be externval_u0*. +5. Return $globalsxv(xv*). + +tablesxv externval_u0* +1. If (externval_u0* is []), then: + a. Return []. +2. Let [externval_0] ++ xv* be externval_u0*. +3. If externval_0 is of the case TABLE, then: + a. Let (TABLE ta) be externval_0. + b. Return [ta] ++ $tablesxv(xv*). +4. Let [externval] ++ xv* be externval_u0*. +5. Return $tablesxv(xv*). + +memsxv externval_u0* +1. If (externval_u0* is []), then: + a. Return []. +2. Let [externval_0] ++ xv* be externval_u0*. +3. If externval_0 is of the case MEM, then: + a. Let (MEM ma) be externval_0. + b. Return [ma] ++ $memsxv(xv*). +4. Let [externval] ++ xv* be externval_u0*. +5. Return $memsxv(xv*). + +store +1. Return. + +frame +1. Let f be the current frame. +2. Return f. + +funcaddr +1. Let f be the current frame. +2. Return f.MODULE.FUNCS. + +funcinst +1. Return s.FUNCS. + +globalinst +1. Return s.GLOBALS. + +tableinst +1. Return s.TABLES. + +meminst +1. Return s.MEMS. + +eleminst +1. Return s.ELEMS. + +datainst +1. Return s.DATAS. + +moduleinst +1. Let f be the current frame. +2. Return f.MODULE. + +type x +1. Let f be the current frame. +2. Return f.MODULE.TYPES[x]. + +func x +1. Let f be the current frame. +2. Return s.FUNCS[f.MODULE.FUNCS[x]]. + +global x +1. Let f be the current frame. +2. Return s.GLOBALS[f.MODULE.GLOBALS[x]]. + +table x +1. Let f be the current frame. +2. Return s.TABLES[f.MODULE.TABLES[x]]. + +mem x +1. Let f be the current frame. +2. Return s.MEMS[f.MODULE.MEMS[x]]. + +elem x +1. Let f be the current frame. +2. Return s.ELEMS[f.MODULE.ELEMS[x]]. + +data x +1. Let f be the current frame. +2. Return s.DATAS[f.MODULE.DATAS[x]]. + +local x +1. Let f be the current frame. +2. Return f.LOCALS[x]. + +with_local x v +1. Let f be the current frame. +2. Replace f.LOCALS[x] with v. + +with_global x v +1. Let f be the current frame. +2. Replace s.GLOBALS[f.MODULE.GLOBALS[x]].VALUE with v. + +with_table x i r +1. Let f be the current frame. +2. Replace s.TABLES[f.MODULE.TABLES[x]].REFS[i] with r. + +with_tableinst x ti +1. Let f be the current frame. +2. Replace s.TABLES[f.MODULE.TABLES[x]] with ti. + +with_mem x i j b* +1. Let f be the current frame. +2. Replace s.MEMS[f.MODULE.MEMS[x]].BYTES[i : j] with b*. + +with_meminst x mi +1. Let f be the current frame. +2. Replace s.MEMS[f.MODULE.MEMS[x]] with mi. + +with_elem x r* +1. Let f be the current frame. +2. Replace s.ELEMS[f.MODULE.ELEMS[x]].REFS with r*. + +with_data x b* +1. Let f be the current frame. +2. Replace s.DATAS[f.MODULE.DATAS[x]].BYTES with b*. + +growtable ti n r +1. Let { TYPE: ((i, j), rt); REFS: r'*; } be ti. +2. Let i' be (|r'*| + n). +3. If (i' ≤ j), then: + a. Let ti' be { TYPE: ((i', j), rt); REFS: r'* ++ r^n; }. + b. Return ti'. + +growmemory mi n +1. Let { TYPE: (PAGE (i, j)); BYTES: b*; } be mi. +2. Let i' be ((|b*| / (64 · $Ki())) + n). +3. If (i' ≤ j), then: + a. Let mi' be { TYPE: (PAGE (i', j)); BYTES: b* ++ 0^(n · (64 · $Ki())); }. + b. Return mi'. + +blocktype blocktype_u1 +1. If (blocktype_u1 is (_RESULT ?())), then: + a. Return ([] -> []). +2. If blocktype_u1 is of the case _RESULT, then: + a. Let (_RESULT valtype_0) be blocktype_u1. + b. If valtype_0 is defined, then: + 1) Let ?(t) be valtype_0. + 2) Return ([] -> [t]). +3. Assert: Due to validation, blocktype_u1 is of the case _IDX. +4. Let (_IDX x) be blocktype_u1. +5. Return $type(x). + +funcs externval_u0* +1. If (externval_u0* is []), then: + a. Return []. +2. Let [externval_0] ++ externval'* be externval_u0*. +3. If externval_0 is of the case FUNC, then: + a. Let (FUNC fa) be externval_0. + b. Return [fa] ++ $funcs(externval'*). +4. Let [externval] ++ externval'* be externval_u0*. +5. Return $funcs(externval'*). + +globals externval_u0* +1. If (externval_u0* is []), then: + a. Return []. +2. Let [externval_0] ++ externval'* be externval_u0*. +3. If externval_0 is of the case GLOBAL, then: + a. Let (GLOBAL ga) be externval_0. + b. Return [ga] ++ $globals(externval'*). +4. Let [externval] ++ externval'* be externval_u0*. +5. Return $globals(externval'*). + +tables externval_u0* +1. If (externval_u0* is []), then: + a. Return []. +2. Let [externval_0] ++ externval'* be externval_u0*. +3. If externval_0 is of the case TABLE, then: + a. Let (TABLE ta) be externval_0. + b. Return [ta] ++ $tables(externval'*). +4. Let [externval] ++ externval'* be externval_u0*. +5. Return $tables(externval'*). + +mems externval_u0* +1. If (externval_u0* is []), then: + a. Return []. +2. Let [externval_0] ++ externval'* be externval_u0*. +3. If externval_0 is of the case MEM, then: + a. Let (MEM ma) be externval_0. + b. Return [ma] ++ $mems(externval'*). +4. Let [externval] ++ externval'* be externval_u0*. +5. Return $mems(externval'*). + +allocfunc moduleinst func +1. Assert: Due to validation, func is of the case FUNC. +2. Let (FUNC x local* expr) be func. +3. Let fi be { TYPE: moduleinst.TYPES[x]; MODULE: moduleinst; CODE: func; }. +4. Let a be |s.FUNCS|. +5. Append fi to the s.FUNCS. +6. Return a. + +allocfuncs moduleinst func_u0* +1. If (func_u0* is []), then: + a. Return []. +2. Let [func] ++ func'* be func_u0*. +3. Let fa be $allocfunc(moduleinst, func). +4. Let fa'* be $allocfuncs(moduleinst, func'*). +5. Return [fa] ++ fa'*. + +allocglobal globaltype val +1. Let gi be { TYPE: globaltype; VALUE: val; }. +2. Let a be |s.GLOBALS|. +3. Append gi to the s.GLOBALS. +4. Return a. + +allocglobals globaltype_u0* val_u1* +1. If (globaltype_u0* is []), then: + a. Assert: Due to validation, (val_u1* is []). + b. Return []. +2. Else: + a. Let [globaltype] ++ globaltype'* be globaltype_u0*. + b. Assert: Due to validation, (|val_u1*| ≥ 1). + c. Let [val] ++ val'* be val_u1*. + d. Let ga be $allocglobal(globaltype, val). + e. Let ga'* be $allocglobals(globaltype'*, val'*). + f. Return [ga] ++ ga'*. + +alloctable ((i, j), rt) +1. Let ti be { TYPE: ((i, j), rt); REFS: (REF.NULL rt)^i; }. +2. Let a be |s.TABLES|. +3. Append ti to the s.TABLES. +4. Return a. + +alloctables tabletype_u0* +1. If (tabletype_u0* is []), then: + a. Return []. +2. Let [tabletype] ++ tabletype'* be tabletype_u0*. +3. Let ta be $alloctable(tabletype). +4. Let ta'* be $alloctables(tabletype'*). +5. Return [ta] ++ ta'*. + +allocmem (PAGE (i, j)) +1. Let mi be { TYPE: (PAGE (i, j)); BYTES: 0^(i · (64 · $Ki())); }. +2. Let a be |s.MEMS|. +3. Append mi to the s.MEMS. +4. Return a. + +allocmems memtype_u0* +1. If (memtype_u0* is []), then: + a. Return []. +2. Let [memtype] ++ memtype'* be memtype_u0*. +3. Let ma be $allocmem(memtype). +4. Let ma'* be $allocmems(memtype'*). +5. Return [ma] ++ ma'*. + +allocelem rt ref* +1. Let ei be { TYPE: rt; REFS: ref*; }. +2. Let a be |s.ELEMS|. +3. Append ei to the s.ELEMS. +4. Return a. + +allocelems reftype_u0* ref_u1* +1. If ((reftype_u0* is []) and (ref_u1* is [])), then: + a. Return []. +2. Assert: Due to validation, (|ref_u1*| ≥ 1). +3. Let [ref*] ++ ref'** be ref_u1*. +4. Assert: Due to validation, (|reftype_u0*| ≥ 1). +5. Let [rt] ++ rt'* be reftype_u0*. +6. Let ea be $allocelem(rt, ref*). +7. Let ea'* be $allocelems(rt'*, ref'**). +8. Return [ea] ++ ea'*. + +allocdata byte* +1. Let di be { BYTES: byte*; }. +2. Let a be |s.DATAS|. +3. Append di to the s.DATAS. +4. Return a. + +allocdatas byte_u0* +1. If (byte_u0* is []), then: + a. Return []. +2. Let [byte*] ++ byte'** be byte_u0*. +3. Let da be $allocdata(byte*). +4. Let da'* be $allocdatas(byte'**). +5. Return [da] ++ da'*. + +instexport fa* ga* ta* ma* (EXPORT name externidx_u0) +1. If externidx_u0 is of the case FUNC, then: + a. Let (FUNC x) be externidx_u0. + b. Return { NAME: name; VALUE: (FUNC fa*[x]); }. +2. If externidx_u0 is of the case GLOBAL, then: + a. Let (GLOBAL x) be externidx_u0. + b. Return { NAME: name; VALUE: (GLOBAL ga*[x]); }. +3. If externidx_u0 is of the case TABLE, then: + a. Let (TABLE x) be externidx_u0. + b. Return { NAME: name; VALUE: (TABLE ta*[x]); }. +4. Assert: Due to validation, externidx_u0 is of the case MEM. +5. Let (MEM x) be externidx_u0. +6. Return { NAME: name; VALUE: (MEM ma*[x]); }. + +allocmodule module externval* val* ref** +1. Let fa_ex* be $funcs(externval*). +2. Let ga_ex* be $globals(externval*). +3. Let ma_ex* be $mems(externval*). +4. Let ta_ex* be $tables(externval*). +5. Assert: Due to validation, module is of the case MODULE. +6. Let (MODULE type_0 import* func^n_func global_1 table_2 mem_3 elem_4 data_5 start? export*) be module. +7. Assert: Due to validation, data_5 is of the case DATA. +8. Let (DATA byte* datamode)^n_data be data_5. +9. Assert: Due to validation, elem_4 is of the case ELEM. +10. Let (ELEM rt expr_2* elemmode)^n_elem be elem_4. +11. Assert: Due to validation, mem_3 is of the case MEMORY. +12. Let (MEMORY memtype)^n_mem be mem_3. +13. Assert: Due to validation, table_2 is of the case TABLE. +14. Let (TABLE tabletype)^n_table be table_2. +15. Assert: Due to validation, global_1 is of the case GLOBAL. +16. Let (GLOBAL globaltype expr_1)^n_global be global_1. +17. Assert: Due to validation, type_0 is of the case TYPE. +18. Let (TYPE ft)* be type_0. +19. Let fa* be (|s.FUNCS| + i_func)^(i_func t_2*) be $funcinst()[fa].TYPE. +4. Pop the activation of _f from the stack. +5. Let k be |t_2*|. +6. Push the activation of f with arity k to the stack. +7. Push the values val^n to the stack. +8. Execute the instruction (CALL_ADDR fa). +9. Pop all values val* from the top of the stack. +10. Pop the activation of f with arity k from the stack. +11. Push the values val* to the stack. +12. Pop the values val^k from the stack. +13. Return val^k. + +Step_pure/unreachable +1. Trap. + +Step_pure/nop +1. Do nothing. + +Step_pure/drop +1. Assert: Due to validation, a value is on the top of the stack. +2. Pop the value val from the stack. +3. Do nothing. + +Step_pure/select t*? +1. Assert: Due to validation, a value of value type I32 is on the top of the stack. +2. Pop the value (I32.CONST c) from the stack. +3. Assert: Due to validation, a value is on the top of the stack. +4. Pop the value val_2 from the stack. +5. Assert: Due to validation, a value is on the top of the stack. +6. Pop the value val_1 from the stack. +7. If (c is not 0), then: + a. Push the value val_1 to the stack. +8. Else: + a. Push the value val_2 to the stack. + +Step_pure/if bt instr_1* instr_2* +1. Assert: Due to validation, a value of value type I32 is on the top of the stack. +2. Pop the value (I32.CONST c) from the stack. +3. If (c is not 0), then: + a. Execute the instruction (BLOCK bt instr_1*). +4. Else: + a. Execute the instruction (BLOCK bt instr_2*). + +Step_pure/label +1. Pop all values val* from the top of the stack. +2. Assert: Due to validation, a label is now on the top of the stack. +3. Pop the current label from the stack. +4. Push the values val* to the stack. + +Step_pure/br n_u0 +1. Pop all values val* from the top of the stack. +2. Let L be the current label. +3. Let n be the arity of L. +4. Let instr'* be the continuation of L. +5. Pop the current label from the stack. +6. Let admininstr_u1* be val*. +7. If ((n_u0 is 0) and (|admininstr_u1*| ≥ n)), then: + a. Let val'* ++ val^n be admininstr_u1*. + b. Push the values val^n to the stack. + c. Execute the instruction instr'*. +8. If (n_u0 ≥ 1), then: + a. Let l be (n_u0 - 1). + b. If the type of admininstr_u1 is val*, then: + 1) Let val* be admininstr_u1*. + 2) Push the values val* to the stack. + 3) Execute the instruction (BR l). + +Step_pure/br_if l +1. Assert: Due to validation, a value of value type I32 is on the top of the stack. +2. Pop the value (I32.CONST c) from the stack. +3. If (c is not 0), then: + a. Execute the instruction (BR l). +4. Else: + a. Do nothing. + +Step_pure/br_table l* l' +1. Assert: Due to validation, a value of value type I32 is on the top of the stack. +2. Pop the value (I32.CONST i) from the stack. +3. If (i < |l*|), then: + a. Execute the instruction (BR l*[i]). +4. Else: + a. Execute the instruction (BR l'). + +Step_pure/frame +1. Let f be the current frame. +2. Let n be the arity of f. +3. Assert: Due to validation, there are at least n values on the top of the stack. +4. Assert: Due to validation, there are at least n values on the top of the stack. +5. Pop the values val^n from the stack. +6. Assert: Due to validation, a frame is now on the top of the stack. +7. Pop the current frame from the stack. +8. Push the values val^n to the stack. + +Step_pure/return +1. Pop all values val* from the top of the stack. +2. If a frame is now on the top of the stack, then: + a. Let f be the current frame. + b. Let n be the arity of f. + c. Pop the current frame from the stack. + d. Let val'* ++ val^n be val*. + e. Push the values val^n to the stack. +3. Else if a label is now on the top of the stack, then: + a. Pop the current label from the stack. + b. Push the values val* to the stack. + c. Execute the instruction RETURN. + +Step_pure/trap +1. YetI: TODO: It is likely that the value stack of two rules are different. + +Step_pure/unop nt unop +1. Assert: Due to validation, a value of value type nt is on the top of the stack. +2. Pop the value (nt.CONST c_1) from the stack. +3. If (|$unop_(nt, unop, c_1)| ≤ 0), then: + a. Trap. +4. Let c be an element of $unop_(nt, unop, c_1). +5. Push the value (nt.CONST c) to the stack. + +Step_pure/binop nt binop +1. Assert: Due to validation, a value of value type nt is on the top of the stack. +2. Pop the value (nt.CONST c_2) from the stack. +3. Assert: Due to validation, a value of value type nt is on the top of the stack. +4. Pop the value (nt.CONST c_1) from the stack. +5. If (|$binop_(nt, binop, c_1, c_2)| ≤ 0), then: + a. Trap. +6. Let c be an element of $binop_(nt, binop, c_1, c_2). +7. Push the value (nt.CONST c) to the stack. + +Step_pure/testop nt testop +1. Assert: Due to validation, a value of value type nt is on the top of the stack. +2. Pop the value (nt.CONST c_1) from the stack. +3. Let c be $testop_(nt, testop, c_1). +4. Push the value (I32.CONST c) to the stack. + +Step_pure/relop nt relop +1. Assert: Due to validation, a value of value type nt is on the top of the stack. +2. Pop the value (nt.CONST c_2) from the stack. +3. Assert: Due to validation, a value of value type nt is on the top of the stack. +4. Pop the value (nt.CONST c_1) from the stack. +5. Let c be $relop_(nt, relop, c_1, c_2). +6. Push the value (I32.CONST c) to the stack. + +Step_pure/cvtop nt_2 nt_1 cvtop +1. Assert: Due to validation, a value of value type nt_1 is on the top of the stack. +2. Pop the value (nt_1.CONST c_1) from the stack. +3. If (|$cvtop__(nt_1, nt_2, cvtop, c_1)| ≤ 0), then: + a. Trap. +4. Let c be an element of $cvtop__(nt_1, nt_2, cvtop, c_1). +5. Push the value (nt_2.CONST c) to the stack. + +Step_pure/ref.is_null +1. Assert: Due to validation, a value is on the top of the stack. +2. Pop the value ref from the stack. +3. If ref is of the case REF.NULL, then: + a. Push the value (I32.CONST 1) to the stack. +4. Else: + a. Push the value (I32.CONST 0) to the stack. + +Step_pure/vvunop V128 vvunop +1. Assert: Due to validation, a value of value type V128 is on the top of the stack. +2. Pop the value (V128.CONST c_1) from the stack. +3. Let c be $vvunop_(V128, vvunop, c_1). +4. Push the value (V128.CONST c) to the stack. + +Step_pure/vvbinop V128 vvbinop +1. Assert: Due to validation, a value of value type V128 is on the top of the stack. +2. Pop the value (V128.CONST c_2) from the stack. +3. Assert: Due to validation, a value of value type V128 is on the top of the stack. +4. Pop the value (V128.CONST c_1) from the stack. +5. Let c be $vvbinop_(V128, vvbinop, c_1, c_2). +6. Push the value (V128.CONST c) to the stack. + +Step_pure/vvternop V128 vvternop +1. Assert: Due to validation, a value of value type V128 is on the top of the stack. +2. Pop the value (V128.CONST c_3) from the stack. +3. Assert: Due to validation, a value of value type V128 is on the top of the stack. +4. Pop the value (V128.CONST c_2) from the stack. +5. Assert: Due to validation, a value of value type V128 is on the top of the stack. +6. Pop the value (V128.CONST c_1) from the stack. +7. Let c be $vvternop_(V128, vvternop, c_1, c_2, c_3). +8. Push the value (V128.CONST c) to the stack. + +Step_pure/vvtestop V128 ANY_TRUE +1. Assert: Due to validation, a value of value type V128 is on the top of the stack. +2. Pop the value (V128.CONST c_1) from the stack. +3. Let c be $ine_($size(V128), c_1, 0). +4. Push the value (I32.CONST c) to the stack. + +Step_pure/vunop sh vunop +1. Assert: Due to validation, a value of value type V128 is on the top of the stack. +2. Pop the value (V128.CONST c_1) from the stack. +3. If (|$vunop_(sh, vunop, c_1)| ≤ 0), then: + a. Trap. +4. Let c be an element of $vunop_(sh, vunop, c_1). +5. Push the value (V128.CONST c) to the stack. + +Step_pure/vbinop sh vbinop +1. Assert: Due to validation, a value of value type V128 is on the top of the stack. +2. Pop the value (V128.CONST c_2) from the stack. +3. Assert: Due to validation, a value of value type V128 is on the top of the stack. +4. Pop the value (V128.CONST c_1) from the stack. +5. If (|$vbinop_(sh, vbinop, c_1, c_2)| ≤ 0), then: + a. Trap. +6. Let c be an element of $vbinop_(sh, vbinop, c_1, c_2). +7. Push the value (V128.CONST c) to the stack. + +Step_pure/vtestop (Jnn X N) ALL_TRUE +1. Assert: Due to validation, a value of value type V128 is on the top of the stack. +2. Pop the value (V128.CONST c) from the stack. +3. Let ci_1* be $lanes_((Jnn X N), c). +4. If (ci_1 is not 0)*, then: + a. Push the value (I32.CONST 1) to the stack. +5. Else: + a. Push the value (I32.CONST 0) to the stack. + +Step_pure/vrelop sh vrelop +1. Assert: Due to validation, a value of value type V128 is on the top of the stack. +2. Pop the value (V128.CONST c_2) from the stack. +3. Assert: Due to validation, a value of value type V128 is on the top of the stack. +4. Pop the value (V128.CONST c_1) from the stack. +5. Let c be $vrelop_(sh, vrelop, c_1, c_2). +6. Push the value (V128.CONST c) to the stack. + +Step_pure/vshiftop (Jnn X N) vshiftop +1. Assert: Due to validation, a value of value type I32 is on the top of the stack. +2. Pop the value (I32.CONST n) from the stack. +3. Assert: Due to validation, a value of value type V128 is on the top of the stack. +4. Pop the value (V128.CONST c_1) from the stack. +5. Let c'* be $lanes_((Jnn X N), c_1). +6. Let c be $invlanes_((Jnn X N), $vshiftop_((Jnn X N), vshiftop, c', n)*). +7. Push the value (V128.CONST c) to the stack. + +Step_pure/vbitmask (Jnn X N) +1. Assert: Due to validation, a value of value type V128 is on the top of the stack. +2. Pop the value (V128.CONST c) from the stack. +3. Let ci_1* be $lanes_((Jnn X N), c). +4. Let ci be $ibits__1^-1(32, $ilt_($lsize(Jnn), S, ci_1, 0)*). +5. Push the value (I32.CONST ci) to the stack. + +Step_pure/vswizzle (Pnn X M) +1. Assert: Due to validation, a value of value type V128 is on the top of the stack. +2. Pop the value (V128.CONST c_2) from the stack. +3. Assert: Due to validation, a value of value type V128 is on the top of the stack. +4. Pop the value (V128.CONST c_1) from the stack. +5. Let c'* be $lanes_((Pnn X M), c_1) ++ 0^(256 - M). +6. Let ci* be $lanes_((Pnn X M), c_2). +7. Assert: Due to validation, (ci*[k] < |c'*|)^(k 0), then: + a) Let c be an element of $invlanes_((Lnn_2 X M), cj*)*. + b) Push the value (V128.CONST c) to the stack. +4. If zero_u5? is not defined, then: + a. Let Lnn_1 be lanetype_u4. + b. Let Lnn_2 be lanetype_u3. + c. Let M_1 be n_u1. + d. Let M_2 be n_u0. + e. If half_u2? is defined, then: + 1) Let ?(half) be half_u2?. + 2) Let ci* be $lanes_((Lnn_1 X M_1), c_1)[$half(half, 0, M_2) : M_2]. + 3) Let cj** be $setproduct_(lane_(Lnn_2), $vcvtop__((Lnn_1 X M_1), (Lnn_2 X M_2), vcvtop, ci)*). + 4) If (|$invlanes_((Lnn_2 X M_2), cj*)*| > 0), then: + a) Let c be an element of $invlanes_((Lnn_2 X M_2), cj*)*. + b) Push the value (V128.CONST c) to the stack. +5. If half_u2? is not defined, then: + a. Let M_1 be n_u1. + b. Let M_2 be n_u0. + c. If the type of lanetype_u4 is numtype, then: + 1) Let nt_1 be lanetype_u4. + 2) If the type of lanetype_u3 is numtype, then: + a) Let nt_2 be lanetype_u3. + b) If zero_u5? is defined, then: + 1. Let ci* be $lanes_((nt_1 X M_1), c_1). + 2. Let cj** be $setproduct_(lane_((nt_2 : numtype <: lanetype)), $vcvtop__((nt_1 X M_1), (nt_2 X M_2), vcvtop, ci)* ++ [$zero(nt_2)]^M_1). + 3. If (|$invlanes_((nt_2 X M_2), cj*)*| > 0), then: + a. Let c be an element of $invlanes_((nt_2 X M_2), cj*)*. + b. Push the value (V128.CONST c) to the stack. + +Step_pure/local.tee x +1. Assert: Due to validation, a value is on the top of the stack. +2. Pop the value val from the stack. +3. Push the value val to the stack. +4. Push the value val to the stack. +5. Execute the instruction (LOCAL.SET x). + +Step_read/block bt instr* +1. Let z be the current state. +2. Let (t_1^k -> t_2^n) be $blocktype(z, bt). +3. Assert: Due to validation, there are at least k values on the top of the stack. +4. Pop the values val^k from the stack. +5. Let L be the label_n{[]}. +6. Enter val^k ++ instr* with label L. + +Step_read/loop bt instr* +1. Let z be the current state. +2. Let (t_1^k -> t_2^n) be $blocktype(z, bt). +3. Assert: Due to validation, there are at least k values on the top of the stack. +4. Pop the values val^k from the stack. +5. Let L be the label_k{[(LOOP bt instr*)]}. +6. Enter val^k ++ instr* with label L. + +Step_read/call x +1. Let z be the current state. +2. Assert: Due to validation, (x < |$funcaddr(z)|). +3. Execute the instruction (CALL_ADDR $funcaddr(z)[x]). + +Step_read/call_indirect x y +1. Let z be the current state. +2. Assert: Due to validation, a value of value type I32 is on the top of the stack. +3. Pop the value (I32.CONST i) from the stack. +4. If (i ≥ |$table(z, x).REFS|), then: + a. Trap. +5. If $table(z, x).REFS[i] is not of the case REF.FUNC_ADDR, then: + a. Trap. +6. Let (REF.FUNC_ADDR a) be $table(z, x).REFS[i]. +7. If (a ≥ |$funcinst(z)|), then: + a. Trap. +8. If ($type(z, y) is not $funcinst(z)[a].TYPE), then: + a. Trap. +9. Execute the instruction (CALL_ADDR a). + +Step_read/call_addr a +1. Let z be the current state. +2. Assert: Due to validation, (a < |$funcinst(z)|). +3. Let { TYPE: (t_1^k -> t_2^n); MODULE: mm; CODE: func; } be $funcinst(z)[a]. +4. Assert: Due to validation, there are at least k values on the top of the stack. +5. Pop the values val^k from the stack. +6. Assert: Due to validation, func is of the case FUNC. +7. Let (FUNC x local_0 instr*) be func. +8. Assert: Due to validation, local_0 is of the case LOCAL. +9. Let (LOCAL t)* be local_0. +10. Let f be { LOCALS: val^k ++ $default_(t)*; MODULE: mm; }. +11. Let F be the activation of f with arity n. +12. Push F to the stack. +13. Let L be the label_n{[]}. +14. Enter instr* with label L. + +Step_read/ref.func x +1. Let z be the current state. +2. Assert: Due to validation, (x < |$funcaddr(z)|). +3. Push the value (REF.FUNC_ADDR $funcaddr(z)[x]) to the stack. + +Step_read/local.get x +1. Let z be the current state. +2. Push the value $local(z, x) to the stack. + +Step_read/global.get x +1. Let z be the current state. +2. Push the value $global(z, x).VALUE to the stack. + +Step_read/table.get x +1. Let z be the current state. +2. Assert: Due to validation, a value of value type I32 is on the top of the stack. +3. Pop the value (I32.CONST i) from the stack. +4. If (i ≥ |$table(z, x).REFS|), then: + a. Trap. +5. Push the value $table(z, x).REFS[i] to the stack. + +Step_read/table.size x +1. Let z be the current state. +2. Let n be |$table(z, x).REFS|. +3. Push the value (I32.CONST n) to the stack. + +Step_read/table.fill x +1. Let z be the current state. +2. Assert: Due to validation, a value of value type I32 is on the top of the stack. +3. Pop the value (I32.CONST n) from the stack. +4. Assert: Due to validation, a value is on the top of the stack. +5. Pop the value val from the stack. +6. Assert: Due to validation, a value of value type I32 is on the top of the stack. +7. Pop the value (I32.CONST i) from the stack. +8. If ((i + n) > |$table(z, x).REFS|), then: + a. Trap. +9. If (n is 0), then: + a. Do nothing. +10. Else: + a. Push the value (I32.CONST i) to the stack. + b. Push the value val to the stack. + c. Execute the instruction (TABLE.SET x). + d. Push the value (I32.CONST (i + 1)) to the stack. + e. Push the value val to the stack. + f. Push the value (I32.CONST (n - 1)) to the stack. + g. Execute the instruction (TABLE.FILL x). + +Step_read/table.copy x y +1. Let z be the current state. +2. Assert: Due to validation, a value of value type I32 is on the top of the stack. +3. Pop the value (I32.CONST n) from the stack. +4. Assert: Due to validation, a value of value type I32 is on the top of the stack. +5. Pop the value (I32.CONST i) from the stack. +6. Assert: Due to validation, a value of value type I32 is on the top of the stack. +7. Pop the value (I32.CONST j) from the stack. +8. If ((i + n) > |$table(z, y).REFS|), then: + a. Trap. +9. If ((j + n) > |$table(z, x).REFS|), then: + a. Trap. +10. If (n is 0), then: + a. Do nothing. +11. Else: + a. If (j ≤ i), then: + 1) Push the value (I32.CONST j) to the stack. + 2) Push the value (I32.CONST i) to the stack. + 3) Execute the instruction (TABLE.GET y). + 4) Execute the instruction (TABLE.SET x). + 5) Push the value (I32.CONST (j + 1)) to the stack. + 6) Push the value (I32.CONST (i + 1)) to the stack. + b. Else: + 1) Push the value (I32.CONST ((j + n) - 1)) to the stack. + 2) Push the value (I32.CONST ((i + n) - 1)) to the stack. + 3) Execute the instruction (TABLE.GET y). + 4) Execute the instruction (TABLE.SET x). + 5) Push the value (I32.CONST j) to the stack. + 6) Push the value (I32.CONST i) to the stack. + c. Push the value (I32.CONST (n - 1)) to the stack. + d. Execute the instruction (TABLE.COPY x y). + +Step_read/table.init x y +1. Let z be the current state. +2. Assert: Due to validation, a value of value type I32 is on the top of the stack. +3. Pop the value (I32.CONST n) from the stack. +4. Assert: Due to validation, a value of value type I32 is on the top of the stack. +5. Pop the value (I32.CONST i) from the stack. +6. Assert: Due to validation, a value of value type I32 is on the top of the stack. +7. Pop the value (I32.CONST j) from the stack. +8. If ((i + n) > |$elem(z, y).REFS|), then: + a. Trap. +9. If ((j + n) > |$table(z, x).REFS|), then: + a. Trap. +10. If (n is 0), then: + a. Do nothing. +11. Else if (i < |$elem(z, y).REFS|), then: + a. Push the value (I32.CONST j) to the stack. + b. Push the value $elem(z, y).REFS[i] to the stack. + c. Execute the instruction (TABLE.SET x). + d. Push the value (I32.CONST (j + 1)) to the stack. + e. Push the value (I32.CONST (i + 1)) to the stack. + f. Push the value (I32.CONST (n - 1)) to the stack. + g. Execute the instruction (TABLE.INIT x y). + +Step_read/load numtype_u0 sz_sx_u1? ao +1. Let z be the current state. +2. Assert: Due to validation, a value of value type I32 is on the top of the stack. +3. Pop the value (I32.CONST i) from the stack. +4. If sz_sx_u1? is not defined, then: + a. Let nt be numtype_u0. + b. If (((i + ao.OFFSET) + ($size(nt) / 8)) > |$mem(z, 0).BYTES|), then: + 1) Trap. + c. Let c be $nbytes__1^-1(nt, $mem(z, 0).BYTES[(i + ao.OFFSET) : ($size(nt) / 8)]). + d. Push the value (nt.CONST c) to the stack. +5. If the type of numtype_u0 is Inn, then: + a. If sz_sx_u1? is defined, then: + 1) Let ?(sz_sx_0) be sz_sx_u1?. + 2) Let (n, sx) be sz_sx_0. + 3) If (((i + ao.OFFSET) + (n / 8)) > |$mem(z, 0).BYTES|), then: + a) Trap. + b. Let Inn be numtype_u0. + c. If sz_sx_u1? is defined, then: + 1) Let ?(sz_sx_0) be sz_sx_u1?. + 2) Let (n, sx) be sz_sx_0. + 3) Let c be $ibytes__1^-1(n, $mem(z, 0).BYTES[(i + ao.OFFSET) : (n / 8)]). + 4) Push the value (Inn.CONST $extend__(n, $size(Inn), sx, c)) to the stack. + +Step_read/vload V128 vloadop_u0? ao +1. Let z be the current state. +2. Assert: Due to validation, a value of value type I32 is on the top of the stack. +3. Pop the value (I32.CONST i) from the stack. +4. If vloadop_u0? is not defined, then: + a. If (((i + ao.OFFSET) + ($size(V128) / 8)) > |$mem(z, 0).BYTES|), then: + 1) Trap. + b. Let c be $vbytes__1^-1(V128, $mem(z, 0).BYTES[(i + ao.OFFSET) : ($size(V128) / 8)]). + c. Push the value (V128.CONST c) to the stack. +5. Else: + a. Let ?(vloadop_0) be vloadop_u0?. + b. If vloadop_0 is of the case SHAPE, then: + 1) Let (SHAPE M N sx) be vloadop_0. + 2) If (((i + ao.OFFSET) + ((M · N) / 8)) > |$mem(z, 0).BYTES|), then: + a) Trap. + 3) If the type of $lsize^-1((M · 2)) is Jnn, then: + a) Let Jnn be $lsize^-1((M · 2)). + b) Let j^N be $ibytes__1^-1(M, $mem(z, 0).BYTES[((i + ao.OFFSET) + ((k · M) / 8)) : (M / 8)])^(k |$mem(z, 0).BYTES|), then: + a) Trap. + 3) Let M be (128 / N). + 4) If the type of $lsize^-1(N) is Jnn, then: + a) Let Jnn be $lsize^-1(N). + b) Let j be $ibytes__1^-1(N, $mem(z, 0).BYTES[(i + ao.OFFSET) : (N / 8)]). + c) Let c be $invlanes_((Jnn X M), j^M). + d) Push the value (V128.CONST c) to the stack. + d. If vloadop_0 is of the case ZERO, then: + 1) Let (ZERO N) be vloadop_0. + 2) If (((i + ao.OFFSET) + (N / 8)) > |$mem(z, 0).BYTES|), then: + a) Trap. + 3) Let j be $ibytes__1^-1(N, $mem(z, 0).BYTES[(i + ao.OFFSET) : (N / 8)]). + 4) Let c be $extend__(N, 128, U, j). + 5) Push the value (V128.CONST c) to the stack. + +Step_read/vload_lane V128 N ao j +1. Let z be the current state. +2. Assert: Due to validation, a value of value type V128 is on the top of the stack. +3. Pop the value (V128.CONST c_1) from the stack. +4. Assert: Due to validation, a value of value type I32 is on the top of the stack. +5. Pop the value (I32.CONST i) from the stack. +6. If (((i + ao.OFFSET) + (N / 8)) > |$mem(z, 0).BYTES|), then: + a. Trap. +7. Let M be (128 / N). +8. If the type of $lsize^-1(N) is Jnn, then: + a. Let Jnn be $lsize^-1(N). + b. Let k be $ibytes__1^-1(N, $mem(z, 0).BYTES[(i + ao.OFFSET) : (N / 8)]). + c. Let c be $invlanes_((Jnn X M), $lanes_((Jnn X M), c_1) with [j] replaced by k). + d. Push the value (V128.CONST c) to the stack. + +Step_read/memory.size +1. Let z be the current state. +2. Let ((n · 64) · $Ki()) be |$mem(z, 0).BYTES|. +3. Push the value (I32.CONST n) to the stack. + +Step_read/memory.fill +1. Let z be the current state. +2. Assert: Due to validation, a value of value type I32 is on the top of the stack. +3. Pop the value (I32.CONST n) from the stack. +4. Assert: Due to validation, a value is on the top of the stack. +5. Pop the value val from the stack. +6. Assert: Due to validation, a value of value type I32 is on the top of the stack. +7. Pop the value (I32.CONST i) from the stack. +8. If ((i + n) > |$mem(z, 0).BYTES|), then: + a. Trap. +9. If (n is 0), then: + a. Do nothing. +10. Else: + a. Push the value (I32.CONST i) to the stack. + b. Push the value val to the stack. + c. Execute the instruction (STORE I32 ?(8) $memarg0()). + d. Push the value (I32.CONST (i + 1)) to the stack. + e. Push the value val to the stack. + f. Push the value (I32.CONST (n - 1)) to the stack. + g. Execute the instruction MEMORY.FILL. + +Step_read/memory.copy +1. Let z be the current state. +2. Assert: Due to validation, a value of value type I32 is on the top of the stack. +3. Pop the value (I32.CONST n) from the stack. +4. Assert: Due to validation, a value of value type I32 is on the top of the stack. +5. Pop the value (I32.CONST i) from the stack. +6. Assert: Due to validation, a value of value type I32 is on the top of the stack. +7. Pop the value (I32.CONST j) from the stack. +8. If ((i + n) > |$mem(z, 0).BYTES|), then: + a. Trap. +9. If ((j + n) > |$mem(z, 0).BYTES|), then: + a. Trap. +10. If (n is 0), then: + a. Do nothing. +11. Else: + a. If (j ≤ i), then: + 1) Push the value (I32.CONST j) to the stack. + 2) Push the value (I32.CONST i) to the stack. + 3) Execute the instruction (LOAD I32 ?((8, U)) $memarg0()). + 4) Execute the instruction (STORE I32 ?(8) $memarg0()). + 5) Push the value (I32.CONST (j + 1)) to the stack. + 6) Push the value (I32.CONST (i + 1)) to the stack. + b. Else: + 1) Push the value (I32.CONST ((j + n) - 1)) to the stack. + 2) Push the value (I32.CONST ((i + n) - 1)) to the stack. + 3) Execute the instruction (LOAD I32 ?((8, U)) $memarg0()). + 4) Execute the instruction (STORE I32 ?(8) $memarg0()). + 5) Push the value (I32.CONST j) to the stack. + 6) Push the value (I32.CONST i) to the stack. + c. Push the value (I32.CONST (n - 1)) to the stack. + d. Execute the instruction MEMORY.COPY. + +Step_read/memory.init x +1. Let z be the current state. +2. Assert: Due to validation, a value of value type I32 is on the top of the stack. +3. Pop the value (I32.CONST n) from the stack. +4. Assert: Due to validation, a value of value type I32 is on the top of the stack. +5. Pop the value (I32.CONST i) from the stack. +6. Assert: Due to validation, a value of value type I32 is on the top of the stack. +7. Pop the value (I32.CONST j) from the stack. +8. If ((i + n) > |$data(z, x).BYTES|), then: + a. Trap. +9. If ((j + n) > |$mem(z, 0).BYTES|), then: + a. Trap. +10. If (n is 0), then: + a. Do nothing. +11. Else if (i < |$data(z, x).BYTES|), then: + a. Push the value (I32.CONST j) to the stack. + b. Push the value (I32.CONST $data(z, x).BYTES[i]) to the stack. + c. Execute the instruction (STORE I32 ?(8) $memarg0()). + d. Push the value (I32.CONST (j + 1)) to the stack. + e. Push the value (I32.CONST (i + 1)) to the stack. + f. Push the value (I32.CONST (n - 1)) to the stack. + g. Execute the instruction (MEMORY.INIT x). + +Step/ctxt +1. YetI: TODO: It is likely that the value stack of two rules are different. + +Step/local.set x +1. Let z be the current state. +2. Assert: Due to validation, a value is on the top of the stack. +3. Pop the value val from the stack. +4. Perform $with_local(z, x, val). + +Step/global.set x +1. Let z be the current state. +2. Assert: Due to validation, a value is on the top of the stack. +3. Pop the value val from the stack. +4. Perform $with_global(z, x, val). + +Step/table.set x +1. Let z be the current state. +2. Assert: Due to validation, a value is on the top of the stack. +3. Pop the value ref from the stack. +4. Assert: Due to validation, a value of value type I32 is on the top of the stack. +5. Pop the value (I32.CONST i) from the stack. +6. If (i ≥ |$table(z, x).REFS|), then: + a. Trap. +7. Perform $with_table(z, x, i, ref). + +Step/table.grow x +1. Let z be the current state. +2. Assert: Due to validation, a value of value type I32 is on the top of the stack. +3. Pop the value (I32.CONST n) from the stack. +4. Assert: Due to validation, a value is on the top of the stack. +5. Pop the value ref from the stack. +6. Either: + a. Let ti be $growtable($table(z, x), n, ref). + b. Push the value (I32.CONST |$table(z, x).REFS|) to the stack. + c. Perform $with_tableinst(z, x, ti). +7. Or: + a. Push the value (I32.CONST $invsigned_(32, (- 1))) to the stack. + +Step/elem.drop x +1. Let z be the current state. +2. Perform $with_elem(z, x, []). + +Step/store numtype_u1 sz_u2? ao +1. Let z be the current state. +2. Assert: Due to validation, a value of value type numtype_u0 is on the top of the stack. +3. Pop the value (numtype_u0.CONST c) from the stack. +4. Assert: Due to validation, a value of value type I32 is on the top of the stack. +5. Pop the value (I32.CONST i) from the stack. +6. If sz_u2? is not defined, then: + a. Let nt be numtype_u1. + b. If (numtype_u0 is nt), then: + 1) If (((i + ao.OFFSET) + ($size(nt) / 8)) > |$mem(z, 0).BYTES|), then: + a) Trap. + 2) Let b* be $nbytes_(nt, c). + 3) Perform $with_mem(z, 0, (i + ao.OFFSET), ($size(nt) / 8), b*). +7. Else: + a. Let ?(n) be sz_u2?. + b. If the type of numtype_u1 is Inn, then: + 1) Let Inn be numtype_u1. + 2) If (numtype_u0 is Inn), then: + a) If (((i + ao.OFFSET) + (n / 8)) > |$mem(z, 0).BYTES|), then: + 1. Trap. + b) Let b* be $ibytes_(n, $wrap__($size(Inn), n, c)). + c) Perform $with_mem(z, 0, (i + ao.OFFSET), (n / 8), b*). + +Step/vstore V128 ao +1. Let z be the current state. +2. Assert: Due to validation, a value of value type V128 is on the top of the stack. +3. Pop the value (V128.CONST c) from the stack. +4. Assert: Due to validation, a value of value type I32 is on the top of the stack. +5. Pop the value (I32.CONST i) from the stack. +6. If (((i + ao.OFFSET) + ($size(V128) / 8)) > |$mem(z, 0).BYTES|), then: + a. Trap. +7. Let b* be $vbytes_(V128, c). +8. Perform $with_mem(z, 0, (i + ao.OFFSET), ($size(V128) / 8), b*). + +Step/vstore_lane V128 N ao j +1. Let z be the current state. +2. Assert: Due to validation, a value of value type V128 is on the top of the stack. +3. Pop the value (V128.CONST c) from the stack. +4. Assert: Due to validation, a value of value type I32 is on the top of the stack. +5. Pop the value (I32.CONST i) from the stack. +6. If (((i + ao.OFFSET) + N) > |$mem(z, 0).BYTES|), then: + a. Trap. +7. Let M be (128 / N). +8. If the type of $lsize^-1(N) is Jnn, then: + a. Let Jnn be $lsize^-1(N). + b. If (j < |$lanes_((Jnn X M), c)|), then: + 1) Let b* be $ibytes_(N, $lanes_((Jnn X M), c)[j]). + 2) Perform $with_mem(z, 0, (i + ao.OFFSET), (N / 8), b*). + +Step/memory.grow +1. Let z be the current state. +2. Assert: Due to validation, a value of value type I32 is on the top of the stack. +3. Pop the value (I32.CONST n) from the stack. +4. Either: + a. Let mi be $growmemory($mem(z, 0), n). + b. Push the value (I32.CONST (|$mem(z, 0).BYTES| / (64 · $Ki()))) to the stack. + c. Perform $with_meminst(z, 0, mi). +5. Or: + a. Push the value (I32.CONST $invsigned_(32, (- 1))) to the stack. + +Step/data.drop x +1. Let z be the current state. +2. Perform $with_data(z, x, []). + +eval_expr instr* +1. Execute the instruction instr*. +2. Pop the value val from the stack. +3. Return [val]. + +== Complete. +Generating prose for Wasm 3.0... +watsup 0.4 generator +== Parsing... +== Elaboration... +== IL Validation... +== Running pass sideconditions... +== IL Validation after pass sideconditions... +== Translating to AL... +== Prose Generation... +6-typing.watsup:194.10-194.32: if_expr_to_instrs: Yet `$before(typeuse, x, i)` +6-typing.watsup:817.9-817.55: if_expr_to_instrs: Yet `(($unpack(zt) = (numtype : numtype <: valtype)) \/ ($unpack(zt) = (vectype : vectype <: valtype)))` +6-typing.watsup:851.9-851.55: if_expr_to_instrs: Yet `(($unpack(zt) = (numtype : numtype <: valtype)) \/ ($unpack(zt) = (vectype : vectype <: valtype)))` +6-typing.watsup:1309.9-1309.30: if_expr_to_instrs: Yet `$disjoint_(syntax name, nm*{nm : name})` + +* :math:`{\mathit{numtype}}` is valid. + + +* :math:`{\mathit{vectype}}` is valid. + + +* :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid if and only if: + + + * Either: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{absheaptype}}`. + + * Or: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{typeidx}}`. + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`{\mathit{typeidx}}`. + + * :math:`C{.}\mathsf{types}{}[{\mathit{typeidx}}]` must be equal to :math:`{\mathit{dt}}`. * Or: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{rec}~i)`. + + * :math:`{|C{.}\mathsf{recs}|}` must be greater than :math:`i`. + + * :math:`C{.}\mathsf{recs}{}[i]` must be equal to :math:`{\mathit{st}}`. + + +* :math:`(\mathsf{ref}~(\mathsf{null}~{()^?})~{\mathit{heaptype}})` is valid if and only if: + + + * :math:`{\mathit{heaptype}}` is valid. + + +* :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid if and only if: + + + * Either: + + * :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{numtype}}`. + + * :math:`{\mathit{numtype}}` is valid. + + * Or: + + * :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{vectype}}`. + + * :math:`{\mathit{vectype}}` is valid. * Or: + + * :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{reftype}}`. + + * :math:`{\mathit{reftype}}` is valid. * Or: + + * :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{bot}`. + + +* :math:`{t^\ast}` is valid if and only if: + + + * For all :math:`t` in :math:`{t^\ast}`, + + * :math:`t` is valid. + + +* :math:`{t_1^\ast} \rightarrow_{{x^\ast}} {t_2^\ast}` is valid if and only if: + + + * :math:`{|{x^\ast}|}` must be equal to :math:`{|{{{\mathit{lt}}}^\ast}|}`. + + * For all :math:`x` in :math:`{x^\ast}`, + + * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. + + * :math:`{t_1^\ast}` is valid. + + * :math:`{t_2^\ast}` is valid. + + * For all :math:`{{\mathit{lt}}}` in :math:`{{{\mathit{lt}}}^\ast}` and :math:`x` in :math:`{x^\ast}`, + + * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`{{\mathit{lt}}}`. + + +* :math:`{\mathit{packtype}}` is valid. + + +* :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid if and only if: + + + * Either: + + * :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{valtype}}`. + + * :math:`{\mathit{valtype}}` is valid. + + * Or: + + * :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{packtype}}`. + + * :math:`{\mathit{packtype}}` is valid. + + +* :math:`((\mathsf{mut}~{()^?}), {\mathit{storagetype}})` is valid if and only if: + + + * :math:`{\mathit{storagetype}}` is valid. + + +* :math:`{t_1^\ast} \rightarrow {t_2^\ast}` is valid if and only if: + + + * :math:`{t_1^\ast}` is valid. + + * :math:`{t_2^\ast}` is valid. + + +* :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid if and only if: + + + * Either: + + * :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{struct}~{{\mathit{fieldtype}}^\ast})`. + + * For all :math:`{\mathit{fieldtype}}` in :math:`{{\mathit{fieldtype}}^\ast}`, + + * :math:`{\mathit{fieldtype}}` is valid. + + * Or: + + * :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{array}~{\mathit{fieldtype}})`. + + * :math:`{\mathit{fieldtype}}` is valid. * Or: + + * :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{func}~{\mathit{functype}})`. + + * :math:`{\mathit{functype}}` is valid. + + +* :math:`{\mathit{packtype}}` matches :math:`{\mathit{packtype}}`. + + +* :math:`{\mathit{numtype}}` matches :math:`{\mathit{numtype}}`. + + +* :math:`{\mathit{deftype}}_1` matches :math:`{\mathit{deftype}}_2` if and only if: + + + * Either: + + * :math:`{{\mathrm{clos}}}_{C}({\mathit{deftype}}_1)` must be equal to :math:`{{\mathrm{clos}}}_{C}({\mathit{deftype}}_2)`. + + * Or: + + * :math:`{|{{\mathit{typeuse}}^\ast}|}` must be greater than :math:`i`. + + * :math:`{\mathrm{unroll}}({\mathit{deftype}}_1)` must be equal to :math:`(\mathsf{sub}~{\mathsf{final}^?}~{{\mathit{typeuse}}^\ast}~{\mathit{ct}})`. + + * :math:`{{\mathit{typeuse}}^\ast}{}[i]` matches :math:`{\mathit{deftype}}_2`. + + +* :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` matches :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` if and only if: + + + * Either: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{heaptype}}`. + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`{\mathit{heaptype}}`. + + * Or: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{heaptype}}_1`. + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`{\mathit{heaptype}}_2`. + + * :math:`{\mathit{heaptype}'}` is valid. + + * :math:`{\mathit{heaptype}}_1` matches :math:`{\mathit{heaptype}'}`. + + * :math:`{\mathit{heaptype}'}` matches :math:`{\mathit{heaptype}}_2`. * Or: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{eq}`. + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`\mathsf{any}`. * Or: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{i{\scriptstyle 31}}`. + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`\mathsf{eq}`. * Or: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{struct}`. + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`\mathsf{eq}`. * Or: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{array}`. + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`\mathsf{eq}`. * Or: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{deftype}}`. + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`\mathsf{struct}`. + + * :math:`{\mathrm{expand}}({\mathit{deftype}})` must be equal to :math:`(\mathsf{struct}~{{\mathit{fieldtype}}^\ast})`. * Or: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{deftype}}`. + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`\mathsf{array}`. + + * :math:`{\mathrm{expand}}({\mathit{deftype}})` must be equal to :math:`(\mathsf{array}~{\mathit{fieldtype}})`. * Or: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{deftype}}`. + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`\mathsf{func}`. + + * :math:`{\mathrm{expand}}({\mathit{deftype}})` must be equal to :math:`(\mathsf{func}~{\mathit{functype}})`. * Or: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{deftype}}_1`. + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`{\mathit{deftype}}_2`. + + * :math:`{\mathit{deftype}}_1` matches :math:`{\mathit{deftype}}_2`. * Or: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{typeidx}}`. + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`{\mathit{heaptype}}`. + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`{\mathit{typeidx}}`. + + * :math:`C{.}\mathsf{types}{}[{\mathit{typeidx}}]` matches :math:`{\mathit{heaptype}}`. * Or: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{heaptype}}`. + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`{\mathit{typeidx}}`. + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`{\mathit{typeidx}}`. + + * :math:`{\mathit{heaptype}}` matches :math:`C{.}\mathsf{types}{}[{\mathit{typeidx}}]`. * Or: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{rec}~i)`. + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`{{\mathit{typeuse}}^\ast}{}[j]`. + + * :math:`{|C{.}\mathsf{recs}|}` must be greater than :math:`i`. + + * :math:`{|{{\mathit{typeuse}}^\ast}|}` must be greater than :math:`j`. + + * :math:`C{.}\mathsf{recs}{}[i]` must be equal to :math:`(\mathsf{sub}~{\mathsf{final}^?}~{{\mathit{typeuse}}^\ast}~{\mathit{ct}})`. * Or: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{none}`. + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`{\mathit{heaptype}}`. + + * :math:`{\mathit{heaptype}}` matches :math:`\mathsf{any}`. * Or: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{nofunc}`. + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`{\mathit{heaptype}}`. + + * :math:`{\mathit{heaptype}}` matches :math:`\mathsf{func}`. * Or: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{noextern}`. + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`{\mathit{heaptype}}`. + + * :math:`{\mathit{heaptype}}` matches :math:`\mathsf{extern}`. * Or: + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{bot}`. + + * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`{\mathit{heaptype}}`. + + +* :math:`(\mathsf{ref}~(\mathsf{null}~{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?})~{\mathit{ht}}_1)` matches :math:`(\mathsf{ref}~(\mathsf{null}~{{\mathit{u{\kern-0.1em\scriptstyle 1}}}^?})~{\mathit{ht}}_2)` if and only if: + + + * Either: + + * :math:`{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}` must be equal to :math:`\epsilon`. + + * :math:`{{\mathit{u{\kern-0.1em\scriptstyle 1}}}^?}` must be equal to :math:`\epsilon`. + + * :math:`{\mathit{ht}}_1` matches :math:`{\mathit{ht}}_2`. + + * Or: + + * :math:`{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}` must be equal to :math:`{()^?}`. + + * :math:`{{\mathit{u{\kern-0.1em\scriptstyle 1}}}^?}` must be equal to :math:`()`. + + * :math:`{\mathit{ht}}_1` matches :math:`{\mathit{ht}}_2`. + + +* :math:`{\mathit{vectype}}` matches :math:`{\mathit{vectype}}`. + + +* :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` matches :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` if and only if: + + + * Either: + + * :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{numtype}}_1`. + + * :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`{\mathit{numtype}}_2`. + + * :math:`{\mathit{numtype}}_1` matches :math:`{\mathit{numtype}}_2`. + + * Or: + + * :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{vectype}}_1`. + + * :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`{\mathit{vectype}}_2`. + + * :math:`{\mathit{vectype}}_1` matches :math:`{\mathit{vectype}}_2`. * Or: + + * :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{reftype}}_1`. + + * :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`{\mathit{reftype}}_2`. + + * :math:`{\mathit{reftype}}_1` matches :math:`{\mathit{reftype}}_2`. * Or: + + * :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{bot}`. + + * :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`{\mathit{valtype}}`. + + +* :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` matches :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` if and only if: + + + * Either: + + * :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{valtype}}_1`. + + * :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`{\mathit{valtype}}_2`. + + * :math:`{\mathit{valtype}}_1` matches :math:`{\mathit{valtype}}_2`. + + * Or: + + * :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{packtype}}_1`. + + * :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`{\mathit{packtype}}_2`. + + * :math:`{\mathit{packtype}}_1` matches :math:`{\mathit{packtype}}_2`. + + +* :math:`((\mathsf{mut}~{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}), {\mathit{zt}}_1)` matches :math:`((\mathsf{mut}~{{\mathit{u{\kern-0.1em\scriptstyle 1}}}^?}), {\mathit{zt}}_2)` if and only if: + + + * Either: + + * :math:`{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}` must be equal to :math:`\epsilon`. + + * :math:`{{\mathit{u{\kern-0.1em\scriptstyle 1}}}^?}` must be equal to :math:`\epsilon`. + + * :math:`{\mathit{zt}}_1` matches :math:`{\mathit{zt}}_2`. + + * Or: + + * :math:`{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}` must be equal to :math:`()`. + + * :math:`{{\mathit{u{\kern-0.1em\scriptstyle 1}}}^?}` must be equal to :math:`()`. + + * :math:`{\mathit{zt}}_1` matches :math:`{\mathit{zt}}_2`. + + * :math:`{\mathit{zt}}_2` matches :math:`{\mathit{zt}}_1`. + + +* :math:`{t_1^\ast}` matches :math:`{t_2^\ast}` if and only if: + + + * :math:`{|{t_2^\ast}|}` must be equal to :math:`{|{t_1^\ast}|}`. + + * For all :math:`t_1` in :math:`{t_1^\ast}` and :math:`t_2` in :math:`{t_2^\ast}`, + + * :math:`t_1` matches :math:`t_2`. + + +* :math:`{t_{11}^\ast} \rightarrow {t_{12}^\ast}` matches :math:`{t_{21}^\ast} \rightarrow {t_{22}^\ast}` if and only if: + + + * :math:`{t_{21}^\ast}` matches :math:`{t_{11}^\ast}`. + + * :math:`{t_{12}^\ast}` matches :math:`{t_{22}^\ast}`. + + +* :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` matches :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` if and only if: + + + * Either: + + * :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{struct}~{{\mathit{yt}}_1^\ast}~{\mathit{yt}'}_1)`. + + * :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{struct}~{{\mathit{yt}}_2^\ast})`. + + * :math:`{|{{\mathit{yt}}_2^\ast}|}` must be equal to :math:`{|{{\mathit{yt}}_1^\ast}|}`. + + * For all :math:`{\mathit{yt}}_1` in :math:`{{\mathit{yt}}_1^\ast}` and :math:`{\mathit{yt}}_2` in :math:`{{\mathit{yt}}_2^\ast}`, + + * :math:`{\mathit{yt}}_1` matches :math:`{\mathit{yt}}_2`. + + * Or: + + * :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{array}~{\mathit{yt}}_1)`. + + * :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{array}~{\mathit{yt}}_2)`. + + * :math:`{\mathit{yt}}_1` matches :math:`{\mathit{yt}}_2`. * Or: + + * :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{func}~{\mathit{ft}}_1)`. + + * :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{func}~{\mathit{ft}}_2)`. + + * :math:`{\mathit{ft}}_1` matches :math:`{\mathit{ft}}_2`. + + +* :math:`(\mathsf{sub}~(\mathsf{final}~{()^?})~{{\mathit{typeidx}}^\ast}~{\mathit{comptype}})` is valid with type :math:`({\mathsf{ok}}{x_0})` if and only if: + + + * :math:`{|{x^\ast}|}` must be equal to :math:`{|{{\mathit{comptype}'}^\ast}|}`. + + * :math:`{|{{{x'}^\ast}^\ast}|}` must be equal to :math:`{|{{\mathit{comptype}'}^\ast}|}`. + + * For all :math:`x` in :math:`{x^\ast}`, + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`{|{x^\ast}|}` must be less than or equal to :math:`1`. + + * For all :math:`x` in :math:`{x^\ast}`, + + * :math:`x` must be less than :math:`x_0`. + + * For all :math:`{\mathit{comptype}'}` in :math:`{{\mathit{comptype}'}^\ast}` and :math:`x` in :math:`{x^\ast}` and :math:`{x'}` in :math:`{{x'}^\ast}`, + + * :math:`{\mathrm{unroll}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{sub}~(\mathsf{final}~\epsilon)~{{x'}^\ast}~{\mathit{comptype}'})`. + + * :math:`{\mathit{comptype}}` is valid. + + * For all :math:`{\mathit{comptype}'}` in :math:`{{\mathit{comptype}'}^\ast}`, + + * :math:`{\mathit{comptype}}` matches :math:`{\mathit{comptype}'}`. + + +* :math:`(\mathsf{sub}~(\mathsf{final}~{()^?})~{{\mathit{typeuse}}^\ast}~{\mathit{compttype}})` is valid with type :math:`({\mathsf{ok}}{(x, i)})` if and only if: + + + * :math:`{|{{\mathit{typeuse}}^\ast}|}` must be equal to :math:`{|{{\mathit{comptype}'}^\ast}|}`. + + * :math:`{|{{{\mathit{typeuse}'}^\ast}^\ast}|}` must be equal to :math:`{|{{\mathit{comptype}'}^\ast}|}`. + + * :math:`{|{{\mathit{typeuse}}^\ast}|}` must be less than or equal to :math:`1`. + + * For all :math:`{\mathit{typeuse}}` in :math:`{{\mathit{typeuse}}^\ast}`, + + * YetI: $before(typeuse, x, i). + + * For all :math:`{\mathit{comptype}'}` in :math:`{{\mathit{comptype}'}^\ast}` and :math:`{\mathit{typeuse}}` in :math:`{{\mathit{typeuse}}^\ast}` and :math:`{\mathit{typeuse}'}` in :math:`{{\mathit{typeuse}'}^\ast}`, + + * :math:`{{\mathrm{unroll}}}_{C}({\mathit{typeuse}})` must be equal to :math:`(\mathsf{sub}~(\mathsf{final}~\epsilon)~{{\mathit{typeuse}'}^\ast}~{\mathit{comptype}'})`. + + * :math:`{\mathit{comptype}}` is valid. + + * For all :math:`{\mathit{comptype}'}` in :math:`{{\mathit{comptype}'}^\ast}`, + + * :math:`{\mathit{comptype}}` matches :math:`{\mathit{comptype}'}`. + + +* :math:`(\mathsf{rec}~{{\mathit{subtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` is valid with type :math:`({\mathsf{ok}}{(x, i)})` if and only if: + + + * Either: + + * :math:`{{\mathit{subtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`\epsilon`. + + * Or: + + * :math:`{{\mathit{subtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`{\mathit{subtype}}_1~{{\mathit{subtype}}^\ast}`. + + * :math:`{\mathit{subtype}}_1` is valid with type :math:`({\mathsf{ok}}{(x, i)})`. + + * :math:`(\mathsf{rec}~{{\mathit{subtype}}^\ast})` is valid with type :math:`({\mathsf{ok}}{(x + 1, i + 1)})`. + + +* :math:`(\mathsf{rec}~{{\mathit{subtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` is valid with type :math:`({\mathsf{ok}}{x})` if and only if: + + + * Either: + + * :math:`{{\mathit{subtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`\epsilon`. + + * Or: + + * :math:`{{\mathit{subtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`{\mathit{subtype}}_1~{{\mathit{subtype}}^\ast}`. + + * :math:`{\mathit{subtype}}_1` is valid with type :math:`({\mathsf{ok}}{x})`. + + * :math:`(\mathsf{rec}~{{\mathit{subtype}}^\ast})` is valid with type :math:`({\mathsf{ok}}{x + 1})`. * Or: + + * :math:`{{\mathit{subtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`{{\mathit{subtype}}^\ast}`. + + * Under the context :math:`C{}[{.}\mathsf{recs} \mathrel{{=}{\oplus}} {{\mathit{subtype}}^\ast}]`, :math:`(\mathsf{rec}~{{\mathit{subtype}}^\ast})` is valid with type :math:`({\mathsf{ok}}{(x, 0)})`. + + +* :math:`({\mathit{rectype}} {.} i)` is valid if and only if: + + + * :math:`{\mathit{rectype}}` is valid with type :math:`({\mathsf{ok}}{x})`. + + * :math:`{\mathit{rectype}}` must be equal to :math:`(\mathsf{rec}~{{\mathit{subtype}}^{n}})`. + + * :math:`i` must be less than :math:`n`. + + +* :math:`(n, m)` is valid with type :math:`k` if and only if: + + + * :math:`n` must be less than or equal to :math:`m`. + + * :math:`m` must be less than or equal to :math:`k`. + + +* :math:`((\mathsf{mut}~{()^?}), t)` is valid if and only if: + + + * :math:`t` is valid. + + +* :math:`({\mathit{limits}}, {\mathit{reftype}})` is valid if and only if: + + + * :math:`{\mathit{limits}}` is valid with type :math:`{2^{32}} - 1`. + + * :math:`{\mathit{reftype}}` is valid. + + +* :math:`(\mathsf{page}~{\mathit{limits}})` is valid if and only if: + + + * :math:`{\mathit{limits}}` is valid with type :math:`{2^{16}}`. + + +* :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid if and only if: + + + * Either: + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{func}~{\mathit{deftype}})`. + + * :math:`{\mathit{deftype}}` is valid. + + * :math:`{\mathrm{expand}}({\mathit{deftype}})` must be equal to :math:`(\mathsf{func}~{\mathit{functype}})`. + + * Or: + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{global}~{\mathit{globaltype}})`. + + * :math:`{\mathit{globaltype}}` is valid. * Or: + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{table}~{\mathit{tabletype}})`. + + * :math:`{\mathit{tabletype}}` is valid. * Or: + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{mem}~{\mathit{memtype}})`. + + * :math:`{\mathit{memtype}}` is valid. + + +* :math:`{t_{11}^\ast} \rightarrow_{{x_1^\ast}} {t_{12}^\ast}` matches :math:`{t_{21}^\ast} \rightarrow_{{x_2^\ast}} {t_{22}^\ast}` if and only if: + + + * :math:`{|{x^\ast}|}` must be equal to :math:`{|{t^\ast}|}`. + + * For all :math:`x` in :math:`{x^\ast}`, + + * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. + + * :math:`{t_{21}^\ast}` matches :math:`{t_{11}^\ast}`. + + * :math:`{t_{12}^\ast}` matches :math:`{t_{22}^\ast}`. + + * :math:`{x^\ast}` must be equal to :math:`{x_2^\ast} \setminus {x_1^\ast}`. + + * For all :math:`t` in :math:`{t^\ast}` and :math:`x` in :math:`{x^\ast}`, + + * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`(\mathsf{set}, t)`. + + +* :math:`(n_1, m_1)` matches :math:`(n_2, m_2)` if and only if: + + + * :math:`n_1` must be greater than or equal to :math:`n_2`. + + * :math:`m_1` must be less than or equal to :math:`m_2`. + + +* :math:`((\mathsf{mut}~{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}), {\mathit{valtype}}_1)` matches :math:`((\mathsf{mut}~{{\mathit{u{\kern-0.1em\scriptstyle 1}}}^?}), {\mathit{valtype}}_2)` if and only if: + + + * Either: + + * :math:`{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}` must be equal to :math:`\epsilon`. + + * :math:`{{\mathit{u{\kern-0.1em\scriptstyle 1}}}^?}` must be equal to :math:`\epsilon`. + + * :math:`{\mathit{valtype}}_1` matches :math:`{\mathit{valtype}}_2`. + + * Or: + + * :math:`{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}` must be equal to :math:`()`. + + * :math:`{{\mathit{u{\kern-0.1em\scriptstyle 1}}}^?}` must be equal to :math:`()`. + + * :math:`{\mathit{valtype}}_1` matches :math:`{\mathit{valtype}}_2`. + + * :math:`{\mathit{valtype}}_2` matches :math:`{\mathit{valtype}}_1`. + + +* :math:`({\mathit{limits}}_1, {\mathit{reftype}}_1)` matches :math:`({\mathit{limits}}_2, {\mathit{reftype}}_2)` if and only if: + + + * :math:`{\mathit{limits}}_1` matches :math:`{\mathit{limits}}_2`. + + * :math:`{\mathit{reftype}}_1` matches :math:`{\mathit{reftype}}_2`. + + * :math:`{\mathit{reftype}}_2` matches :math:`{\mathit{reftype}}_1`. + + +* :math:`(\mathsf{page}~{\mathit{limits}}_1)` matches :math:`(\mathsf{page}~{\mathit{limits}}_2)` if and only if: + + + * :math:`{\mathit{limits}}_1` matches :math:`{\mathit{limits}}_2`. + + +* :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` matches :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` if and only if: + + + * Either: + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{func}~{\mathit{deftype}}_1)`. + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{func}~{\mathit{deftype}}_2)`. + + * :math:`{\mathit{deftype}}_1` matches :math:`{\mathit{deftype}}_2`. + + * Or: + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{global}~{\mathit{globaltype}}_1)`. + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{global}~{\mathit{globaltype}}_2)`. + + * :math:`{\mathit{globaltype}}_1` matches :math:`{\mathit{globaltype}}_2`. * Or: + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{table}~{\mathit{tabletype}}_1)`. + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{table}~{\mathit{tabletype}}_2)`. + + * :math:`{\mathit{tabletype}}_1` matches :math:`{\mathit{tabletype}}_2`. * Or: + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{mem}~{\mathit{memtype}}_1)`. + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{mem}~{\mathit{memtype}}_2)`. + + * :math:`{\mathit{memtype}}_1` matches :math:`{\mathit{memtype}}_2`. + + +* :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid with type :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast} \rightarrow_{\epsilon} {{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` if and only if: + + + * Either: + + * :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{{\mathit{valtype}}^?}`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` must be equal to :math:`\epsilon`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` must be equal to :math:`{{\mathit{valtype}}^?}`. + + * If :math:`{\mathit{valtype}}` is defined, + + * :math:`{\mathit{valtype}}` is valid. + + * Or: + + * :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`{\mathit{typeidx}}`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` must be equal to :math:`{t_1^\ast}`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` must be equal to :math:`{t_2^\ast}`. + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`{\mathit{typeidx}}`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[{\mathit{typeidx}}])` must be equal to :math:`(\mathsf{func}~{t_1^\ast} \rightarrow {t_2^\ast})`. + + +* :math:`\mathsf{nop}` is valid with type :math:`\epsilon \rightarrow_{\epsilon} \epsilon`. + + +* :math:`\mathsf{unreachable}` is valid with type :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}` if and only if: + + + * :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}` is valid. + + +* :math:`\mathsf{drop}` is valid with type :math:`t \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`t` is valid. + + +* :math:`(\mathsf{select}~t)` is valid with type :math:`t~t~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} t` if and only if: + + + * :math:`t` is valid. + + +* :math:`(\mathsf{block}~{\mathit{bt}}~{{\mathit{instr}}^\ast})` is valid with type :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}` if and only if: + + + * :math:`{\mathit{bt}}` is valid with type :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}`. + + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow_{{x^\ast}} {t_2^\ast}`. + + +* :math:`(\mathsf{loop}~{\mathit{bt}}~{{\mathit{instr}}^\ast})` is valid with type :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}` if and only if: + + + * :math:`{\mathit{bt}}` is valid with type :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}`. + + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_1^\ast}]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow_{{x^\ast}} {t_2^\ast}`. + + +* :math:`(\mathsf{if}~{\mathit{bt}}~{{\mathit{instr}}_1^\ast}~{{\mathit{instr}}_2^\ast})` is valid with type :math:`{t_1^\ast}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} {t_2^\ast}` if and only if: + + + * :math:`{\mathit{bt}}` is valid with type :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}`. + + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}_1^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow_{{x_1^\ast}} {t_2^\ast}`. + + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}_2^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow_{{x_2^\ast}} {t_2^\ast}`. + + +* :math:`(\mathsf{br}~l)` is valid with type :math:`{t_1^\ast}~{t^\ast} \rightarrow_{\epsilon} {t_2^\ast}` if and only if: + + + * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. + + * :math:`C{.}\mathsf{labels}{}[l]` must be equal to :math:`{t^\ast}`. + + * :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}` is valid. + + +* :math:`(\mathsf{br\_if}~l)` is valid with type :math:`{t^\ast}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} {t^\ast}` if and only if: + + + * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. + + * :math:`C{.}\mathsf{labels}{}[l]` must be equal to :math:`{t^\ast}`. + + +* :math:`(\mathsf{br\_table}~{l^\ast}~{l'})` is valid with type :math:`{t_1^\ast}~{t^\ast} \rightarrow_{\epsilon} {t_2^\ast}` if and only if: + + + * For all :math:`l` in :math:`{l^\ast}`, + + * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. + + * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`{l'}`. + + * For all :math:`l` in :math:`{l^\ast}`, + + * :math:`{t^\ast}` matches :math:`C{.}\mathsf{labels}{}[l]`. + + * :math:`{t^\ast}` matches :math:`C{.}\mathsf{labels}{}[{l'}]`. + + * :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}` is valid. + + +* :math:`(\mathsf{br\_on\_null}~l)` is valid with type :math:`{t^\ast}~(\mathsf{ref}~(\mathsf{null}~())~{\mathit{ht}}) \rightarrow_{\epsilon} {t^\ast}~(\mathsf{ref}~(\mathsf{null}~\epsilon)~{\mathit{ht}})` if and only if: + + + * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. + + * :math:`C{.}\mathsf{labels}{}[l]` must be equal to :math:`{t^\ast}`. + + * :math:`{\mathit{ht}}` is valid. + + +* :math:`(\mathsf{br\_on\_non\_null}~l)` is valid with type :math:`{t^\ast}~(\mathsf{ref}~(\mathsf{null}~())~{\mathit{ht}}) \rightarrow_{\epsilon} {t^\ast}` if and only if: + + + * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. + + * :math:`C{.}\mathsf{labels}{}[l]` must be equal to :math:`{t^\ast}~(\mathsf{ref}~(\mathsf{null}~\epsilon)~{\mathit{ht}})`. + + +* :math:`(\mathsf{br\_on\_cast}~l~{\mathit{rt}}_1~{\mathit{rt}}_2)` is valid with type :math:`{t^\ast}~{\mathit{rt}}_1 \rightarrow_{\epsilon} {t^\ast}~{\mathit{rt}}_1 \setminus {\mathit{rt}}_2` if and only if: + + + * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. + + * :math:`C{.}\mathsf{labels}{}[l]` must be equal to :math:`{t^\ast}~{\mathit{rt}}`. + + * :math:`{\mathit{rt}}_1` is valid. + + * :math:`{\mathit{rt}}_2` is valid. + + * :math:`{\mathit{rt}}_2` matches :math:`{\mathit{rt}}_1`. + + * :math:`{\mathit{rt}}_2` matches :math:`{\mathit{rt}}`. + + +* :math:`(\mathsf{br\_on\_cast\_fail}~l~{\mathit{rt}}_1~{\mathit{rt}}_2)` is valid with type :math:`{t^\ast}~{\mathit{rt}}_1 \rightarrow_{\epsilon} {t^\ast}~{\mathit{rt}}_2` if and only if: + + + * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. + + * :math:`C{.}\mathsf{labels}{}[l]` must be equal to :math:`{t^\ast}~{\mathit{rt}}`. + + * :math:`{\mathit{rt}}_1` is valid. + + * :math:`{\mathit{rt}}_2` is valid. + + * :math:`{\mathit{rt}}_2` matches :math:`{\mathit{rt}}_1`. + + * :math:`{\mathit{rt}}_1 \setminus {\mathit{rt}}_2` matches :math:`{\mathit{rt}}`. + + +* :math:`(\mathsf{call}~x)` is valid with type :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}` if and only if: + + + * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{funcs}{}[x])` must be equal to :math:`(\mathsf{func}~{t_1^\ast} \rightarrow {t_2^\ast})`. + + +* :math:`(\mathsf{call\_ref}~x)` is valid with type :math:`{t_1^\ast}~(\mathsf{ref}~(\mathsf{null}~())~x) \rightarrow_{\epsilon} {t_2^\ast}` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{func}~{t_1^\ast} \rightarrow {t_2^\ast})`. + + +* :math:`(\mathsf{call\_indirect}~x~y)` is valid with type :math:`{t_1^\ast}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} {t_2^\ast}` if and only if: + + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`y`. + + * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. + + * :math:`{\mathit{rt}}` matches :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{func})`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[y])` must be equal to :math:`(\mathsf{func}~{t_1^\ast} \rightarrow {t_2^\ast})`. + + +* :math:`\mathsf{return}` is valid with type :math:`{t_1^\ast}~{t^\ast} \rightarrow_{\epsilon} {t_2^\ast}` if and only if: + + + * :math:`C{.}\mathsf{return}` must be equal to :math:`{t^\ast}`. + + * :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}` is valid. + + +* :math:`(\mathsf{return\_call}~x)` is valid with type :math:`{t_3^\ast}~{t_1^\ast} \rightarrow_{\epsilon} {t_4^\ast}` if and only if: + + + * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{funcs}{}[x])` must be equal to :math:`(\mathsf{func}~{t_1^\ast} \rightarrow {t_2^\ast})`. + + * :math:`C{.}\mathsf{return}` must be equal to :math:`{{t'}_2^\ast}`. + + * :math:`{t_2^\ast}` matches :math:`{{t'}_2^\ast}`. + + * :math:`{t_3^\ast} \rightarrow_{\epsilon} {t_4^\ast}` is valid. + + +* :math:`(\mathsf{return\_call\_ref}~x)` is valid with type :math:`{t_3^\ast}~{t_1^\ast}~(\mathsf{ref}~(\mathsf{null}~())~x) \rightarrow_{\epsilon} {t_4^\ast}` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{func}~{t_1^\ast} \rightarrow {t_2^\ast})`. + + * :math:`C{.}\mathsf{return}` must be equal to :math:`{{t'}_2^\ast}`. + + * :math:`{t_2^\ast}` matches :math:`{{t'}_2^\ast}`. + + * :math:`{t_3^\ast} \rightarrow_{\epsilon} {t_4^\ast}` is valid. + + +* :math:`(\mathsf{return\_call\_indirect}~x~y)` is valid with type :math:`{t_3^\ast}~{t_1^\ast}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} {t_4^\ast}` if and only if: + + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`y`. + + * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. + + * :math:`{\mathit{rt}}` matches :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{func})`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[y])` must be equal to :math:`(\mathsf{func}~{t_1^\ast} \rightarrow {t_2^\ast})`. + + * :math:`C{.}\mathsf{return}` must be equal to :math:`{{t'}_2^\ast}`. + + * :math:`{t_2^\ast}` matches :math:`{{t'}_2^\ast}`. + + * :math:`{t_3^\ast} \rightarrow_{\epsilon} {t_4^\ast}` is valid. + + +* :math:`({\mathit{nt}}{.}\mathsf{const}~c_{\mathit{nt}})` is valid with type :math:`\epsilon \rightarrow_{\epsilon} {\mathit{nt}}`. + + +* :math:`({\mathit{nt}} {.} {\mathit{unop}}_{\mathit{nt}})` is valid with type :math:`{\mathit{nt}} \rightarrow_{\epsilon} {\mathit{nt}}`. + + +* :math:`({\mathit{nt}} {.} {\mathit{binop}}_{\mathit{nt}})` is valid with type :math:`{\mathit{nt}}~{\mathit{nt}} \rightarrow_{\epsilon} {\mathit{nt}}`. + + +* :math:`({\mathit{nt}} {.} {\mathit{testop}}_{\mathit{nt}})` is valid with type :math:`{\mathit{nt}} \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}`. + + +* :math:`({\mathit{nt}} {.} {\mathit{relop}}_{\mathit{nt}})` is valid with type :math:`{\mathit{nt}}~{\mathit{nt}} \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}`. + + +* :math:`({\mathit{nt}}_1 {.} {{\mathit{cvtop}}}{\mathsf{\_}}{{\mathit{nt}}_2})` is valid with type :math:`{\mathit{nt}}_2 \rightarrow_{\epsilon} {\mathit{nt}}_1`. + + +* :math:`(\mathsf{ref{.}null}~{\mathit{ht}})` is valid with type :math:`\epsilon \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~())~{\mathit{ht}})` if and only if: + + + * :math:`{\mathit{ht}}` is valid. + + +* :math:`(\mathsf{ref{.}func}~x)` is valid with type :math:`\epsilon \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~{\mathit{dt}})` if and only if: + + + * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. + + * :math:`{|C{.}\mathsf{refs}|}` must be greater than :math:`0`. + + * :math:`C{.}\mathsf{funcs}{}[x]` must be equal to :math:`{\mathit{dt}}`. + + * :math:`x` must be contained in :math:`C{.}\mathsf{refs}`. + + +* :math:`\mathsf{ref{.}i{\scriptstyle 31}}` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~\mathsf{i{\scriptstyle 31}})`. + + +* :math:`\mathsf{ref{.}is\_null}` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~{\mathit{ht}}) \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}` if and only if: + + + * :math:`{\mathit{ht}}` is valid. + + +* :math:`\mathsf{ref{.}as\_non\_null}` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~{\mathit{ht}}) \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~{\mathit{ht}})` if and only if: + + + * :math:`{\mathit{ht}}` is valid. + + +* :math:`\mathsf{ref{.}eq}` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{eq})~(\mathsf{ref}~(\mathsf{null}~())~\mathsf{eq}) \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}`. + + +* :math:`(\mathsf{ref{.}test}~{\mathit{rt}})` is valid with type :math:`{\mathit{rt}'} \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}` if and only if: + + + * :math:`{\mathit{rt}}` is valid. + + * :math:`{\mathit{rt}'}` is valid. + + * :math:`{\mathit{rt}}` matches :math:`{\mathit{rt}'}`. + + +* :math:`(\mathsf{ref{.}cast}~{\mathit{rt}})` is valid with type :math:`{\mathit{rt}'} \rightarrow_{\epsilon} {\mathit{rt}}` if and only if: + + + * :math:`{\mathit{rt}}` is valid. + + * :math:`{\mathit{rt}'}` is valid. + + * :math:`{\mathit{rt}}` matches :math:`{\mathit{rt}'}`. + + +* :math:`({\mathsf{i{\scriptstyle 31}{.}get}}{\mathsf{\_}}{{\mathit{sx}}})` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{i{\scriptstyle 31}}) \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}`. + + +* :math:`(\mathsf{struct{.}new}~x)` is valid with type :math:`{{\mathrm{unpack}}({\mathit{zt}})^\ast} \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~x)` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`{|{{\mathit{zt}}^\ast}|}` must be equal to :math:`{|{{\mathsf{mut}^?}^\ast}|}`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{struct}~{({\mathsf{mut}^?}, {\mathit{zt}})^\ast})`. + + +* :math:`(\mathsf{struct{.}new\_default}~x)` is valid with type :math:`\epsilon \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~x)` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`{|{{\mathit{zt}}^\ast}|}` must be equal to :math:`{|{{\mathsf{mut}^?}^\ast}|}`. + + * :math:`{|{{\mathit{zt}}^\ast}|}` must be equal to :math:`{|{{\mathit{val}}^\ast}|}`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{struct}~{({\mathsf{mut}^?}, {\mathit{zt}})^\ast})`. + + * For all :math:`{\mathit{val}}` in :math:`{{\mathit{val}}^\ast}` and :math:`{\mathit{zt}}` in :math:`{{\mathit{zt}}^\ast}`, + + * :math:`{{\mathrm{default}}}_{{\mathrm{unpack}}({\mathit{zt}})}` must be equal to :math:`{\mathit{val}}`. + + +* :math:`({\mathsf{struct{.}get}}{\mathsf{\_}}{{{\mathit{sx}}^?}}~x~i)` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~x) \rightarrow_{\epsilon} {\mathrm{unpack}}({\mathit{zt}})` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`{|{{\mathit{yt}}^\ast}|}` must be greater than :math:`i`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{struct}~{{\mathit{yt}}^\ast})`. + + * :math:`{{\mathit{yt}}^\ast}{}[i]` must be equal to :math:`({\mathsf{mut}^?}, {\mathit{zt}})`. + + * :math:`{{\mathit{sx}}^?}` is :math:`\epsilon` if and only if :math:`{\mathit{zt}}` is :math:`{\mathrm{unpack}}({\mathit{zt}})`. + + +* :math:`(\mathsf{struct{.}set}~x~i)` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~x)~{\mathrm{unpack}}({\mathit{zt}}) \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`{|{{\mathit{yt}}^\ast}|}` must be greater than :math:`i`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{struct}~{{\mathit{yt}}^\ast})`. + + * :math:`{{\mathit{yt}}^\ast}{}[i]` must be equal to :math:`((\mathsf{mut}~()), {\mathit{zt}})`. + + +* :math:`(\mathsf{array{.}new}~x)` is valid with type :math:`{\mathrm{unpack}}({\mathit{zt}})~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~x)` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~({\mathsf{mut}^?}, {\mathit{zt}}))`. + + +* :math:`(\mathsf{array{.}new\_default}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~x)` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~({\mathsf{mut}^?}, {\mathit{zt}}))`. + + * :math:`{{\mathrm{default}}}_{{\mathrm{unpack}}({\mathit{zt}})}` must be equal to :math:`{\mathit{val}}`. + + +* :math:`(\mathsf{array{.}new\_fixed}~x~n)` is valid with type :math:`{{\mathrm{unpack}}({\mathit{zt}})^{n}} \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~x)` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~({\mathsf{mut}^?}, {\mathit{zt}}))`. + + +* :math:`(\mathsf{array{.}new\_elem}~x~y)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~x)` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`{|C{.}\mathsf{elems}|}` must be greater than :math:`y`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~({\mathsf{mut}^?}, {\mathit{rt}}))`. + + * :math:`C{.}\mathsf{elems}{}[y]` matches :math:`{\mathit{rt}}`. + + +* :math:`(\mathsf{array{.}new\_data}~x~y)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~x)` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`{|C{.}\mathsf{datas}|}` must be greater than :math:`y`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~({\mathsf{mut}^?}, {\mathit{zt}}))`. + + * YetI: (($unpack(zt) = (numtype : numtype <: valtype)) \/ ($unpack(zt) = (vectype : vectype <: valtype))). + + * :math:`C{.}\mathsf{datas}{}[y]` must be equal to :math:`\mathsf{ok}`. + + +* :math:`({\mathsf{array{.}get}}{\mathsf{\_}}{{{\mathit{sx}}^?}}~x)` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~x)~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} {\mathrm{unpack}}({\mathit{zt}})` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~({\mathsf{mut}^?}, {\mathit{zt}}))`. + + * :math:`{{\mathit{sx}}^?}` is :math:`\epsilon` if and only if :math:`{\mathit{zt}}` is :math:`{\mathrm{unpack}}({\mathit{zt}})`. + + +* :math:`(\mathsf{array{.}set}~x)` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~x)~\mathsf{i{\scriptstyle 32}}~{\mathrm{unpack}}({\mathit{zt}}) \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~((\mathsf{mut}~()), {\mathit{zt}}))`. + + +* :math:`\mathsf{array{.}len}` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{array}) \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~((\mathsf{mut}~()), {\mathit{zt}}))`. + + +* :math:`(\mathsf{array{.}fill}~x)` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~x)~\mathsf{i{\scriptstyle 32}}~{\mathrm{unpack}}({\mathit{zt}})~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~((\mathsf{mut}~()), {\mathit{zt}}))`. + + +* :math:`(\mathsf{array{.}copy}~x_1~x_2)` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~x_1)~\mathsf{i{\scriptstyle 32}}~(\mathsf{ref}~(\mathsf{null}~())~x_2)~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x_1`. + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x_2`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x_1])` must be equal to :math:`(\mathsf{array}~((\mathsf{mut}~()), {\mathit{zt}}_1))`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x_2])` must be equal to :math:`(\mathsf{array}~({\mathsf{mut}^?}, {\mathit{zt}}_2))`. + + * :math:`{\mathit{zt}}_2` matches :math:`{\mathit{zt}}_1`. + + +* :math:`(\mathsf{array{.}init\_elem}~x~y)` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~x)~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`{|C{.}\mathsf{elems}|}` must be greater than :math:`y`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~((\mathsf{mut}~()), {\mathit{zt}}))`. + + * :math:`C{.}\mathsf{elems}{}[y]` matches :math:`{\mathit{zt}}`. + + +* :math:`(\mathsf{array{.}init\_data}~x~y)` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~x)~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`{|C{.}\mathsf{datas}|}` must be greater than :math:`y`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~((\mathsf{mut}~()), {\mathit{zt}}))`. + + * YetI: (($unpack(zt) = (numtype : numtype <: valtype)) \/ ($unpack(zt) = (vectype : vectype <: valtype))). + + * :math:`C{.}\mathsf{datas}{}[y]` must be equal to :math:`\mathsf{ok}`. + + +* :math:`\mathsf{extern{.}convert\_any}` is valid with type :math:`(\mathsf{ref}~{\mathsf{null}^?}~\mathsf{any}) \rightarrow_{\epsilon} (\mathsf{ref}~{\mathsf{null}^?}~\mathsf{extern})`. + + +* :math:`\mathsf{any{.}convert\_extern}` is valid with type :math:`(\mathsf{ref}~{\mathsf{null}^?}~\mathsf{extern}) \rightarrow_{\epsilon} (\mathsf{ref}~{\mathsf{null}^?}~\mathsf{any})`. + + +* :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c)` is valid with type :math:`\epsilon \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. + + +* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvunop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. + + +* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvbinop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. + + +* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvternop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. + + +* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvtestop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}`. + + +* :math:`({\mathit{sh}} {.} {\mathit{vunop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. + + +* :math:`({\mathit{sh}} {.} {\mathit{vbinop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. + + +* :math:`({\mathit{sh}} {.} {\mathit{vtestop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}`. + + +* :math:`({\mathit{sh}} {.} {\mathit{vrelop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. + + +* :math:`({\mathit{sh}} {.} {\mathit{vshiftop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. + + +* :math:`({\mathit{sh}}{.}\mathsf{bitmask})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}`. + + +* :math:`({\mathit{sh}}{.}\mathsf{swizzle})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. + + +* :math:`({\mathit{sh}}{.}\mathsf{shuffle}~{i^\ast})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}` if and only if: + + + * For all :math:`i` in :math:`{i^\ast}`, + + * :math:`i` must be less than :math:`2 \cdot {\mathrm{dim}}({\mathit{sh}})`. + + +* :math:`({\mathit{sh}}{.}\mathsf{splat})` is valid with type :math:`{\mathrm{unpack}}({\mathit{sh}}) \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. + + +* :math:`({{\mathit{sh}}{.}\mathsf{extract\_lane}}{\mathsf{\_}}{{{\mathit{sx}}^?}}~i)` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} {\mathrm{unpack}}({\mathit{sh}})` if and only if: + + + * :math:`i` must be less than :math:`{\mathrm{dim}}({\mathit{sh}})`. + + +* :math:`({\mathit{sh}}{.}\mathsf{replace\_lane}~i)` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~{\mathrm{unpack}}({\mathit{sh}}) \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}` if and only if: + + + * :math:`i` must be less than :math:`{\mathrm{dim}}({\mathit{sh}})`. + + +* :math:`({\mathit{sh}}_1 {.} {{\mathit{vextunop}}}{\mathsf{\_}}{{\mathit{sh}}_2})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. + + +* :math:`({\mathit{sh}}_1 {.} {{\mathit{vextbinop}}}{\mathsf{\_}}{{\mathit{sh}}_2})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. + + +* :math:`({{\mathit{sh}}_1{.}\mathsf{narrow}}{\mathsf{\_}}{{\mathit{sh}}_2}{\mathsf{\_}}{{\mathit{sx}}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. + + +* :math:`({\mathit{sh}}_1 {.} {{\mathit{vcvtop}}}{\mathsf{\_}}{{{\mathit{zero}}^?}}{\mathsf{\_}}{{\mathit{sh}}_2}{\mathsf{\_}}{{{\mathit{half}}^?}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. + + +* :math:`(\mathsf{local{.}get}~x)` is valid with type :math:`\epsilon \rightarrow_{\epsilon} t` if and only if: + + + * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`(\mathsf{set}, t)`. + + +* :math:`(\mathsf{local{.}set}~x)` is valid with type :math:`t \rightarrow_{x} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`({\mathit{init}}, t)`. + + +* :math:`(\mathsf{local{.}tee}~x)` is valid with type :math:`t \rightarrow_{x} t` if and only if: + + + * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`({\mathit{init}}, t)`. + + +* :math:`(\mathsf{global{.}get}~x)` is valid with type :math:`\epsilon \rightarrow_{\epsilon} t` if and only if: + + + * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`({\mathsf{mut}^?}, t)`. + + +* :math:`(\mathsf{global{.}set}~x)` is valid with type :math:`t \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`((\mathsf{mut}~()), t)`. + + +* :math:`(\mathsf{table{.}get}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} {\mathit{rt}}` if and only if: + + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. + + +* :math:`(\mathsf{table{.}set}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~{\mathit{rt}} \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. + + +* :math:`(\mathsf{table{.}size}~x)` is valid with type :math:`\epsilon \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}` if and only if: + + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. + + +* :math:`(\mathsf{table{.}grow}~x)` is valid with type :math:`{\mathit{rt}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}` if and only if: + + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. + + +* :math:`(\mathsf{table{.}fill}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~{\mathit{rt}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. + + +* :math:`(\mathsf{table{.}copy}~x_1~x_2)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x_1`. + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x_2`. + + * :math:`C{.}\mathsf{tables}{}[x_1]` must be equal to :math:`({\mathit{lim}}_1, {\mathit{rt}}_1)`. + + * :math:`C{.}\mathsf{tables}{}[x_2]` must be equal to :math:`({\mathit{lim}}_2, {\mathit{rt}}_2)`. + + * :math:`{\mathit{rt}}_2` matches :math:`{\mathit{rt}}_1`. + + +* :math:`(\mathsf{table{.}init}~x~y)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. + + * :math:`{|C{.}\mathsf{elems}|}` must be greater than :math:`y`. + + * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}}_1)`. + + * :math:`C{.}\mathsf{elems}{}[y]` must be equal to :math:`{\mathit{rt}}_2`. + + * :math:`{\mathit{rt}}_2` matches :math:`{\mathit{rt}}_1`. + + +* :math:`(\mathsf{elem{.}drop}~x)` is valid with type :math:`\epsilon \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{elems}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{elems}{}[x]` must be equal to :math:`{\mathit{rt}}`. + + +* :math:`(\mathsf{memory{.}size}~x)` is valid with type :math:`\epsilon \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{mems}{}[x]` must be equal to :math:`{\mathit{mt}}`. + + +* :math:`(\mathsf{memory{.}grow}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{mems}{}[x]` must be equal to :math:`{\mathit{mt}}`. + + +* :math:`(\mathsf{memory{.}fill}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{mems}{}[x]` must be equal to :math:`{\mathit{mt}}`. + + +* :math:`(\mathsf{memory{.}copy}~x_1~x_2)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x_1`. + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x_2`. + + * :math:`C{.}\mathsf{mems}{}[x_1]` must be equal to :math:`{\mathit{mt}}_1`. + + * :math:`C{.}\mathsf{mems}{}[x_2]` must be equal to :math:`{\mathit{mt}}_2`. + + +* :math:`(\mathsf{memory{.}init}~x~y)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. + + * :math:`{|C{.}\mathsf{datas}|}` must be greater than :math:`y`. + + * :math:`C{.}\mathsf{mems}{}[x]` must be equal to :math:`{\mathit{mt}}`. + + * :math:`C{.}\mathsf{datas}{}[y]` must be equal to :math:`\mathsf{ok}`. + + +* :math:`(\mathsf{data{.}drop}~x)` is valid with type :math:`\epsilon \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{datas}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{datas}{}[x]` must be equal to :math:`\mathsf{ok}`. + + +* :math:`({{\mathit{nt}}{.}\mathsf{load}}{\epsilon}~x~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} {\mathit{nt}}` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{mems}{}[x]` must be equal to :math:`{\mathit{mt}}`. + + * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`{|{\mathit{nt}}|} / 8`. + + +* :math:`({{\mathit{nt}}{.}\mathsf{store}}{\epsilon}~x~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~{\mathit{nt}} \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{mems}{}[x]` must be equal to :math:`{\mathit{mt}}`. + + * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`{|{\mathit{nt}}|} / 8`. + + +* :math:`({\mathsf{v{\scriptstyle 128}}{.}\mathsf{load}}{\epsilon}~x~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{mems}{}[x]` must be equal to :math:`{\mathit{mt}}`. + + * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`{|\mathsf{v{\scriptstyle 128}}|} / 8`. + + +* :math:`({\mathsf{v{\scriptstyle 128}}{.}\mathsf{load}}{N}{\mathsf{\_}}{\mathsf{lane}}~x~{\mathit{memarg}}~i)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{mems}{}[x]` must be equal to :math:`{\mathit{mt}}`. + + * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`N / 8`. + + * :math:`i` must be less than :math:`128 / N`. + + +* :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{store}~x~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{mems}{}[x]` must be equal to :math:`{\mathit{mt}}`. + + * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`{|\mathsf{v{\scriptstyle 128}}|} / 8`. + + +* :math:`({\mathsf{v{\scriptstyle 128}}{.}\mathsf{store}}{N}{\mathsf{\_}}{\mathsf{lane}}~x~{\mathit{memarg}}~i)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \epsilon` if and only if: + + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{mems}{}[x]` must be equal to :math:`{\mathit{mt}}`. + + * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`N / 8`. + + * :math:`i` must be less than :math:`128 / N`. + + +* :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is valid with type :math:`{\mathit{instrtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}` if and only if: + + + * Either: + + * :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`\epsilon`. + + * :math:`{\mathit{instrtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}` must be equal to :math:`\epsilon \rightarrow_{\epsilon} \epsilon`. + + * Or: + + * :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`{\mathit{instr}}_1~{{\mathit{instr}}_2^\ast}`. + + * :math:`{\mathit{instrtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}` must be equal to :math:`{t_1^\ast} \rightarrow_{{x_1^\ast}~{x_2^\ast}} {t_3^\ast}`. + + * :math:`{|{t^\ast}|}` must be equal to :math:`{|{{\mathit{init}}^\ast}|}`. + + * :math:`{|{x_1^\ast}|}` must be equal to :math:`{|{{\mathit{init}}^\ast}|}`. + + * For all :math:`x_1` in :math:`{x_1^\ast}`, + + * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x_1`. + + * :math:`{\mathit{instr}}_1` is valid with type :math:`{t_1^\ast} \rightarrow_{{x_1^\ast}} {t_2^\ast}`. + + * For all :math:`{\mathit{init}}` in :math:`{{\mathit{init}}^\ast}` and :math:`t` in :math:`{t^\ast}` and :math:`x_1` in :math:`{x_1^\ast}`, + + * :math:`C{.}\mathsf{locals}{}[x_1]` must be equal to :math:`({\mathit{init}}, t)`. + + * Under the context :math:`C{}[{.}\mathsf{local}{}[{x_1^\ast}] = {(\mathsf{set}, t)^\ast}]`, :math:`{{\mathit{instr}}_2^\ast}` is valid with type :math:`{t_2^\ast} \rightarrow_{{x_2^\ast}} {t_3^\ast}`. * Or: + + * :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`{{\mathit{instr}}^\ast}`. + + * :math:`{\mathit{instrtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}` must be equal to :math:`{\mathit{it}'}`. + + * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{\mathit{it}}`. + + * :math:`{\mathit{it}}` matches :math:`{\mathit{it}'}`. + + * :math:`{\mathit{it}'}` is valid. * Or: + + * :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`{{\mathit{instr}}^\ast}`. + + * :math:`{\mathit{instrtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}` must be equal to :math:`{t^\ast}~{t_1^\ast} \rightarrow_{{x^\ast}} {t^\ast}~{t_2^\ast}`. + + * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow_{{x^\ast}} {t_2^\ast}`. + + * :math:`{t^\ast}` is valid. + + +* :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t^\ast}` if and only if: + + + * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`\epsilon \rightarrow_{\epsilon} {t^\ast}`. + + +* :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is const if and only if: + + + * Either: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`({\mathit{nt}}{.}\mathsf{const}~c_{\mathit{nt}})`. + + * Or: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`({\mathit{vt}}{.}\mathsf{const}~c_{\mathit{vt}})`. * Or: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{ref{.}null}~{\mathit{ht}})`. * Or: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{ref{.}i{\scriptstyle 31}}`. * Or: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{ref{.}func}~x)`. * Or: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{struct{.}new}~x)`. * Or: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{struct{.}new\_default}~x)`. * Or: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{array{.}new}~x)`. * Or: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{array{.}new\_default}~x)`. * Or: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{array{.}new\_fixed}~x~n)`. * Or: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{any{.}convert\_extern}`. * Or: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{extern{.}convert\_any}`. * Or: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{global{.}get}~x)`. + + * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`((\mathsf{mut}~\epsilon), t)`. * Or: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`({\mathsf{i}}{N} {.} {\mathit{binop}})`. + + * :math:`{|\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 64}}|}` must be greater than :math:`0`. + + * :math:`{|\mathsf{add}~\mathsf{sub}~\mathsf{mul}|}` must be greater than :math:`0`. + + * :math:`{\mathsf{i}}{N}` must be contained in :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 64}}`. + + * :math:`{\mathit{binop}}` must be contained in :math:`\mathsf{add}~\mathsf{sub}~\mathsf{mul}`. + + +* :math:`{{\mathit{instr}}^\ast}` is const if and only if: + + + * For all :math:`{\mathit{instr}}` in :math:`{{\mathit{instr}}^\ast}`, + + * :math:`{\mathit{instr}}` is const. + + +* :math:`(\mathsf{type}~{\mathit{rectype}})` is valid with type :math:`{{\mathit{dt}}^\ast}` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be equal to :math:`x`. + + * :math:`{{\mathit{dt}}^\ast}` must be equal to :math:`{{{{\mathrm{roll}}}_{x}^\ast}}{({\mathit{rectype}})}`. + + * Under the context :math:`C{}[{.}\mathsf{types} \mathrel{{=}{\oplus}} {{\mathit{dt}}^\ast}]`, :math:`{\mathit{rectype}}` is valid with type :math:`({\mathsf{ok}}{x})`. + + +* :math:`(\mathsf{local}~t)` is valid with type :math:`({\mathit{init}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}, t)` if and only if: + + + * Either: + + * :math:`{\mathit{init}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{set}`. + + * :math:`{{\mathrm{default}}}_{t}` must be different with :math:`\epsilon`. + + * Or: + + * :math:`{\mathit{init}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{unset}`. + + * :math:`{{\mathrm{default}}}_{t}` must be equal to :math:`\epsilon`. + + +* :math:`(\mathsf{func}~x~{{\mathit{local}}^\ast}~{\mathit{expr}})` is valid with type :math:`C{.}\mathsf{types}{}[x]` if and only if: + + + * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. + + * :math:`{|{{\mathit{local}}^\ast}|}` must be equal to :math:`{|{{{\mathit{lt}}}^\ast}|}`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{func}~{t_1^\ast} \rightarrow {t_2^\ast})`. + + * For all :math:`{{\mathit{lt}}}` in :math:`{{{\mathit{lt}}}^\ast}` and :math:`{\mathit{local}}` in :math:`{{\mathit{local}}^\ast}`, + + * :math:`{\mathit{local}}` is valid with type :math:`{{\mathit{lt}}}`. + + * Under the context :math:`C{}[{.}\mathsf{locals} \mathrel{{=}{\oplus}} {(\mathsf{set}, t_1)^\ast}~{{{\mathit{lt}}}^\ast}]{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]{}[{.}\mathsf{return} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{\mathit{expr}}` is valid with type :math:`{t_2^\ast}`. + + +* :math:`(\mathsf{global}~{\mathit{globaltype}}~{\mathit{expr}})` is valid with type :math:`{\mathit{globaltype}}` if and only if: + + + * :math:`{\mathit{gt}}` is valid. + + * :math:`{\mathit{globaltype}}` must be equal to :math:`({\mathsf{mut}^?}, t)`. + + * :math:`{\mathit{expr}}` is valid with type :math:`t`. + + * :math:`{\mathit{expr}}` is const. + + +* :math:`(\mathsf{table}~{\mathit{tabletype}}~{\mathit{expr}})` is valid with type :math:`{\mathit{tabletype}}` if and only if: + + + * :math:`{\mathit{tt}}` is valid. + + * :math:`{\mathit{tabletype}}` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. + + * :math:`{\mathit{expr}}` is valid with type :math:`{\mathit{rt}}`. + + * :math:`{\mathit{expr}}` is const. + + +* :math:`(\mathsf{memory}~{\mathit{memtype}})` is valid with type :math:`{\mathit{memtype}}` if and only if: + + + * :math:`{\mathit{memtype}}` is valid. + + +* :math:`{\mathit{elemmode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid with type :math:`{\mathit{rt}}` if and only if: + + + * Either: + + * :math:`{\mathit{elemmode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{active}~x~{\mathit{expr}})`. + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}'})`. + + * :math:`{\mathit{rt}}` matches :math:`{\mathit{rt}'}`. + + * :math:`{\mathit{expr}}` is valid with type :math:`\mathsf{i{\scriptstyle 32}}`. + + * :math:`{\mathit{expr}}` is const. + + * Or: + + * :math:`{\mathit{elemmode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{passive}`. * Or: + + * :math:`{\mathit{elemmode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{declare}`. + + +* :math:`(\mathsf{elem}~{\mathit{elemtype}}~{{\mathit{expr}}^\ast}~{\mathit{elemmode}})` is valid with type :math:`{\mathit{elemtype}}` if and only if: + + + * :math:`{\mathit{elemtype}}` is valid. + + * For all :math:`{\mathit{expr}}` in :math:`{{\mathit{expr}}^\ast}`, + + * :math:`{\mathit{expr}}` is valid with type :math:`{\mathit{elemtype}}`. + + * :math:`{\mathit{expr}}` is const. + + * :math:`{\mathit{elemmode}}` is valid with type :math:`{\mathit{elemtype}}`. + + +* :math:`{\mathit{datamode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid with type :math:`\mathsf{ok}` if and only if: + + + * Either: + + * :math:`{\mathit{datamode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{active}~x~{\mathit{expr}})`. + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{mems}{}[x]` must be equal to :math:`{\mathit{mt}}`. + + * :math:`{\mathit{expr}}` is valid with type :math:`\mathsf{i{\scriptstyle 32}}`. + + * :math:`{\mathit{expr}}` is const. + + * Or: + + * :math:`{\mathit{datamode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`\mathsf{passive}`. + + +* :math:`(\mathsf{data}~{b^\ast}~{\mathit{datamode}})` is valid with type :math:`\mathsf{ok}` if and only if: + + + * :math:`{\mathit{datamode}}` is valid with type :math:`\mathsf{ok}`. + + +* :math:`(\mathsf{start}~x)` is valid if and only if: + + + * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. + + * :math:`{\mathrm{expand}}(C{.}\mathsf{funcs}{}[x])` must be equal to :math:`(\mathsf{func}~\epsilon \rightarrow \epsilon)`. + + +* :math:`(\mathsf{import}~{\mathit{name}}_1~{\mathit{name}}_2~{\mathit{xt}})` is valid with type :math:`{\mathit{xt}}` if and only if: + + + * :math:`{\mathit{xt}}` is valid. + + +* :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid with type :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` if and only if: + + + * Either: + + * :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{func}~x)`. + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{func}~{\mathit{dt}})`. + + * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{funcs}{}[x]` must be equal to :math:`{\mathit{dt}}`. + + * Or: + + * :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{global}~x)`. + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{global}~{\mathit{gt}})`. + + * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`{\mathit{gt}}`. * Or: + + * :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{table}~x)`. + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{table}~{\mathit{tt}})`. + + * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`{\mathit{tt}}`. * Or: + + * :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{mem}~x)`. + + * :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`(\mathsf{mem}~{\mathit{mt}})`. + + * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{mems}{}[x]` must be equal to :math:`{\mathit{mt}}`. + + +* :math:`(\mathsf{export}~{\mathit{name}}~{\mathit{externidx}})` is valid with type :math:`{\mathit{name}}` and :math:`{\mathit{xt}}` if and only if: + + + * :math:`{\mathit{externidx}}` is valid with type :math:`{\mathit{xt}}`. + + +* :math:`{{\mathit{global}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is valid with type :math:`{{\mathit{globaltype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` if and only if: + + + * Either: + + * :math:`{{\mathit{global}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`\epsilon`. + + * :math:`{{\mathit{globaltype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` must be equal to :math:`\epsilon`. + + * Or: + + * :math:`{{\mathit{global}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`{\mathit{global}}_1~{{\mathit{global}}^\ast}`. + + * :math:`{{\mathit{globaltype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` must be equal to :math:`{\mathit{gt}}_1~{{\mathit{gt}}^\ast}`. + + * :math:`{\mathit{global}}` is valid with type :math:`{\mathit{gt}}_1`. + + * Under the context :math:`C{}[{.}\mathsf{globals} \mathrel{{=}{\oplus}} {\mathit{gt}}_1]`, :math:`{{\mathit{global}}^\ast}` is valid with type :math:`{{\mathit{gt}}^\ast}`. + + +* :math:`{{\mathit{type}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is valid with type :math:`{{\mathit{deftype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` if and only if: + + + * Either: + + * :math:`{{\mathit{type}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`\epsilon`. + + * :math:`{{\mathit{deftype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` must be equal to :math:`\epsilon`. + + * Or: + + * :math:`{{\mathit{type}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`{\mathit{type}}_1~{{\mathit{type}}^\ast}`. + + * :math:`{{\mathit{deftype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` must be equal to :math:`{{\mathit{dt}}_1^\ast}~{{\mathit{dt}}^\ast}`. + + * :math:`{\mathit{type}}_1` is valid with type :math:`{{\mathit{dt}}_1^\ast}`. + + * Under the context :math:`C{}[{.}\mathsf{types} \mathrel{{=}{\oplus}} {{\mathit{dt}}_1^\ast}]`, :math:`{{\mathit{type}}^\ast}` is valid with type :math:`{{\mathit{dt}}^\ast}`. + + +* :math:`(\mathsf{module}~{{\mathit{type}}^\ast}~{{\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})` is valid with type :math:`{{\mathrm{clos}}}_{C}({{\mathit{xt}}_{\mathsf{i}}^\ast} \rightarrow {{\mathit{xt}}_{\mathsf{e}}^\ast})` if and only if: + + + * :math:`{|{{\mathit{xt}}_{\mathsf{i}}^\ast}|}` must be equal to :math:`{|{{\mathit{import}}^\ast}|}`. + + * :math:`{|{{\mathit{tt}}^\ast}|}` must be equal to :math:`{|{{\mathit{table}}^\ast}|}`. + + * :math:`{|{{\mathit{mt}}^\ast}|}` must be equal to :math:`{|{{\mathit{mem}}^\ast}|}`. + + * :math:`{|{{\mathit{func}}^\ast}|}` must be equal to :math:`{|{{\mathit{dt}}^\ast}|}`. + + * :math:`{|{{\mathit{rt}}^\ast}|}` must be equal to :math:`{|{{\mathit{elem}}^\ast}|}`. + + * :math:`{|{{\mathit{ok}}^\ast}|}` must be equal to :math:`{|{{\mathit{data}}^\ast}|}`. + + * :math:`{|{{\mathit{nm}}^\ast}|}` must be equal to :math:`{|{{\mathit{export}}^\ast}|}`. + + * :math:`{|{{\mathit{xt}}_{\mathsf{e}}^\ast}|}` must be equal to :math:`{|{{\mathit{export}}^\ast}|}`. + + * Under the context :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{recs}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon,\; \mathsf{return}~\epsilon,\; \mathsf{refs}~\epsilon \}\end{array}`, :math:`{{\mathit{type}}^\ast}` is valid with type :math:`{{\mathit{dt}'}^\ast}`. + + * For all :math:`{\mathit{import}}` in :math:`{{\mathit{import}}^\ast}` and :math:`{\mathit{xt}}_{\mathsf{i}}` in :math:`{{\mathit{xt}}_{\mathsf{i}}^\ast}`, + + * Under the context :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~{{\mathit{dt}'}^\ast},\; \mathsf{recs}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon,\; \mathsf{return}~\epsilon,\; \mathsf{refs}~\epsilon \}\end{array}`, :math:`{\mathit{import}}` is valid with type :math:`{\mathit{xt}}_{\mathsf{i}}`. + + * Under the context :math:`{C'}`, :math:`{{\mathit{global}}^\ast}` is valid with type :math:`{{\mathit{gt}}^\ast}`. + + * For all :math:`{\mathit{table}}` in :math:`{{\mathit{table}}^\ast}` and :math:`{\mathit{tt}}` in :math:`{{\mathit{tt}}^\ast}`, + + * Under the context :math:`{C'}`, :math:`{\mathit{table}}` is valid with type :math:`{\mathit{tt}}`. + + * For all :math:`{\mathit{mem}}` in :math:`{{\mathit{mem}}^\ast}` and :math:`{\mathit{mt}}` in :math:`{{\mathit{mt}}^\ast}`, + + * Under the context :math:`{C'}`, :math:`{\mathit{mem}}` is valid with type :math:`{\mathit{mt}}`. + + * For all :math:`{\mathit{dt}}` in :math:`{{\mathit{dt}}^\ast}` and :math:`{\mathit{func}}` in :math:`{{\mathit{func}}^\ast}`, + + * :math:`{\mathit{func}}` is valid with type :math:`{\mathit{dt}}`. + + * For all :math:`{\mathit{elem}}` in :math:`{{\mathit{elem}}^\ast}` and :math:`{\mathit{rt}}` in :math:`{{\mathit{rt}}^\ast}`, + + * :math:`{\mathit{elem}}` is valid with type :math:`{\mathit{rt}}`. + + * For all :math:`{\mathit{data}}` in :math:`{{\mathit{data}}^\ast}` and :math:`{\mathit{ok}}` in :math:`{{\mathit{ok}}^\ast}`, + + * :math:`{\mathit{data}}` is valid with type :math:`{\mathit{ok}}`. + + * If :math:`{\mathit{start}}` is defined, + + * :math:`{\mathit{start}}` is valid. + + * For all :math:`{\mathit{export}}` in :math:`{{\mathit{export}}^\ast}` and :math:`{\mathit{nm}}` in :math:`{{\mathit{nm}}^\ast}` and :math:`{\mathit{xt}}_{\mathsf{e}}` in :math:`{{\mathit{xt}}_{\mathsf{e}}^\ast}`, + + * :math:`{\mathit{export}}` is valid with type :math:`{\mathit{nm}}` and :math:`{\mathit{xt}}_{\mathsf{e}}`. + + * YetI: $disjoint_(syntax name, nm*{nm : name}). + + * :math:`C` must be equal to :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~{{\mathit{dt}'}^\ast},\; \mathsf{recs}~\epsilon,\; \mathsf{funcs}~{{\mathit{dt}}_{\mathsf{i}}^\ast}~{{\mathit{dt}}^\ast},\; \mathsf{globals}~{{\mathit{gt}}_{\mathsf{i}}^\ast}~{{\mathit{gt}}^\ast},\; \mathsf{tables}~{{\mathit{tt}}_{\mathsf{i}}^\ast}~{{\mathit{tt}}^\ast},\; \mathsf{mems}~{{\mathit{mt}}_{\mathsf{i}}^\ast}~{{\mathit{mt}}^\ast},\; \mathsf{elems}~{{\mathit{rt}}^\ast},\; \mathsf{datas}~{{\mathit{ok}}^\ast},\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon,\; \mathsf{return}~\epsilon,\; \mathsf{refs}~{x^\ast} \}\end{array}`. + + * :math:`{C'}` must be equal to :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~{{\mathit{dt}'}^\ast},\; \mathsf{recs}~\epsilon,\; \mathsf{funcs}~{{\mathit{dt}}_{\mathsf{i}}^\ast}~{{\mathit{dt}}^\ast},\; \mathsf{globals}~{{\mathit{gt}}_{\mathsf{i}}^\ast},\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon,\; \mathsf{return}~\epsilon,\; \mathsf{refs}~{x^\ast} \}\end{array}`. + + * :math:`{x^\ast}` must be equal to `$funcidx_nonfuncs(YetE (`%%%%%`_nonfuncs(global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data*{data : data})))`. + + * :math:`{{\mathit{dt}}_{\mathsf{i}}^\ast}` must be equal to :math:`{\mathrm{funcs}}({{\mathit{xt}}_{\mathsf{i}}^\ast})`. + + * :math:`{{\mathit{gt}}_{\mathsf{i}}^\ast}` must be equal to :math:`{\mathrm{globals}}({{\mathit{xt}}_{\mathsf{i}}^\ast})`. + + * :math:`{{\mathit{tt}}_{\mathsf{i}}^\ast}` must be equal to :math:`{\mathrm{tables}}({{\mathit{xt}}_{\mathsf{i}}^\ast})`. + + * :math:`{{\mathit{mt}}_{\mathsf{i}}^\ast}` must be equal to :math:`{\mathrm{mems}}({{\mathit{xt}}_{\mathsf{i}}^\ast})`. + + +* :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid with type :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast} \rightarrow {{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 3}}}^\ast}` if and only if: + + + * Either: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{i{\scriptstyle 32}} {.} \mathsf{add})`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` must be equal to :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 3}}}^\ast}` must be equal to :math:`\mathsf{i{\scriptstyle 32}}`. + + * Or: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{global{.}get}~x)`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` must be equal to :math:`\epsilon`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 3}}}^\ast}` must be equal to :math:`t`. + + * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. + + * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`({\mathsf{mut}^?}, t)`. * Or: + + * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`(\mathsf{block}~{\mathit{blocktype}}~{{\mathit{instr}}^\ast})`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` must be equal to :math:`{t_1^\ast}`. + + * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 3}}}^\ast}` must be equal to :math:`{t_2^\ast}`. + + * :math:`{\mathit{blocktype}}` is valid with type :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}`. + + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + + +:math:`{\mathrm{Ki}}` +..................... + + +1. Return :math:`1024`. + + +:math:`{\mathrm{min}}(n_{\mathit{u{\kern-0.1em\scriptstyle 0}}}, n_{\mathit{u{\kern-0.1em\scriptstyle 1}}})` +............................................................................................................ + + +1. If :math:`n_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`0`, then: + + a. Return :math:`0`. + +#. If :math:`n_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is :math:`0`, then: + + a. Return :math:`0`. + +#. Assert: Due to validation, :math:`n_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is greater than or equal to :math:`1`. + +#. Let :math:`i` be :math:`n_{\mathit{u{\kern-0.1em\scriptstyle 0}}} - 1`. + +#. Assert: Due to validation, :math:`n_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is greater than or equal to :math:`1`. + +#. Let :math:`j` be :math:`n_{\mathit{u{\kern-0.1em\scriptstyle 1}}} - 1`. + +#. Return :math:`{\mathrm{min}}(i, j)`. + + +:math:`{\Sigma}\, {n_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` +................................................................... + + +1. If :math:`{n_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`0`. + +#. Let :math:`n~{{n'}^\ast}` be :math:`{n_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`n + {\Sigma}\, {{n'}^\ast}`. + + +:math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` +........................................................ + + +1. If :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Assert: Due to validation, :math:`{|{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}|}` is :math:`1`. + +#. Let :math:`w` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`w`. + + +:math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}` +..................................................... + + +1. If :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}` is not defined, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`w` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}`. + +#. Return :math:`w`. + + +:math:`{\bigoplus}\, {X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` +...................................................................... + + +1. If :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{w^\ast}~{{{w'}^\ast}^\ast}` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{w^\ast}~{\bigoplus}\, {{{w'}^\ast}^\ast}`. + + +:math:`{\bigoplus}\, {X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` +...................................................................... + + +1. If :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{w^{n}}~{({{w'}^{n}})^\ast}` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{w^{n}}~{\bigoplus}\, {({{w'}^{n}})^\ast}`. + + +:math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}~{\mathrm{disjoint}}` +............................................................................ + + +1. If :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return true. + +#. Let :math:`w~{{w'}^\ast}` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return not `w <- w'*` and :math:`{{w'}^\ast}~{\mathrm{disjoint}}`. + + +:math:`{{\mathrm{setminus{\kern-0.1em\scriptstyle 1}}}}_{{\mathit{TODO}}}(w, {X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +............................................................................................................................... + + +1. If :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`w`. + +#. Let :math:`w_1~{{w'}^\ast}` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`w` is :math:`w_1`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`w_1~{{w'}^\ast}` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{{\mathrm{setminus{\kern-0.1em\scriptstyle 1}}}}_{{\mathit{TODO}}}(w, {{w'}^\ast})`. + + +:math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast} \setminus {w^\ast}` +........................................................................... + + +1. If :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`w_1~{{w'}^\ast}` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{{\mathrm{setminus{\kern-0.1em\scriptstyle 1}}}}_{{\mathit{TODO}}}(w_1, {w^\ast})~{{w'}^\ast} \setminus {w^\ast}`. + + +:math:`{{\mathrm{setproduct{\kern-0.1em\scriptstyle 2}}}}_{{\mathit{TODO}}}(w_1, {X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +................................................................................................................................... + + +1. If :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{{w'}^\ast}~{{w^\ast}^\ast}` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`w_1~{{w'}^\ast}~{{\mathrm{setproduct{\kern-0.1em\scriptstyle 2}}}}_{{\mathit{TODO}}}(w_1, {{w^\ast}^\ast})`. + + +:math:`{{\mathrm{setproduct{\kern-0.1em\scriptstyle 1}}}}_{{\mathit{TODO}}}({X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}, {{w^\ast}^\ast})` +............................................................................................................................................... + + +1. If :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`w_1~{{w'}^\ast}` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{{\mathrm{setproduct{\kern-0.1em\scriptstyle 2}}}}_{{\mathit{TODO}}}(w_1, {{w^\ast}^\ast})~{{\mathrm{setproduct{\kern-0.1em\scriptstyle 1}}}}_{{\mathit{TODO}}}({{w'}^\ast}, {{w^\ast}^\ast})`. + + +:math:`\Large\times~{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` +..................................................................... + + +1. If :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`{w_1^\ast}~{{w^\ast}^\ast}` be :math:`{X_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{{\mathrm{setproduct{\kern-0.1em\scriptstyle 1}}}}_{{\mathit{TODO}}}({w_1^\ast}, \Large\times~{{w^\ast}^\ast})`. + + +:math:`{\mathrm{signif}}(N_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +.................................................................... + + +1. If :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`32`, then: + + a. Return :math:`23`. + +#. Assert: Due to validation, :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`64`. + +#. Return :math:`52`. + + +:math:`{\mathrm{expon}}(N_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +................................................................... + + +1. If :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`32`, then: + + a. Return :math:`8`. + +#. Assert: Due to validation, :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`64`. + +#. Return :math:`11`. + + +:math:`M` +......... + + +1. Return :math:`{\mathrm{signif}}(N)`. + + +:math:`E` +......... + + +1. Return :math:`{\mathrm{expon}}(N)`. + + +:math:`{+0}` +............ + + +1. Return :math:`({+((0 + 0 \cdot {2^{{-M}}}) \cdot {2^{n}})})`. + + +:math:`{+1}` +............ + + +1. Return :math:`({+((1 + 1 \cdot {2^{{-M}}}) \cdot {2^{0}})})`. + + +:math:`{{\mathrm{canon}}}_{N}` +.............................. + + +1. Return :math:`{2^{{\mathrm{signif}}(N) - 1}}`. + + +:math:`{\mathrm{cont}}(b)` +.......................... + + +1. Assert: Due to validation, :math:`128` is less than :math:`b`. + +#. Assert: Due to validation, :math:`b` is less than :math:`192`. + +#. Return :math:`b - 128`. + + +:math:`\mathsf{anyref}` +....................... + + +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{any})`. + + +:math:`\mathsf{eqref}` +...................... + + +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{eq})`. + + +:math:`\mathsf{i{\scriptstyle 31}ref}` +...................................... + + +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{i{\scriptstyle 31}})`. + + +:math:`\mathsf{structref}` +.......................... + + +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{struct})`. + + +:math:`\mathsf{arrayref}` +......................... + + +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{array})`. + + +:math:`\mathsf{funcref}` +........................ + + +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{func})`. + + +:math:`\mathsf{externref}` +.......................... + + +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{extern})`. + + +:math:`\mathsf{nullref}` +........................ + + +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{none})`. + + +:math:`\mathsf{nullfuncref}` +............................ + + +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{nofunc})`. + + +:math:`\mathsf{nullexternref}` +.............................. + + +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{noextern})`. + + +:math:`{|{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}|}` +...................................................................... + + +1. If :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{i{\scriptstyle 32}}`, then: + + a. Return :math:`32`. + +#. If :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{i{\scriptstyle 64}}`, then: + + a. Return :math:`64`. + +#. If :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{f{\scriptstyle 32}}`, then: + + a. Return :math:`32`. + +#. Assert: Due to validation, :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{f{\scriptstyle 64}}`. + +#. Return :math:`64`. + + +:math:`{|\mathsf{v{\scriptstyle 128}}|}` +........................................ + + +1. Return :math:`128`. + + +:math:`{|{\mathit{packtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}|}` +....................................................................... + + +1. If :math:`{\mathit{packtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{i{\scriptstyle 8}}`, then: + + a. Return :math:`8`. + +#. Assert: Due to validation, :math:`{\mathit{packtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{i{\scriptstyle 16}}`. + +#. Return :math:`16`. + + +:math:`{|{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}|}` +....................................................................... + + +1. If the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is numtype, then: + + a. Let :math:`{\mathit{numtype}}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{|{\mathit{numtype}}|}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is packtype. + +#. Let :math:`{\mathit{packtype}}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{|{\mathit{packtype}}|}`. + + +:math:`{|{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}|}` +.......................................................................... + + +1. If the type of :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is numtype, then: + + a. Let :math:`{\mathit{numtype}}` be :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{|{\mathit{numtype}}|}`. + +#. If the type of :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is vectype, then: + + a. Let :math:`{\mathit{vectype}}` be :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{|{\mathit{vectype}}|}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is packtype. + +#. Let :math:`{\mathit{packtype}}` be :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{|{\mathit{packtype}}|}`. + + +:math:`{\mathrm{lanetype}}({{\mathsf{i}}{N}}{\mathsf{x}}{N})` +............................................................. + + +1. Return :math:`{\mathsf{i}}{N}`. + + +:math:`N` +......... + + +1. Return :math:`{|{\mathit{nt}}|}`. + + +:math:`N_1` +........... + + +1. Return :math:`{|{\mathit{nt}}|}`. + + +:math:`N_2` +........... + + +1. Return :math:`{|{\mathit{nt}}|}`. + + +:math:`N` +......... + + +1. Return :math:`{|{\mathit{pt}}|}`. + + +:math:`N` +......... + + +1. Return :math:`{|{\mathit{lt}}|}`. + + +:math:`N_1` +........... + + +1. Return :math:`{|{\mathit{lt}}|}`. + + +:math:`N_2` +........... + + +1. Return :math:`{|{\mathit{lt}}|}`. + + +:math:`0` +......... + + +1. If the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is Inn, then: + + a. Return :math:`0`. + +#. Assert: Due to validation, the type of :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is Fnn. + +#. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{+0}`. + + +:math:`{\mathrm{dim}}({{\mathsf{i}}{N}}{\mathsf{x}}{N})` +........................................................ + + +1. Return :math:`N`. + + +:math:`{|{{\mathsf{i}}{N}}{\mathsf{x}}{N}|}` +............................................ + + +1. Return :math:`{|{\mathsf{i}}{N}|} \cdot N`. + + +:math:`{\mathsf{i}}{N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}` +............................................................... + + +1. If :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`32`, then: + + a. Return :math:`\mathsf{i{\scriptstyle 32}}`. + +#. Assert: Due to validation, :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`64`. + +#. Return :math:`\mathsf{i{\scriptstyle 64}}`. + + +:math:`{\mathsf{f}}{N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}` +............................................................... + + +1. If :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`32`, then: + + a. Return :math:`\mathsf{f{\scriptstyle 32}}`. + +#. Assert: Due to validation, :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`64`. + +#. Return :math:`\mathsf{f{\scriptstyle 64}}`. + + +:math:`{\mathsf{i}}{N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}` +............................................................... + + +1. If :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`8`, then: + + a. Return :math:`\mathsf{i{\scriptstyle 8}}`. + +#. If :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`16`, then: + + a. Return :math:`\mathsf{i{\scriptstyle 16}}`. + +#. If :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`32`, then: + + a. Return :math:`\mathsf{i{\scriptstyle 32}}`. + +#. Assert: Due to validation, :math:`N_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`64`. + +#. Return :math:`\mathsf{i{\scriptstyle 64}}`. + + +:math:`{\mathrm{unpack}}({\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +...................................................................................... + + +1. If the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is numtype, then: + + a. Let :math:`{\mathit{numtype}}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathit{numtype}}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is packtype. + +#. Return :math:`\mathsf{i{\scriptstyle 32}}`. + + +:math:`{\mathrm{unpack}}({\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +......................................................................................... + + +1. If the type of :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valtype, then: + + a. Let :math:`{\mathit{valtype}}` be :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathit{valtype}}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is packtype. + +#. Return :math:`\mathsf{i{\scriptstyle 32}}`. + + +:math:`{\mathrm{unpack}}({\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +......................................................................................... + + +1. If the type of :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is numtype, then: + + a. Let :math:`{\mathit{numtype}}` be :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathit{numtype}}`. + +#. If the type of :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is packtype, then: + + a. Return :math:`\mathsf{i{\scriptstyle 32}}`. + + +:math:`{\mathrm{unpack}}({\mathit{vectype}})` +............................................. + + +1. Return :math:`{\mathit{vectype}}`. + + +:math:`{\mathrm{unpack}}({\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +......................................................................................... + + +1. If the type of :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is consttype, then: + + a. Let :math:`{\mathit{consttype}}` be :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathit{consttype}}`. + +#. If the type of :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is packtype, then: + + a. Return :math:`\mathsf{i{\scriptstyle 32}}`. + +#. If the type of :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is lanetype, then: + + a. Let :math:`{\mathit{lanetype}}` be :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{unpack}}({\mathit{lanetype}})`. + + +:math:`{\mathrm{sx}}({\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +..................................................................................... + + +1. If the type of :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is consttype, then: + + a. Return :math:`\epsilon`. + +#. Assert: Due to validation, the type of :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is packtype. + +#. Return :math:`\mathsf{s}`. + + +:math:`{\mathit{consttype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}{.}\mathsf{const}~c` +....................................................................................... + + +1. If the type of :math:`{\mathit{consttype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is numtype, then: + + a. Let :math:`{\mathit{numtype}}` be :math:`{\mathit{consttype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`({\mathit{numtype}}{.}\mathsf{const}~c)`. + +#. Assert: Due to validation, the type of :math:`{\mathit{consttype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is vectype. + +#. Let :math:`{\mathit{vectype}}` be :math:`{\mathit{consttype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`({\mathit{vectype}}{.}\mathsf{const}~c)`. + + +:math:`{\mathrm{unpack}}({{\mathsf{i}}{N}}{\mathsf{x}}{N})` +........................................................... + + +1. Return :math:`{\mathrm{unpack}}({\mathsf{i}}{N})`. + + +:math:`(\mathsf{ref}~{\mathsf{null}}{{{}_{1}^?}}~{\mathit{ht}}_1) \setminus (\mathsf{ref}~(\mathsf{null}~{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?})~{\mathit{ht}}_2)` +....................................................................................................................................................................... + + +1. If :math:`{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}` is :math:`()`, then: + + a. Return :math:`(\mathsf{ref}~(\mathsf{null}~\epsilon)~{\mathit{ht}}_1)`. + +#. Assert: Due to validation, :math:`{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}` is not defined. + +#. Return :math:`(\mathsf{ref}~{\mathsf{null}}{{{}_{1}^?}}~{\mathit{ht}}_1)`. + + +:math:`x` +......... + + +1. Return :math:`x`. + + +:math:`{\mathrm{free}}_{\mathit{opt}}({{\mathit{free}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?})` +................................................................................................... + + +1. If :math:`{{\mathit{free}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}` is not defined, then: + + a. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + +#. Let :math:`{\mathit{free}}` be :math:`{{\mathit{free}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}`. + +#. Return :math:`{\mathit{free}}`. + + +:math:`{\mathrm{free}}_{\mathit{list}}({{\mathit{free}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +....................................................................................................... + + +1. If :math:`{{\mathit{free}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + +#. Return `YetE (free ++ $free_list(free'*{free' : free}))`. + + +:math:`{\mathrm{free}}_{\mathit{typeidx}}({\mathit{typeidx}})` +.............................................................. + + +1. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~{\mathit{typeidx}},\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + + +:math:`{\mathrm{free}}_{\mathit{funcidx}}({\mathit{funcidx}})` +.............................................................. + + +1. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~{\mathit{funcidx}},\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + + +:math:`{\mathrm{free}}_{\mathit{globalidx}}({\mathit{globalidx}})` +.................................................................. + + +1. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~{\mathit{globalidx}},\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + + +:math:`{\mathrm{free}}_{\mathit{tableidx}}({\mathit{tableidx}})` +................................................................ + + +1. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~{\mathit{tableidx}},\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + + +:math:`{\mathrm{free}}_{\mathit{memidx}}({\mathit{memidx}})` +............................................................ + + +1. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~{\mathit{memidx}},\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + + +:math:`{\mathrm{free}}_{\mathit{elemidx}}({\mathit{elemidx}})` +.............................................................. + + +1. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~{\mathit{elemidx}},\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + + +:math:`{\mathrm{free}}_{\mathit{dataidx}}({\mathit{dataidx}})` +.............................................................. + + +1. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~{\mathit{dataidx}},\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + + +:math:`{\mathrm{free}}_{\mathit{localidx}}({\mathit{localidx}})` +................................................................ + + +1. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~{\mathit{localidx}},\; \mathsf{labels}~\epsilon \}\end{array}`. + + +:math:`{\mathrm{free}}_{\mathit{labelidx}}({\mathit{labelidx}})` +................................................................ + + +1. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~{\mathit{labelidx}} \}\end{array}`. + + +:math:`{\mathrm{free}}_{\mathit{externidx}}({\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +.......................................................................................................... + + +1. If :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{func}`, then: + + a. Let :math:`(\mathsf{func}~{\mathit{funcidx}})` be :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{funcidx}}({\mathit{funcidx}})`. + +#. If :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{global}`, then: + + a. Let :math:`(\mathsf{global}~{\mathit{globalidx}})` be :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{globalidx}}({\mathit{globalidx}})`. + +#. If :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{table}`, then: + + a. Let :math:`(\mathsf{table}~{\mathit{tableidx}})` be :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{tableidx}}({\mathit{tableidx}})`. + +#. Assert: Due to validation, :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{mem}`. + +#. Let :math:`(\mathsf{mem}~{\mathit{memidx}})` be :math:`{\mathit{externidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{\mathrm{free}}_{\mathit{memidx}}({\mathit{memidx}})`. + + +:math:`{\mathrm{free}}_{\mathit{numtype}}({\mathit{numtype}})` +.............................................................. + + +1. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + + +:math:`{\mathrm{free}}_{\mathit{packtype}}({\mathit{packtype}})` +................................................................ + + +1. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + + +:math:`{\mathrm{free}}_{\mathit{lanetype}}({\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +........................................................................................................ + + +1. If the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is numtype, then: + + a. Let :math:`{\mathit{numtype}}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{numtype}}({\mathit{numtype}})`. + +#. Assert: Due to validation, the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is packtype. + +#. Let :math:`{\mathit{packtype}}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{\mathrm{free}}_{\mathit{packtype}}({\mathit{packtype}})`. + + +:math:`{\mathrm{free}}_{\mathit{vectype}}({\mathit{vectype}})` +.............................................................. + + +1. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + + +:math:`{\mathrm{free}}_{\mathit{consttype}}({\mathit{consttype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +.......................................................................................................... + + +1. If the type of :math:`{\mathit{consttype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is numtype, then: + + a. Let :math:`{\mathit{numtype}}` be :math:`{\mathit{consttype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{numtype}}({\mathit{numtype}})`. + +#. Assert: Due to validation, the type of :math:`{\mathit{consttype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is vectype. + +#. Let :math:`{\mathit{vectype}}` be :math:`{\mathit{consttype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{\mathrm{free}}_{\mathit{vectype}}({\mathit{vectype}})`. + + +:math:`{\mathrm{free}}_{\mathit{absheaptype}}({\mathit{absheaptype}})` +...................................................................... + + +1. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + + +:math:`{\mathrm{free}}_{\mathit{rectype}}((\mathsf{rec}~{{\mathit{subtype}}^\ast}))` +.................................................................................... + + +1. Return :math:`{\mathrm{free}}_{\mathit{list}}({{\mathrm{free}}_{\mathit{subtype}}({\mathit{subtype}})^\ast})`. + + +:math:`{\mathrm{free}}_{\mathit{deftype}}(({\mathit{rectype}} {.} n))` +...................................................................... + + +1. Return :math:`{\mathrm{free}}_{\mathit{rectype}}({\mathit{rectype}})`. + + +:math:`{\mathrm{free}}_{\mathit{typeuse}}({\mathit{typeuse}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +...................................................................................................... + + +1. If :math:`{\mathit{typeuse}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case , then: + + a. Let :math:`{\mathit{typeidx}}` be :math:`{\mathit{typeuse}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{typeidx}}({\mathit{typeidx}})`. + +#. If :math:`{\mathit{typeuse}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{rec}`, then: + + a. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{typeuse}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is deftype. + +#. Let :math:`{\mathit{deftype}}` be :math:`{\mathit{typeuse}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{\mathrm{free}}_{\mathit{deftype}}({\mathit{deftype}})`. + + +:math:`{\mathrm{free}}_{\mathit{heaptype}}({\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +........................................................................................................ + + +1. If the type of :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is absheaptype, then: + + a. Let :math:`{\mathit{absheaptype}}` be :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{absheaptype}}({\mathit{absheaptype}})`. + +#. Assert: Due to validation, the type of :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is typeuse. + +#. Let :math:`{\mathit{typeuse}}` be :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{\mathrm{free}}_{\mathit{typeuse}}({\mathit{typeuse}})`. + + +:math:`{\mathrm{free}}_{\mathit{reftype}}((\mathsf{ref}~{\mathsf{null}^?}~{\mathit{heaptype}}))` +................................................................................................ + + +1. Return :math:`{\mathrm{free}}_{\mathit{heaptype}}({\mathit{heaptype}})`. + + +:math:`{\mathrm{free}}_{\mathit{valtype}}({\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +...................................................................................................... + + +1. If the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is numtype, then: + + a. Let :math:`{\mathit{numtype}}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{numtype}}({\mathit{numtype}})`. + +#. If the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is vectype, then: + + a. Let :math:`{\mathit{vectype}}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{vectype}}({\mathit{vectype}})`. + +#. If the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is reftype, then: + + a. Let :math:`{\mathit{reftype}}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{reftype}}({\mathit{reftype}})`. + +#. Assert: Due to validation, :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{bot}`. + +#. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + + +:math:`{\mathrm{free}}_{\mathit{resulttype}}({{\mathit{valtype}}^\ast})` +........................................................................ + + +1. Return :math:`{\mathrm{free}}_{\mathit{list}}({{\mathrm{free}}_{\mathit{valtype}}({\mathit{valtype}})^\ast})`. + + +:math:`{\mathrm{free}}_{\mathit{storagetype}}({\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +.............................................................................................................. + + +1. If the type of :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valtype, then: + + a. Let :math:`{\mathit{valtype}}` be :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{valtype}}({\mathit{valtype}})`. + +#. Assert: Due to validation, the type of :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is packtype. + +#. Let :math:`{\mathit{packtype}}` be :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{\mathrm{free}}_{\mathit{packtype}}({\mathit{packtype}})`. + + +:math:`{\mathrm{free}}_{\mathit{fieldtype}}(({\mathsf{mut}^?}, {\mathit{storagetype}}))` +........................................................................................ + + +1. Return :math:`{\mathrm{free}}_{\mathit{storagetype}}({\mathit{storagetype}})`. + + +:math:`{\mathrm{free}}_{\mathit{functype}}({\mathit{resulttype}}_1 \rightarrow {\mathit{resulttype}}_2)` +........................................................................................................ + + +1. Return `YetE ($free_resulttype(resulttype_1) ++ $free_resulttype(resulttype_2))`. + + +:math:`{\mathrm{free}}_{\mathit{structtype}}({{\mathit{fieldtype}}^\ast})` +.......................................................................... + + +1. Return :math:`{\mathrm{free}}_{\mathit{list}}({{\mathrm{free}}_{\mathit{fieldtype}}({\mathit{fieldtype}})^\ast})`. + + +:math:`{\mathrm{free}}_{\mathit{arraytype}}({\mathit{fieldtype}})` +.................................................................. + + +1. Return :math:`{\mathrm{free}}_{\mathit{fieldtype}}({\mathit{fieldtype}})`. + + +:math:`{\mathrm{free}}_{\mathit{comptype}}({\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +........................................................................................................ + + +1. If :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{struct}`, then: + + a. Let :math:`(\mathsf{struct}~{\mathit{structtype}})` be :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{structtype}}({\mathit{structtype}})`. + +#. If :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{array}`, then: + + a. Let :math:`(\mathsf{array}~{\mathit{arraytype}})` be :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{arraytype}}({\mathit{arraytype}})`. + +#. Assert: Due to validation, :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{func}`. + +#. Let :math:`(\mathsf{func}~{\mathit{functype}})` be :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{\mathrm{free}}_{\mathit{functype}}({\mathit{functype}})`. + + +:math:`{\mathrm{free}}_{\mathit{subtype}}((\mathsf{sub}~{\mathsf{final}^?}~{{\mathit{typeuse}}^\ast}~{\mathit{comptype}}))` +........................................................................................................................... + + +1. Return `YetE ($free_list($free_typeuse(typeuse)*{typeuse : typeuse}) ++ $free_comptype(comptype))`. + + +:math:`{\mathrm{free}}_{\mathit{globaltype}}(({\mathsf{mut}^?}, {\mathit{valtype}}))` +..................................................................................... + + +1. Return :math:`{\mathrm{free}}_{\mathit{valtype}}({\mathit{valtype}})`. + + +:math:`{\mathrm{free}}_{\mathit{tabletype}}(({\mathit{limits}}, {\mathit{reftype}}))` +..................................................................................... + + +1. Return :math:`{\mathrm{free}}_{\mathit{reftype}}({\mathit{reftype}})`. + + +:math:`{\mathrm{free}}_{\mathit{memtype}}((\mathsf{page}~{\mathit{limits}}))` +............................................................................. + + +1. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + + +:math:`{\mathrm{free}}_{\mathit{elemtype}}({\mathit{reftype}})` +............................................................... + + +1. Return :math:`{\mathrm{free}}_{\mathit{reftype}}({\mathit{reftype}})`. + + +:math:`{\mathrm{free}}_{\mathit{datatype}}(\mathsf{ok})` +........................................................ + + +1. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + + +:math:`{\mathrm{free}}_{\mathit{externtype}}({\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +............................................................................................................ + + +1. If :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{func}`, then: + + a. Let :math:`(\mathsf{func}~{\mathit{typeuse}})` be :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{typeuse}}({\mathit{typeuse}})`. + +#. If :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{global}`, then: + + a. Let :math:`(\mathsf{global}~{\mathit{globaltype}})` be :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{globaltype}}({\mathit{globaltype}})`. + +#. If :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{table}`, then: + + a. Let :math:`(\mathsf{table}~{\mathit{tabletype}})` be :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{tabletype}}({\mathit{tabletype}})`. + +#. Assert: Due to validation, :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{mem}`. + +#. Let :math:`(\mathsf{mem}~{\mathit{memtype}})` be :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{\mathrm{free}}_{\mathit{memtype}}({\mathit{memtype}})`. + + +:math:`{\mathrm{free}}_{\mathit{moduletype}}({{\mathit{externtype}}_1^\ast} \rightarrow {{\mathit{externtype}}_2^\ast})` +........................................................................................................................ + + +1. Return `YetE ($free_list($free_externtype(externtype_1)*{externtype_1 : externtype}) ++ $free_list($free_externtype(externtype_2)*{externtype_2 : externtype}))`. + + +:math:`{\mathrm{free}}_{\mathit{blocktype}}({\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +.......................................................................................................... + + +1. If :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case , then: + + a. Let :math:`{{\mathit{valtype}}^?}` be :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{opt}}({{\mathrm{free}}_{\mathit{valtype}}({\mathit{valtype}})^?})`. + +#. Assert: Due to validation, :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case . + +#. Let :math:`{\mathit{funcidx}}` be :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{\mathrm{free}}_{\mathit{funcidx}}({\mathit{funcidx}})`. + + +:math:`{\mathrm{free}}_{\mathit{shape}}({{\mathit{lanetype}}}{\mathsf{x}}{{\mathit{dim}}})` +........................................................................................... + + +1. Return :math:`{\mathrm{free}}_{\mathit{lanetype}}({\mathit{lanetype}})`. + + +:math:`{\mathrm{shift}}_{\mathit{labelidxs}}({{\mathit{labelidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` +................................................................................................................. + + +1. If :math:`{{\mathit{labelidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`\epsilon`. + +#. Let :math:`n_0~{{\mathit{labelidx}'}^\ast}` be :math:`{{\mathit{labelidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. If :math:`n_0` is :math:`0`, then: + + a. Return :math:`{\mathrm{shift}}_{\mathit{labelidxs}}({{\mathit{labelidx}'}^\ast})`. + +#. Let :math:`{\mathit{labelidx}}~{{\mathit{labelidx}'}^\ast}` be :math:`{{\mathit{labelidx}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{\mathit{labelidx}} - 1~{\mathrm{shift}}_{\mathit{labelidxs}}({{\mathit{labelidx}'}^\ast})`. + + +:math:`{\mathrm{free}}_{\mathit{block}}({{\mathit{instr}}^\ast})` +................................................................. + + +1. Let :math:`{\mathit{free}}` be :math:`{\mathrm{free}}_{\mathit{list}}({{\mathrm{free}}_{\mathit{instr}}({\mathit{instr}})^\ast})`. + +#. Return :math:`{\mathit{free}}{}[{.}\mathsf{labels} = {\mathrm{shift}}_{\mathit{labelidxs}}({\mathit{free}}{.}\mathsf{labels})]`. + + +:math:`{\mathrm{free}}_{\mathit{instr}}({\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +.................................................................................................. + + +1. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{nop}`, then: + + a. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{unreachable}`, then: + + a. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{drop}`, then: + + a. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{select}`, then: + + a. Let :math:`(\mathsf{select}~{({{\mathit{valtype}}^\ast})^?})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{opt}}({{\mathrm{free}}_{\mathit{list}}({{\mathrm{free}}_{\mathit{valtype}}({\mathit{valtype}})^\ast})^?})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{block}`, then: + + a. Return `YetE ($free_blocktype(blocktype) ++ $free_block(instr*{instr : instr}))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{loop}`, then: + + a. Return `YetE ($free_blocktype(blocktype) ++ $free_block(instr*{instr : instr}))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{if}`, then: + + a. Return `YetE ($free_blocktype(blocktype) ++ $free_block(instr_1*{instr_1 : instr}) ++ $free_block(instr_2*{instr_2 : instr}))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{br}`, then: + + a. Let :math:`(\mathsf{br}~{\mathit{labelidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{labelidx}}({\mathit{labelidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{br\_if}`, then: + + a. Let :math:`(\mathsf{br\_if}~{\mathit{labelidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{labelidx}}({\mathit{labelidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{br\_table}`, then: + + a. Return `YetE ($free_list($free_labelidx(labelidx)*{}) ++ $free_labelidx(labelidx))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{br\_on\_null}`, then: + + a. Let :math:`(\mathsf{br\_on\_null}~{\mathit{labelidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{labelidx}}({\mathit{labelidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{br\_on\_non\_null}`, then: + + a. Let :math:`(\mathsf{br\_on\_non\_null}~{\mathit{labelidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{labelidx}}({\mathit{labelidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{br\_on\_cast}`, then: + + a. Return `YetE ($free_labelidx(labelidx) ++ $free_reftype(reftype_1) ++ $free_reftype(reftype_2))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{br\_on\_cast\_fail}`, then: + + a. Return `YetE ($free_labelidx(labelidx) ++ $free_reftype(reftype_1) ++ $free_reftype(reftype_2))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{call}`, then: + + a. Let :math:`(\mathsf{call}~{\mathit{funcidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{funcidx}}({\mathit{funcidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{call\_ref}`, then: + + a. Let :math:`(\mathsf{call\_ref}~{\mathit{typeuse}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{typeuse}}({\mathit{typeuse}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{call\_indirect}`, then: + + a. Return `YetE ($free_tableidx(tableidx) ++ $free_typeuse(typeuse))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{return}`, then: + + a. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{return\_call}`, then: + + a. Let :math:`(\mathsf{return\_call}~{\mathit{funcidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{funcidx}}({\mathit{funcidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{return\_call\_ref}`, then: + + a. Let :math:`(\mathsf{return\_call\_ref}~{\mathit{typeuse}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{typeuse}}({\mathit{typeuse}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{return\_call\_indirect}`, then: + + a. Return `YetE ($free_tableidx(tableidx) ++ $free_typeuse(typeuse))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{const}`, then: + + a. Let :math:`({\mathit{numtype}}{.}\mathsf{const}~{\mathit{numlit}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{numtype}}({\mathit{numtype}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{unop}`, then: + + a. Let :math:`({\mathit{numtype}} {.} {\mathit{unop}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{numtype}}({\mathit{numtype}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{binop}`, then: + + a. Let :math:`({\mathit{numtype}} {.} {\mathit{binop}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{numtype}}({\mathit{numtype}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{testop}`, then: + + a. Let :math:`({\mathit{numtype}} {.} {\mathit{testop}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{numtype}}({\mathit{numtype}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{relop}`, then: + + a. Let :math:`({\mathit{numtype}} {.} {\mathit{relop}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{numtype}}({\mathit{numtype}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{cvtop}`, then: + + a. Return `YetE ($free_numtype(numtype_1) ++ $free_numtype(numtype_2))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vconst}`, then: + + a. Let :math:`({\mathit{vectype}}{.}\mathsf{const}~{\mathit{veclit}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{vectype}}({\mathit{vectype}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vvunop}`, then: + + a. Let :math:`({\mathit{vectype}} {.} {\mathit{vvunop}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{vectype}}({\mathit{vectype}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vvbinop}`, then: + + a. Let :math:`({\mathit{vectype}} {.} {\mathit{vvbinop}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{vectype}}({\mathit{vectype}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vvternop}`, then: + + a. Let :math:`({\mathit{vectype}} {.} {\mathit{vvternop}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{vectype}}({\mathit{vectype}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vvtestop}`, then: + + a. Let :math:`({\mathit{vectype}} {.} {\mathit{vvtestop}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{vectype}}({\mathit{vectype}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vunop}`, then: + + a. Let :math:`({\mathit{shape}} {.} {\mathit{vunop}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{shape}}({\mathit{shape}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vbinop}`, then: + + a. Let :math:`({\mathit{shape}} {.} {\mathit{vbinop}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{shape}}({\mathit{shape}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vtestop}`, then: + + a. Let :math:`({\mathit{shape}} {.} {\mathit{vtestop}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{shape}}({\mathit{shape}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vrelop}`, then: + + a. Let :math:`({\mathit{shape}} {.} {\mathit{vrelop}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{shape}}({\mathit{shape}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vshiftop}`, then: + + a. Let :math:`({\mathit{ishape}} {.} {\mathit{vshiftop}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{shape}}({\mathit{ishape}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vbitmask}`, then: + + a. Let :math:`({\mathit{ishape}}{.}\mathsf{bitmask})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{shape}}({\mathit{ishape}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vswizzle}`, then: + + a. Let :math:`({\mathit{ishape}}{.}\mathsf{swizzle})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{shape}}({\mathit{ishape}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vshuffle}`, then: + + a. Let :math:`({\mathit{ishape}}{.}\mathsf{shuffle}~{{\mathit{laneidx}}^\ast})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{shape}}({\mathit{ishape}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vextunop}`, then: + + a. Return `YetE ($free_shape((ishape_1 : ishape <: shape)) ++ $free_shape((ishape_2 : ishape <: shape)))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vextbinop}`, then: + + a. Return `YetE ($free_shape((ishape_1 : ishape <: shape)) ++ $free_shape((ishape_2 : ishape <: shape)))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vnarrow}`, then: + + a. Return `YetE ($free_shape((ishape_1 : ishape <: shape)) ++ $free_shape((ishape_2 : ishape <: shape)))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vcvtop}`, then: + + a. Return `YetE ($free_shape(shape_1) ++ $free_shape(shape_2))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vsplat}`, then: + + a. Let :math:`({\mathit{shape}}{.}\mathsf{splat})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{shape}}({\mathit{shape}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vextract\_lane}`, then: + + a. Let :math:`({{\mathit{shape}}{.}\mathsf{extract\_lane}}{\mathsf{\_}}{{{\mathit{sx}}^?}}~{\mathit{laneidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{shape}}({\mathit{shape}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vreplace\_lane}`, then: + + a. Let :math:`({\mathit{shape}}{.}\mathsf{replace\_lane}~{\mathit{laneidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{shape}}({\mathit{shape}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{ref{.}null}`, then: + + a. Let :math:`(\mathsf{ref{.}null}~{\mathit{heaptype}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{heaptype}}({\mathit{heaptype}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{ref{.}is\_null}`, then: + + a. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{ref{.}as\_non\_null}`, then: + + a. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{ref{.}eq}`, then: + + a. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{ref{.}test}`, then: + + a. Let :math:`(\mathsf{ref{.}test}~{\mathit{reftype}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{reftype}}({\mathit{reftype}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{ref{.}cast}`, then: + + a. Let :math:`(\mathsf{ref{.}cast}~{\mathit{reftype}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{reftype}}({\mathit{reftype}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{ref{.}func}`, then: + + a. Let :math:`(\mathsf{ref{.}func}~{\mathit{funcidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{funcidx}}({\mathit{funcidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{ref{.}i{\scriptstyle 31}}`, then: + + a. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{i{\scriptstyle 31}{.}get}`, then: + + a. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{struct{.}new}`, then: + + a. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{struct{.}new\_default}`, then: + + a. Let :math:`(\mathsf{struct{.}new\_default}~{\mathit{typeidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{typeidx}}({\mathit{typeidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{struct{.}get}`, then: + + a. Let :math:`({\mathsf{struct{.}get}}{\mathsf{\_}}{{{\mathit{sx}}^?}}~{\mathit{typeidx}}~{\mathit{u{\kern-0.1em\scriptstyle 32}}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{typeidx}}({\mathit{typeidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{struct{.}set}`, then: + + a. Let :math:`(\mathsf{struct{.}set}~{\mathit{typeidx}}~{\mathit{u{\kern-0.1em\scriptstyle 32}}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{typeidx}}({\mathit{typeidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{array{.}new}`, then: + + a. Let :math:`(\mathsf{array{.}new}~{\mathit{typeidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{typeidx}}({\mathit{typeidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{array{.}new\_default}`, then: + + a. Let :math:`(\mathsf{array{.}new\_default}~{\mathit{typeidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{typeidx}}({\mathit{typeidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{array{.}new\_fixed}`, then: + + a. Let :math:`(\mathsf{array{.}new\_fixed}~{\mathit{typeidx}}~{\mathit{u{\kern-0.1em\scriptstyle 32}}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{typeidx}}({\mathit{typeidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{array{.}new\_data}`, then: + + a. Return `YetE ($free_typeidx(typeidx) ++ $free_dataidx(dataidx))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{array{.}new\_elem}`, then: + + a. Return `YetE ($free_typeidx(typeidx) ++ $free_elemidx(elemidx))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{array{.}get}`, then: + + a. Let :math:`({\mathsf{array{.}get}}{\mathsf{\_}}{{{\mathit{sx}}^?}}~{\mathit{typeidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{typeidx}}({\mathit{typeidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{array{.}set}`, then: + + a. Let :math:`(\mathsf{array{.}set}~{\mathit{typeidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{typeidx}}({\mathit{typeidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{array{.}len}`, then: + + a. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{array{.}fill}`, then: + + a. Let :math:`(\mathsf{array{.}fill}~{\mathit{typeidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{typeidx}}({\mathit{typeidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{array{.}copy}`, then: + + a. Return `YetE ($free_typeidx(typeidx_1) ++ $free_typeidx(typeidx_2))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{array{.}init\_data}`, then: + + a. Return `YetE ($free_typeidx(typeidx) ++ $free_dataidx(dataidx))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{array{.}init\_elem}`, then: + + a. Return `YetE ($free_typeidx(typeidx) ++ $free_elemidx(elemidx))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{extern{.}convert\_any}`, then: + + a. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{any{.}convert\_extern}`, then: + + a. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{local{.}get}`, then: + + a. Let :math:`(\mathsf{local{.}get}~{\mathit{localidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{localidx}}({\mathit{localidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{local{.}set}`, then: + + a. Let :math:`(\mathsf{local{.}set}~{\mathit{localidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{localidx}}({\mathit{localidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{local{.}tee}`, then: + + a. Let :math:`(\mathsf{local{.}tee}~{\mathit{localidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{localidx}}({\mathit{localidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{global{.}get}`, then: + + a. Let :math:`(\mathsf{global{.}get}~{\mathit{globalidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{globalidx}}({\mathit{globalidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{global{.}set}`, then: + + a. Let :math:`(\mathsf{global{.}set}~{\mathit{globalidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{globalidx}}({\mathit{globalidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{table{.}get}`, then: + + a. Let :math:`(\mathsf{table{.}get}~{\mathit{tableidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{tableidx}}({\mathit{tableidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{table{.}set}`, then: + + a. Let :math:`(\mathsf{table{.}set}~{\mathit{tableidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{tableidx}}({\mathit{tableidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{table{.}size}`, then: + + a. Let :math:`(\mathsf{table{.}size}~{\mathit{tableidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{tableidx}}({\mathit{tableidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{table{.}grow}`, then: + + a. Let :math:`(\mathsf{table{.}grow}~{\mathit{tableidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{tableidx}}({\mathit{tableidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{table{.}fill}`, then: + + a. Let :math:`(\mathsf{table{.}fill}~{\mathit{tableidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{tableidx}}({\mathit{tableidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{table{.}copy}`, then: + + a. Return `YetE ($free_tableidx(tableidx_1) ++ $free_tableidx(tableidx_2))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{table{.}init}`, then: + + a. Return `YetE ($free_tableidx(tableidx) ++ $free_elemidx(elemidx))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{elem{.}drop}`, then: + + a. Let :math:`(\mathsf{elem{.}drop}~{\mathit{elemidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{elemidx}}({\mathit{elemidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{load}`, then: + + a. Let :math:`({{\mathit{numtype}}{.}\mathsf{load}}{{\mathit{loadop\_{\scriptstyle 0}}}}~{\mathit{memidx}}~{\mathit{memarg}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. If :math:`{\mathit{loadop\_{\scriptstyle 0}}}` is defined, then: + + 1) Return `YetE ($free_numtype(numtype) ++ $free_memidx(memidx))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{store}`, then: + + a. Return `YetE ($free_numtype(numtype) ++ $free_memidx(memidx))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vload}`, then: + + a. Return `YetE ($free_vectype(vectype) ++ $free_memidx(memidx))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vload\_lane}`, then: + + a. Return `YetE ($free_vectype(vectype) ++ $free_memidx(memidx))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vstore}`, then: + + a. Return `YetE ($free_vectype(vectype) ++ $free_memidx(memidx))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{vstore\_lane}`, then: + + a. Return `YetE ($free_vectype(vectype) ++ $free_memidx(memidx))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{memory{.}size}`, then: + + a. Let :math:`(\mathsf{memory{.}size}~{\mathit{memidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{memidx}}({\mathit{memidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{memory{.}grow}`, then: + + a. Let :math:`(\mathsf{memory{.}grow}~{\mathit{memidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{memidx}}({\mathit{memidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{memory{.}fill}`, then: + + a. Let :math:`(\mathsf{memory{.}fill}~{\mathit{memidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{\mathrm{free}}_{\mathit{memidx}}({\mathit{memidx}})`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{memory{.}copy}`, then: + + a. Return `YetE ($free_memidx(memidx_1) ++ $free_memidx(memidx_2))`. + +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{memory{.}init}`, then: + + a. Return `YetE ($free_memidx(memidx) ++ $free_dataidx(dataidx))`. + +#. Assert: Due to validation, :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{data{.}drop}`. + +#. Let :math:`(\mathsf{data{.}drop}~{\mathit{dataidx}})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{\mathrm{free}}_{\mathit{dataidx}}({\mathit{dataidx}})`. + + +:math:`{\mathrm{free}}_{\mathit{expr}}({{\mathit{instr}}^\ast})` +................................................................ + + +1. Return :math:`{\mathrm{free}}_{\mathit{list}}({{\mathrm{free}}_{\mathit{instr}}({\mathit{instr}})^\ast})`. + + +:math:`{\mathrm{free}}_{\mathit{type}}((\mathsf{type}~{\mathit{rectype}}))` +........................................................................... + + +1. Return :math:`{\mathrm{free}}_{\mathit{rectype}}({\mathit{rectype}})`. + + +:math:`{\mathrm{free}}_{\mathit{local}}((\mathsf{local}~t))` +............................................................ + + +1. Return :math:`{\mathrm{free}}_{\mathit{valtype}}(t)`. + + +:math:`{\mathrm{free}}_{\mathit{func}}((\mathsf{func}~{\mathit{typeidx}}~{{\mathit{local}}^\ast}~{\mathit{expr}}))` +................................................................................................................... + + +1. Return `YetE ($free_typeidx(typeidx) ++ $free_list($free_local(local)*{local : local}) ++ $free_block(expr)[LOCALS_free = []])`. + + +:math:`{\mathrm{free}}_{\mathit{global}}((\mathsf{global}~{\mathit{globaltype}}~{\mathit{expr}}))` +.................................................................................................. + + +1. Return `YetE ($free_globaltype(globaltype) ++ $free_expr(expr))`. + + +:math:`{\mathrm{free}}_{\mathit{table}}((\mathsf{table}~{\mathit{tabletype}}~{\mathit{expr}}))` +............................................................................................... + + +1. Return `YetE ($free_tabletype(tabletype) ++ $free_expr(expr))`. + + +:math:`{\mathrm{free}}_{\mathit{mem}}((\mathsf{memory}~{\mathit{memtype}}))` +............................................................................ + + +1. Return :math:`{\mathrm{free}}_{\mathit{memtype}}({\mathit{memtype}})`. + + +:math:`{\mathrm{free}}_{\mathit{elemmode}}({\mathit{elemmode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +........................................................................................................ + + +1. If :math:`{\mathit{elemmode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{active}`, then: + + a. Return `YetE ($free_tableidx(tableidx) ++ $free_expr(expr))`. + +#. If :math:`{\mathit{elemmode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{passive}`, then: + + a. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + +#. Assert: Due to validation, :math:`{\mathit{elemmode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{declare}`. + +#. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + + +:math:`{\mathrm{free}}_{\mathit{datamode}}({\mathit{datamode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +........................................................................................................ + + +1. If :math:`{\mathit{datamode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{active}`, then: + + a. Return `YetE ($free_memidx(memidx) ++ $free_expr(expr))`. + +#. Assert: Due to validation, :math:`{\mathit{datamode}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{passive}`. + +#. Return :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon \}\end{array}`. + + +:math:`{\mathrm{free}}_{\mathit{elem}}((\mathsf{elem}~{\mathit{reftype}}~{{\mathit{expr}}^\ast}~{\mathit{elemmode}}))` +...................................................................................................................... + + +1. Return `YetE ($free_reftype(reftype) ++ $free_list($free_expr(expr)*{expr : expr}) ++ $free_elemmode(elemmode))`. + + +:math:`{\mathrm{free}}_{\mathit{data}}((\mathsf{data}~{{\mathit{byte}}^\ast}~{\mathit{datamode}}))` +................................................................................................... + + +1. Return :math:`{\mathrm{free}}_{\mathit{datamode}}({\mathit{datamode}})`. + + +:math:`{\mathrm{free}}_{\mathit{start}}((\mathsf{start}~{\mathit{funcidx}}))` +............................................................................. + + +1. Return :math:`{\mathrm{free}}_{\mathit{funcidx}}({\mathit{funcidx}})`. + + +:math:`{\mathrm{free}}_{\mathit{export}}((\mathsf{export}~{\mathit{name}}~{\mathit{externidx}}))` +................................................................................................. + + +1. Return :math:`{\mathrm{free}}_{\mathit{externidx}}({\mathit{externidx}})`. + + +:math:`{\mathrm{free}}_{\mathit{import}}((\mathsf{import}~{\mathit{name}}_1~{\mathit{name}}_2~{\mathit{externtype}}))` +...................................................................................................................... + + +1. Return :math:`{\mathrm{free}}_{\mathit{externtype}}({\mathit{externtype}})`. + + +:math:`{\mathrm{free}}_{\mathit{module}}((\mathsf{module}~{{\mathit{type}}^\ast}~{{\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}))` +...................................................................................................................................................................................................................................................................................................... + + +1. Return `YetE ($free_list($free_type(type)*{type : type}) ++ $free_list($free_import(import)*{import : import}) ++ $free_list($free_func(func)*{func : func}) ++ $free_list($free_global(global)*{global : global}) ++ $free_list($free_table(table)*{table : table}) ++ $free_list($free_mem(mem)*{mem : mem}) ++ $free_list($free_elem(elem)*{elem : elem}) ++ $free_list($free_data(data)*{data : data}) ++ $free_opt($free_start(start)?{start : start}) ++ $free_list($free_export(export)*{export : export}))`. + + +:math:`{\mathrm{funcidx}}({\mathit{module}})` +............................................. + + +1. Return :math:`{\mathrm{free}}_{\mathit{module}}({\mathit{module}}){.}\mathsf{funcs}`. + + +:math:`{\mathrm{dataidx}}({{\mathit{func}}^\ast})` +.................................................. + + +1. Return :math:`{\mathrm{free}}_{\mathit{list}}({{\mathrm{free}}_{\mathit{func}}({\mathit{func}})^\ast}){.}\mathsf{datas}`. + + +:math:`{{\mathit{tv}}}{{}[ {{\mathit{typevar}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast} := {{\mathit{typeuse}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast} ]}` +..................................................................................................................................................................... + + +1. If :math:`{{\mathit{typevar}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is :math:`\epsilon` and :math:`{{\mathit{typeuse}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}` is :math:`\epsilon`, then: + + a. Return :math:`{\mathit{tv}}`. + +#. Assert: Due to validation, :math:`{|{{\mathit{typeuse}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}|}` is greater than or equal to :math:`1`. + +#. Let :math:`{\mathit{tu}}_1~{{\mathit{tu}'}^\ast}` be :math:`{{\mathit{typeuse}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}`. + +#. If :math:`{|{{\mathit{typevar}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}|}` is greater than or equal to :math:`1`, then: + + a. Let :math:`{\mathit{tv}}_1~{{\mathit{tv}'}^\ast}` be :math:`{{\mathit{typevar}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + + #. If :math:`{\mathit{tv}}` is :math:`{\mathit{tv}}_1`, then: + + 1) Return :math:`{\mathit{tu}}_1`. + +#. Let :math:`{\mathit{tu}}_1~{{\mathit{tu}'}^\ast}` be :math:`{{\mathit{typeuse}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}`. + +#. Assert: Due to validation, :math:`{|{{\mathit{typevar}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}|}` is greater than or equal to :math:`1`. + +#. Let :math:`{\mathit{tv}}_1~{{\mathit{tv}'}^\ast}` be :math:`{{\mathit{typevar}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}`. + +#. Return :math:`{{\mathit{tv}}}{{}[ {{\mathit{tv}'}^\ast} := {{\mathit{tu}'}^\ast} ]}`. + + +:math:`{{\mathit{pt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +........................................................................... + + +1. Return :math:`{\mathit{pt}}`. + + +:math:`{{\mathit{nt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +........................................................................... + + +1. Return :math:`{\mathit{nt}}`. + + +:math:`{{\mathit{vt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +........................................................................... + + +1. Return :math:`{\mathit{vt}}`. + + +:math:`{{\mathit{typeuse}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +........................................................................................................................ + + +1. If the type of :math:`{\mathit{typeuse}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is typevar, then: + + a. Let :math:`{\mathit{tv}'}` be :math:`{\mathit{typeuse}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{{\mathit{tv}'}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{typeuse}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is deftype. + +#. Let :math:`{\mathit{dt}}` be :math:`{\mathit{typeuse}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{{\mathit{dt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}`. + + +:math:`{{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +......................................................................................................................... + + +1. If the type of :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is typevar, then: + + a. Let :math:`{\mathit{tv}'}` be :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{{\mathit{tv}'}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}`. + +#. If the type of :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is deftype, then: + + a. Let :math:`{\mathit{dt}}` be :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{{\mathit{dt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}`. + +#. Let :math:`{\mathit{ht}}` be :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{\mathit{ht}}`. + + +:math:`{(\mathsf{ref}~{\mathsf{null}^?}~{\mathit{ht}})}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +............................................................................................................ + + +1. Return :math:`(\mathsf{ref}~{\mathsf{null}^?}~{{\mathit{ht}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]})`. + + +:math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +........................................................................................................................ + + +1. If the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is numtype, then: + + a. Let :math:`{\mathit{nt}}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{{\mathit{nt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}`. + +#. If the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is vectype, then: + + a. Let :math:`{\mathit{vt}}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{{\mathit{vt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}`. + +#. If the type of :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is reftype, then: + + a. Let :math:`{\mathit{rt}}` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{{\mathit{rt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}`. + +#. Assert: Due to validation, :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{bot}`. + +#. Return :math:`\mathsf{bot}`. + + +:math:`{{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +............................................................................................................................ + + +1. If the type of :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valtype, then: + + a. Let :math:`t` be :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`{t}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}`. + +#. Assert: Due to validation, the type of :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is packtype. + +#. Let :math:`{\mathit{pt}}` be :math:`{\mathit{storagetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`{{\mathit{pt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}`. + + +:math:`{({\mathsf{mut}^?}, {\mathit{zt}})}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +............................................................................................... + + +1. Return :math:`({\mathsf{mut}^?}, {{\mathit{zt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]})`. + + +:math:`{{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +......................................................................................................................... + + +1. If :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{struct}`, then: + + a. Let :math:`(\mathsf{struct}~{{\mathit{yt}}^\ast})` be :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`(\mathsf{struct}~{{{\mathit{yt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}^\ast})`. + +#. If :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{array}`, then: + + a. Let :math:`(\mathsf{array}~{\mathit{yt}})` be :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`(\mathsf{array}~{{\mathit{yt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]})`. + +#. Assert: Due to validation, :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{func}`. + +#. Let :math:`(\mathsf{func}~{\mathit{ft}})` be :math:`{\mathit{comptype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`(\mathsf{func}~{{\mathit{ft}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]})`. + + +:math:`{(\mathsf{sub}~{\mathsf{final}^?}~{{\mathit{tu}'}^\ast}~{\mathit{ct}})}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +................................................................................................................................... + + +1. Return :math:`(\mathsf{sub}~{\mathsf{final}^?}~{{{\mathit{tu}'}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}^\ast}~{{\mathit{ct}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]})`. + + +:math:`{(\mathsf{rec}~{{\mathit{st}}^\ast})}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +................................................................................................. + + +1. Return :math:`(\mathsf{rec}~{{{\mathit{st}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}^\ast})`. + + +:math:`{({\mathit{qt}} {.} i)}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +................................................................................... + + +1. Return :math:`({{\mathit{qt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]} {.} i)`. + + +:math:`{{t_1^\ast} \rightarrow {t_2^\ast}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +............................................................................................... + + +1. Return :math:`{{t_1}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}^\ast} \rightarrow {{t_2}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}^\ast}`. + + +:math:`{({\mathsf{mut}^?}, t)}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +................................................................................... + + +1. Return :math:`({\mathsf{mut}^?}, {t}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]})`. + + +:math:`{({\mathit{lim}}, {\mathit{rt}})}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +............................................................................................. + + +1. Return :math:`({\mathit{lim}}, {{\mathit{rt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]})`. + + +:math:`{(\mathsf{page}~{\mathit{lim}})}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +............................................................................................ + + +1. Return :math:`(\mathsf{page}~{\mathit{lim}})`. + + +:math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +........................................................................................................................... + + +1. If :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{func}`, then: + + a. Let :math:`(\mathsf{func}~{\mathit{dt}})` be :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`(\mathsf{func}~{{\mathit{dt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]})`. + +#. If :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{global}`, then: + + a. Let :math:`(\mathsf{global}~{\mathit{gt}})` be :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`(\mathsf{global}~{{\mathit{gt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]})`. + +#. If :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{table}`, then: + + a. Let :math:`(\mathsf{table}~{\mathit{tt}})` be :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + + #. Return :math:`(\mathsf{table}~{{\mathit{tt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]})`. + +#. Assert: Due to validation, :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{mem}`. + +#. Let :math:`(\mathsf{mem}~{\mathit{mt}})` be :math:`{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + +#. Return :math:`(\mathsf{mem}~{{\mathit{mt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]})`. + + +:math:`{{{\mathit{xt}}_1^\ast} \rightarrow {{\mathit{xt}}_2^\ast}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +....................................................................................................................... + + +1. Return :math:`{{{\mathit{xt}}_1}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}^\ast} \rightarrow {{{\mathit{xt}}_2}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}^\ast}`. + + +:math:`{t}{{}[ {:=}\, {{\mathit{tu}}^{n}} ]}` +............................................. + + +1. Return :math:`{t}{{}[ {i^{i []). -2. If blocktype_u1 is of the case _RESULT, then: - a. Let (_RESULT valtype_0) be blocktype_u1. - b. If valtype_0 is defined, then: - 1) Let ?(t) be valtype_0. - 2) Return ([] -> [t]). -3. Assert: Due to validation, blocktype_u1 is of the case _IDX. -4. Let (_IDX x) be blocktype_u1. -5. Return $type(x). +#. Push the value :math:`(\mathsf{ref{.}array}~a)` to the stack. -funcs externval_u0* -1. If (externval_u0* is []), then: - a. Return []. -2. Let [externval_0] ++ externval'* be externval_u0*. -3. If externval_0 is of the case FUNC, then: - a. Let (FUNC fa) be externval_0. - b. Return [fa] ++ $funcs(externval'*). -4. Let [externval] ++ externval'* be externval_u0*. -5. Return $funcs(externval'*). +#. Perform :math:`z{}[{.}\mathsf{arrays} \mathrel{{=}{\oplus}} {\mathit{ai}}]`. -globals externval_u0* -1. If (externval_u0* is []), then: - a. Return []. -2. Let [externval_0] ++ externval'* be externval_u0*. -3. If externval_0 is of the case GLOBAL, then: - a. Let (GLOBAL ga) be externval_0. - b. Return [ga] ++ $globals(externval'*). -4. Let [externval] ++ externval'* be externval_u0*. -5. Return $globals(externval'*). -tables externval_u0* -1. If (externval_u0* is []), then: - a. Return []. -2. Let [externval_0] ++ externval'* be externval_u0*. -3. If externval_0 is of the case TABLE, then: - a. Let (TABLE ta) be externval_0. - b. Return [ta] ++ $tables(externval'*). -4. Let [externval] ++ externval'* be externval_u0*. -5. Return $tables(externval'*). +:math:`\mathsf{array{.}set}~x` +.............................. -mems externval_u0* -1. If (externval_u0* is []), then: - a. Return []. -2. Let [externval_0] ++ externval'* be externval_u0*. -3. If externval_0 is of the case MEM, then: - a. Let (MEM ma) be externval_0. - b. Return [ma] ++ $mems(externval'*). -4. Let [externval] ++ externval'* be externval_u0*. -5. Return $mems(externval'*). -allocfunc moduleinst func -1. Assert: Due to validation, func is of the case FUNC. -2. Let (FUNC x local* expr) be func. -3. Let fi be { TYPE: moduleinst.TYPES[x]; MODULE: moduleinst; CODE: func; }. -4. Let a be |s.FUNCS|. -5. Append fi to the s.FUNCS. -6. Return a. +1. Let :math:`z` be the current state. -allocfuncs moduleinst func_u0* -1. If (func_u0* is []), then: - a. Return []. -2. Let [func] ++ func'* be func_u0*. -3. Let fa be $allocfunc(moduleinst, func). -4. Let fa'* be $allocfuncs(moduleinst, func'*). -5. Return [fa] ++ fa'*. +#. Assert: Due to validation, a value is on the top of the stack. -allocglobal globaltype val -1. Let gi be { TYPE: globaltype; VALUE: val; }. -2. Let a be |s.GLOBALS|. -3. Append gi to the s.GLOBALS. -4. Return a. +#. Pop the value :math:`{\mathit{val}}` from the stack. -allocglobals globaltype_u0* val_u1* -1. If (globaltype_u0* is []), then: - a. Assert: Due to validation, (val_u1* is []). - b. Return []. -2. Else: - a. Let [globaltype] ++ globaltype'* be globaltype_u0*. - b. Assert: Due to validation, (|val_u1*| ≥ 1). - c. Let [val] ++ val'* be val_u1*. - d. Let ga be $allocglobal(globaltype, val). - e. Let ga'* be $allocglobals(globaltype'*, val'*). - f. Return [ga] ++ ga'*. +#. Assert: Due to validation, a value of value type :math:`\mathsf{i{\scriptstyle 32}}` is on the top of the stack. -alloctable ((i, j), rt) -1. Let ti be { TYPE: ((i, j), rt); REFS: (REF.NULL rt)^i; }. -2. Let a be |s.TABLES|. -3. Append ti to the s.TABLES. -4. Return a. +#. Pop the value :math:`(\mathsf{i{\scriptstyle 32}}{.}\mathsf{const}~i)` from the stack. -alloctables tabletype_u0* -1. If (tabletype_u0* is []), then: - a. Return []. -2. Let [tabletype] ++ tabletype'* be tabletype_u0*. -3. Let ta be $alloctable(tabletype). -4. Let ta'* be $alloctables(tabletype'*). -5. Return [ta] ++ ta'*. +#. Assert: Due to validation, a value is on the top of the stack. -allocmem (PAGE (i, j)) -1. Let mi be { TYPE: (PAGE (i, j)); BYTES: 0^(i · (64 · $Ki())); }. -2. Let a be |s.MEMS|. -3. Append mi to the s.MEMS. -4. Return a. +#. Pop the value :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` from the stack. -allocmems memtype_u0* -1. If (memtype_u0* is []), then: - a. Return []. -2. Let [memtype] ++ memtype'* be memtype_u0*. -3. Let ma be $allocmem(memtype). -4. Let ma'* be $allocmems(memtype'*). -5. Return [ma] ++ ma'*. +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{ref{.}null}`, then: -allocelem rt ref* -1. Let ei be { TYPE: rt; REFS: ref*; }. -2. Let a be |s.ELEMS|. -3. Append ei to the s.ELEMS. -4. Return a. + a. Trap. -allocelems reftype_u0* ref_u1* -1. If ((reftype_u0* is []) and (ref_u1* is [])), then: - a. Return []. -2. Assert: Due to validation, (|ref_u1*| ≥ 1). -3. Let [ref*] ++ ref'** be ref_u1*. -4. Assert: Due to validation, (|reftype_u0*| ≥ 1). -5. Let [rt] ++ rt'* be reftype_u0*. -6. Let ea be $allocelem(rt, ref*). -7. Let ea'* be $allocelems(rt'*, ref'**). -8. Return [ea] ++ ea'*. +#. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{ref{.}array}`, then: -allocdata byte* -1. Let di be { BYTES: byte*; }. -2. Let a be |s.DATAS|. -3. Append di to the s.DATAS. -4. Return a. + a. Let :math:`(\mathsf{ref{.}array}~a)` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. -allocdatas byte_u0* -1. If (byte_u0* is []), then: - a. Return []. -2. Let [byte*] ++ byte'** be byte_u0*. -3. Let da be $allocdata(byte*). -4. Let da'* be $allocdatas(byte'**). -5. Return [da] ++ da'*. + #. If :math:`a` is less than :math:`{|z{.}\mathsf{arrays}|}` and :math:`i` is greater than or equal to :math:`{|z{.}\mathsf{arrays}{}[a]{.}\mathsf{fields}|}`, then: -instexport fa* ga* ta* ma* (EXPORT name externidx_u0) -1. If externidx_u0 is of the case FUNC, then: - a. Let (FUNC x) be externidx_u0. - b. Return { NAME: name; VALUE: (FUNC fa*[x]); }. -2. If externidx_u0 is of the case GLOBAL, then: - a. Let (GLOBAL x) be externidx_u0. - b. Return { NAME: name; VALUE: (GLOBAL ga*[x]); }. -3. If externidx_u0 is of the case TABLE, then: - a. Let (TABLE x) be externidx_u0. - b. Return { NAME: name; VALUE: (TABLE ta*[x]); }. -4. Assert: Due to validation, externidx_u0 is of the case MEM. -5. Let (MEM x) be externidx_u0. -6. Return { NAME: name; VALUE: (MEM ma*[x]); }. + 1) Trap. -allocmodule module externval* val* ref** -1. Let fa_ex* be $funcs(externval*). -2. Let ga_ex* be $globals(externval*). -3. Let ma_ex* be $mems(externval*). -4. Let ta_ex* be $tables(externval*). -5. Assert: Due to validation, module is of the case MODULE. -6. Let (MODULE type_0 import* func^n_func global_1 table_2 mem_3 elem_4 data_5 start? export*) be module. -7. Assert: Due to validation, data_5 is of the case DATA. -8. Let (DATA byte* datamode)^n_data be data_5. -9. Assert: Due to validation, elem_4 is of the case ELEM. -10. Let (ELEM rt expr_2* elemmode)^n_elem be elem_4. -11. Assert: Due to validation, mem_3 is of the case MEMORY. -12. Let (MEMORY memtype)^n_mem be mem_3. -13. Assert: Due to validation, table_2 is of the case TABLE. -14. Let (TABLE tabletype)^n_table be table_2. -15. Assert: Due to validation, global_1 is of the case GLOBAL. -16. Let (GLOBAL globaltype expr_1)^n_global be global_1. -17. Assert: Due to validation, type_0 is of the case TYPE. -18. Let (TYPE ft)* be type_0. -19. Let fa* be (|s.FUNCS| + i_func)^(i_func t_2*) be $funcinst()[fa].TYPE. -4. Pop the activation of _f from the stack. -5. Let k be |t_2*|. -6. Push the activation of f with arity k to the stack. -7. Push the values val^n to the stack. -8. Execute the instruction (CALL_ADDR fa). -9. Pop all values val* from the top of the stack. -10. Pop the activation of f with arity k from the stack. -11. Push the values val* to the stack. -12. Pop the values val^k from the stack. -13. Return val^k. -Step_pure/unreachable -1. Trap. +1. Let :math:`z` be the current state. -Step_pure/nop -1. Do nothing. +#. Assert: Due to validation, a value is on the top of the stack. -Step_pure/drop -1. Assert: Due to validation, a value is on the top of the stack. -2. Pop the value val from the stack. -3. Do nothing. +#. Pop the value :math:`{\mathit{val}}` from the stack. -Step_pure/select t*? -1. Assert: Due to validation, a value of value type I32 is on the top of the stack. -2. Pop the value (I32.CONST c) from the stack. -3. Assert: Due to validation, a value is on the top of the stack. -4. Pop the value val_2 from the stack. -5. Assert: Due to validation, a value is on the top of the stack. -6. Pop the value val_1 from the stack. -7. If (c is not 0), then: - a. Push the value val_1 to the stack. -8. Else: - a. Push the value val_2 to the stack. +#. Perform :math:`z{}[{.}\mathsf{locals}{}[x] = {\mathit{val}}]`. -Step_pure/if bt instr_1* instr_2* -1. Assert: Due to validation, a value of value type I32 is on the top of the stack. -2. Pop the value (I32.CONST c) from the stack. -3. If (c is not 0), then: - a. Execute the instruction (BLOCK bt instr_1*). -4. Else: - a. Execute the instruction (BLOCK bt instr_2*). -Step_pure/label -1. Pop all values val* from the top of the stack. -2. Assert: Due to validation, a label is now on the top of the stack. -3. Pop the current label from the stack. -4. Push the values val* to the stack. +:math:`\mathsf{global{.}set}~x` +............................... -Step_pure/br n_u0 -1. Pop all values val* from the top of the stack. -2. Let L be the current label. -3. Let n be the arity of L. -4. Let instr'* be the continuation of L. -5. Pop the current label from the stack. -6. Let admininstr_u1* be val*. -7. If ((n_u0 is 0) and (|admininstr_u1*| ≥ n)), then: - a. Let val'* ++ val^n be admininstr_u1*. - b. Push the values val^n to the stack. - c. Execute the instruction instr'*. -8. If (n_u0 ≥ 1), then: - a. Let l be (n_u0 - 1). - b. If the type of admininstr_u1 is val*, then: - 1) Let val* be admininstr_u1*. - 2) Push the values val* to the stack. - 3) Execute the instruction (BR l). -Step_pure/br_if l -1. Assert: Due to validation, a value of value type I32 is on the top of the stack. -2. Pop the value (I32.CONST c) from the stack. -3. If (c is not 0), then: - a. Execute the instruction (BR l). -4. Else: - a. Do nothing. +1. Let :math:`z` be the current state. -Step_pure/br_table l* l' -1. Assert: Due to validation, a value of value type I32 is on the top of the stack. -2. Pop the value (I32.CONST i) from the stack. -3. If (i < |l*|), then: - a. Execute the instruction (BR l*[i]). -4. Else: - a. Execute the instruction (BR l'). +#. Assert: Due to validation, a value is on the top of the stack. -Step_pure/frame -1. Let f be the current frame. -2. Let n be the arity of f. -3. Assert: Due to validation, there are at least n values on the top of the stack. -4. Assert: Due to validation, there are at least n values on the top of the stack. -5. Pop the values val^n from the stack. -6. Assert: Due to validation, a frame is now on the top of the stack. -7. Pop the current frame from the stack. -8. Push the values val^n to the stack. +#. Pop the value :math:`{\mathit{val}}` from the stack. -Step_pure/return -1. Pop all values val* from the top of the stack. -2. If a frame is now on the top of the stack, then: - a. Let f be the current frame. - b. Let n be the arity of f. - c. Pop the current frame from the stack. - d. Let val'* ++ val^n be val*. - e. Push the values val^n to the stack. -3. Else if a label is now on the top of the stack, then: - a. Pop the current label from the stack. - b. Push the values val* to the stack. - c. Execute the instruction RETURN. +#. Perform :math:`z{}[{.}\mathsf{globals}{}[x]{.}\mathsf{value} = {\mathit{val}}]`. -Step_pure/trap -1. YetI: TODO: It is likely that the value stack of two rules are different. -Step_pure/unop nt unop -1. Assert: Due to validation, a value of value type nt is on the top of the stack. -2. Pop the value (nt.CONST c_1) from the stack. -3. If (|$unop_(nt, unop, c_1)| ≤ 0), then: - a. Trap. -4. Let c be an element of $unop_(nt, unop, c_1). -5. Push the value (nt.CONST c) to the stack. +:math:`\mathsf{table{.}set}~x` +.............................. -Step_pure/binop nt binop -1. Assert: Due to validation, a value of value type nt is on the top of the stack. -2. Pop the value (nt.CONST c_2) from the stack. -3. Assert: Due to validation, a value of value type nt is on the top of the stack. -4. Pop the value (nt.CONST c_1) from the stack. -5. If (|$binop_(nt, binop, c_1, c_2)| ≤ 0), then: - a. Trap. -6. Let c be an element of $binop_(nt, binop, c_1, c_2). -7. Push the value (nt.CONST c) to the stack. -Step_pure/testop nt testop -1. Assert: Due to validation, a value of value type nt is on the top of the stack. -2. Pop the value (nt.CONST c_1) from the stack. -3. Let c be $testop_(nt, testop, c_1). -4. Push the value (I32.CONST c) to the stack. +1. Let :math:`z` be the current state. -Step_pure/relop nt relop -1. Assert: Due to validation, a value of value type nt is on the top of the stack. -2. Pop the value (nt.CONST c_2) from the stack. -3. Assert: Due to validation, a value of value type nt is on the top of the stack. -4. Pop the value (nt.CONST c_1) from the stack. -5. Let c be $relop_(nt, relop, c_1, c_2). -6. Push the value (I32.CONST c) to the stack. +#. Assert: Due to validation, a value is on the top of the stack. -Step_pure/cvtop nt_2 nt_1 cvtop -1. Assert: Due to validation, a value of value type nt_1 is on the top of the stack. -2. Pop the value (nt_1.CONST c_1) from the stack. -3. If (|$cvtop__(nt_1, nt_2, cvtop, c_1)| ≤ 0), then: - a. Trap. -4. Let c be an element of $cvtop__(nt_1, nt_2, cvtop, c_1). -5. Push the value (nt_2.CONST c) to the stack. +#. Pop the value :math:`{\mathit{ref}}` from the stack. -Step_pure/ref.is_null -1. Assert: Due to validation, a value is on the top of the stack. -2. Pop the value ref from the stack. -3. If ref is of the case REF.NULL, then: - a. Push the value (I32.CONST 1) to the stack. -4. Else: - a. Push the value (I32.CONST 0) to the stack. +#. Assert: Due to validation, a value of value type :math:`\mathsf{i{\scriptstyle 32}}` is on the top of the stack. -Step_pure/vvunop V128 vvunop -1. Assert: Due to validation, a value of value type V128 is on the top of the stack. -2. Pop the value (V128.CONST c_1) from the stack. -3. Let c be $vvunop_(V128, vvunop, c_1). -4. Push the value (V128.CONST c) to the stack. +#. Pop the value :math:`(\mathsf{i{\scriptstyle 32}}{.}\mathsf{const}~i)` from the stack. -Step_pure/vvbinop V128 vvbinop -1. Assert: Due to validation, a value of value type V128 is on the top of the stack. -2. Pop the value (V128.CONST c_2) from the stack. -3. Assert: Due to validation, a value of value type V128 is on the top of the stack. -4. Pop the value (V128.CONST c_1) from the stack. -5. Let c be $vvbinop_(V128, vvbinop, c_1, c_2). -6. Push the value (V128.CONST c) to the stack. +#. If :math:`i` is greater than or equal to :math:`{|z{.}\mathsf{tables}{}[x]{.}\mathsf{refs}|}`, then: -Step_pure/vvternop V128 vvternop -1. Assert: Due to validation, a value of value type V128 is on the top of the stack. -2. Pop the value (V128.CONST c_3) from the stack. -3. Assert: Due to validation, a value of value type V128 is on the top of the stack. -4. Pop the value (V128.CONST c_2) from the stack. -5. Assert: Due to validation, a value of value type V128 is on the top of the stack. -6. Pop the value (V128.CONST c_1) from the stack. -7. Let c be $vvternop_(V128, vvternop, c_1, c_2, c_3). -8. Push the value (V128.CONST c) to the stack. + a. Trap. -Step_pure/vvtestop V128 ANY_TRUE -1. Assert: Due to validation, a value of value type V128 is on the top of the stack. -2. Pop the value (V128.CONST c_1) from the stack. -3. Let c be $ine_($size(V128), c_1, 0). -4. Push the value (I32.CONST c) to the stack. +#. Perform :math:`z{}[{.}\mathsf{tables}{}[x]{.}\mathsf{refs}{}[i] = {\mathit{ref}}]`. -Step_pure/vunop sh vunop -1. Assert: Due to validation, a value of value type V128 is on the top of the stack. -2. Pop the value (V128.CONST c_1) from the stack. -3. If (|$vunop_(sh, vunop, c_1)| ≤ 0), then: - a. Trap. -4. Let c be an element of $vunop_(sh, vunop, c_1). -5. Push the value (V128.CONST c) to the stack. -Step_pure/vbinop sh vbinop -1. Assert: Due to validation, a value of value type V128 is on the top of the stack. -2. Pop the value (V128.CONST c_2) from the stack. -3. Assert: Due to validation, a value of value type V128 is on the top of the stack. -4. Pop the value (V128.CONST c_1) from the stack. -5. If (|$vbinop_(sh, vbinop, c_1, c_2)| ≤ 0), then: - a. Trap. -6. Let c be an element of $vbinop_(sh, vbinop, c_1, c_2). -7. Push the value (V128.CONST c) to the stack. +:math:`\mathsf{table{.}grow}~x` +............................... -Step_pure/vtestop (Jnn X N) ALL_TRUE -1. Assert: Due to validation, a value of value type V128 is on the top of the stack. -2. Pop the value (V128.CONST c) from the stack. -3. Let ci_1* be $lanes_((Jnn X N), c). -4. If (ci_1 is not 0)*, then: - a. Push the value (I32.CONST 1) to the stack. -5. Else: - a. Push the value (I32.CONST 0) to the stack. -Step_pure/vrelop sh vrelop -1. Assert: Due to validation, a value of value type V128 is on the top of the stack. -2. Pop the value (V128.CONST c_2) from the stack. -3. Assert: Due to validation, a value of value type V128 is on the top of the stack. -4. Pop the value (V128.CONST c_1) from the stack. -5. Let c be $vrelop_(sh, vrelop, c_1, c_2). -6. Push the value (V128.CONST c) to the stack. +1. Let :math:`z` be the current state. -Step_pure/vshiftop (Jnn X N) vshiftop -1. Assert: Due to validation, a value of value type I32 is on the top of the stack. -2. Pop the value (I32.CONST n) from the stack. -3. Assert: Due to validation, a value of value type V128 is on the top of the stack. -4. Pop the value (V128.CONST c_1) from the stack. -5. Let c'* be $lanes_((Jnn X N), c_1). -6. Let c be $invlanes_((Jnn X N), $vshiftop_((Jnn X N), vshiftop, c', n)*). -7. Push the value (V128.CONST c) to the stack. +#. Assert: Due to validation, a value of value type :math:`\mathsf{i{\scriptstyle 32}}` is on the top of the stack. -Step_pure/vbitmask (Jnn X N) -1. Assert: Due to validation, a value of value type V128 is on the top of the stack. -2. Pop the value (V128.CONST c) from the stack. -3. Let ci_1* be $lanes_((Jnn X N), c). -4. Let ci be $ibits__1^-1(32, $ilt_($lsize(Jnn), S, ci_1, 0)*). -5. Push the value (I32.CONST ci) to the stack. +#. Pop the value :math:`(\mathsf{i{\scriptstyle 32}}{.}\mathsf{const}~n)` from the stack. -Step_pure/vswizzle (Pnn X M) -1. Assert: Due to validation, a value of value type V128 is on the top of the stack. -2. Pop the value (V128.CONST c_2) from the stack. -3. Assert: Due to validation, a value of value type V128 is on the top of the stack. -4. Pop the value (V128.CONST c_1) from the stack. -5. Let c'* be $lanes_((Pnn X M), c_1) ++ 0^(256 - M). -6. Let ci* be $lanes_((Pnn X M), c_2). -7. Assert: Due to validation, (ci*[k] < |c'*|)^(k 0), then: - a) Let c be an element of $invlanes_((Lnn_2 X M), cj*)*. - b) Push the value (V128.CONST c) to the stack. -4. If zero_u5? is not defined, then: - a. Let Lnn_1 be lanetype_u4. - b. Let Lnn_2 be lanetype_u3. - c. Let M_1 be n_u1. - d. Let M_2 be n_u0. - e. If half_u2? is defined, then: - 1) Let ?(half) be half_u2?. - 2) Let ci* be $lanes_((Lnn_1 X M_1), c_1)[$half(half, 0, M_2) : M_2]. - 3) Let cj** be $setproduct_(lane_(Lnn_2), $vcvtop__((Lnn_1 X M_1), (Lnn_2 X M_2), vcvtop, ci)*). - 4) If (|$invlanes_((Lnn_2 X M_2), cj*)*| > 0), then: - a) Let c be an element of $invlanes_((Lnn_2 X M_2), cj*)*. - b) Push the value (V128.CONST c) to the stack. -5. If half_u2? is not defined, then: - a. Let M_1 be n_u1. - b. Let M_2 be n_u0. - c. If the type of lanetype_u4 is numtype, then: - 1) Let nt_1 be lanetype_u4. - 2) If the type of lanetype_u3 is numtype, then: - a) Let nt_2 be lanetype_u3. - b) If zero_u5? is defined, then: - 1. Let ci* be $lanes_((nt_1 X M_1), c_1). - 2. Let cj** be $setproduct_(lane_((nt_2 : numtype <: lanetype)), $vcvtop__((nt_1 X M_1), (nt_2 X M_2), vcvtop, ci)* ++ [$zero(nt_2)]^M_1). - 3. If (|$invlanes_((nt_2 X M_2), cj*)*| > 0), then: - a. Let c be an element of $invlanes_((nt_2 X M_2), cj*)*. - b. Push the value (V128.CONST c) to the stack. +#. Pop the value :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c)` from the stack. -Step_pure/local.tee x -1. Assert: Due to validation, a value is on the top of the stack. -2. Pop the value val from the stack. -3. Push the value val to the stack. -4. Push the value val to the stack. -5. Execute the instruction (LOCAL.SET x). +#. Assert: Due to validation, a value of value type :math:`\mathsf{i{\scriptstyle 32}}` is on the top of the stack. -Step_read/block bt instr* -1. Let z be the current state. -2. Let (t_1^k -> t_2^n) be $blocktype(z, bt). -3. Assert: Due to validation, there are at least k values on the top of the stack. -4. Pop the values val^k from the stack. -5. Let L be the label_n{[]}. -6. Enter val^k ++ instr* with label L. +#. Pop the value :math:`(\mathsf{i{\scriptstyle 32}}{.}\mathsf{const}~i)` from the stack. -Step_read/loop bt instr* -1. Let z be the current state. -2. Let (t_1^k -> t_2^n) be $blocktype(z, bt). -3. Assert: Due to validation, there are at least k values on the top of the stack. -4. Pop the values val^k from the stack. -5. Let L be the label_k{[(LOOP bt instr*)]}. -6. Enter val^k ++ instr* with label L. +#. If :math:`i + {\mathit{ao}}{.}\mathsf{offset} + {|\mathsf{v{\scriptstyle 128}}|} / 8` is greater than :math:`{|z{.}\mathsf{mems}{}[x]{.}\mathsf{bytes}|}`, then: -Step_read/call x -1. Let z be the current state. -2. Assert: Due to validation, (x < |$funcaddr(z)|). -3. Execute the instruction (CALL_ADDR $funcaddr(z)[x]). + a. Trap. -Step_read/call_indirect x y -1. Let z be the current state. -2. Assert: Due to validation, a value of value type I32 is on the top of the stack. -3. Pop the value (I32.CONST i) from the stack. -4. If (i ≥ |$table(z, x).REFS|), then: - a. Trap. -5. If $table(z, x).REFS[i] is not of the case REF.FUNC_ADDR, then: - a. Trap. -6. Let (REF.FUNC_ADDR a) be $table(z, x).REFS[i]. -7. If (a ≥ |$funcinst(z)|), then: - a. Trap. -8. If ($type(z, y) is not $funcinst(z)[a].TYPE), then: - a. Trap. -9. Execute the instruction (CALL_ADDR a). +#. Let :math:`{b^\ast}` be :math:`{{\mathrm{bytes}}}_{\mathsf{v{\scriptstyle 128}}}(c)`. -Step_read/call_addr a -1. Let z be the current state. -2. Assert: Due to validation, (a < |$funcinst(z)|). -3. Let { TYPE: (t_1^k -> t_2^n); MODULE: mm; CODE: func; } be $funcinst(z)[a]. -4. Assert: Due to validation, there are at least k values on the top of the stack. -5. Pop the values val^k from the stack. -6. Assert: Due to validation, func is of the case FUNC. -7. Let (FUNC x local_0 instr*) be func. -8. Assert: Due to validation, local_0 is of the case LOCAL. -9. Let (LOCAL t)* be local_0. -10. Let f be { LOCALS: val^k ++ $default_(t)*; MODULE: mm; }. -11. Let F be the activation of f with arity n. -12. Push F to the stack. -13. Let L be the label_n{[]}. -14. Enter instr* with label L. +#. Perform :math:`z{}[{.}\mathsf{mems}{}[x]{.}\mathsf{bytes}{}[i + {\mathit{ao}}{.}\mathsf{offset} : {|\mathsf{v{\scriptstyle 128}}|} / 8] = {b^\ast}]`. -Step_read/ref.func x -1. Let z be the current state. -2. Assert: Due to validation, (x < |$funcaddr(z)|). -3. Push the value (REF.FUNC_ADDR $funcaddr(z)[x]) to the stack. -Step_read/local.get x -1. Let z be the current state. -2. Push the value $local(z, x) to the stack. +:math:`{\mathsf{v{\scriptstyle 128}}{.}\mathsf{store}}{N}{\mathsf{\_}}{\mathsf{lane}}~x~{\mathit{ao}}~j` +........................................................................................................ -Step_read/global.get x -1. Let z be the current state. -2. Push the value $global(z, x).VALUE to the stack. -Step_read/table.get x -1. Let z be the current state. -2. Assert: Due to validation, a value of value type I32 is on the top of the stack. -3. Pop the value (I32.CONST i) from the stack. -4. If (i ≥ |$table(z, x).REFS|), then: - a. Trap. -5. Push the value $table(z, x).REFS[i] to the stack. +1. Let :math:`z` be the current state. -Step_read/table.size x -1. Let z be the current state. -2. Let n be |$table(z, x).REFS|. -3. Push the value (I32.CONST n) to the stack. +#. Assert: Due to validation, a value of value type :math:`\mathsf{v{\scriptstyle 128}}` is on the top of the stack. -Step_read/table.fill x -1. Let z be the current state. -2. Assert: Due to validation, a value of value type I32 is on the top of the stack. -3. Pop the value (I32.CONST n) from the stack. -4. Assert: Due to validation, a value is on the top of the stack. -5. Pop the value val from the stack. -6. Assert: Due to validation, a value of value type I32 is on the top of the stack. -7. Pop the value (I32.CONST i) from the stack. -8. If ((i + n) > |$table(z, x).REFS|), then: - a. Trap. -9. If (n is 0), then: - a. Do nothing. -10. Else: - a. Push the value (I32.CONST i) to the stack. - b. Push the value val to the stack. - c. Execute the instruction (TABLE.SET x). - d. Push the value (I32.CONST (i + 1)) to the stack. - e. Push the value val to the stack. - f. Push the value (I32.CONST (n - 1)) to the stack. - g. Execute the instruction (TABLE.FILL x). +#. Pop the value :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c)` from the stack. -Step_read/table.copy x y -1. Let z be the current state. -2. Assert: Due to validation, a value of value type I32 is on the top of the stack. -3. Pop the value (I32.CONST n) from the stack. -4. Assert: Due to validation, a value of value type I32 is on the top of the stack. -5. Pop the value (I32.CONST i) from the stack. -6. Assert: Due to validation, a value of value type I32 is on the top of the stack. -7. Pop the value (I32.CONST j) from the stack. -8. If ((i + n) > |$table(z, y).REFS|), then: - a. Trap. -9. If ((j + n) > |$table(z, x).REFS|), then: - a. Trap. -10. If (n is 0), then: - a. Do nothing. -11. Else: - a. If (j ≤ i), then: - 1) Push the value (I32.CONST j) to the stack. - 2) Push the value (I32.CONST i) to the stack. - 3) Execute the instruction (TABLE.GET y). - 4) Execute the instruction (TABLE.SET x). - 5) Push the value (I32.CONST (j + 1)) to the stack. - 6) Push the value (I32.CONST (i + 1)) to the stack. - b. Else: - 1) Push the value (I32.CONST ((j + n) - 1)) to the stack. - 2) Push the value (I32.CONST ((i + n) - 1)) to the stack. - 3) Execute the instruction (TABLE.GET y). - 4) Execute the instruction (TABLE.SET x). - 5) Push the value (I32.CONST j) to the stack. - 6) Push the value (I32.CONST i) to the stack. - c. Push the value (I32.CONST (n - 1)) to the stack. - d. Execute the instruction (TABLE.COPY x y). +#. Assert: Due to validation, a value of value type :math:`\mathsf{i{\scriptstyle 32}}` is on the top of the stack. + +#. Pop the value :math:`(\mathsf{i{\scriptstyle 32}}{.}\mathsf{const}~i)` from the stack. + +#. If :math:`i + {\mathit{ao}}{.}\mathsf{offset} + N` is greater than :math:`{|z{.}\mathsf{mems}{}[x]{.}\mathsf{bytes}|}`, then: + + a. Trap. + +#. Let :math:`M` be :math:`128 / N`. + +#. If the type of :math:`{\mathit{fresh}}` for which :math:`{|{\mathit{fresh}}|}` :math:`=` :math:`N` is Jnn, then: + + a. Let :math:`{\mathsf{i}}{N}` be the result for which :math:`{|{\mathsf{i}}{N}|}` :math:`=` :math:`N`. + + #. If :math:`j` is less than :math:`{|{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}(c)|}`, then: + + 1) Let :math:`{b^\ast}` be :math:`{{\mathrm{bytes}}}_{{\mathsf{i}}{N}}({{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}(c){}[j])`. + + #) Perform :math:`z{}[{.}\mathsf{mems}{}[x]{.}\mathsf{bytes}{}[i + {\mathit{ao}}{.}\mathsf{offset} : N / 8] = {b^\ast}]`. -Step_read/table.init x y -1. Let z be the current state. -2. Assert: Due to validation, a value of value type I32 is on the top of the stack. -3. Pop the value (I32.CONST n) from the stack. -4. Assert: Due to validation, a value of value type I32 is on the top of the stack. -5. Pop the value (I32.CONST i) from the stack. -6. Assert: Due to validation, a value of value type I32 is on the top of the stack. -7. Pop the value (I32.CONST j) from the stack. -8. If ((i + n) > |$elem(z, y).REFS|), then: - a. Trap. -9. If ((j + n) > |$table(z, x).REFS|), then: - a. Trap. -10. If (n is 0), then: - a. Do nothing. -11. Else if (i < |$elem(z, y).REFS|), then: - a. Push the value (I32.CONST j) to the stack. - b. Push the value $elem(z, y).REFS[i] to the stack. - c. Execute the instruction (TABLE.SET x). - d. Push the value (I32.CONST (j + 1)) to the stack. - e. Push the value (I32.CONST (i + 1)) to the stack. - f. Push the value (I32.CONST (n - 1)) to the stack. - g. Execute the instruction (TABLE.INIT x y). -Step_read/load numtype_u0 sz_sx_u1? ao -1. Let z be the current state. -2. Assert: Due to validation, a value of value type I32 is on the top of the stack. -3. Pop the value (I32.CONST i) from the stack. -4. If sz_sx_u1? is not defined, then: - a. Let nt be numtype_u0. - b. If (((i + ao.OFFSET) + ($size(nt) / 8)) > |$mem(z, 0).BYTES|), then: - 1) Trap. - c. Let c be $nbytes__1^-1(nt, $mem(z, 0).BYTES[(i + ao.OFFSET) : ($size(nt) / 8)]). - d. Push the value (nt.CONST c) to the stack. -5. If the type of numtype_u0 is Inn, then: - a. If sz_sx_u1? is defined, then: - 1) Let ?(sz_sx_0) be sz_sx_u1?. - 2) Let (n, sx) be sz_sx_0. - 3) If (((i + ao.OFFSET) + (n / 8)) > |$mem(z, 0).BYTES|), then: - a) Trap. - b. Let Inn be numtype_u0. - c. If sz_sx_u1? is defined, then: - 1) Let ?(sz_sx_0) be sz_sx_u1?. - 2) Let (n, sx) be sz_sx_0. - 3) Let c be $ibytes__1^-1(n, $mem(z, 0).BYTES[(i + ao.OFFSET) : (n / 8)]). - 4) Push the value (Inn.CONST $extend__(n, $size(Inn), sx, c)) to the stack. +:math:`\mathsf{memory{.}grow}~x` +................................ -Step_read/vload V128 vloadop_u0? ao -1. Let z be the current state. -2. Assert: Due to validation, a value of value type I32 is on the top of the stack. -3. Pop the value (I32.CONST i) from the stack. -4. If vloadop_u0? is not defined, then: - a. If (((i + ao.OFFSET) + ($size(V128) / 8)) > |$mem(z, 0).BYTES|), then: - 1) Trap. - b. Let c be $vbytes__1^-1(V128, $mem(z, 0).BYTES[(i + ao.OFFSET) : ($size(V128) / 8)]). - c. Push the value (V128.CONST c) to the stack. -5. Else: - a. Let ?(vloadop_0) be vloadop_u0?. - b. If vloadop_0 is of the case SHAPE, then: - 1) Let (SHAPE M N sx) be vloadop_0. - 2) If (((i + ao.OFFSET) + ((M · N) / 8)) > |$mem(z, 0).BYTES|), then: - a) Trap. - 3) If the type of $lsize^-1((M · 2)) is Jnn, then: - a) Let Jnn be $lsize^-1((M · 2)). - b) Let j^N be $ibytes__1^-1(M, $mem(z, 0).BYTES[((i + ao.OFFSET) + ((k · M) / 8)) : (M / 8)])^(k |$mem(z, 0).BYTES|), then: - a) Trap. - 3) Let M be (128 / N). - 4) If the type of $lsize^-1(N) is Jnn, then: - a) Let Jnn be $lsize^-1(N). - b) Let j be $ibytes__1^-1(N, $mem(z, 0).BYTES[(i + ao.OFFSET) : (N / 8)]). - c) Let c be $invlanes_((Jnn X M), j^M). - d) Push the value (V128.CONST c) to the stack. - d. If vloadop_0 is of the case ZERO, then: - 1) Let (ZERO N) be vloadop_0. - 2) If (((i + ao.OFFSET) + (N / 8)) > |$mem(z, 0).BYTES|), then: - a) Trap. - 3) Let j be $ibytes__1^-1(N, $mem(z, 0).BYTES[(i + ao.OFFSET) : (N / 8)]). - 4) Let c be $extend__(N, 128, U, j). - 5) Push the value (V128.CONST c) to the stack. -Step_read/vload_lane V128 N ao j -1. Let z be the current state. -2. Assert: Due to validation, a value of value type V128 is on the top of the stack. -3. Pop the value (V128.CONST c_1) from the stack. -4. Assert: Due to validation, a value of value type I32 is on the top of the stack. -5. Pop the value (I32.CONST i) from the stack. -6. If (((i + ao.OFFSET) + (N / 8)) > |$mem(z, 0).BYTES|), then: - a. Trap. -7. Let M be (128 / N). -8. If the type of $lsize^-1(N) is Jnn, then: - a. Let Jnn be $lsize^-1(N). - b. Let k be $ibytes__1^-1(N, $mem(z, 0).BYTES[(i + ao.OFFSET) : (N / 8)]). - c. Let c be $invlanes_((Jnn X M), $lanes_((Jnn X M), c_1) with [j] replaced by k). - d. Push the value (V128.CONST c) to the stack. +1. Let :math:`z` be the current state. -Step_read/memory.size -1. Let z be the current state. -2. Let ((n · 64) · $Ki()) be |$mem(z, 0).BYTES|. -3. Push the value (I32.CONST n) to the stack. +#. Assert: Due to validation, a value of value type :math:`\mathsf{i{\scriptstyle 32}}` is on the top of the stack. -Step_read/memory.fill -1. Let z be the current state. -2. Assert: Due to validation, a value of value type I32 is on the top of the stack. -3. Pop the value (I32.CONST n) from the stack. -4. Assert: Due to validation, a value is on the top of the stack. -5. Pop the value val from the stack. -6. Assert: Due to validation, a value of value type I32 is on the top of the stack. -7. Pop the value (I32.CONST i) from the stack. -8. If ((i + n) > |$mem(z, 0).BYTES|), then: - a. Trap. -9. If (n is 0), then: - a. Do nothing. -10. Else: - a. Push the value (I32.CONST i) to the stack. - b. Push the value val to the stack. - c. Execute the instruction (STORE I32 ?(8) $memarg0()). - d. Push the value (I32.CONST (i + 1)) to the stack. - e. Push the value val to the stack. - f. Push the value (I32.CONST (n - 1)) to the stack. - g. Execute the instruction MEMORY.FILL. +#. Pop the value :math:`(\mathsf{i{\scriptstyle 32}}{.}\mathsf{const}~n)` from the stack. -Step_read/memory.copy -1. Let z be the current state. -2. Assert: Due to validation, a value of value type I32 is on the top of the stack. -3. Pop the value (I32.CONST n) from the stack. -4. Assert: Due to validation, a value of value type I32 is on the top of the stack. -5. Pop the value (I32.CONST i) from the stack. -6. Assert: Due to validation, a value of value type I32 is on the top of the stack. -7. Pop the value (I32.CONST j) from the stack. -8. If ((i + n) > |$mem(z, 0).BYTES|), then: - a. Trap. -9. If ((j + n) > |$mem(z, 0).BYTES|), then: - a. Trap. -10. If (n is 0), then: - a. Do nothing. -11. Else: - a. If (j ≤ i), then: - 1) Push the value (I32.CONST j) to the stack. - 2) Push the value (I32.CONST i) to the stack. - 3) Execute the instruction (LOAD I32 ?((8, U)) $memarg0()). - 4) Execute the instruction (STORE I32 ?(8) $memarg0()). - 5) Push the value (I32.CONST (j + 1)) to the stack. - 6) Push the value (I32.CONST (i + 1)) to the stack. - b. Else: - 1) Push the value (I32.CONST ((j + n) - 1)) to the stack. - 2) Push the value (I32.CONST ((i + n) - 1)) to the stack. - 3) Execute the instruction (LOAD I32 ?((8, U)) $memarg0()). - 4) Execute the instruction (STORE I32 ?(8) $memarg0()). - 5) Push the value (I32.CONST j) to the stack. - 6) Push the value (I32.CONST i) to the stack. - c. Push the value (I32.CONST (n - 1)) to the stack. - d. Execute the instruction MEMORY.COPY. +#. Either: -Step_read/memory.init x -1. Let z be the current state. -2. Assert: Due to validation, a value of value type I32 is on the top of the stack. -3. Pop the value (I32.CONST n) from the stack. -4. Assert: Due to validation, a value of value type I32 is on the top of the stack. -5. Pop the value (I32.CONST i) from the stack. -6. Assert: Due to validation, a value of value type I32 is on the top of the stack. -7. Pop the value (I32.CONST j) from the stack. -8. If ((i + n) > |$data(z, x).BYTES|), then: - a. Trap. -9. If ((j + n) > |$mem(z, 0).BYTES|), then: - a. Trap. -10. If (n is 0), then: - a. Do nothing. -11. Else if (i < |$data(z, x).BYTES|), then: - a. Push the value (I32.CONST j) to the stack. - b. Push the value (I32.CONST $data(z, x).BYTES[i]) to the stack. - c. Execute the instruction (STORE I32 ?(8) $memarg0()). - d. Push the value (I32.CONST (j + 1)) to the stack. - e. Push the value (I32.CONST (i + 1)) to the stack. - f. Push the value (I32.CONST (n - 1)) to the stack. - g. Execute the instruction (MEMORY.INIT x). + a. Let :math:`{\mathit{mi}}` be :math:`{\mathrm{growmem}}(z{.}\mathsf{mems}{}[x], n)`. -Step/ctxt -1. YetI: TODO: It is likely that the value stack of two rules are different. + #. Push the value :math:`(\mathsf{i{\scriptstyle 32}}{.}\mathsf{const}~{|z{.}\mathsf{mems}{}[x]{.}\mathsf{bytes}|} / 64 \, {\mathrm{Ki}})` to the stack. -Step/local.set x -1. Let z be the current state. -2. Assert: Due to validation, a value is on the top of the stack. -3. Pop the value val from the stack. -4. Perform $with_local(z, x, val). + #. Perform :math:`z{}[{.}\mathsf{mems}{}[x] = {\mathit{mi}}]`. -Step/global.set x -1. Let z be the current state. -2. Assert: Due to validation, a value is on the top of the stack. -3. Pop the value val from the stack. -4. Perform $with_global(z, x, val). +#. Or: -Step/table.set x -1. Let z be the current state. -2. Assert: Due to validation, a value is on the top of the stack. -3. Pop the value ref from the stack. -4. Assert: Due to validation, a value of value type I32 is on the top of the stack. -5. Pop the value (I32.CONST i) from the stack. -6. If (i ≥ |$table(z, x).REFS|), then: - a. Trap. -7. Perform $with_table(z, x, i, ref). + a. Push the value :math:`(\mathsf{i{\scriptstyle 32}}{.}\mathsf{const}~{{{{\mathrm{signed}}}_{32}^{{-1}}}}{({-1})})` to the stack. -Step/table.grow x -1. Let z be the current state. -2. Assert: Due to validation, a value of value type I32 is on the top of the stack. -3. Pop the value (I32.CONST n) from the stack. -4. Assert: Due to validation, a value is on the top of the stack. -5. Pop the value ref from the stack. -6. Either: - a. Let ti be $growtable($table(z, x), n, ref). - b. Push the value (I32.CONST |$table(z, x).REFS|) to the stack. - c. Perform $with_tableinst(z, x, ti). -7. Or: - a. Push the value (I32.CONST $invsigned_(32, (- 1))) to the stack. -Step/elem.drop x -1. Let z be the current state. -2. Perform $with_elem(z, x, []). +:math:`\mathsf{data{.}drop}~x` +.............................. -Step/store numtype_u1 sz_u2? ao -1. Let z be the current state. -2. Assert: Due to validation, a value of value type numtype_u0 is on the top of the stack. -3. Pop the value (numtype_u0.CONST c) from the stack. -4. Assert: Due to validation, a value of value type I32 is on the top of the stack. -5. Pop the value (I32.CONST i) from the stack. -6. If sz_u2? is not defined, then: - a. Let nt be numtype_u1. - b. If (numtype_u0 is nt), then: - 1) If (((i + ao.OFFSET) + ($size(nt) / 8)) > |$mem(z, 0).BYTES|), then: - a) Trap. - 2) Let b* be $nbytes_(nt, c). - 3) Perform $with_mem(z, 0, (i + ao.OFFSET), ($size(nt) / 8), b*). -7. Else: - a. Let ?(n) be sz_u2?. - b. If the type of numtype_u1 is Inn, then: - 1) Let Inn be numtype_u1. - 2) If (numtype_u0 is Inn), then: - a) If (((i + ao.OFFSET) + (n / 8)) > |$mem(z, 0).BYTES|), then: - 1. Trap. - b) Let b* be $ibytes_(n, $wrap__($size(Inn), n, c)). - c) Perform $with_mem(z, 0, (i + ao.OFFSET), (n / 8), b*). -Step/vstore V128 ao -1. Let z be the current state. -2. Assert: Due to validation, a value of value type V128 is on the top of the stack. -3. Pop the value (V128.CONST c) from the stack. -4. Assert: Due to validation, a value of value type I32 is on the top of the stack. -5. Pop the value (I32.CONST i) from the stack. -6. If (((i + ao.OFFSET) + ($size(V128) / 8)) > |$mem(z, 0).BYTES|), then: - a. Trap. -7. Let b* be $vbytes_(V128, c). -8. Perform $with_mem(z, 0, (i + ao.OFFSET), ($size(V128) / 8), b*). +1. Let :math:`z` be the current state. -Step/vstore_lane V128 N ao j -1. Let z be the current state. -2. Assert: Due to validation, a value of value type V128 is on the top of the stack. -3. Pop the value (V128.CONST c) from the stack. -4. Assert: Due to validation, a value of value type I32 is on the top of the stack. -5. Pop the value (I32.CONST i) from the stack. -6. If (((i + ao.OFFSET) + N) > |$mem(z, 0).BYTES|), then: - a. Trap. -7. Let M be (128 / N). -8. If the type of $lsize^-1(N) is Jnn, then: - a. Let Jnn be $lsize^-1(N). - b. If (j < |$lanes_((Jnn X M), c)|), then: - 1) Let b* be $ibytes_(N, $lanes_((Jnn X M), c)[j]). - 2) Perform $with_mem(z, 0, (i + ao.OFFSET), (N / 8), b*). +#. Perform :math:`z{}[{.}\mathsf{datas}{}[x]{.}\mathsf{bytes} = \epsilon]`. -Step/memory.grow -1. Let z be the current state. -2. Assert: Due to validation, a value of value type I32 is on the top of the stack. -3. Pop the value (I32.CONST n) from the stack. -4. Either: - a. Let mi be $growmemory($mem(z, 0), n). - b. Push the value (I32.CONST (|$mem(z, 0).BYTES| / (64 · $Ki()))) to the stack. - c. Perform $with_meminst(z, 0, mi). -5. Or: - a. Push the value (I32.CONST $invsigned_(32, (- 1))) to the stack. -Step/data.drop x -1. Let z be the current state. -2. Perform $with_data(z, x, []). +:math:`{\mathrm{eval}}_{\mathit{expr}}({{\mathit{instr}}^\ast})` +................................................................ + + +1. Execute the instruction :math:`{{\mathit{instr}}^\ast}`. + +#. Pop the value :math:`{\mathit{val}}` from the stack. + +#. Return :math:`{\mathit{val}}`. + -eval_expr instr* -1. Execute the instruction instr*. -2. Pop the value val from the stack. -3. Return [val]. == Complete. -Generating prose for Wasm 3.0... watsup 0.4 generator == Parsing... == Elaboration... @@ -4142,9 +21632,6 @@ watsup 0.4 generator 6-typing.watsup:817.9-817.55: if_expr_to_instrs: Yet `(($unpack(zt) = (numtype : numtype <: valtype)) \/ ($unpack(zt) = (vectype : vectype <: valtype)))` 6-typing.watsup:851.9-851.55: if_expr_to_instrs: Yet `(($unpack(zt) = (numtype : numtype <: valtype)) \/ ($unpack(zt) = (vectype : vectype <: valtype)))` 6-typing.watsup:1309.9-1309.30: if_expr_to_instrs: Yet `$disjoint_(syntax name, nm*{nm : name})` -================= - Generated prose -================= Numtype_ok - the number type numtype is valid. @@ -8871,5 +26358,6 @@ eval_expr instr* 1. Execute the instruction instr*. 2. Pop the value val from the stack. 3. Return [val]. + == Complete. ``` From 15c625281a06158a18748b6246add087c6137c3b Mon Sep 17 00:00:00 2001 From: 702fbtngus <702fbtngus@kaist.ac.kr> Date: Wed, 7 Aug 2024 19:59:03 +0900 Subject: [PATCH 04/26] Recover state implemented --- spectec/src/backend-interpreter/ds.ml | 1 - spectec/src/backend-prose/gen.ml | 8 +-- spectec/src/il2al/translate.ml | 3 +- spectec/src/il2al/transpile.ml | 82 +++++++++++++++++++++++---- spectec/src/il2al/transpile.mli | 1 + spectec/test-prose/TEST.md | 76 ++++++++++++------------- 6 files changed, 116 insertions(+), 55 deletions(-) diff --git a/spectec/src/backend-interpreter/ds.ml b/spectec/src/backend-interpreter/ds.ml index e11493b542..e91cf247f5 100644 --- a/spectec/src/backend-interpreter/ds.ml +++ b/spectec/src/backend-interpreter/ds.ml @@ -335,7 +335,6 @@ end (* Initialization *) let init algos = - let algos = List.map Il2al.Transpile.remove_state algos in (* Initialize info_map *) let init_info algo = diff --git a/spectec/src/backend-prose/gen.ml b/spectec/src/backend-prose/gen.ml index b8b87bcf16..397e7e8101 100644 --- a/spectec/src/backend-prose/gen.ml +++ b/spectec/src/backend-prose/gen.ml @@ -466,12 +466,10 @@ let gen_validation_prose () = let gen_execution_prose () = List.map (fun algo -> - let handle_state = match algo.it with - | Al.Ast.RuleA _ -> Il2al.Transpile.insert_state_binding - | Al.Ast.FuncA _ -> Il2al.Transpile.remove_state - in let algo = - handle_state algo + algo + |> Il2al.Transpile.recover_state + |> Il2al.Transpile.insert_state_binding |> Il2al.Transpile.remove_exit |> Il2al.Transpile.remove_enter in diff --git a/spectec/src/il2al/translate.ml b/spectec/src/il2al/translate.ml index cc78b645a6..1be9158a43 100644 --- a/spectec/src/il2al/translate.ml +++ b/spectec/src/il2al/translate.ml @@ -1399,4 +1399,5 @@ let translate il = |> Animate.transform in - translate_helpers il' @ translate_rules il' + let al = (translate_helpers il' @ translate_rules il') in + List.map Transpile.remove_state al diff --git a/spectec/src/il2al/transpile.ml b/spectec/src/il2al/transpile.ml index d1a76622c0..72cf1f97ee 100644 --- a/spectec/src/il2al/transpile.ml +++ b/spectec/src/il2al/transpile.ml @@ -546,6 +546,60 @@ let remove_state algo = | rule -> rule } +let get_state_arg_opt f = + let arg = ref (TypA (Il.Ast.BoolT $ no_region)) in + let id = f $ no_region in + match Il.Env.find_def !Al.Valid.env id with + | (params, _, _) -> + let param_state = List.find_opt ( + fun param -> + match param.it with + | Il.Ast.ExpP (id, ({ at = _ ; it = VarT ({ at = _ ; it = "state"; note = _ ;}, _); note = _ } as typ)) -> + arg := ExpA ((VarE "z") $$ id.at % typ); + true + | _ -> false + ) params in + if Option.is_some param_state then ( + let param_state = Option.get param_state in + Option.some {param_state with it = !arg} + ) else Option.none + +let recover_state algo = + + let recover_state_expr expr = + match expr.it with + | CallE (f, args) -> + let arg_state = get_state_arg_opt f in + if Option.is_some arg_state then + let answer = {expr with it = CallE (f, Option.get arg_state :: args)} in + answer + else expr + | _ -> expr + in + + let recover_state_instr instr = + match instr.it with + | PerformI (f, args) -> + let arg_state = get_state_arg_opt f in + if Option.is_some arg_state then + let answer = {instr with it = PerformI (f, Option.get arg_state :: args)} in + [answer] + else [instr] + | _ -> [instr] + in + + let walk_config = + { + Walk.default_config with + (* pre_instr = ; *) + pre_expr = recover_state_expr; + pre_instr = recover_state_instr + } + in + + let algo' = Walk.walk walk_config algo in + algo' + let insert_state_binding algo = let state_count = ref 0 in @@ -564,16 +618,24 @@ let insert_state_binding algo = in let algo' = Walk.walk walk_config algo in - { algo' with it = - match algo'.it with - | FuncA (name, params, body) when !state_count > 0 -> - let body = (letI (varE "z" ~note:stateT, getCurStateE () ~note:stateT)) :: body in - FuncA (name, params, body) - | RuleA (name, anchor, params, body) when !state_count > 0 -> - let body = (letI (varE "z" ~note:stateT, getCurStateE () ~note:stateT)) :: body in - RuleA (name, anchor, params, body) - | a -> a - } + if !state_count > 0 then ( + match algo.it with + | RuleA _ -> + { algo' with it = + match algo'.it with + | FuncA (name, params, body) -> + let body = (letI (varE "z" ~note:stateT, getCurStateE () ~note:stateT)) :: body in + FuncA (name, params, body) + | RuleA (name, anchor, params, body) -> + let body = (letI (varE "z" ~note:stateT, getCurStateE () ~note:stateT)) :: body in + RuleA (name, anchor, params, body) + } + | FuncA (id, args, instrs) -> + let answer = {algo with it = FuncA (id, {at = no; it = ExpA (varE "z" ~note:stateT); note = ()} :: args, instrs)} in + answer + ) + else algo' + (* Insert "Let f be the current frame" if necessary. *) let insert_frame_binding instrs = diff --git a/spectec/src/il2al/transpile.mli b/spectec/src/il2al/transpile.mli index da58e263f6..181dce71dd 100644 --- a/spectec/src/il2al/transpile.mli +++ b/spectec/src/il2al/transpile.mli @@ -6,6 +6,7 @@ val simplify_record_concat : expr -> expr val enhance_readability : instr list -> instr list val flatten_if : instr list -> instr list val remove_state : algorithm -> algorithm +val recover_state : algorithm -> algorithm val insert_state_binding : algorithm -> algorithm val insert_frame_binding : instr list -> instr list val handle_frame : arg list -> instr list -> instr list diff --git a/spectec/test-prose/TEST.md b/spectec/test-prose/TEST.md index 1606a077bb..9211ffba6d 100644 --- a/spectec/test-prose/TEST.md +++ b/spectec/test-prose/TEST.md @@ -2067,8 +2067,8 @@ watsup 0.4 generator #. Return. -:math:`{\mathrm{instantiate}}({\mathit{module}}, {{\mathit{externval}}^\ast})` -.............................................................................. +:math:`{\mathrm{instantiate}}(z, {\mathit{module}}, {{\mathit{externval}}^\ast})` +................................................................................. 1. Assert: Due to validation, :math:`{\mathit{module}}` is of the case :math:`\mathsf{module}`. @@ -2142,15 +2142,15 @@ watsup 0.4 generator #. Return :math:`f{.}\mathsf{module}`. -:math:`{\mathrm{invoke}}({\mathit{fa}}, {{\mathit{val}}^{n}})` -.............................................................. +:math:`{\mathrm{invoke}}(z, {\mathit{fa}}, {{\mathit{val}}^{n}})` +................................................................. 1. Let :math:`f` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{locals}~\epsilon,\; \mathsf{module}~\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{exports}~\epsilon \}\end{array} \}\end{array}`. #. Push the activation of :math:`f` to the stack. -#. Let :math:`{t_1^{n}} \rightarrow {t_2^\ast}` be :math:`{\mathrm{funcinst}}{}[{\mathit{fa}}]{.}\mathsf{type}`. +#. Let :math:`{t_1^{n}} \rightarrow {t_2^\ast}` be :math:`z{.}\mathsf{funcs}{}[{\mathit{fa}}]{.}\mathsf{type}`. #. Pop the activation of :math:`f` from the stack. @@ -3838,7 +3838,7 @@ initdata moduleinst u32_u0* byte_u1* 7. Perform $initdata(moduleinst, i'*, b'**). 8. Return. -instantiate module externval* +instantiate z module externval* 1. Assert: Due to validation, module is of the case MODULE. 2. Let (MODULE type* import* func* global* table* mem* elem* data* start? export*) be module. 3. Assert: Due to validation, type is of the case TYPE*. @@ -3875,10 +3875,10 @@ instantiate module externval* 32. Pop the activation of f with arity 0 from the stack. 33. Return f.MODULE. -invoke fa val^n +invoke z fa val^n 1. Let f be { LOCALS: []; MODULE: { TYPES: []; FUNCS: []; GLOBALS: []; TABLES: []; MEMS: []; EXPORTS: []; }; }. 2. Push the activation of f to the stack. -3. Let (t_1^n -> t_2*) be $funcinst()[fa].TYPE. +3. Let (t_1^n -> t_2*) be $funcinst(z)[fa].TYPE. 4. Pop the activation of _f from the stack. 5. Let k be |t_2*|. 6. Push the activation of f with arity k to the stack. @@ -7348,8 +7348,8 @@ watsup 0.4 generator #. Return :math:`{\mathit{mi}'}`. -:math:`{\mathrm{blocktype}}({\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}})` -.......................................................................................... +:math:`{{\mathrm{blocktype}}}_{z}({\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}})` +................................................................................................ 1. If :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is :math:`\epsilon`, then: @@ -7370,7 +7370,7 @@ watsup 0.4 generator #. Let :math:`x` be :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. -#. Return :math:`{\mathrm{type}}(x)`. +#. Return :math:`z{.}\mathsf{types}{}[x]`. :math:`{\mathrm{funcs}}({{\mathit{externval}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})` @@ -7807,8 +7807,8 @@ watsup 0.4 generator #. Return :math:`{{\mathit{instr}}^\ast}~(\mathsf{i{\scriptstyle 32}}{.}\mathsf{const}~0)~(\mathsf{i{\scriptstyle 32}}{.}\mathsf{const}~n)~(\mathsf{memory{.}init}~i)~(\mathsf{data{.}drop}~i)`. -:math:`{\mathrm{instantiate}}({\mathit{module}}, {{\mathit{externval}}^\ast})` -.............................................................................. +:math:`{\mathrm{instantiate}}(z, {\mathit{module}}, {{\mathit{externval}}^\ast})` +................................................................................. 1. Assert: Due to validation, :math:`{\mathit{module}}` is of the case :math:`\mathsf{module}`. @@ -7880,15 +7880,15 @@ watsup 0.4 generator #. Return :math:`f{.}\mathsf{module}`. -:math:`{\mathrm{invoke}}({\mathit{fa}}, {{\mathit{val}}^{n}})` -.............................................................. +:math:`{\mathrm{invoke}}(z, {\mathit{fa}}, {{\mathit{val}}^{n}})` +................................................................. 1. Let :math:`f` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{locals}~\epsilon,\; \mathsf{module}~\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~\epsilon,\; \mathsf{funcs}~\epsilon,\; \mathsf{globals}~\epsilon,\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{exports}~\epsilon \}\end{array} \}\end{array}`. #. Push the activation of :math:`f` to the stack. -#. Let :math:`{t_1^{n}} \rightarrow {t_2^\ast}` be :math:`{\mathrm{funcinst}}{}[{\mathit{fa}}]{.}\mathsf{type}`. +#. Let :math:`{t_1^{n}} \rightarrow {t_2^\ast}` be :math:`z{.}\mathsf{funcs}{}[{\mathit{fa}}]{.}\mathsf{type}`. #. Pop the activation of :math:`f` from the stack. @@ -11201,7 +11201,7 @@ growmemory mi n a. Let mi' be { TYPE: (PAGE (i', j)); BYTES: b* ++ 0^(n · (64 · $Ki())); }. b. Return mi'. -blocktype blocktype_u1 +blocktype z blocktype_u1 1. If (blocktype_u1 is (_RESULT ?())), then: a. Return ([] -> []). 2. If blocktype_u1 is of the case _RESULT, then: @@ -11211,7 +11211,7 @@ blocktype blocktype_u1 2) Return ([] -> [t]). 3. Assert: Due to validation, blocktype_u1 is of the case _IDX. 4. Let (_IDX x) be blocktype_u1. -5. Return $type(x). +5. Return $type(z, x). funcs externval_u0* 1. If (externval_u0* is []), then: @@ -11420,7 +11420,7 @@ rundata (DATA byte* datamode_u0) i 5. Let n be |byte*|. 6. Return instr* ++ [(I32.CONST 0), (I32.CONST n), (MEMORY.INIT i), (DATA.DROP i)]. -instantiate module externval* +instantiate z module externval* 1. Assert: Due to validation, module is of the case MODULE. 2. Let (MODULE type* import* func* global* table* mem* elem* data* start? export*) be module. 3. Assert: Due to validation, type is of the case TYPE*. @@ -11456,10 +11456,10 @@ instantiate module externval* 31. Pop the activation of f with arity 0 from the stack. 32. Return f.MODULE. -invoke fa val^n +invoke z fa val^n 1. Let f be { LOCALS: []; MODULE: { TYPES: []; FUNCS: []; GLOBALS: []; TABLES: []; MEMS: []; ELEMS: []; DATAS: []; EXPORTS: []; }; }. 2. Push the activation of f to the stack. -3. Let (t_1^n -> t_2*) be $funcinst()[fa].TYPE. +3. Let (t_1^n -> t_2*) be $funcinst(z)[fa].TYPE. 4. Pop the activation of _f from the stack. 5. Let k be |t_2*|. 6. Push the activation of f with arity k to the stack. @@ -18389,17 +18389,17 @@ watsup 0.4 generator #. Return :math:`{\mathit{meminst}'}`. -:math:`{{\mathrm{blocktype}}}_{{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}` -............................................................................................. +:math:`{{\mathrm{blocktype}}}_{z}({\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}})` +................................................................................................ 1. If :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case , then: a. Let :math:`x` be :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. - #. Assert: Due to validation, :math:`{\mathrm{expand}}({\mathrm{type}}(x))` is of the case :math:`\mathsf{func}`. + #. Assert: Due to validation, :math:`{\mathrm{expand}}(z{.}\mathsf{types}{}[x])` is of the case :math:`\mathsf{func}`. - #. Let :math:`(\mathsf{func}~{\mathit{ft}})` be :math:`{\mathrm{expand}}({\mathrm{type}}(x))`. + #. Let :math:`(\mathsf{func}~{\mathit{ft}})` be :math:`{\mathrm{expand}}(z{.}\mathsf{types}{}[x])`. #. Return :math:`{\mathit{ft}}`. @@ -18808,8 +18808,8 @@ watsup 0.4 generator #. Return :math:`{{\mathit{instr}}^\ast}~(\mathsf{i{\scriptstyle 32}}{.}\mathsf{const}~0)~(\mathsf{i{\scriptstyle 32}}{.}\mathsf{const}~n)~(\mathsf{memory{.}init}~y~x)~(\mathsf{data{.}drop}~x)`. -:math:`{\mathrm{evalglobals}}({{\mathit{globaltype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}, {{\mathit{expr}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast})` -.................................................................................................................................................................... +:math:`{{{\mathrm{evalglobal}}^\ast}}{(z, {{\mathit{globaltype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}, {{\mathit{expr}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast})}` +................................................................................................................................................................................. 1. Let :math:`z` be the current frame. @@ -18834,13 +18834,13 @@ watsup 0.4 generator #. Append :math:`a` to the :math:`f{.}\mathsf{module}{.}\mathsf{globals}`. -#. Let :math:`{{\mathit{val}'}^\ast}` be :math:`{\mathrm{evalglobals}}({{\mathit{gt}'}^\ast}, {{\mathit{expr}'}^\ast})`. +#. Let :math:`{{\mathit{val}'}^\ast}` be :math:`{{{\mathrm{evalglobal}}^\ast}}{(z, {{\mathit{gt}'}^\ast}, {{\mathit{expr}'}^\ast})}`. #. Return :math:`{\mathit{val}}~{{\mathit{val}'}^\ast}`. -:math:`{\mathrm{instantiate}}({\mathit{module}}, {{\mathit{externval}}^\ast})` -.............................................................................. +:math:`{\mathrm{instantiate}}(z, {\mathit{module}}, {{\mathit{externval}}^\ast})` +................................................................................. 1. Let :math:`{{\mathit{xt}}_{\mathsf{i}}^\ast} \rightarrow {{\mathit{xt}}_{\mathsf{e}}^\ast}` be :math:`{\mathrm{Module}}_{\mathit{ok}}({\mathit{module}})`. @@ -18881,7 +18881,7 @@ watsup 0.4 generator #. Push the activation of :math:`z` to the stack. -#. Let :math:`{{\mathit{val}}_{\mathsf{g}}^\ast}` be :math:`{\mathrm{evalglobals}}({{\mathit{globaltype}}^\ast}, {{\mathit{expr}}_{\mathsf{g}}^\ast})`. +#. Let :math:`{{\mathit{val}}_{\mathsf{g}}^\ast}` be :math:`{{{\mathrm{evalglobal}}^\ast}}{(z, {{\mathit{globaltype}}^\ast}, {{\mathit{expr}}_{\mathsf{g}}^\ast})}`. #. Pop the activation of :math:`{z'}` from the stack. @@ -24807,11 +24807,11 @@ growmem meminst n b. Let meminst' be { TYPE: (PAGE (i', j)); BYTES: b* ++ 0^(n · (64 · $Ki())); }. c. Return meminst'. -blocktype_ blocktype_u0 +blocktype_ z blocktype_u0 1. If blocktype_u0 is of the case _IDX, then: a. Let (_IDX x) be blocktype_u0. - b. Assert: Due to validation, $expanddt($type(x)) is of the case FUNC. - c. Let (FUNC ft) be $expanddt($type(x)). + b. Assert: Due to validation, $expanddt($type(z, x)) is of the case FUNC. + c. Let (FUNC ft) be $expanddt($type(z, x)). d. Return ft. 2. Assert: Due to validation, blocktype_u0 is of the case _RESULT. 3. Let (_RESULT t?) be blocktype_u0. @@ -25007,7 +25007,7 @@ rundata_ x (DATA b^n datamode_u0) 3. Let (ACTIVE y instr*) be datamode_u0. 4. Return instr* ++ [(I32.CONST 0), (I32.CONST n), (MEMORY.INIT y x), (DATA.DROP x)]. -evalglobals globaltype_u0* expr_u1* +evalglobals z globaltype_u0* expr_u1* 1. Let z be the current frame. 2. If ((globaltype_u0* is []) and (expr_u1* is [])), then: a. Return []. @@ -25019,10 +25019,10 @@ evalglobals globaltype_u0* expr_u1* 8. Let f be z. 9. Let a be $allocglobal(gt, val). 10. Append a to the f.MODULE.GLOBALS. -11. Let val'* be $evalglobals(gt'*, expr'*). +11. Let val'* be $evalglobals(z, gt'*, expr'*). 12. Return [val] ++ val'*. -instantiate module externval* +instantiate z module externval* 1. Let (xt_I* -> xt_E*) be $Module_ok(module). 2. Assert: Due to validation, module is of the case MODULE. 3. Let (MODULE type* import* func* global* table* mem* elem* data* start? export*) be module. @@ -25042,7 +25042,7 @@ instantiate module externval* 17. Let instr_S? be (CALL x)?. 18. Let z be { LOCALS: []; MODULE: moduleinst_0; }. 19. Push the activation of z to the stack. -20. Let val_G* be $evalglobals(globaltype*, expr_G*). +20. Let val_G* be $evalglobals(z, globaltype*, expr_G*). 21. Pop the activation of z' from the stack. 22. Push the activation of z' to the stack. 23. Let [ref_T]* be $eval_expr(expr_T)*. From 638e76b67a698f6e37ef9ba69047060425e84050 Mon Sep 17 00:00:00 2001 From: 702fbtngus <702fbtngus@kaist.ac.kr> Date: Thu, 8 Aug 2024 16:22:35 +0900 Subject: [PATCH 05/26] Modify is_state, is_store, is_frame --- .../src/backend-interpreter/interpreter.ml | 13 ++++++-- spectec/src/il2al/transpile.ml | 32 +++++++++++-------- spectec/test-prose/TEST.md | 14 +++----- 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/spectec/src/backend-interpreter/interpreter.ml b/spectec/src/backend-interpreter/interpreter.ml index 0178e4832d..550d7cd3ad 100644 --- a/spectec/src/backend-interpreter/interpreter.ml +++ b/spectec/src/backend-interpreter/interpreter.ml @@ -633,8 +633,17 @@ and step_instr (fname: string) (ctx: AlContext.t) (env: value Env.t) (instr: ins ctx | AppendI (e1, e2) -> let a = eval_expr env e1 |> unwrap_listv in - let v = eval_expr env e2 in - a := Array.append !a [|v|]; + let v = ( + match e2.it with + | IterE (_, _, _) -> ( + match eval_expr env e2 with + | ListV a -> !a + | _ -> failwith "wrong IterE" + ) + | _ -> + [|eval_expr env e2|] + ) in + a := Array.append !a v; ctx | _ -> failwith "cannot step instr" diff --git a/spectec/src/il2al/transpile.ml b/spectec/src/il2al/transpile.ml index 72cf1f97ee..c858959a45 100644 --- a/spectec/src/il2al/transpile.ml +++ b/spectec/src/il2al/transpile.ml @@ -448,18 +448,14 @@ let rec mk_access ps base = | h :: t -> accE (base, h) ~note:Al.Al_util.no_note |> mk_access t | [] -> base -let is_store expr = match expr.it with - | VarE s -> - s = "s" || String.starts_with ~prefix:"s'" s || String.starts_with ~prefix:"s_" s +let is_store expr = match expr.note.it with + | Il.Ast.VarT (id, _) when id.it = "store" -> true | _ -> false -let is_frame expr = match expr.it with - | VarE f -> - f = "f" || String.starts_with ~prefix:"f'" f || String.starts_with ~prefix:"f_" f +let is_frame expr = match expr.note.it with + | Il.Ast.VarT (id, _) when id.it = "frame" -> true | _ -> false -let is_state expr = match expr.it with - | TupE [ s; f ] -> is_store s && is_frame f - | VarE z -> - z = "z" || String.starts_with ~prefix:"z'" z || String.starts_with ~prefix:"z_" z +let is_state expr = match expr.note.it with + | Il.Ast.VarT (id, _) when id.it = "state" -> true | _ -> false let is_store_arg arg = match arg.it with @@ -490,8 +486,6 @@ let hide_state_expr expr = let hide_state instr = let at = instr.at in match instr.it with - (* Return *) - | ReturnI (Some e) when is_state e || is_store e -> [ returnI None ~at:at ] (* Perform *) | LetI (e, { it = CallE (fname, args); _ }) when is_state e || is_store e -> [ performI (fname, hide_state_args args) ~at:at ] | PerformI (f, args) -> [ performI (f, hide_state_args args) ~at:at ] @@ -507,17 +501,27 @@ let hide_state instr = appendI (access, e1) ~at:at; returnI (Some addr) ~at:at ] (* Replace store *) + | ReturnI (Some ({ it = TupE [ { it = UpdE (s, ps, e); note; _ }; f ]; _ })) when is_store s && is_frame f -> + let hs, t = Lib.List.split_last ps in + let access = { (mk_access hs s) with note } in + [ replaceI (access, t, e) ~at:at ] | LetI (_, { it = UpdE (s, ps, e); note; _ }) - | ReturnI (Some ({ it = TupE [ { it = UpdE (s, ps, e); note; _ }; { it = VarE "f"; _ } ]; _ })) | ReturnI (Some ({ it = UpdE (s, ps, e); note; _ })) when is_store s -> let hs, t = Lib.List.split_last ps in let access = { (mk_access hs s) with note } in [ replaceI (access, t, e) ~at:at ] (* Replace frame *) - | ReturnI (Some ({ it = TupE [ { it = VarE "s"; _ }; { it = UpdE (f, ps, e); note; _ } ]; _ })) when is_frame f -> + | ReturnI (Some ({ it = TupE [ s; { it = UpdE (f, ps, e); note; _ } ]; _ })) when is_store s && is_frame f -> let hs, t = Lib.List.split_last ps in let access = { (mk_access hs f) with note } in [ replaceI (access, t, e) ~at:at ] + (* Append store *) + | ReturnI (Some ({ it = TupE [ { it = ExtE (s, ps, e, Back); note; _ }; f ]; _ })) when is_store s && is_frame f -> + (* let hs, t = Lib.List.split_last ps in *) + let access = { (mk_access ps s) with note } in + [ appendI (access, e) ~at:at ] + (* Return *) + | ReturnI (Some e) when is_state e || is_store e -> [ returnI None ~at:at ] | _ -> [ instr ] let remove_state algo = diff --git a/spectec/test-prose/TEST.md b/spectec/test-prose/TEST.md index 9211ffba6d..08fa2d1652 100644 --- a/spectec/test-prose/TEST.md +++ b/spectec/test-prose/TEST.md @@ -18345,18 +18345,14 @@ watsup 0.4 generator .................................................................. -1. Let :math:`f` be the current frame. - -#. Return :math:`(s{}[{.}\mathsf{structs} \mathrel{{=}{\oplus}} {{\mathit{si}}^\ast}], f)`. +1. Append :math:`{{\mathit{si}}^\ast}` to the :math:`s{.}\mathsf{structs}`. :math:`{\mathrm{add}}_{\mathit{arrayinst}}({{\mathit{ai}}^\ast})` ................................................................. -1. Let :math:`f` be the current frame. - -#. Return :math:`(s{}[{.}\mathsf{arrays} \mathrel{{=}{\oplus}} {{\mathit{ai}}^\ast}], f)`. +1. Append :math:`{{\mathit{ai}}^\ast}` to the :math:`s{.}\mathsf{arrays}`. :math:`{\mathrm{growtable}}({\mathit{tableinst}}, n, r)` @@ -24786,12 +24782,10 @@ with_array a i fv 1. Replace s.ARRAYS[a].FIELDS[i] with fv. add_structinst si* -1. Let f be the current frame. -2. Return (s with .STRUCTS appended by si*, f). +1. Append si* to the s.STRUCTS. add_arrayinst ai* -1. Let f be the current frame. -2. Return (s with .ARRAYS appended by ai*, f). +1. Append ai* to the s.ARRAYS. growtable tableinst n r 1. Let { TYPE: ((i, j), rt); REFS: r'*; } be tableinst. From 7b0f2a9367ea94e850bcf0efbd8c8d6a2ad9d9d9 Mon Sep 17 00:00:00 2001 From: Wonho Date: Thu, 8 Aug 2024 20:09:47 +0900 Subject: [PATCH 06/26] Minor change to AppendI interpretation --- .../src/backend-interpreter/interpreter.ml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/spectec/src/backend-interpreter/interpreter.ml b/spectec/src/backend-interpreter/interpreter.ml index 550d7cd3ad..57170ab72c 100644 --- a/spectec/src/backend-interpreter/interpreter.ml +++ b/spectec/src/backend-interpreter/interpreter.ml @@ -633,17 +633,17 @@ and step_instr (fname: string) (ctx: AlContext.t) (env: value Env.t) (instr: ins ctx | AppendI (e1, e2) -> let a = eval_expr env e1 |> unwrap_listv in - let v = ( - match e2.it with - | IterE (_, _, _) -> ( - match eval_expr env e2 with - | ListV a -> !a - | _ -> failwith "wrong IterE" - ) - | _ -> - [|eval_expr env e2|] - ) in - a := Array.append !a v; + (match e2.note.it, eval_expr env e2 with + | IterT _, ListV arr_ref -> a := Array.append !a !arr_ref + | IterT (_, Opt), OptV opt -> + a := opt |> Option.to_list |> Array.of_list |> Array.append !a + | IterT _, v -> + v + |> string_of_value + |> sprintf "the expression is evaluated to %s, not a iterable data type" + |> fail_expr e2 + | _, v -> a := Array.append !a [|v|] + ); ctx | _ -> failwith "cannot step instr" From 2d82283b1b2ac0ee3d68b3bde822e476ea19bb9c Mon Sep 17 00:00:00 2001 From: Wonho Date: Fri, 9 Aug 2024 15:19:58 +0900 Subject: [PATCH 07/26] Refactor type unification in AL validation --- spectec/src/al/valid.ml | 60 ++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/spectec/src/al/valid.ml b/spectec/src/al/valid.ml index e4fb2b0dc9..4eaa755dc6 100644 --- a/spectec/src/al/valid.ml +++ b/spectec/src/al/valid.ml @@ -32,6 +32,10 @@ let error_struct source typ = let error_tuple source typ = error_valid "invalid tuple type" source (Il.Print.string_of_typ typ) + +let (let*) = Option.bind + + (* Bound Set *) module Set = Free.IdSet @@ -64,7 +68,7 @@ let get_deftyps (id: Il.Ast.id) (args: Il.Ast.arg list): deftyp list = | ExpA { it=SubE (_, typ, _); _ } -> typ | ExpA { note; _ } -> note | TypA typ -> typ - | _ -> failwith ("TODO: " ^ Il.Print.string_of_arg (Eval.reduce_arg !env arg)) + | a -> failwith ("TODO: " ^ Il.Print.string_of_arg (a $ arg.at)) in let InstD (_, inst_args, deftyp) = inst.it in @@ -89,40 +93,47 @@ let rec unify_deftyp_opt (deftyp: deftyp) : typ option = | StructT _ -> None | VariantT typcases when List.for_all (fun (mixop', _, _) -> is_trivial_mixop mixop') typcases -> - (match typcases with - | (_, (_, typ, _), _) :: _ - when - typcases - |> List.map (fun (_, (_, typ', _), _) -> unify_opt typ typ') - |> List.for_all Option.is_some - -> Some typ - | _ -> None - ) + typcases |> List.map (fun (_, (_, typ, _), _) -> typ) |> unify_typs_opt | _ -> None -and unify_opt (typ1: typ) (typ2: typ) : typ option = +and unify_deftyps_opt : deftyp list -> typ option = function + | [] -> None + | [deftyp] -> unify_deftyp_opt deftyp + | deftyp :: deftyps -> + let* typ1 = unify_deftyp_opt deftyp in + let* typ2 = unify_deftyps_opt deftyps in + unify_typ_opt typ1 typ2 + +and unify_typ_opt (typ1: typ) (typ2: typ) : typ option = let typ1', typ2' = ground_typ_of typ1, ground_typ_of typ2 in match typ1'.it, typ2'.it with - | VarT (id1, _), VarT (id2, _) when id1 = id2 -> Some (ground_typ_of typ1) - | BoolT, BoolT | NumT _, NumT _ | TextT, TextT -> Some typ1 + | VarT (id1, _), VarT (id2, _) when id1 = id2 -> Some typ1' + | BoolT, BoolT | NumT _, NumT _ | TextT, TextT -> Some typ1' | TupT etl1, TupT etl2 -> - let (let*) = Option.bind in - let etl = + let* etl = List.fold_right2 (fun et1 et2 acc -> let* acc = acc in - let* res = unify_opt (snd et1) (snd et2) in + let* res = unify_typ_opt (snd et1) (snd et2) in Some ((fst et1, res) :: acc) ) etl1 etl2 (Some []) in - Option.map (fun etl -> TupT etl $ typ1.at) etl + Some (TupT etl $ typ1.at) | IterT (typ1'', iter), IterT (typ2'', _) -> - Option.map (fun typ -> IterT (typ, iter) $ typ1.at) (unify_opt typ1'' typ2'') + let* typ = unify_typ_opt typ1'' typ2'' in + Some (IterT (typ, iter) $ typ1.at) | _ -> None +and unify_typs_opt : typ list -> typ option = function + | [] -> None + | [typ] -> Some typ + | typ :: typs' -> + let* unified_typ = unify_typs_opt typs' in + unify_typ_opt typ unified_typ + and ground_typ_of (typ: typ) : typ = match typ.it with | VarT (id, _) when Env.mem_var !env id -> @@ -133,15 +144,10 @@ and ground_typ_of (typ: typ) : typ = (* NOTE: Consider `fN` as a `NumT` to prevent diverging ground type *) | VarT (id, _) when id.it = "fN" -> NumT RealT $ typ.at | VarT (id, args) -> - let typ_opts = List.map unify_deftyp_opt (get_deftyps id args) in - if List.for_all Option.is_some typ_opts then - match List.map Option.get typ_opts with - | typ' :: typs - when List.for_all Option.is_some (List.map (unify_opt typ') typs) -> - ground_typ_of typ' - | _ -> typ - else - typ + get_deftyps id args + |> unify_deftyps_opt + |> Option.map ground_typ_of + |> Option.value ~default:typ | TupT [_, typ'] -> ground_typ_of typ' | IterT (typ', iter) -> IterT (ground_typ_of typ', iter) $ typ.at | _ -> typ From 1a9adc9d8ef399ad990cc2b19b949232b0963f44 Mon Sep 17 00:00:00 2001 From: 702fbtngus <702fbtngus@kaist.ac.kr> Date: Fri, 9 Aug 2024 19:04:32 +0900 Subject: [PATCH 08/26] Set unit type for PerformI --- spectec/src/il2al/transpile.ml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spectec/src/il2al/transpile.ml b/spectec/src/il2al/transpile.ml index c858959a45..825d34f3a5 100644 --- a/spectec/src/il2al/transpile.ml +++ b/spectec/src/il2al/transpile.ml @@ -485,10 +485,17 @@ let hide_state_expr expr = let hide_state instr = let at = instr.at in + let env = Al.Valid.env in + let set_unit_type fname = + let id = (fname $ no_region) in + let unit_type = Il.Ast.TupT [] $ no_region in + match Il.Env.find_def !Al.Valid.env id with + | (params, _, clauses) -> env := Al.Valid.Env.bind_def !env id (params, unit_type, clauses) + in match instr.it with (* Perform *) - | LetI (e, { it = CallE (fname, args); _ }) when is_state e || is_store e -> [ performI (fname, hide_state_args args) ~at:at ] - | PerformI (f, args) -> [ performI (f, hide_state_args args) ~at:at ] + | LetI (e, { it = CallE (fname, args); _ }) when is_state e || is_store e -> set_unit_type fname; [ performI (fname, hide_state_args args) ~at:at ] + | PerformI (f, args) -> set_unit_type f; [ performI (f, hide_state_args args) ~at:at ] (* Append *) | LetI (_, { it = ExtE (s, ps, { it = ListE [ e ]; _ }, Back); note; _ } ) when is_store s -> let access = { (mk_access ps s) with note } in From 7ecd34abbfe576fe9481233a953da5e776535b01 Mon Sep 17 00:00:00 2001 From: 702fbtngus <702fbtngus@kaist.ac.kr> Date: Fri, 9 Aug 2024 19:06:07 +0900 Subject: [PATCH 09/26] InvCallE validation --- spectec/src/al/valid.ml | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/spectec/src/al/valid.ml b/spectec/src/al/valid.ml index 4eaa755dc6..f1ed3e260b 100644 --- a/spectec/src/al/valid.ml +++ b/spectec/src/al/valid.ml @@ -283,6 +283,33 @@ let check_call source id args result_typ = env := global_env | None -> error_valid "no function definition" source "" +let check_inv_call source id indices args result_typ = + let typ2arg typ = ExpA (VarE "" $$ no_region % typ) $ no_region + in + let typs = + match result_typ.it with + | TupT l -> l |> List.split |> snd + | _ -> [result_typ] + in + let free_args = List.map typ2arg typs in + let count_free_args = ref 0 in + let count_bound_args = ref 0 in + let idx2arg idx = + if Option.is_some idx then ( + count_free_args := !count_free_args + 1; + List.nth free_args (!count_free_args - 1) + ) else ( + count_bound_args := !count_bound_args + 1; + List.nth args (!count_bound_args - 1) + ) + in + let new_args = List.map idx2arg indices in + let new_result_typ = match (List.nth args !count_bound_args).it with + | ExpA exp -> exp.note + | a -> error_valid (Printf.sprintf "wrong free argument: %s" (Print.string_of_arg (a $ no_region))) source "" + in + check_call source id new_args new_result_typ + let access (source: source) (typ: typ) (path: path) : typ = match path.it with | IdxP expr -> @@ -344,7 +371,7 @@ let valid_expr (walker: unit_walker) (expr: expr) : unit = | TupE exprs -> check_tuple source exprs expr.note | CaseE _ | CaseE2 _ -> () (* TODO *) | CallE (id, args) -> check_call source id args expr.note - | InvCallE _ -> () (* TODO *) + | InvCallE (id, indices, args) -> check_inv_call source id indices args expr.note; | IterE (expr1, _, iter) -> if not (expr1.note.it = BoolT && expr.note.it = BoolT) then (match iter with @@ -405,7 +432,6 @@ let valid_expr (walker: unit_walker) (expr: expr) : unit = (* Instr validation *) let valid_instr (walker: unit_walker) (instr: instr) : unit = - print_endline (string_of_instr instr); let source = string_of_instr instr $ instr.at in (match instr.it with | IfI (expr, _, _) | AssertI expr -> check_bool source expr.note @@ -425,8 +451,8 @@ let valid_instr (walker: unit_walker) (instr: instr) : unit = error_mismatch source (get_base_typ expr.note) (varT "val") | LetI (expr1, expr2) -> add_bound_vars expr1; check_match source expr1.note expr2.note - | ExecuteI expr | ExecuteSeqI expr -> check_instr source expr.note - | PerformI _ -> () (* TODO *) + | ExecuteI expr | ExecuteSeqI expr -> check_instr source expr.note + | PerformI (id, args) -> check_call source id args (TupT [] $ no_region) | ReplaceI (expr1, path, expr2) -> access source expr1.note path |> check_match source expr2.note | AppendI (expr1, _expr2) -> check_list source expr1.note @@ -438,7 +464,7 @@ let valid_instr (walker: unit_walker) (instr: instr) : unit = let init algo = let params = Al_util.params_of_algo algo in - bound_set := Set.empty; + bound_set := Set.singleton "s"; List.iter add_bound_param params From 5c3de767dfec67637c579e5f9d6d67bdf0f18218 Mon Sep 17 00:00:00 2001 From: 702fbtngus <702fbtngus@kaist.ac.kr> Date: Wed, 14 Aug 2024 14:22:04 +0900 Subject: [PATCH 10/26] check_inv_call comment added --- spectec/src/al/valid.ml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/spectec/src/al/valid.ml b/spectec/src/al/valid.ml index f1ed3e260b..afdc1945e4 100644 --- a/spectec/src/al/valid.ml +++ b/spectec/src/al/valid.ml @@ -283,15 +283,19 @@ let check_call source id args result_typ = env := global_env | None -> error_valid "no function definition" source "" -let check_inv_call source id indices args result_typ = - let typ2arg typ = ExpA (VarE "" $$ no_region % typ) $ no_region - in +let check_inv_call source id indices bound_args result_typ = + (* Get typs from result_typ *) let typs = match result_typ.it with | TupT l -> l |> List.split |> snd | _ -> [result_typ] in + + (* Make arguments with typs *) + let typ2arg typ = ExpA (VarE "" $$ no_region % typ) $ no_region in let free_args = List.map typ2arg typs in + + (* Merge free args and bound args *) let count_free_args = ref 0 in let count_bound_args = ref 0 in let idx2arg idx = @@ -300,11 +304,13 @@ let check_inv_call source id indices args result_typ = List.nth free_args (!count_free_args - 1) ) else ( count_bound_args := !count_bound_args + 1; - List.nth args (!count_bound_args - 1) + List.nth bound_args (!count_bound_args - 1) ) in let new_args = List.map idx2arg indices in - let new_result_typ = match (List.nth args !count_bound_args).it with + + (* Set new result typ as the last element of args *) + let new_result_typ = match (List.nth bound_args !count_bound_args).it with | ExpA exp -> exp.note | a -> error_valid (Printf.sprintf "wrong free argument: %s" (Print.string_of_arg (a $ no_region))) source "" in From cee045e984675a0eb24aee80f4e9aff80f94cd01 Mon Sep 17 00:00:00 2001 From: 702fbtngus <702fbtngus@kaist.ac.kr> Date: Wed, 14 Aug 2024 14:53:05 +0900 Subject: [PATCH 11/26] Removed usage of ref from check_inv_call --- spectec/src/al/valid.ml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/spectec/src/al/valid.ml b/spectec/src/al/valid.ml index afdc1945e4..d781eb2ba4 100644 --- a/spectec/src/al/valid.ml +++ b/spectec/src/al/valid.ml @@ -283,7 +283,7 @@ let check_call source id args result_typ = env := global_env | None -> error_valid "no function definition" source "" -let check_inv_call source id indices bound_args result_typ = +let check_inv_call source id indices args result_typ = (* Get typs from result_typ *) let typs = match result_typ.it with @@ -295,26 +295,27 @@ let check_inv_call source id indices bound_args result_typ = let typ2arg typ = ExpA (VarE "" $$ no_region % typ) $ no_region in let free_args = List.map typ2arg typs in + (* Pop last arg from args *) + let bound_args, last_arg = Lib.List.split_last args in + (* Merge free args and bound args *) - let count_free_args = ref 0 in - let count_bound_args = ref 0 in - let idx2arg idx = - if Option.is_some idx then ( - count_free_args := !count_free_args + 1; - List.nth free_args (!count_free_args - 1) - ) else ( - count_bound_args := !count_bound_args + 1; - List.nth bound_args (!count_bound_args - 1) - ) + let merge_args args idx = + let free_args, bound_args, merged_args = args in + if Option.is_some idx then + let new_free_args, first_free_arg = Lib.List.split_last free_args in + (new_free_args, bound_args, first_free_arg :: merged_args) + else + let new_bound_args,first_bound_arg = Lib.List.split_last free_args in + (free_args, new_bound_args, first_bound_arg :: merged_args) in - let new_args = List.map idx2arg indices in + let _, _, merged_args = List.fold_left merge_args (free_args, bound_args, []) indices in (* Set new result typ as the last element of args *) - let new_result_typ = match (List.nth bound_args !count_bound_args).it with + let new_result_typ = match last_arg.it with | ExpA exp -> exp.note | a -> error_valid (Printf.sprintf "wrong free argument: %s" (Print.string_of_arg (a $ no_region))) source "" in - check_call source id new_args new_result_typ + check_call source id merged_args new_result_typ let access (source: source) (typ: typ) (path: path) : typ = match path.it with From 0f1c8b3d73416673ad85f5e8afec5bd734fb5a65 Mon Sep 17 00:00:00 2001 From: presenthee Date: Mon, 12 Aug 2024 17:08:09 +0900 Subject: [PATCH 12/26] Migrate InfixE to CaseE2 --- spectec/src/al/al_util.ml | 6 + spectec/src/al/print.mli | 3 +- spectec/src/backend-interpreter/builtin.ml | 4 +- spectec/src/backend-interpreter/construct.ml | 266 +++++++++--------- .../src/backend-interpreter/interpreter.ml | 7 +- spectec/src/backend-interpreter/manual.ml | 2 +- spectec/src/backend-interpreter/numerics.ml | 26 +- spectec/src/backend-prose/render.ml | 1 + spectec/src/il2al/translate.ml | 14 +- 9 files changed, 167 insertions(+), 162 deletions(-) diff --git a/spectec/src/al/al_util.ml b/spectec/src/al/al_util.ml index eab1735763..ca45a1e67b 100644 --- a/spectec/src/al/al_util.ml +++ b/spectec/src/al/al_util.ml @@ -242,6 +242,12 @@ let unwrap_framev: value -> value = function | v -> fail_value "unwrap_framev" v +(* Mixop *) + +let get_atom op = + List.find (fun al -> List.length al <> 0) op |> List.hd + + (* Il Types *) (* name for tuple type *) diff --git a/spectec/src/al/print.mli b/spectec/src/al/print.mli index 7b87e8c166..2472f272f9 100644 --- a/spectec/src/al/print.mli +++ b/spectec/src/al/print.mli @@ -1,7 +1,8 @@ open Ast val string_of_list : ('a -> string) -> string -> 'a list -> string -val string_of_atom : atom -> string +val string_of_atom : atom -> string +val string_of_mixop : mixop -> id val string_of_value : value -> string val string_of_values : string -> value list -> string val string_of_iter : iter -> string diff --git a/spectec/src/backend-interpreter/builtin.ml b/spectec/src/backend-interpreter/builtin.ml index 6eb3e56c37..755c234459 100644 --- a/spectec/src/backend-interpreter/builtin.ml +++ b/spectec/src/backend-interpreter/builtin.ml @@ -16,12 +16,12 @@ let f64_to_const f = CaseV ("CONST", [ nullary "F64"; Construct.al_of_float64 f (* TODO: Refactor builtin call logic *) let builtin () = - (* TODO : Change this into host fnuction instance, instead of current normal function instance *) + (* TODO : Change this into host function instance, instead of current normal function instance *) let create_funcinst (name, type_tags) = let winstr_tag = String.uppercase_ascii name in let code = nullary winstr_tag in let ptype = Array.map nullary type_tags in - let arrow = TupV [ listV ptype; listV [||] ] in + let arrow = CaseV ("`%->%`", [ listV ptype; listV [||] ]) in let ftype = CaseV ("FUNC", [ arrow ]) in let dt = CaseV ("DEF", [ diff --git a/spectec/src/backend-interpreter/construct.ml b/spectec/src/backend-interpreter/construct.ml index 2ec2331549..94be9ebe33 100644 --- a/spectec/src/backend-interpreter/construct.ml +++ b/spectec/src/backend-interpreter/construct.ml @@ -121,7 +121,7 @@ and al_to_result_type: value -> result_type = function and al_to_str_type: value -> str_type = function | CaseV ("STRUCT", [ ftl ]) -> DefStructT (StructT (al_to_list al_to_field_type ftl)) | CaseV ("ARRAY", [ ft ]) -> DefArrayT (ArrayT (al_to_field_type ft)) - | CaseV ("FUNC", [ TupV [ rt1; rt2 ] ]) -> + | CaseV ("FUNC", [ CaseV ("`%->%`", [ rt1; rt2 ]) ]) -> DefFuncT (FuncT (al_to_result_type rt1, (al_to_result_type rt2))) | v -> error_value "str type" v @@ -357,12 +357,12 @@ let al_to_extension : value -> Pack.extension = function | v -> error_value "extension" v let al_to_vop f1 f2 = function - | [ TupV [ CaseV ("I8", []); NumV z ]; vop ] when z = sixteen -> V128 (V128.I8x16 (f1 vop)) - | [ TupV [ CaseV ("I16", []); NumV z ]; vop ] when z = eight -> V128 (V128.I16x8 (f1 vop)) - | [ TupV [ CaseV ("I32", []); NumV z ]; vop ] when z = four -> V128 (V128.I32x4 (f1 vop)) - | [ TupV [ CaseV ("I64", []); NumV z ]; vop ] when z = two -> V128 (V128.I64x2 (f1 vop)) - | [ TupV [ CaseV ("F32", []); NumV z ]; vop ] when z = four -> V128 (V128.F32x4 (f2 vop)) - | [ TupV [ CaseV ("F64", []); NumV z ]; vop ] when z = two -> V128 (V128.F64x2 (f2 vop)) + | [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z ]); vop ] when z = sixteen -> V128 (V128.I8x16 (f1 vop)) + | [ CaseV ("`%X%`", [ CaseV ("I16", []); NumV z ]); vop ] when z = eight -> V128 (V128.I16x8 (f1 vop)) + | [ CaseV ("`%X%`", [ CaseV ("I32", []); NumV z ]); vop ] when z = four -> V128 (V128.I32x4 (f1 vop)) + | [ CaseV ("`%X%`", [ CaseV ("I64", []); NumV z ]); vop ] when z = two -> V128 (V128.I64x2 (f1 vop)) + | [ CaseV ("`%X%`", [ CaseV ("F32", []); NumV z ]); vop ] when z = four -> V128 (V128.F32x4 (f2 vop)) + | [ CaseV ("`%X%`", [ CaseV ("F64", []); NumV z ]); vop ] when z = two -> V128 (V128.F64x2 (f2 vop)) | l -> error_values "vop" l let al_to_vvop f = function @@ -380,10 +380,10 @@ let al_to_vtestop : value list -> vec_testop = al_to_vop al_to_int_vtestop al_to_float_vtestop let al_to_vbitmaskop : value list -> vec_bitmaskop = function - | [ TupV [ CaseV ("I8", []); NumV z ] ] when z = sixteen -> V128 (V128.I8x16 (V128Op.Bitmask)) - | [ TupV [ CaseV ("I16", []); NumV z ] ] when z = eight -> V128 (V128.I16x8 (V128Op.Bitmask)) - | [ TupV [ CaseV ("I32", []); NumV z ] ] when z = four -> V128 (V128.I32x4 (V128Op.Bitmask)) - | [ TupV [ CaseV ("I64", []); NumV z ] ] when z = two -> V128 (V128.I64x2 (V128Op.Bitmask)) + | [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z ]) ] when z = sixteen -> V128 (V128.I8x16 (V128Op.Bitmask)) + | [ CaseV ("`%X%`", [ CaseV ("I16", []); NumV z ]) ] when z = eight -> V128 (V128.I16x8 (V128Op.Bitmask)) + | [ CaseV ("`%X%`", [ CaseV ("I32", []); NumV z ]) ] when z = four -> V128 (V128.I32x4 (V128Op.Bitmask)) + | [ CaseV ("`%X%`", [ CaseV ("I64", []); NumV z ]) ] when z = two -> V128 (V128.I64x2 (V128Op.Bitmask)) | l -> error_values "vbitmaskop" l let al_to_int_vrelop : value -> V128Op.irelop = function @@ -464,12 +464,12 @@ let al_to_float_vbinop : value -> V128Op.fbinop = function let al_to_vbinop : value list -> vec_binop = al_to_vop al_to_int_vbinop al_to_float_vbinop let al_to_special_vbinop = function - | CaseV ("VSWIZZLE", [ TupV [ CaseV ("I8", []); NumV z ]; ]) when z = sixteen -> V128 (V128.I8x16 (V128Op.Swizzle)) - | CaseV ("VSHUFFLE", [ TupV [ CaseV ("I8", []); NumV z ]; l ]) when z = sixteen -> V128 (V128.I8x16 (V128Op.Shuffle (al_to_list al_to_int l))) - | CaseV ("VNARROW", [ TupV [ CaseV ("I8", []); NumV z1 ]; TupV [ CaseV ("I16", []); NumV z2 ]; CaseV ("S", []) ]) when z1 = sixteen && z2 = eight -> V128 (V128.I8x16 (V128Op.NarrowS)) - | CaseV ("VNARROW", [ TupV [ CaseV ("I16", []); NumV z1 ]; TupV [ CaseV ("I32", []); NumV z2 ]; CaseV ("S", []) ]) when z1 = eight && z2 = four -> V128 (V128.I16x8 (V128Op.NarrowS)) - | CaseV ("VNARROW", [ TupV [ CaseV ("I8", []); NumV z1 ]; TupV [ CaseV ("I16", []); NumV z2 ]; CaseV ("U", []) ]) when z1 = sixteen && z2 = eight -> V128 (V128.I8x16 (V128Op.NarrowU)) - | CaseV ("VNARROW", [ TupV [ CaseV ("I16", []); NumV z1 ]; TupV [ CaseV ("I32", []); NumV z2 ]; CaseV ("U", []) ]) when z1 = eight && z2 = four -> V128 (V128.I16x8 (V128Op.NarrowU)) + | CaseV ("VSWIZZLE", [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z ]); ]) when z = sixteen -> V128 (V128.I8x16 (V128Op.Swizzle)) + | CaseV ("VSHUFFLE", [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z ]); l ]) when z = sixteen -> V128 (V128.I8x16 (V128Op.Shuffle (al_to_list al_to_int l))) + | CaseV ("VNARROW", [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z1 ]); CaseV ("`%X%`", [ CaseV ("I16", []); NumV z2 ]); CaseV ("S", []) ]) when z1 = sixteen && z2 = eight -> V128 (V128.I8x16 (V128Op.NarrowS)) + | CaseV ("VNARROW", [ CaseV ("`%X%`", [ CaseV ("I16", []); NumV z1 ]); CaseV ("`%X%`", [ CaseV ("I32", []); NumV z2 ]); CaseV ("S", []) ]) when z1 = eight && z2 = four -> V128 (V128.I16x8 (V128Op.NarrowS)) + | CaseV ("VNARROW", [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z1 ]); CaseV ("`%X%`", [ CaseV ("I16", []); NumV z2 ]); CaseV ("U", []) ]) when z1 = sixteen && z2 = eight -> V128 (V128.I8x16 (V128Op.NarrowU)) + | CaseV ("VNARROW", [ CaseV ("`%X%`", [ CaseV ("I16", []); NumV z1 ]); CaseV ("`%X%`", [ CaseV ("I32", []); NumV z2 ]); CaseV ("U", []) ]) when z1 = eight && z2 = four -> V128 (V128.I16x8 (V128Op.NarrowU)) | v -> error_value "special vbinop" v let al_to_int_vcvtop : value list -> V128Op.icvtop = function @@ -485,10 +485,10 @@ let al_to_int_vcvtop : value list -> V128Op.icvtop = function ) | "TRUNC_SAT" -> ( match sh, ext with - | TupV [ CaseV ("F32", []); NumV z ], "S" when z = four -> V128Op.TruncSatSF32x4 - | TupV [ CaseV ("F32", []); NumV z ], "U" when z = four -> V128Op.TruncSatUF32x4 - | TupV [ CaseV ("F64", []); NumV z ], "S" when z = two -> V128Op.TruncSatSZeroF64x2 - | TupV [ CaseV ("F64", []); NumV z ], "U" when z = two -> V128Op.TruncSatUZeroF64x2 + | CaseV ("`%X%`", [ CaseV ("F32", []); NumV z ]), "S" when z = four -> V128Op.TruncSatSF32x4 + | CaseV ("`%X%`", [ CaseV ("F32", []); NumV z ]), "U" when z = four -> V128Op.TruncSatUF32x4 + | CaseV ("`%X%`", [ CaseV ("F64", []); NumV z ]), "S" when z = two -> V128Op.TruncSatSZeroF64x2 + | CaseV ("`%X%`", [ CaseV ("F64", []); NumV z ]), "U" when z = two -> V128Op.TruncSatUZeroF64x2 | _ -> error_values "integer vcvtop" l ) | _ -> error_values "integer vcvtop" l @@ -507,12 +507,12 @@ let al_to_float_vcvtop : value list -> V128Op.fcvtop = function | l -> error_values "float vcvtop" l let al_to_vcvtop : value list -> vec_cvtop = function - | TupV [ CaseV ("I8", []); NumV z ] :: op when z = sixteen -> V128 (V128.I8x16 (al_to_int_vcvtop op)) - | TupV [ CaseV ("I16", []); NumV z ] :: op when z = eight -> V128 (V128.I16x8 (al_to_int_vcvtop op)) - | TupV [ CaseV ("I32", []); NumV z ] :: op when z = four -> V128 (V128.I32x4 (al_to_int_vcvtop op)) - | TupV [ CaseV ("I64", []); NumV z ] :: op when z = two -> V128 (V128.I64x2 (al_to_int_vcvtop op)) - | TupV [ CaseV ("F32", []); NumV z ] :: op when z = four -> V128 (V128.F32x4 (al_to_float_vcvtop op)) - | TupV [ CaseV ("F64", []); NumV z ] :: op when z = two -> V128 (V128.F64x2 (al_to_float_vcvtop op)) + | CaseV ("`%X%`", [ CaseV ("I8", []); NumV z ]) :: op when z = sixteen -> V128 (V128.I8x16 (al_to_int_vcvtop op)) + | CaseV ("`%X%`", [ CaseV ("I16", []); NumV z ]) :: op when z = eight -> V128 (V128.I16x8 (al_to_int_vcvtop op)) + | CaseV ("`%X%`", [ CaseV ("I32", []); NumV z ]) :: op when z = four -> V128 (V128.I32x4 (al_to_int_vcvtop op)) + | CaseV ("`%X%`", [ CaseV ("I64", []); NumV z ]) :: op when z = two -> V128 (V128.I64x2 (al_to_int_vcvtop op)) + | CaseV ("`%X%`", [ CaseV ("F32", []); NumV z ]) :: op when z = four -> V128 (V128.F32x4 (al_to_float_vcvtop op)) + | CaseV ("`%X%`", [ CaseV ("F64", []); NumV z ]) :: op when z = two -> V128 (V128.F64x2 (al_to_float_vcvtop op)) | l -> error_values "vcvtop" l let al_to_int_vshiftop : value -> V128Op.ishiftop = function @@ -547,36 +547,36 @@ let al_to_vvternop' : value -> V128Op.vternop = function let al_to_vvternop : value list -> vec_vternop = al_to_vvop al_to_vvternop' let al_to_vsplatop : value list -> vec_splatop = function - | [ TupV [ CaseV ("I8", []); NumV z ] ] when z = sixteen -> V128 (V128.I8x16 Splat) - | [ TupV [ CaseV ("I16", []); NumV z ] ] when z = eight -> V128 (V128.I16x8 Splat) - | [ TupV [ CaseV ("I32", []); NumV z ] ] when z = four -> V128 (V128.I32x4 Splat) - | [ TupV [ CaseV ("I64", []); NumV z ] ] when z = two -> V128 (V128.I64x2 Splat) - | [ TupV [ CaseV ("F32", []); NumV z ] ] when z = four -> V128 (V128.F32x4 Splat) - | [ TupV [ CaseV ("F64", []); NumV z ] ] when z = two -> V128 (V128.F64x2 Splat) + | [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z ]) ] when z = sixteen -> V128 (V128.I8x16 Splat) + | [ CaseV ("`%X%`", [ CaseV ("I16", []); NumV z ]) ] when z = eight -> V128 (V128.I16x8 Splat) + | [ CaseV ("`%X%`", [ CaseV ("I32", []); NumV z ]) ] when z = four -> V128 (V128.I32x4 Splat) + | [ CaseV ("`%X%`", [ CaseV ("I64", []); NumV z ]) ] when z = two -> V128 (V128.I64x2 Splat) + | [ CaseV ("`%X%`", [ CaseV ("F32", []); NumV z ]) ] when z = four -> V128 (V128.F32x4 Splat) + | [ CaseV ("`%X%`", [ CaseV ("F64", []); NumV z ]) ] when z = two -> V128 (V128.F64x2 Splat) | vs -> error_values "vsplatop" vs let al_to_vextractop : value list -> vec_extractop = function - | [ TupV [ CaseV ("I8", []); NumV z ]; OptV (Some ext); n ] when z = sixteen -> + | [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z ]); OptV (Some ext); n ] when z = sixteen -> V128 (V128.I8x16 (Extract (al_to_int n, al_to_extension ext))) - | [ TupV [ CaseV ("I16", []); NumV z ]; OptV (Some ext); n ] when z = eight -> + | [ CaseV ("`%X%`", [ CaseV ("I16", []); NumV z ]); OptV (Some ext); n ] when z = eight -> V128 (V128.I16x8 (Extract (al_to_int n, al_to_extension ext))) - | [ TupV [ CaseV ("I32", []); NumV z ]; OptV None; n ] when z = four -> + | [ CaseV ("`%X%`", [ CaseV ("I32", []); NumV z ]); OptV None; n ] when z = four -> V128 (V128.I32x4 (Extract (al_to_int n, ()))) - | [ TupV [ CaseV ("I64", []); NumV z ]; OptV None; n ] when z = two -> + | [ CaseV ("`%X%`", [ CaseV ("I64", []); NumV z ]); OptV None; n ] when z = two -> V128 (V128.I64x2 (Extract (al_to_int n, ()))) - | [ TupV [ CaseV ("F32", []); NumV z ]; OptV None; n ] when z = four -> + | [ CaseV ("`%X%`", [ CaseV ("F32", []); NumV z ]); OptV None; n ] when z = four -> V128 (V128.F32x4 (Extract (al_to_int n, ()))) - | [ TupV [ CaseV ("F64", []); NumV z ]; OptV None; n ] when z = two -> + | [ CaseV ("`%X%`", [ CaseV ("F64", []); NumV z ]); OptV None; n ] when z = two -> V128 (V128.F64x2 (Extract (al_to_int n, ()))) | vs -> error_values "vextractop" vs let al_to_vreplaceop : value list -> vec_replaceop = function - | [ TupV [ CaseV ("I8", []); NumV z ]; n ] when z = sixteen -> V128 (V128.I8x16 (Replace (al_to_int n))) - | [ TupV [ CaseV ("I16", []); NumV z ]; n ] when z = eight -> V128 (V128.I16x8 (Replace (al_to_int n))) - | [ TupV [ CaseV ("I32", []); NumV z ]; n ] when z = four -> V128 (V128.I32x4 (Replace (al_to_int n))) - | [ TupV [ CaseV ("I64", []); NumV z ]; n ] when z = two -> V128 (V128.I64x2 (Replace (al_to_int n))) - | [ TupV [ CaseV ("F32", []); NumV z ]; n ] when z = four -> V128 (V128.F32x4 (Replace (al_to_int n))) - | [ TupV [ CaseV ("F64", []); NumV z ]; n ] when z = two -> V128 (V128.F64x2 (Replace (al_to_int n))) + | [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z ]); n ] when z = sixteen -> V128 (V128.I8x16 (Replace (al_to_int n))) + | [ CaseV ("`%X%`", [ CaseV ("I16", []); NumV z ]); n ] when z = eight -> V128 (V128.I16x8 (Replace (al_to_int n))) + | [ CaseV ("`%X%`", [ CaseV ("I32", []); NumV z ]); n ] when z = four -> V128 (V128.I32x4 (Replace (al_to_int n))) + | [ CaseV ("`%X%`", [ CaseV ("I64", []); NumV z ]); n ] when z = two -> V128 (V128.I64x2 (Replace (al_to_int n))) + | [ CaseV ("`%X%`", [ CaseV ("F32", []); NumV z ]); n ] when z = four -> V128 (V128.F32x4 (Replace (al_to_int n))) + | [ CaseV ("`%X%`", [ CaseV ("F64", []); NumV z ]); n ] when z = two -> V128 (V128.F64x2 (Replace (al_to_int n))) | vs -> error_values "vreplaceop" vs let al_to_pack_size : value -> Pack.pack_size = function @@ -1097,7 +1097,7 @@ and al_of_str_type = function | DefStructT (StructT ftl) -> CaseV ("STRUCT", [ al_of_list al_of_field_type ftl ]) | DefArrayT (ArrayT ft) -> CaseV ("ARRAY", [ al_of_field_type ft ]) | DefFuncT (FuncT (rt1, rt2)) -> - CaseV ("FUNC", [ TupV [ al_of_result_type rt1; al_of_result_type rt2] ]) + CaseV ("FUNC", [ CaseV ("`%->%`", [ al_of_result_type rt1; al_of_result_type rt2 ])]) and al_of_sub_type = function | SubT (fin, htl, st) -> @@ -1340,32 +1340,32 @@ let al_of_extension = function let al_of_vop f1 f2 = function | V128 vop -> ( match vop with - | V128.I8x16 op -> [ TupV [ nullary "I8"; numV sixteen ]; f1 op ] - | V128.I16x8 op -> [ TupV [ nullary "I16"; numV eight ]; f1 op ] - | V128.I32x4 op -> [ TupV [ nullary "I32"; numV four ]; f1 op ] - | V128.I64x2 op -> [ TupV [ nullary "I64"; numV two ]; f1 op ] - | V128.F32x4 op -> [ TupV [ nullary "F32"; numV four ]; f2 op ] - | V128.F64x2 op -> [ TupV [ nullary "F64"; numV two ]; f2 op ] + | V128.I8x16 op -> [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); f1 op ] + | V128.I16x8 op -> [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); f1 op ] + | V128.I32x4 op -> [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); f1 op ] + | V128.I64x2 op -> [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); f1 op ] + | V128.F32x4 op -> [ CaseV ("`%X%`", [ nullary "F32"; numV four ]); f2 op ] + | V128.F64x2 op -> [ CaseV ("`%X%`", [ nullary "F64"; numV two ]); f2 op ] ) let al_of_viop f1: ('a, 'a, 'a, 'a, void, void) V128.laneop vecop -> value list = function | V128 vop -> ( match vop with - | V128.I8x16 op -> [ TupV [ nullary "I8"; numV sixteen ]; f1 op ] - | V128.I16x8 op -> [ TupV [ nullary "I16"; numV eight ]; f1 op ] - | V128.I32x4 op -> [ TupV [ nullary "I32"; numV four ]; f1 op ] - | V128.I64x2 op -> [ TupV [ nullary "I64"; numV two ]; f1 op ] + | V128.I8x16 op -> [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); f1 op ] + | V128.I16x8 op -> [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); f1 op ] + | V128.I32x4 op -> [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); f1 op ] + | V128.I64x2 op -> [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); f1 op ] | _ -> . ) let al_of_vbitmaskop = function | V128 vop -> ( match vop with - | V128.I8x16 _ -> [ TupV [ nullary "I8"; numV sixteen ] ] - | V128.I16x8 _ -> [ TupV [ nullary "I16"; numV eight ] ] - | V128.I32x4 _ -> [ TupV [ nullary "I32"; numV four ] ] - | V128.I64x2 _ -> [ TupV [ nullary "I64"; numV two ] ] + | V128.I8x16 _ -> [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]) ] + | V128.I16x8 _ -> [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]) ] + | V128.I32x4 _ -> [ CaseV ("`%X%`", [ nullary "I32"; numV four ]) ] + | V128.I64x2 _ -> [ CaseV ("`%X%`", [ nullary "I64"; numV two ]) ] | _ -> error "al_of_vbitmaskop" empty ) @@ -1444,34 +1444,34 @@ let al_of_float_vbinop : V128Op.fbinop -> value = function let al_of_vbinop = function | V128 vop -> ( match vop with - | V128.I8x16 op -> Option.map (fun v -> [ TupV [ nullary "I8"; numV sixteen ]; v ]) (al_of_int_vbinop op) - | V128.I16x8 op -> Option.map (fun v -> [ TupV [ nullary "I16"; numV eight ]; v ]) (al_of_int_vbinop op) - | V128.I32x4 op -> Option.map (fun v -> [ TupV [ nullary "I32"; numV four ]; v ]) (al_of_int_vbinop op) - | V128.I64x2 op -> Option.map (fun v -> [ TupV [ nullary "I64"; numV two ]; v ]) (al_of_int_vbinop op) - | V128.F32x4 op -> Some ([ TupV [ nullary "F32"; numV four ]; al_of_float_vbinop op ]) - | V128.F64x2 op -> Some ([ TupV [ nullary "F64"; numV two ]; al_of_float_vbinop op ]) + | V128.I8x16 op -> Option.map (fun v -> [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); v ]) (al_of_int_vbinop op) + | V128.I16x8 op -> Option.map (fun v -> [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); v ]) (al_of_int_vbinop op) + | V128.I32x4 op -> Option.map (fun v -> [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); v ]) (al_of_int_vbinop op) + | V128.I64x2 op -> Option.map (fun v -> [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); v ]) (al_of_int_vbinop op) + | V128.F32x4 op -> Some ([ CaseV ("`%X%`", [ nullary "F32"; numV four ]); al_of_float_vbinop op ]) + | V128.F64x2 op -> Some ([ CaseV ("`%X%`", [ nullary "F64"; numV two ]); al_of_float_vbinop op ]) ) let al_of_special_vbinop = function - | V128 (V128.I8x16 (V128Op.Swizzle)) -> CaseV ("VSWIZZLE", [ TupV [ nullary "I8"; numV sixteen ]; ]) - | V128 (V128.I8x16 (V128Op.Shuffle l)) -> CaseV ("VSHUFFLE", [ TupV [ nullary "I8"; numV sixteen ]; al_of_list al_of_int l ]) - | V128 (V128.I8x16 (V128Op.NarrowS)) -> CaseV ("VNARROW", [ TupV [ nullary "I8"; numV sixteen ]; TupV [ nullary "I16"; numV eight ]; al_of_extension Pack.SX ]) - | V128 (V128.I16x8 (V128Op.NarrowS)) -> CaseV ("VNARROW", [ TupV [ nullary "I16"; numV eight ]; TupV [ nullary "I32"; numV four ]; al_of_extension Pack.SX ]) - | V128 (V128.I8x16 (V128Op.NarrowU)) -> CaseV ("VNARROW", [ TupV [ nullary "I8"; numV sixteen ]; TupV [ nullary "I16"; numV eight ]; al_of_extension Pack.ZX ]) - | V128 (V128.I16x8 (V128Op.NarrowU)) -> CaseV ("VNARROW", [ TupV [ nullary "I16"; numV eight]; TupV [ nullary "I32"; numV four ]; al_of_extension Pack.ZX ]) - | V128 (V128.I16x8 (V128Op.ExtMulHighS)) -> CaseV ("VEXTBINOP", [ TupV [ nullary "I16"; numV eight ]; TupV [ nullary "I8"; numV sixteen ]; caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "HIGH"]) ]) - | V128 (V128.I16x8 (V128Op.ExtMulHighU)) -> CaseV ("VEXTBINOP", [ TupV [ nullary "I16"; numV eight ]; TupV [ nullary "I8"; numV sixteen ]; caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "HIGH"]) ]) - | V128 (V128.I16x8 (V128Op.ExtMulLowS)) -> CaseV ("VEXTBINOP", [ TupV [ nullary "I16"; numV eight ]; TupV [ nullary "I8"; numV sixteen ]; caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "LOW"]) ]) - | V128 (V128.I16x8 (V128Op.ExtMulLowU)) -> CaseV ("VEXTBINOP", [ TupV [ nullary "I16"; numV eight ]; TupV [ nullary "I8"; numV sixteen ]; caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "LOW"]) ] ) - | V128 (V128.I32x4 (V128Op.ExtMulHighS)) -> CaseV ("VEXTBINOP", [ TupV [ nullary "I32"; numV four ]; TupV [ nullary "I16"; numV eight ]; caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "HIGH"]) ]) - | V128 (V128.I32x4 (V128Op.ExtMulHighU)) -> CaseV ("VEXTBINOP", [ TupV [ nullary "I32"; numV four ]; TupV [ nullary "I16"; numV eight ]; caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "HIGH"]) ]) - | V128 (V128.I32x4 (V128Op.ExtMulLowS)) -> CaseV ("VEXTBINOP", [ TupV [ nullary "I32"; numV four ]; TupV [ nullary "I16"; numV eight ]; caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "LOW"]) ]) - | V128 (V128.I32x4 (V128Op.ExtMulLowU)) -> CaseV ("VEXTBINOP", [ TupV [ nullary "I32"; numV four ]; TupV [ nullary "I16"; numV eight ]; caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "LOW"]) ] ) - | V128 (V128.I64x2 (V128Op.ExtMulHighS)) -> CaseV ("VEXTBINOP", [ TupV [ nullary "I64"; numV two ]; TupV [ nullary "I32"; numV four ]; caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "HIGH"]) ]) - | V128 (V128.I64x2 (V128Op.ExtMulHighU)) -> CaseV ("VEXTBINOP", [ TupV [ nullary "I64"; numV two ]; TupV [ nullary "I32"; numV four ]; caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "HIGH"]) ]) - | V128 (V128.I64x2 (V128Op.ExtMulLowS)) -> CaseV ("VEXTBINOP", [ TupV [ nullary "I64"; numV two ]; TupV [ nullary "I32"; numV four ]; caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "LOW"]) ]) - | V128 (V128.I64x2 (V128Op.ExtMulLowU)) -> CaseV ("VEXTBINOP", [ TupV [ nullary "I64"; numV two ]; TupV [ nullary "I32"; numV four ]; caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "LOW"]) ] ) - | V128 (V128.I32x4 (V128Op.DotS)) -> CaseV ("VEXTBINOP", [ TupV [ nullary "I32"; numV four ]; TupV [ nullary "I16"; numV eight ]; nullary "DOT" ]) + | V128 (V128.I8x16 (V128Op.Swizzle)) -> CaseV ("VSWIZZLE", [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); ]) + | V128 (V128.I8x16 (V128Op.Shuffle l)) -> CaseV ("VSHUFFLE", [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); al_of_list al_of_int l ]) + | V128 (V128.I8x16 (V128Op.NarrowS)) -> CaseV ("VNARROW", [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); CaseV ("`%X%`", [ nullary "I16"; numV eight ]); al_of_extension Pack.SX ]) + | V128 (V128.I16x8 (V128Op.NarrowS)) -> CaseV ("VNARROW", [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); CaseV ("`%X%`", [ nullary "I32"; numV four ]); al_of_extension Pack.SX ]) + | V128 (V128.I8x16 (V128Op.NarrowU)) -> CaseV ("VNARROW", [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); CaseV ("`%X%`", [ nullary "I16"; numV eight ]); al_of_extension Pack.ZX ]) + | V128 (V128.I16x8 (V128Op.NarrowU)) -> CaseV ("VNARROW", [ CaseV ("`%X%`", [ nullary "I16"; numV eight]); CaseV ("`%X%`", [ nullary "I32"; numV four ]); al_of_extension Pack.ZX ]) + | V128 (V128.I16x8 (V128Op.ExtMulHighS)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "HIGH"]) ]) + | V128 (V128.I16x8 (V128Op.ExtMulHighU)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "HIGH"]) ]) + | V128 (V128.I16x8 (V128Op.ExtMulLowS)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "LOW"]) ]) + | V128 (V128.I16x8 (V128Op.ExtMulLowU)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "LOW"]) ] ) + | V128 (V128.I32x4 (V128Op.ExtMulHighS)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); CaseV ("`%X%`", [ nullary "I16"; numV eight ]); caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "HIGH"]) ]) + | V128 (V128.I32x4 (V128Op.ExtMulHighU)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); CaseV ("`%X%`", [ nullary "I16"; numV eight ]); caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "HIGH"]) ]) + | V128 (V128.I32x4 (V128Op.ExtMulLowS)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); CaseV ("`%X%`", [ nullary "I16"; numV eight ]); caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "LOW"]) ]) + | V128 (V128.I32x4 (V128Op.ExtMulLowU)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); CaseV ("`%X%`", [ nullary "I16"; numV eight ]); caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "LOW"]) ] ) + | V128 (V128.I64x2 (V128Op.ExtMulHighS)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); CaseV ("`%X%`", [ nullary "I32"; numV four ]); caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "HIGH"]) ]) + | V128 (V128.I64x2 (V128Op.ExtMulHighU)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); CaseV ("`%X%`", [ nullary "I32"; numV four ]); caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "HIGH"]) ]) + | V128 (V128.I64x2 (V128Op.ExtMulLowS)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); CaseV ("`%X%`", [ nullary "I32"; numV four ]); caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "LOW"]) ]) + | V128 (V128.I64x2 (V128Op.ExtMulLowU)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); CaseV ("`%X%`", [ nullary "I32"; numV four ]); caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "LOW"]) ] ) + | V128 (V128.I32x4 (V128Op.DotS)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); CaseV ("`%X%`", [ nullary "I16"; numV eight ]); nullary "DOT" ]) | _ -> error "al_of_special_vbinop" empty let al_of_int_vcvtop = function @@ -1479,22 +1479,22 @@ let al_of_int_vcvtop = function | V128Op.ExtendLowU -> Some (None, caseV ("EXTEND", [nullary "U"]), Some (nullary "LOW"), None) | V128Op.ExtendHighS -> Some (None, caseV ("EXTEND", [nullary "S"]), Some (nullary "HIGH"), None) | V128Op.ExtendHighU -> Some (None, caseV ("EXTEND", [nullary "U"]), Some (nullary "HIGH"), None) - | V128Op.TruncSatSF32x4 -> Some (Some (TupV [ nullary "F32"; numV four ]), caseV ("TRUNC_SAT", [nullary "S"]), None, None) - | V128Op.TruncSatUF32x4 -> Some (Some (TupV [ nullary "F32"; numV four ]), caseV ("TRUNC_SAT", [nullary "U"]), None, None) - | V128Op.TruncSatSZeroF64x2 -> Some (Some (TupV [ nullary "F64"; numV two ]), caseV ("TRUNC_SAT", [nullary "S"]), None, Some (nullary "ZERO")) - | V128Op.TruncSatUZeroF64x2 -> Some (Some (TupV [ nullary "F64"; numV two ]), caseV ("TRUNC_SAT", [nullary "U"]), None, Some (nullary "ZERO")) + | V128Op.TruncSatSF32x4 -> Some (Some (CaseV ("`%X%`", [ nullary "F32"; numV four ])), caseV ("TRUNC_SAT", [nullary "S"]), None, None) + | V128Op.TruncSatUF32x4 -> Some (Some (CaseV ("`%X%`", [ nullary "F32"; numV four ])), caseV ("TRUNC_SAT", [nullary "U"]), None, None) + | V128Op.TruncSatSZeroF64x2 -> Some (Some (CaseV ("`%X%`", [ nullary "F64"; numV two ])), caseV ("TRUNC_SAT", [nullary "S"]), None, Some (nullary "ZERO")) + | V128Op.TruncSatUZeroF64x2 -> Some (Some (CaseV ("`%X%`", [ nullary "F64"; numV two ])), caseV ("TRUNC_SAT", [nullary "U"]), None, Some (nullary "ZERO")) | _ -> None let al_of_float32_vcvtop = function - | V128Op.DemoteZeroF64x2 -> Some (Some (TupV [ nullary "F64"; numV two ]), nullary "DEMOTE", None, Some (nullary "ZERO")) - | V128Op.ConvertSI32x4 -> Some (Some (TupV [ nullary "I32"; numV four ]), caseV ("CONVERT", [nullary "S"]), None, None) - | V128Op.ConvertUI32x4 -> Some (Some (TupV [ nullary "I32"; numV four ]), caseV ("CONVERT", [nullary "U"]), None, None) + | V128Op.DemoteZeroF64x2 -> Some (Some (CaseV ("`%X%`", [ nullary "F64"; numV two ])), nullary "DEMOTE", None, Some (nullary "ZERO")) + | V128Op.ConvertSI32x4 -> Some (Some (CaseV ("`%X%`", [ nullary "I32"; numV four ])), caseV ("CONVERT", [nullary "S"]), None, None) + | V128Op.ConvertUI32x4 -> Some (Some (CaseV ("`%X%`", [ nullary "I32"; numV four ])), caseV ("CONVERT", [nullary "U"]), None, None) | _ -> None let al_of_float64_vcvtop = function - | V128Op.PromoteLowF32x4 -> Some (Some (TupV [ nullary "F32"; numV four ]), nullary "PROMOTE", Some (nullary "LOW"), None) - | V128Op.ConvertSI32x4 -> Some (Some (TupV [ nullary "I32"; numV four ]), caseV ("CONVERT", [nullary "S"]), Some (nullary "LOW"), None) - | V128Op.ConvertUI32x4 -> Some (Some (TupV [ nullary "I32"; numV four ]), caseV ("CONVERT", [nullary "U"]), Some (nullary "LOW"), None) + | V128Op.PromoteLowF32x4 -> Some (Some (CaseV ("`%X%`", [ nullary "F32"; numV four ])), nullary "PROMOTE", Some (nullary "LOW"), None) + | V128Op.ConvertSI32x4 -> Some (Some (CaseV ("`%X%`", [ nullary "I32"; numV four ])), caseV ("CONVERT", [nullary "S"]), Some (nullary "LOW"), None) + | V128Op.ConvertUI32x4 -> Some (Some (CaseV ("`%X%`", [ nullary "I32"; numV four ])), caseV ("CONVERT", [nullary "U"]), Some (nullary "LOW"), None) | _ -> None let al_of_vcvtop = function @@ -1505,39 +1505,39 @@ let al_of_vcvtop = function let sh = match to_ with Some sh -> sh | None -> ( match half with | Some _ -> error "al_of_vcvtop" empty - | None -> TupV [ nullary "I8"; numV sixteen ] + | None -> CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]) ) in - [ TupV [ nullary "I8"; numV sixteen ]; sh; op'; optV half; optV zero ] + [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); sh; op'; optV half; optV zero ] ) (al_of_int_vcvtop op) ) | V128.I16x8 op -> ( Option.map (fun (to_, op', half, zero) -> let sh = match to_ with Some sh -> sh | None -> ( match half with - | Some _ -> TupV [ nullary "I8"; numV sixteen ] - | None -> TupV [ nullary "I16"; numV eight ] + | Some _ -> CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]) + | None -> CaseV ("`%X%`", [ nullary "I16"; numV eight ]) ) in - [ TupV [ nullary "I16"; numV eight ]; sh; op'; optV half; optV zero ] + [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); sh; op'; optV half; optV zero ] ) (al_of_int_vcvtop op) ) | V128.I32x4 op -> ( Option.map (fun (to_, op', half, zero) -> let sh = match to_ with Some sh -> sh | None -> ( match half with - | Some _ -> TupV [ nullary "I16"; numV eight ] - | None -> TupV [ nullary "I32"; numV four ] + | Some _ -> CaseV ("`%X%`", [ nullary "I16"; numV eight ]) + | None -> CaseV ("`%X%`", [ nullary "I32"; numV four ]) ) in - [ TupV [ nullary "I32"; numV four ]; sh; op'; optV half; optV zero ] + [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); sh; op'; optV half; optV zero ] ) (al_of_int_vcvtop op) ) | V128.I64x2 op -> ( Option.map (fun (to_, op', half, zero) -> let sh = match to_ with Some sh -> sh | None -> ( match half with - | Some _ -> TupV [ nullary "I32"; numV four ] - | None -> TupV [ nullary "I64"; numV two ] + | Some _ -> CaseV ("`%X%`", [ nullary "I32"; numV four ]) + | None -> CaseV ("`%X%`", [ nullary "I64"; numV two ]) ) in - [ TupV [ nullary "I64"; numV two ]; sh; op'; optV half; optV zero ] + [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); sh; op'; optV half; optV zero ] ) (al_of_int_vcvtop op) ) | V128.F32x4 op -> ( @@ -1545,29 +1545,29 @@ let al_of_vcvtop = function let sh = match to_ with Some sh -> sh | None -> ( match half with | Some _ -> error "al_of_vcvtop" empty - | None -> TupV [ nullary "F32"; numV four ] + | None -> CaseV ("`%X%`", [ nullary "F32"; numV four ]) ) in - [ TupV [ nullary "F32"; numV four ]; sh; op'; optV half; optV zero ] + [ CaseV ("`%X%`", [ nullary "F32"; numV four ]); sh; op'; optV half; optV zero ] ) (al_of_float32_vcvtop op) ) | V128.F64x2 op -> ( Option.map (fun (to_, op', half, zero) -> let sh = match to_ with Some sh -> sh | None -> ( match half with - | Some _ -> TupV [ nullary "F32"; numV four ] - | None -> TupV [ nullary "F64"; numV two ] + | Some _ -> CaseV ("`%X%`", [ nullary "F32"; numV four ]) + | None -> CaseV ("`%X%`", [ nullary "F64"; numV two ]) ) in - [ TupV [ nullary "F64"; numV two ]; sh; op'; optV half; optV zero ] + [ CaseV ("`%X%`", [ nullary "F64"; numV two ]); sh; op'; optV half; optV zero ] ) (al_of_float64_vcvtop op) ) ) let al_of_special_vcvtop = function - | V128 (V128.I16x8 (V128Op.ExtAddPairwiseS)) -> CaseV ("VEXTUNOP", [ TupV [ nullary "I16"; numV eight]; TupV [ nullary "I8"; numV sixteen ]; caseV ("EXTADD_PAIRWISE", [al_of_extension Pack.SX]) ]) - | V128 (V128.I16x8 (V128Op.ExtAddPairwiseU)) -> CaseV ("VEXTUNOP", [ TupV [ nullary "I16"; numV eight]; TupV [ nullary "I8"; numV sixteen ]; caseV ("EXTADD_PAIRWISE", [al_of_extension Pack.ZX]) ]) - | V128 (V128.I32x4 (V128Op.ExtAddPairwiseS)) -> CaseV ("VEXTUNOP", [ TupV [ nullary "I32"; numV four]; TupV [ nullary "I16"; numV eight ]; caseV ("EXTADD_PAIRWISE", [al_of_extension Pack.SX]) ]) - | V128 (V128.I32x4 (V128Op.ExtAddPairwiseU)) -> CaseV ("VEXTUNOP", [ TupV [ nullary "I32"; numV four]; TupV [ nullary "I16"; numV eight ]; caseV ("EXTADD_PAIRWISE", [al_of_extension Pack.ZX]) ]) + | V128 (V128.I16x8 (V128Op.ExtAddPairwiseS)) -> CaseV ("VEXTUNOP", [ CaseV ("`%X%`", [ nullary "I16"; numV eight]); CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); caseV ("EXTADD_PAIRWISE", [al_of_extension Pack.SX]) ]) + | V128 (V128.I16x8 (V128Op.ExtAddPairwiseU)) -> CaseV ("VEXTUNOP", [ CaseV ("`%X%`", [ nullary "I16"; numV eight]); CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); caseV ("EXTADD_PAIRWISE", [al_of_extension Pack.ZX]) ]) + | V128 (V128.I32x4 (V128Op.ExtAddPairwiseS)) -> CaseV ("VEXTUNOP", [ CaseV ("`%X%`", [ nullary "I32"; numV four]); CaseV ("`%X%`", [ nullary "I16"; numV eight ]); caseV ("EXTADD_PAIRWISE", [al_of_extension Pack.SX]) ]) + | V128 (V128.I32x4 (V128Op.ExtAddPairwiseU)) -> CaseV ("VEXTUNOP", [ CaseV ("`%X%`", [ nullary "I32"; numV four]); CaseV ("`%X%`", [ nullary "I16"; numV eight ]); caseV ("EXTADD_PAIRWISE", [al_of_extension Pack.ZX]) ]) | _ -> error "al_of_special_vcvtop" empty let al_of_int_vshiftop : V128Op.ishiftop -> value = function @@ -1609,12 +1609,12 @@ let al_of_vvternop : vec_vternop -> value list = function let al_of_vsplatop : vec_splatop -> value list = function | V128 vop -> ( match vop with - | V128.I8x16 _ -> [ TupV [ nullary "I8"; numV sixteen ] ] - | V128.I16x8 _ -> [ TupV [ nullary "I16"; numV eight ] ] - | V128.I32x4 _ -> [ TupV [ nullary "I32"; numV four ] ] - | V128.I64x2 _ -> [ TupV [ nullary "I64"; numV two ] ] - | V128.F32x4 _ -> [ TupV [ nullary "F32"; numV four ] ] - | V128.F64x2 _ -> [ TupV [ nullary "F64"; numV two ] ] + | V128.I8x16 _ -> [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]) ] + | V128.I16x8 _ -> [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]) ] + | V128.I32x4 _ -> [ CaseV ("`%X%`", [ nullary "I32"; numV four ]) ] + | V128.I64x2 _ -> [ CaseV ("`%X%`", [ nullary "I64"; numV two ]) ] + | V128.F32x4 _ -> [ CaseV ("`%X%`", [ nullary "F32"; numV four ]) ] + | V128.F64x2 _ -> [ CaseV ("`%X%`", [ nullary "F64"; numV two ]) ] ) let al_of_vextractop : vec_extractop -> value list = function @@ -1623,40 +1623,40 @@ let al_of_vextractop : vec_extractop -> value list = function | V128.I8x16 vop' -> ( match vop' with | Extract (n, ext) -> - [ TupV [ nullary "I8"; numV sixteen ]; optV (Some (al_of_extension ext)); al_of_int n; ] + [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); optV (Some (al_of_extension ext)); al_of_int n; ] ) | V128.I16x8 vop' -> ( match vop' with | Extract (n, ext) -> - [ TupV [ nullary "I16"; numV eight ]; optV (Some (al_of_extension ext)); al_of_int n; ] + [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); optV (Some (al_of_extension ext)); al_of_int n; ] ) | V128.I32x4 vop' -> ( match vop' with - | Extract (n, _) -> [ TupV [ nullary "I32"; numV four ]; optV None; al_of_int n ] + | Extract (n, _) -> [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); optV None; al_of_int n ] ) | V128.I64x2 vop' -> ( match vop' with - | Extract (n, _) -> [ TupV [ nullary "I64"; numV two ]; optV None; al_of_int n ] + | Extract (n, _) -> [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); optV None; al_of_int n ] ) | V128.F32x4 vop' -> ( match vop' with - | Extract (n, _) -> [ TupV [ nullary "F32"; numV four ]; optV None; al_of_int n ] + | Extract (n, _) -> [ CaseV ("`%X%`", [ nullary "F32"; numV four ]); optV None; al_of_int n ] ) | V128.F64x2 vop' -> ( match vop' with - | Extract (n, _) -> [ TupV [ nullary "F64"; numV two ]; optV None; al_of_int n ] + | Extract (n, _) -> [ CaseV ("`%X%`", [ nullary "F64"; numV two ]); optV None; al_of_int n ] ) ) let al_of_vreplaceop : vec_replaceop -> value list = function | V128 vop -> ( match vop with - | V128.I8x16 (Replace n) -> [ TupV [ nullary "I8"; numV sixteen ]; al_of_int n ] - | V128.I16x8 (Replace n) -> [ TupV [ nullary "I16"; numV eight ]; al_of_int n ] - | V128.I32x4 (Replace n) -> [ TupV [ nullary "I32"; numV four ]; al_of_int n ] - | V128.I64x2 (Replace n) -> [ TupV [ nullary "I64"; numV two ]; al_of_int n ] - | V128.F32x4 (Replace n) -> [ TupV [ nullary "F32"; numV four ]; al_of_int n ] - | V128.F64x2 (Replace n) -> [ TupV [ nullary "F64"; numV two ]; al_of_int n ] + | V128.I8x16 (Replace n) -> [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); al_of_int n ] + | V128.I16x8 (Replace n) -> [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); al_of_int n ] + | V128.I32x4 (Replace n) -> [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); al_of_int n ] + | V128.I64x2 (Replace n) -> [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); al_of_int n ] + | V128.F32x4 (Replace n) -> [ CaseV ("`%X%`", [ nullary "F32"; numV four ]); al_of_int n ] + | V128.F64x2 (Replace n) -> [ CaseV ("`%X%`", [ nullary "F64"; numV two ]); al_of_int n ] ) let al_of_pack_size = function diff --git a/spectec/src/backend-interpreter/interpreter.ml b/spectec/src/backend-interpreter/interpreter.ml index 57170ab72c..b39754d720 100644 --- a/spectec/src/backend-interpreter/interpreter.ml +++ b/spectec/src/backend-interpreter/interpreter.ml @@ -277,6 +277,7 @@ and eval_expr env expr = | [] -> eval_expr env e2 in eval_expr env e1 |> replace ps | CaseE (tag, el) -> caseV (Print.string_of_atom tag, List.map (eval_expr env) el) + | CaseE2 (op, el) -> caseV (Print.string_of_mixop op, List.map (eval_expr env) el) | OptE opt -> Option.map (eval_expr env) opt |> optV | TupE el -> List.map (eval_expr env) el |> tupV (* Context *) @@ -338,7 +339,6 @@ and eval_expr env expr = | [], Opt -> optV None | [v], Opt -> Option.some v |> optV | l, _ -> listV_of_list l) - | InfixE (e1, _, e2) -> TupV [ eval_expr env e1; eval_expr env e2 ] (* condition *) | TopFrameE -> let ctx = WasmContext.get_top_context () in @@ -451,8 +451,6 @@ and assign lhs rhs env = |> List.fold_right merge (List.map (fun v -> assign e v Env.empty) rhs_iter) |> Env.union (fun _ _ v -> Some v) env_with_length - | InfixE (lhs1, _, lhs2), TupV [rhs1; rhs2] -> - env |> assign lhs1 rhs1 |> assign lhs2 rhs2 | TupE lhs_s, TupV rhs_s when List.length lhs_s = List.length rhs_s -> List.fold_right2 assign lhs_s rhs_s env @@ -462,6 +460,9 @@ and assign lhs rhs env = | CaseE (lhs_tag, lhs_s), CaseV (rhs_tag, rhs_s) when (Print.string_of_atom lhs_tag) = rhs_tag && List.length lhs_s = List.length rhs_s -> List.fold_right2 assign lhs_s rhs_s env + | CaseE2 (op, lhs_s), CaseV (rhs_tag, rhs_s) + when (Print.string_of_mixop op) = rhs_tag && List.length lhs_s = List.length rhs_s -> + List.fold_right2 assign lhs_s rhs_s env | OptE (Some lhs), OptV (Some rhs) -> assign lhs rhs env (* Assumption: e1 is the assign target *) | BinE (binop, e1, e2), NumV m -> diff --git a/spectec/src/backend-interpreter/manual.ml b/spectec/src/backend-interpreter/manual.ml index 908f4a0335..6bf87ae589 100644 --- a/spectec/src/backend-interpreter/manual.ml +++ b/spectec/src/backend-interpreter/manual.ml @@ -54,7 +54,7 @@ let module_ok = function |> Reference_interpreter.Valid.check_module; *) (* TODO: Moduletype *) - TupV [listV_of_list []; listV_of_list []] + CaseV ("`%->%`", [listV_of_list []; listV_of_list []]) | vs -> Numerics.error_values "$Module_ok" vs let manual_map = diff --git a/spectec/src/backend-interpreter/numerics.ml b/spectec/src/backend-interpreter/numerics.ml index 997bbc4d07..1ce6994aaf 100644 --- a/spectec/src/backend-interpreter/numerics.ml +++ b/spectec/src/backend-interpreter/numerics.ml @@ -1025,17 +1025,17 @@ let lanes : numerics = name = "lanes"; f = (function - | [ TupV [ CaseV ("I8", []); NumV z ]; v ] when z = Z.of_int 16 -> + | [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z ]); v ] when z = Z.of_int 16 -> v |> al_to_vec128 |> V128.I8x16.to_lanes |> List.map al_of_int8 |> listV_of_list - | [ TupV [ CaseV ("I16", []); NumV z ]; v ] when z = Z.of_int 8 -> + | [ CaseV ("`%X%`", [ CaseV ("I16", []); NumV z ]); v ] when z = Z.of_int 8 -> v |> al_to_vec128 |> V128.I16x8.to_lanes |> List.map al_of_int16 |> listV_of_list - | [ TupV [ CaseV ("I32", []); NumV z ]; v ] when z = Z.of_int 4 -> + | [ CaseV ("`%X%`", [ CaseV ("I32", []); NumV z ]); v ] when z = Z.of_int 4 -> v |> al_to_vec128 |> V128.I32x4.to_lanes |> List.map al_of_int32 |> listV_of_list - | [ TupV [ CaseV ("I64", []); NumV z ]; v ] when z = Z.of_int 2 -> + | [ CaseV ("`%X%`", [ CaseV ("I64", []); NumV z ]); v ] when z = Z.of_int 2 -> v |> al_to_vec128 |> V128.I64x2.to_lanes |> List.map al_of_int64 |> listV_of_list - | [ TupV [ CaseV ("F32", []); NumV z ]; v ] when z = Z.of_int 4 -> + | [ CaseV ("`%X%`", [ CaseV ("F32", []); NumV z ]); v ] when z = Z.of_int 4 -> v |> al_to_vec128 |> V128.F32x4.to_lanes |> List.map al_of_float32 |> listV_of_list - | [ TupV [ CaseV ("F64", []); NumV z ]; v ] when z = Z.of_int 2 -> + | [ CaseV ("`%X%`", [ CaseV ("F64", []); NumV z ]); v ] when z = Z.of_int 2 -> v |> al_to_vec128 |> V128.F64x2.to_lanes |> List.map al_of_float64 |> listV_of_list | vs -> error_values "lanes" vs ); @@ -1045,19 +1045,19 @@ let inverse_of_lanes : numerics = name = "inverse_of_lanes"; f = (function - | [ TupV [ CaseV ("I8", []); NumV z ]; ListV lanes; ] when z = Z.of_int 16 && Array.length !lanes = 16 -> + | [ CaseV ("`%X%`",[ CaseV ("I8", []); NumV z ]); ListV lanes; ] when z = Z.of_int 16 && Array.length !lanes = 16 -> List.map al_to_int32 (!lanes |> Array.to_list) |> List.map i8_to_i32 |> V128.I8x16.of_lanes |> al_of_vec128 - | [ TupV [ CaseV ("I16", []); NumV z ]; ListV lanes; ] when z = Z.of_int 8 && Array.length !lanes = 8 -> + | [ CaseV ("`%X%`",[ CaseV ("I16", []); NumV z ]); ListV lanes; ] when z = Z.of_int 8 && Array.length !lanes = 8 -> List.map al_to_int32 (!lanes |> Array.to_list) |> List.map i16_to_i32 |> V128.I16x8.of_lanes |> al_of_vec128 - | [ TupV [ CaseV ("I32", []); NumV z ]; ListV lanes; ] when z = Z.of_int 4 && Array.length !lanes = 4 -> + | [ CaseV ("`%X%`",[ CaseV ("I32", []); NumV z ]); ListV lanes; ] when z = Z.of_int 4 && Array.length !lanes = 4 -> List.map al_to_int32 (!lanes |> Array.to_list) |> V128.I32x4.of_lanes |> al_of_vec128 - | [ TupV [ CaseV ("I64", []); NumV z ]; ListV lanes; ] when z = Z.of_int 2 && Array.length !lanes = 2 -> + | [ CaseV ("`%X%`",[ CaseV ("I64", []); NumV z ]); ListV lanes; ] when z = Z.of_int 2 && Array.length !lanes = 2 -> List.map al_to_int64 (!lanes |> Array.to_list) |> V128.I64x2.of_lanes |> al_of_vec128 - | [ TupV [ CaseV ("F32", []); NumV z ]; ListV lanes; ] when z = Z.of_int 4 && Array.length !lanes = 4 -> + | [ CaseV ("`%X%`",[ CaseV ("F32", []); NumV z ]); ListV lanes; ] when z = Z.of_int 4 && Array.length !lanes = 4 -> List.map al_to_float32 (!lanes |> Array.to_list) |> V128.F32x4.of_lanes |> al_of_vec128 - | [ TupV [ CaseV ("F64", []); NumV z ]; ListV lanes; ] when z = Z.of_int 2 && Array.length !lanes = 2 -> + | [ CaseV ("`%X%`",[ CaseV ("F64", []); NumV z ]); ListV lanes; ] when z = Z.of_int 2 && Array.length !lanes = 2 -> List.map al_to_float64 (!lanes |> Array.to_list) |> V128.F64x2.of_lanes |> al_of_vec128 - | vs -> error_values "inverse_of_lanes" vs + | vs -> error_values "inverse_of_lanes" vs ); } diff --git a/spectec/src/backend-prose/render.ml b/spectec/src/backend-prose/render.ml index dbca01f584..f25d7cc1aa 100644 --- a/spectec/src/backend-prose/render.ml +++ b/spectec/src/backend-prose/render.ml @@ -240,6 +240,7 @@ and al_to_el_expr expr = let ele = El.Ast.SeqE ([ ela ] @ elel) in if List.length elel = 0 then Some ele else Some (El.Ast.ParenE (ele $ no_region, `Insig)) + | Al.Ast.CaseE2 (_op, _el) -> None (* TODO *) | Al.Ast.OptE (Some e) -> let* ele = al_to_el_expr e in Some (ele.it) diff --git a/spectec/src/il2al/translate.ml b/spectec/src/il2al/translate.ml index 1be9158a43..03eaacefe8 100644 --- a/spectec/src/il2al/translate.ml +++ b/spectec/src/il2al/translate.ml @@ -268,15 +268,11 @@ and translate_exp exp = tupE [ translate_exp e1; translate_exp e2 ] ~at:at ~note:note | [ []; [{it = Il.Semicolon; _}]; [] ], [ e1; e2 ] -> tupE [ translate_exp e1; translate_exp e2 ] ~at:at ~note:note - | [ []; [{it = Il.Arrow; _} as atom]; [] ], [ e1; e2 ] -> - infixE (translate_exp e1, atom, translate_exp e2) ~at:at ~note:note - | [ []; [{it = Il.Arrow; _} as atom]; []; [] ], [ e1; e2; e3 ] -> - infixE (translate_exp e1, atom, catE (translate_exp e2, translate_exp e3) ~note:Al.Al_util.no_note) ~at:at ~note:note - | [ []; [{it = Il.ArrowSub; _} as atom]; []; [] ], [ e1; e2; e3 ] -> - infixE (translate_exp e1, atom, catE (translate_exp e2, translate_exp e3) ~note:Al.Al_util.no_note) ~at:at ~note:note - | [ []; [{it = Il.Atom _; _} as atom]; [] ], [ e1; e2 ] -> - infixE (translate_exp e1, atom, translate_exp e2) ~at:at ~note:note - | _ -> yetE (Il.Print.string_of_exp exp) ~at:at ~note:note) + | [ []; _atom; [] ], [ _; _ ] + | [ []; _atom; []; [] ], [ _; _; _ ] -> + caseE2 (op, translate_argexp e) ~at:at ~note:note + | _ -> yetE (Il.Print.string_of_exp exp) ~at:at ~note:note + ) | Il.UncaseE (e, op) -> (match op with | [ []; [] ] -> translate_exp e From 2d731b4dba1a99160c44876da90692f964d0ea90 Mon Sep 17 00:00:00 2001 From: presenthee Date: Tue, 13 Aug 2024 15:02:34 +0900 Subject: [PATCH 13/26] Migrate CaseE translation to CaseE2 --- spectec/src/al/al_util.ml | 5 +- spectec/src/backend-interpreter/builtin.ml | 2 +- spectec/src/backend-interpreter/construct.ml | 266 +++++++++--------- .../src/backend-interpreter/interpreter.ml | 16 +- spectec/src/backend-interpreter/manual.ml | 2 +- spectec/src/backend-interpreter/numerics.ml | 24 +- spectec/src/il2al/translate.ml | 58 ++-- 7 files changed, 200 insertions(+), 173 deletions(-) diff --git a/spectec/src/al/al_util.ml b/spectec/src/al/al_util.ml index ca45a1e67b..d27514f6cd 100644 --- a/spectec/src/al/al_util.ml +++ b/spectec/src/al/al_util.ml @@ -245,8 +245,11 @@ let unwrap_framev: value -> value = function (* Mixop *) let get_atom op = - List.find (fun al -> List.length al <> 0) op |> List.hd + match List.find_opt (fun al -> List.length al <> 0) op with + | Some al -> Some(List.hd al) + | None -> None +let name_of_mixop = Il.Mixop.name (* Il Types *) diff --git a/spectec/src/backend-interpreter/builtin.ml b/spectec/src/backend-interpreter/builtin.ml index 755c234459..dd072c17d7 100644 --- a/spectec/src/backend-interpreter/builtin.ml +++ b/spectec/src/backend-interpreter/builtin.ml @@ -21,7 +21,7 @@ let builtin () = let winstr_tag = String.uppercase_ascii name in let code = nullary winstr_tag in let ptype = Array.map nullary type_tags in - let arrow = CaseV ("`%->%`", [ listV ptype; listV [||] ]) in + let arrow = CaseV ("->", [ listV ptype; listV [||] ]) in let ftype = CaseV ("FUNC", [ arrow ]) in let dt = CaseV ("DEF", [ diff --git a/spectec/src/backend-interpreter/construct.ml b/spectec/src/backend-interpreter/construct.ml index 94be9ebe33..bab0cd2d9f 100644 --- a/spectec/src/backend-interpreter/construct.ml +++ b/spectec/src/backend-interpreter/construct.ml @@ -121,7 +121,7 @@ and al_to_result_type: value -> result_type = function and al_to_str_type: value -> str_type = function | CaseV ("STRUCT", [ ftl ]) -> DefStructT (StructT (al_to_list al_to_field_type ftl)) | CaseV ("ARRAY", [ ft ]) -> DefArrayT (ArrayT (al_to_field_type ft)) - | CaseV ("FUNC", [ CaseV ("`%->%`", [ rt1; rt2 ]) ]) -> + | CaseV ("FUNC", [ CaseV ("->", [ rt1; rt2 ]) ]) -> DefFuncT (FuncT (al_to_result_type rt1, (al_to_result_type rt2))) | v -> error_value "str type" v @@ -357,12 +357,12 @@ let al_to_extension : value -> Pack.extension = function | v -> error_value "extension" v let al_to_vop f1 f2 = function - | [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z ]); vop ] when z = sixteen -> V128 (V128.I8x16 (f1 vop)) - | [ CaseV ("`%X%`", [ CaseV ("I16", []); NumV z ]); vop ] when z = eight -> V128 (V128.I16x8 (f1 vop)) - | [ CaseV ("`%X%`", [ CaseV ("I32", []); NumV z ]); vop ] when z = four -> V128 (V128.I32x4 (f1 vop)) - | [ CaseV ("`%X%`", [ CaseV ("I64", []); NumV z ]); vop ] when z = two -> V128 (V128.I64x2 (f1 vop)) - | [ CaseV ("`%X%`", [ CaseV ("F32", []); NumV z ]); vop ] when z = four -> V128 (V128.F32x4 (f2 vop)) - | [ CaseV ("`%X%`", [ CaseV ("F64", []); NumV z ]); vop ] when z = two -> V128 (V128.F64x2 (f2 vop)) + | [ CaseV ("X", [ CaseV ("I8", []); NumV z ]); vop ] when z = sixteen -> V128 (V128.I8x16 (f1 vop)) + | [ CaseV ("X", [ CaseV ("I16", []); NumV z ]); vop ] when z = eight -> V128 (V128.I16x8 (f1 vop)) + | [ CaseV ("X", [ CaseV ("I32", []); NumV z ]); vop ] when z = four -> V128 (V128.I32x4 (f1 vop)) + | [ CaseV ("X", [ CaseV ("I64", []); NumV z ]); vop ] when z = two -> V128 (V128.I64x2 (f1 vop)) + | [ CaseV ("X", [ CaseV ("F32", []); NumV z ]); vop ] when z = four -> V128 (V128.F32x4 (f2 vop)) + | [ CaseV ("X", [ CaseV ("F64", []); NumV z ]); vop ] when z = two -> V128 (V128.F64x2 (f2 vop)) | l -> error_values "vop" l let al_to_vvop f = function @@ -380,10 +380,10 @@ let al_to_vtestop : value list -> vec_testop = al_to_vop al_to_int_vtestop al_to_float_vtestop let al_to_vbitmaskop : value list -> vec_bitmaskop = function - | [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z ]) ] when z = sixteen -> V128 (V128.I8x16 (V128Op.Bitmask)) - | [ CaseV ("`%X%`", [ CaseV ("I16", []); NumV z ]) ] when z = eight -> V128 (V128.I16x8 (V128Op.Bitmask)) - | [ CaseV ("`%X%`", [ CaseV ("I32", []); NumV z ]) ] when z = four -> V128 (V128.I32x4 (V128Op.Bitmask)) - | [ CaseV ("`%X%`", [ CaseV ("I64", []); NumV z ]) ] when z = two -> V128 (V128.I64x2 (V128Op.Bitmask)) + | [ CaseV ("X", [ CaseV ("I8", []); NumV z ]) ] when z = sixteen -> V128 (V128.I8x16 (V128Op.Bitmask)) + | [ CaseV ("X", [ CaseV ("I16", []); NumV z ]) ] when z = eight -> V128 (V128.I16x8 (V128Op.Bitmask)) + | [ CaseV ("X", [ CaseV ("I32", []); NumV z ]) ] when z = four -> V128 (V128.I32x4 (V128Op.Bitmask)) + | [ CaseV ("X", [ CaseV ("I64", []); NumV z ]) ] when z = two -> V128 (V128.I64x2 (V128Op.Bitmask)) | l -> error_values "vbitmaskop" l let al_to_int_vrelop : value -> V128Op.irelop = function @@ -464,12 +464,12 @@ let al_to_float_vbinop : value -> V128Op.fbinop = function let al_to_vbinop : value list -> vec_binop = al_to_vop al_to_int_vbinop al_to_float_vbinop let al_to_special_vbinop = function - | CaseV ("VSWIZZLE", [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z ]); ]) when z = sixteen -> V128 (V128.I8x16 (V128Op.Swizzle)) - | CaseV ("VSHUFFLE", [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z ]); l ]) when z = sixteen -> V128 (V128.I8x16 (V128Op.Shuffle (al_to_list al_to_int l))) - | CaseV ("VNARROW", [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z1 ]); CaseV ("`%X%`", [ CaseV ("I16", []); NumV z2 ]); CaseV ("S", []) ]) when z1 = sixteen && z2 = eight -> V128 (V128.I8x16 (V128Op.NarrowS)) - | CaseV ("VNARROW", [ CaseV ("`%X%`", [ CaseV ("I16", []); NumV z1 ]); CaseV ("`%X%`", [ CaseV ("I32", []); NumV z2 ]); CaseV ("S", []) ]) when z1 = eight && z2 = four -> V128 (V128.I16x8 (V128Op.NarrowS)) - | CaseV ("VNARROW", [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z1 ]); CaseV ("`%X%`", [ CaseV ("I16", []); NumV z2 ]); CaseV ("U", []) ]) when z1 = sixteen && z2 = eight -> V128 (V128.I8x16 (V128Op.NarrowU)) - | CaseV ("VNARROW", [ CaseV ("`%X%`", [ CaseV ("I16", []); NumV z1 ]); CaseV ("`%X%`", [ CaseV ("I32", []); NumV z2 ]); CaseV ("U", []) ]) when z1 = eight && z2 = four -> V128 (V128.I16x8 (V128Op.NarrowU)) + | CaseV ("VSWIZZLE", [ CaseV ("X", [ CaseV ("I8", []); NumV z ]); ]) when z = sixteen -> V128 (V128.I8x16 (V128Op.Swizzle)) + | CaseV ("VSHUFFLE", [ CaseV ("X", [ CaseV ("I8", []); NumV z ]); l ]) when z = sixteen -> V128 (V128.I8x16 (V128Op.Shuffle (al_to_list al_to_int l))) + | CaseV ("VNARROW", [ CaseV ("X", [ CaseV ("I8", []); NumV z1 ]); CaseV ("X", [ CaseV ("I16", []); NumV z2 ]); CaseV ("S", []) ]) when z1 = sixteen && z2 = eight -> V128 (V128.I8x16 (V128Op.NarrowS)) + | CaseV ("VNARROW", [ CaseV ("X", [ CaseV ("I16", []); NumV z1 ]); CaseV ("X", [ CaseV ("I32", []); NumV z2 ]); CaseV ("S", []) ]) when z1 = eight && z2 = four -> V128 (V128.I16x8 (V128Op.NarrowS)) + | CaseV ("VNARROW", [ CaseV ("X", [ CaseV ("I8", []); NumV z1 ]); CaseV ("X", [ CaseV ("I16", []); NumV z2 ]); CaseV ("U", []) ]) when z1 = sixteen && z2 = eight -> V128 (V128.I8x16 (V128Op.NarrowU)) + | CaseV ("VNARROW", [ CaseV ("X", [ CaseV ("I16", []); NumV z1 ]); CaseV ("X", [ CaseV ("I32", []); NumV z2 ]); CaseV ("U", []) ]) when z1 = eight && z2 = four -> V128 (V128.I16x8 (V128Op.NarrowU)) | v -> error_value "special vbinop" v let al_to_int_vcvtop : value list -> V128Op.icvtop = function @@ -485,10 +485,10 @@ let al_to_int_vcvtop : value list -> V128Op.icvtop = function ) | "TRUNC_SAT" -> ( match sh, ext with - | CaseV ("`%X%`", [ CaseV ("F32", []); NumV z ]), "S" when z = four -> V128Op.TruncSatSF32x4 - | CaseV ("`%X%`", [ CaseV ("F32", []); NumV z ]), "U" when z = four -> V128Op.TruncSatUF32x4 - | CaseV ("`%X%`", [ CaseV ("F64", []); NumV z ]), "S" when z = two -> V128Op.TruncSatSZeroF64x2 - | CaseV ("`%X%`", [ CaseV ("F64", []); NumV z ]), "U" when z = two -> V128Op.TruncSatUZeroF64x2 + | CaseV ("X", [ CaseV ("F32", []); NumV z ]), "S" when z = four -> V128Op.TruncSatSF32x4 + | CaseV ("X", [ CaseV ("F32", []); NumV z ]), "U" when z = four -> V128Op.TruncSatUF32x4 + | CaseV ("X", [ CaseV ("F64", []); NumV z ]), "S" when z = two -> V128Op.TruncSatSZeroF64x2 + | CaseV ("X", [ CaseV ("F64", []); NumV z ]), "U" when z = two -> V128Op.TruncSatUZeroF64x2 | _ -> error_values "integer vcvtop" l ) | _ -> error_values "integer vcvtop" l @@ -507,12 +507,12 @@ let al_to_float_vcvtop : value list -> V128Op.fcvtop = function | l -> error_values "float vcvtop" l let al_to_vcvtop : value list -> vec_cvtop = function - | CaseV ("`%X%`", [ CaseV ("I8", []); NumV z ]) :: op when z = sixteen -> V128 (V128.I8x16 (al_to_int_vcvtop op)) - | CaseV ("`%X%`", [ CaseV ("I16", []); NumV z ]) :: op when z = eight -> V128 (V128.I16x8 (al_to_int_vcvtop op)) - | CaseV ("`%X%`", [ CaseV ("I32", []); NumV z ]) :: op when z = four -> V128 (V128.I32x4 (al_to_int_vcvtop op)) - | CaseV ("`%X%`", [ CaseV ("I64", []); NumV z ]) :: op when z = two -> V128 (V128.I64x2 (al_to_int_vcvtop op)) - | CaseV ("`%X%`", [ CaseV ("F32", []); NumV z ]) :: op when z = four -> V128 (V128.F32x4 (al_to_float_vcvtop op)) - | CaseV ("`%X%`", [ CaseV ("F64", []); NumV z ]) :: op when z = two -> V128 (V128.F64x2 (al_to_float_vcvtop op)) + | CaseV ("X", [ CaseV ("I8", []); NumV z ]) :: op when z = sixteen -> V128 (V128.I8x16 (al_to_int_vcvtop op)) + | CaseV ("X", [ CaseV ("I16", []); NumV z ]) :: op when z = eight -> V128 (V128.I16x8 (al_to_int_vcvtop op)) + | CaseV ("X", [ CaseV ("I32", []); NumV z ]) :: op when z = four -> V128 (V128.I32x4 (al_to_int_vcvtop op)) + | CaseV ("X", [ CaseV ("I64", []); NumV z ]) :: op when z = two -> V128 (V128.I64x2 (al_to_int_vcvtop op)) + | CaseV ("X", [ CaseV ("F32", []); NumV z ]) :: op when z = four -> V128 (V128.F32x4 (al_to_float_vcvtop op)) + | CaseV ("X", [ CaseV ("F64", []); NumV z ]) :: op when z = two -> V128 (V128.F64x2 (al_to_float_vcvtop op)) | l -> error_values "vcvtop" l let al_to_int_vshiftop : value -> V128Op.ishiftop = function @@ -547,36 +547,36 @@ let al_to_vvternop' : value -> V128Op.vternop = function let al_to_vvternop : value list -> vec_vternop = al_to_vvop al_to_vvternop' let al_to_vsplatop : value list -> vec_splatop = function - | [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z ]) ] when z = sixteen -> V128 (V128.I8x16 Splat) - | [ CaseV ("`%X%`", [ CaseV ("I16", []); NumV z ]) ] when z = eight -> V128 (V128.I16x8 Splat) - | [ CaseV ("`%X%`", [ CaseV ("I32", []); NumV z ]) ] when z = four -> V128 (V128.I32x4 Splat) - | [ CaseV ("`%X%`", [ CaseV ("I64", []); NumV z ]) ] when z = two -> V128 (V128.I64x2 Splat) - | [ CaseV ("`%X%`", [ CaseV ("F32", []); NumV z ]) ] when z = four -> V128 (V128.F32x4 Splat) - | [ CaseV ("`%X%`", [ CaseV ("F64", []); NumV z ]) ] when z = two -> V128 (V128.F64x2 Splat) + | [ CaseV ("X", [ CaseV ("I8", []); NumV z ]) ] when z = sixteen -> V128 (V128.I8x16 Splat) + | [ CaseV ("X", [ CaseV ("I16", []); NumV z ]) ] when z = eight -> V128 (V128.I16x8 Splat) + | [ CaseV ("X", [ CaseV ("I32", []); NumV z ]) ] when z = four -> V128 (V128.I32x4 Splat) + | [ CaseV ("X", [ CaseV ("I64", []); NumV z ]) ] when z = two -> V128 (V128.I64x2 Splat) + | [ CaseV ("X", [ CaseV ("F32", []); NumV z ]) ] when z = four -> V128 (V128.F32x4 Splat) + | [ CaseV ("X", [ CaseV ("F64", []); NumV z ]) ] when z = two -> V128 (V128.F64x2 Splat) | vs -> error_values "vsplatop" vs let al_to_vextractop : value list -> vec_extractop = function - | [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z ]); OptV (Some ext); n ] when z = sixteen -> + | [ CaseV ("X", [ CaseV ("I8", []); NumV z ]); OptV (Some ext); n ] when z = sixteen -> V128 (V128.I8x16 (Extract (al_to_int n, al_to_extension ext))) - | [ CaseV ("`%X%`", [ CaseV ("I16", []); NumV z ]); OptV (Some ext); n ] when z = eight -> + | [ CaseV ("X", [ CaseV ("I16", []); NumV z ]); OptV (Some ext); n ] when z = eight -> V128 (V128.I16x8 (Extract (al_to_int n, al_to_extension ext))) - | [ CaseV ("`%X%`", [ CaseV ("I32", []); NumV z ]); OptV None; n ] when z = four -> + | [ CaseV ("X", [ CaseV ("I32", []); NumV z ]); OptV None; n ] when z = four -> V128 (V128.I32x4 (Extract (al_to_int n, ()))) - | [ CaseV ("`%X%`", [ CaseV ("I64", []); NumV z ]); OptV None; n ] when z = two -> + | [ CaseV ("X", [ CaseV ("I64", []); NumV z ]); OptV None; n ] when z = two -> V128 (V128.I64x2 (Extract (al_to_int n, ()))) - | [ CaseV ("`%X%`", [ CaseV ("F32", []); NumV z ]); OptV None; n ] when z = four -> + | [ CaseV ("X", [ CaseV ("F32", []); NumV z ]); OptV None; n ] when z = four -> V128 (V128.F32x4 (Extract (al_to_int n, ()))) - | [ CaseV ("`%X%`", [ CaseV ("F64", []); NumV z ]); OptV None; n ] when z = two -> + | [ CaseV ("X", [ CaseV ("F64", []); NumV z ]); OptV None; n ] when z = two -> V128 (V128.F64x2 (Extract (al_to_int n, ()))) | vs -> error_values "vextractop" vs let al_to_vreplaceop : value list -> vec_replaceop = function - | [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z ]); n ] when z = sixteen -> V128 (V128.I8x16 (Replace (al_to_int n))) - | [ CaseV ("`%X%`", [ CaseV ("I16", []); NumV z ]); n ] when z = eight -> V128 (V128.I16x8 (Replace (al_to_int n))) - | [ CaseV ("`%X%`", [ CaseV ("I32", []); NumV z ]); n ] when z = four -> V128 (V128.I32x4 (Replace (al_to_int n))) - | [ CaseV ("`%X%`", [ CaseV ("I64", []); NumV z ]); n ] when z = two -> V128 (V128.I64x2 (Replace (al_to_int n))) - | [ CaseV ("`%X%`", [ CaseV ("F32", []); NumV z ]); n ] when z = four -> V128 (V128.F32x4 (Replace (al_to_int n))) - | [ CaseV ("`%X%`", [ CaseV ("F64", []); NumV z ]); n ] when z = two -> V128 (V128.F64x2 (Replace (al_to_int n))) + | [ CaseV ("X", [ CaseV ("I8", []); NumV z ]); n ] when z = sixteen -> V128 (V128.I8x16 (Replace (al_to_int n))) + | [ CaseV ("X", [ CaseV ("I16", []); NumV z ]); n ] when z = eight -> V128 (V128.I16x8 (Replace (al_to_int n))) + | [ CaseV ("X", [ CaseV ("I32", []); NumV z ]); n ] when z = four -> V128 (V128.I32x4 (Replace (al_to_int n))) + | [ CaseV ("X", [ CaseV ("I64", []); NumV z ]); n ] when z = two -> V128 (V128.I64x2 (Replace (al_to_int n))) + | [ CaseV ("X", [ CaseV ("F32", []); NumV z ]); n ] when z = four -> V128 (V128.F32x4 (Replace (al_to_int n))) + | [ CaseV ("X", [ CaseV ("F64", []); NumV z ]); n ] when z = two -> V128 (V128.F64x2 (Replace (al_to_int n))) | vs -> error_values "vreplaceop" vs let al_to_pack_size : value -> Pack.pack_size = function @@ -1097,7 +1097,7 @@ and al_of_str_type = function | DefStructT (StructT ftl) -> CaseV ("STRUCT", [ al_of_list al_of_field_type ftl ]) | DefArrayT (ArrayT ft) -> CaseV ("ARRAY", [ al_of_field_type ft ]) | DefFuncT (FuncT (rt1, rt2)) -> - CaseV ("FUNC", [ CaseV ("`%->%`", [ al_of_result_type rt1; al_of_result_type rt2 ])]) + CaseV ("FUNC", [ CaseV ("->", [ al_of_result_type rt1; al_of_result_type rt2 ])]) and al_of_sub_type = function | SubT (fin, htl, st) -> @@ -1340,32 +1340,32 @@ let al_of_extension = function let al_of_vop f1 f2 = function | V128 vop -> ( match vop with - | V128.I8x16 op -> [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); f1 op ] - | V128.I16x8 op -> [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); f1 op ] - | V128.I32x4 op -> [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); f1 op ] - | V128.I64x2 op -> [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); f1 op ] - | V128.F32x4 op -> [ CaseV ("`%X%`", [ nullary "F32"; numV four ]); f2 op ] - | V128.F64x2 op -> [ CaseV ("`%X%`", [ nullary "F64"; numV two ]); f2 op ] + | V128.I8x16 op -> [ CaseV ("X", [ nullary "I8"; numV sixteen ]); f1 op ] + | V128.I16x8 op -> [ CaseV ("X", [ nullary "I16"; numV eight ]); f1 op ] + | V128.I32x4 op -> [ CaseV ("X", [ nullary "I32"; numV four ]); f1 op ] + | V128.I64x2 op -> [ CaseV ("X", [ nullary "I64"; numV two ]); f1 op ] + | V128.F32x4 op -> [ CaseV ("X", [ nullary "F32"; numV four ]); f2 op ] + | V128.F64x2 op -> [ CaseV ("X", [ nullary "F64"; numV two ]); f2 op ] ) let al_of_viop f1: ('a, 'a, 'a, 'a, void, void) V128.laneop vecop -> value list = function | V128 vop -> ( match vop with - | V128.I8x16 op -> [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); f1 op ] - | V128.I16x8 op -> [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); f1 op ] - | V128.I32x4 op -> [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); f1 op ] - | V128.I64x2 op -> [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); f1 op ] + | V128.I8x16 op -> [ CaseV ("X", [ nullary "I8"; numV sixteen ]); f1 op ] + | V128.I16x8 op -> [ CaseV ("X", [ nullary "I16"; numV eight ]); f1 op ] + | V128.I32x4 op -> [ CaseV ("X", [ nullary "I32"; numV four ]); f1 op ] + | V128.I64x2 op -> [ CaseV ("X", [ nullary "I64"; numV two ]); f1 op ] | _ -> . ) let al_of_vbitmaskop = function | V128 vop -> ( match vop with - | V128.I8x16 _ -> [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]) ] - | V128.I16x8 _ -> [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]) ] - | V128.I32x4 _ -> [ CaseV ("`%X%`", [ nullary "I32"; numV four ]) ] - | V128.I64x2 _ -> [ CaseV ("`%X%`", [ nullary "I64"; numV two ]) ] + | V128.I8x16 _ -> [ CaseV ("X", [ nullary "I8"; numV sixteen ]) ] + | V128.I16x8 _ -> [ CaseV ("X", [ nullary "I16"; numV eight ]) ] + | V128.I32x4 _ -> [ CaseV ("X", [ nullary "I32"; numV four ]) ] + | V128.I64x2 _ -> [ CaseV ("X", [ nullary "I64"; numV two ]) ] | _ -> error "al_of_vbitmaskop" empty ) @@ -1444,34 +1444,34 @@ let al_of_float_vbinop : V128Op.fbinop -> value = function let al_of_vbinop = function | V128 vop -> ( match vop with - | V128.I8x16 op -> Option.map (fun v -> [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); v ]) (al_of_int_vbinop op) - | V128.I16x8 op -> Option.map (fun v -> [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); v ]) (al_of_int_vbinop op) - | V128.I32x4 op -> Option.map (fun v -> [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); v ]) (al_of_int_vbinop op) - | V128.I64x2 op -> Option.map (fun v -> [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); v ]) (al_of_int_vbinop op) - | V128.F32x4 op -> Some ([ CaseV ("`%X%`", [ nullary "F32"; numV four ]); al_of_float_vbinop op ]) - | V128.F64x2 op -> Some ([ CaseV ("`%X%`", [ nullary "F64"; numV two ]); al_of_float_vbinop op ]) + | V128.I8x16 op -> Option.map (fun v -> [ CaseV ("X", [ nullary "I8"; numV sixteen ]); v ]) (al_of_int_vbinop op) + | V128.I16x8 op -> Option.map (fun v -> [ CaseV ("X", [ nullary "I16"; numV eight ]); v ]) (al_of_int_vbinop op) + | V128.I32x4 op -> Option.map (fun v -> [ CaseV ("X", [ nullary "I32"; numV four ]); v ]) (al_of_int_vbinop op) + | V128.I64x2 op -> Option.map (fun v -> [ CaseV ("X", [ nullary "I64"; numV two ]); v ]) (al_of_int_vbinop op) + | V128.F32x4 op -> Some ([ CaseV ("X", [ nullary "F32"; numV four ]); al_of_float_vbinop op ]) + | V128.F64x2 op -> Some ([ CaseV ("X", [ nullary "F64"; numV two ]); al_of_float_vbinop op ]) ) let al_of_special_vbinop = function - | V128 (V128.I8x16 (V128Op.Swizzle)) -> CaseV ("VSWIZZLE", [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); ]) - | V128 (V128.I8x16 (V128Op.Shuffle l)) -> CaseV ("VSHUFFLE", [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); al_of_list al_of_int l ]) - | V128 (V128.I8x16 (V128Op.NarrowS)) -> CaseV ("VNARROW", [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); CaseV ("`%X%`", [ nullary "I16"; numV eight ]); al_of_extension Pack.SX ]) - | V128 (V128.I16x8 (V128Op.NarrowS)) -> CaseV ("VNARROW", [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); CaseV ("`%X%`", [ nullary "I32"; numV four ]); al_of_extension Pack.SX ]) - | V128 (V128.I8x16 (V128Op.NarrowU)) -> CaseV ("VNARROW", [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); CaseV ("`%X%`", [ nullary "I16"; numV eight ]); al_of_extension Pack.ZX ]) - | V128 (V128.I16x8 (V128Op.NarrowU)) -> CaseV ("VNARROW", [ CaseV ("`%X%`", [ nullary "I16"; numV eight]); CaseV ("`%X%`", [ nullary "I32"; numV four ]); al_of_extension Pack.ZX ]) - | V128 (V128.I16x8 (V128Op.ExtMulHighS)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "HIGH"]) ]) - | V128 (V128.I16x8 (V128Op.ExtMulHighU)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "HIGH"]) ]) - | V128 (V128.I16x8 (V128Op.ExtMulLowS)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "LOW"]) ]) - | V128 (V128.I16x8 (V128Op.ExtMulLowU)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "LOW"]) ] ) - | V128 (V128.I32x4 (V128Op.ExtMulHighS)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); CaseV ("`%X%`", [ nullary "I16"; numV eight ]); caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "HIGH"]) ]) - | V128 (V128.I32x4 (V128Op.ExtMulHighU)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); CaseV ("`%X%`", [ nullary "I16"; numV eight ]); caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "HIGH"]) ]) - | V128 (V128.I32x4 (V128Op.ExtMulLowS)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); CaseV ("`%X%`", [ nullary "I16"; numV eight ]); caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "LOW"]) ]) - | V128 (V128.I32x4 (V128Op.ExtMulLowU)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); CaseV ("`%X%`", [ nullary "I16"; numV eight ]); caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "LOW"]) ] ) - | V128 (V128.I64x2 (V128Op.ExtMulHighS)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); CaseV ("`%X%`", [ nullary "I32"; numV four ]); caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "HIGH"]) ]) - | V128 (V128.I64x2 (V128Op.ExtMulHighU)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); CaseV ("`%X%`", [ nullary "I32"; numV four ]); caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "HIGH"]) ]) - | V128 (V128.I64x2 (V128Op.ExtMulLowS)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); CaseV ("`%X%`", [ nullary "I32"; numV four ]); caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "LOW"]) ]) - | V128 (V128.I64x2 (V128Op.ExtMulLowU)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); CaseV ("`%X%`", [ nullary "I32"; numV four ]); caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "LOW"]) ] ) - | V128 (V128.I32x4 (V128Op.DotS)) -> CaseV ("VEXTBINOP", [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); CaseV ("`%X%`", [ nullary "I16"; numV eight ]); nullary "DOT" ]) + | V128 (V128.I8x16 (V128Op.Swizzle)) -> CaseV ("VSWIZZLE", [ CaseV ("X", [ nullary "I8"; numV sixteen ]); ]) + | V128 (V128.I8x16 (V128Op.Shuffle l)) -> CaseV ("VSHUFFLE", [ CaseV ("X", [ nullary "I8"; numV sixteen ]); al_of_list al_of_int l ]) + | V128 (V128.I8x16 (V128Op.NarrowS)) -> CaseV ("VNARROW", [ CaseV ("X", [ nullary "I8"; numV sixteen ]); CaseV ("X", [ nullary "I16"; numV eight ]); al_of_extension Pack.SX ]) + | V128 (V128.I16x8 (V128Op.NarrowS)) -> CaseV ("VNARROW", [ CaseV ("X", [ nullary "I16"; numV eight ]); CaseV ("X", [ nullary "I32"; numV four ]); al_of_extension Pack.SX ]) + | V128 (V128.I8x16 (V128Op.NarrowU)) -> CaseV ("VNARROW", [ CaseV ("X", [ nullary "I8"; numV sixteen ]); CaseV ("X", [ nullary "I16"; numV eight ]); al_of_extension Pack.ZX ]) + | V128 (V128.I16x8 (V128Op.NarrowU)) -> CaseV ("VNARROW", [ CaseV ("X", [ nullary "I16"; numV eight]); CaseV ("X", [ nullary "I32"; numV four ]); al_of_extension Pack.ZX ]) + | V128 (V128.I16x8 (V128Op.ExtMulHighS)) -> CaseV ("VEXTBINOP", [ CaseV ("X", [ nullary "I16"; numV eight ]); CaseV ("X", [ nullary "I8"; numV sixteen ]); caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "HIGH"]) ]) + | V128 (V128.I16x8 (V128Op.ExtMulHighU)) -> CaseV ("VEXTBINOP", [ CaseV ("X", [ nullary "I16"; numV eight ]); CaseV ("X", [ nullary "I8"; numV sixteen ]); caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "HIGH"]) ]) + | V128 (V128.I16x8 (V128Op.ExtMulLowS)) -> CaseV ("VEXTBINOP", [ CaseV ("X", [ nullary "I16"; numV eight ]); CaseV ("X", [ nullary "I8"; numV sixteen ]); caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "LOW"]) ]) + | V128 (V128.I16x8 (V128Op.ExtMulLowU)) -> CaseV ("VEXTBINOP", [ CaseV ("X", [ nullary "I16"; numV eight ]); CaseV ("X", [ nullary "I8"; numV sixteen ]); caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "LOW"]) ] ) + | V128 (V128.I32x4 (V128Op.ExtMulHighS)) -> CaseV ("VEXTBINOP", [ CaseV ("X", [ nullary "I32"; numV four ]); CaseV ("X", [ nullary "I16"; numV eight ]); caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "HIGH"]) ]) + | V128 (V128.I32x4 (V128Op.ExtMulHighU)) -> CaseV ("VEXTBINOP", [ CaseV ("X", [ nullary "I32"; numV four ]); CaseV ("X", [ nullary "I16"; numV eight ]); caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "HIGH"]) ]) + | V128 (V128.I32x4 (V128Op.ExtMulLowS)) -> CaseV ("VEXTBINOP", [ CaseV ("X", [ nullary "I32"; numV four ]); CaseV ("X", [ nullary "I16"; numV eight ]); caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "LOW"]) ]) + | V128 (V128.I32x4 (V128Op.ExtMulLowU)) -> CaseV ("VEXTBINOP", [ CaseV ("X", [ nullary "I32"; numV four ]); CaseV ("X", [ nullary "I16"; numV eight ]); caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "LOW"]) ] ) + | V128 (V128.I64x2 (V128Op.ExtMulHighS)) -> CaseV ("VEXTBINOP", [ CaseV ("X", [ nullary "I64"; numV two ]); CaseV ("X", [ nullary "I32"; numV four ]); caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "HIGH"]) ]) + | V128 (V128.I64x2 (V128Op.ExtMulHighU)) -> CaseV ("VEXTBINOP", [ CaseV ("X", [ nullary "I64"; numV two ]); CaseV ("X", [ nullary "I32"; numV four ]); caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "HIGH"]) ]) + | V128 (V128.I64x2 (V128Op.ExtMulLowS)) -> CaseV ("VEXTBINOP", [ CaseV ("X", [ nullary "I64"; numV two ]); CaseV ("X", [ nullary "I32"; numV four ]); caseV ("EXTMUL", [al_of_extension Pack.SX; nullary "LOW"]) ]) + | V128 (V128.I64x2 (V128Op.ExtMulLowU)) -> CaseV ("VEXTBINOP", [ CaseV ("X", [ nullary "I64"; numV two ]); CaseV ("X", [ nullary "I32"; numV four ]); caseV ("EXTMUL", [al_of_extension Pack.ZX; nullary "LOW"]) ] ) + | V128 (V128.I32x4 (V128Op.DotS)) -> CaseV ("VEXTBINOP", [ CaseV ("X", [ nullary "I32"; numV four ]); CaseV ("X", [ nullary "I16"; numV eight ]); nullary "DOT" ]) | _ -> error "al_of_special_vbinop" empty let al_of_int_vcvtop = function @@ -1479,22 +1479,22 @@ let al_of_int_vcvtop = function | V128Op.ExtendLowU -> Some (None, caseV ("EXTEND", [nullary "U"]), Some (nullary "LOW"), None) | V128Op.ExtendHighS -> Some (None, caseV ("EXTEND", [nullary "S"]), Some (nullary "HIGH"), None) | V128Op.ExtendHighU -> Some (None, caseV ("EXTEND", [nullary "U"]), Some (nullary "HIGH"), None) - | V128Op.TruncSatSF32x4 -> Some (Some (CaseV ("`%X%`", [ nullary "F32"; numV four ])), caseV ("TRUNC_SAT", [nullary "S"]), None, None) - | V128Op.TruncSatUF32x4 -> Some (Some (CaseV ("`%X%`", [ nullary "F32"; numV four ])), caseV ("TRUNC_SAT", [nullary "U"]), None, None) - | V128Op.TruncSatSZeroF64x2 -> Some (Some (CaseV ("`%X%`", [ nullary "F64"; numV two ])), caseV ("TRUNC_SAT", [nullary "S"]), None, Some (nullary "ZERO")) - | V128Op.TruncSatUZeroF64x2 -> Some (Some (CaseV ("`%X%`", [ nullary "F64"; numV two ])), caseV ("TRUNC_SAT", [nullary "U"]), None, Some (nullary "ZERO")) + | V128Op.TruncSatSF32x4 -> Some (Some (CaseV ("X", [ nullary "F32"; numV four ])), caseV ("TRUNC_SAT", [nullary "S"]), None, None) + | V128Op.TruncSatUF32x4 -> Some (Some (CaseV ("X", [ nullary "F32"; numV four ])), caseV ("TRUNC_SAT", [nullary "U"]), None, None) + | V128Op.TruncSatSZeroF64x2 -> Some (Some (CaseV ("X", [ nullary "F64"; numV two ])), caseV ("TRUNC_SAT", [nullary "S"]), None, Some (nullary "ZERO")) + | V128Op.TruncSatUZeroF64x2 -> Some (Some (CaseV ("X", [ nullary "F64"; numV two ])), caseV ("TRUNC_SAT", [nullary "U"]), None, Some (nullary "ZERO")) | _ -> None let al_of_float32_vcvtop = function - | V128Op.DemoteZeroF64x2 -> Some (Some (CaseV ("`%X%`", [ nullary "F64"; numV two ])), nullary "DEMOTE", None, Some (nullary "ZERO")) - | V128Op.ConvertSI32x4 -> Some (Some (CaseV ("`%X%`", [ nullary "I32"; numV four ])), caseV ("CONVERT", [nullary "S"]), None, None) - | V128Op.ConvertUI32x4 -> Some (Some (CaseV ("`%X%`", [ nullary "I32"; numV four ])), caseV ("CONVERT", [nullary "U"]), None, None) + | V128Op.DemoteZeroF64x2 -> Some (Some (CaseV ("X", [ nullary "F64"; numV two ])), nullary "DEMOTE", None, Some (nullary "ZERO")) + | V128Op.ConvertSI32x4 -> Some (Some (CaseV ("X", [ nullary "I32"; numV four ])), caseV ("CONVERT", [nullary "S"]), None, None) + | V128Op.ConvertUI32x4 -> Some (Some (CaseV ("X", [ nullary "I32"; numV four ])), caseV ("CONVERT", [nullary "U"]), None, None) | _ -> None let al_of_float64_vcvtop = function - | V128Op.PromoteLowF32x4 -> Some (Some (CaseV ("`%X%`", [ nullary "F32"; numV four ])), nullary "PROMOTE", Some (nullary "LOW"), None) - | V128Op.ConvertSI32x4 -> Some (Some (CaseV ("`%X%`", [ nullary "I32"; numV four ])), caseV ("CONVERT", [nullary "S"]), Some (nullary "LOW"), None) - | V128Op.ConvertUI32x4 -> Some (Some (CaseV ("`%X%`", [ nullary "I32"; numV four ])), caseV ("CONVERT", [nullary "U"]), Some (nullary "LOW"), None) + | V128Op.PromoteLowF32x4 -> Some (Some (CaseV ("X", [ nullary "F32"; numV four ])), nullary "PROMOTE", Some (nullary "LOW"), None) + | V128Op.ConvertSI32x4 -> Some (Some (CaseV ("X", [ nullary "I32"; numV four ])), caseV ("CONVERT", [nullary "S"]), Some (nullary "LOW"), None) + | V128Op.ConvertUI32x4 -> Some (Some (CaseV ("X", [ nullary "I32"; numV four ])), caseV ("CONVERT", [nullary "U"]), Some (nullary "LOW"), None) | _ -> None let al_of_vcvtop = function @@ -1505,39 +1505,39 @@ let al_of_vcvtop = function let sh = match to_ with Some sh -> sh | None -> ( match half with | Some _ -> error "al_of_vcvtop" empty - | None -> CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]) + | None -> CaseV ("X", [ nullary "I8"; numV sixteen ]) ) in - [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); sh; op'; optV half; optV zero ] + [ CaseV ("X", [ nullary "I8"; numV sixteen ]); sh; op'; optV half; optV zero ] ) (al_of_int_vcvtop op) ) | V128.I16x8 op -> ( Option.map (fun (to_, op', half, zero) -> let sh = match to_ with Some sh -> sh | None -> ( match half with - | Some _ -> CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]) - | None -> CaseV ("`%X%`", [ nullary "I16"; numV eight ]) + | Some _ -> CaseV ("X", [ nullary "I8"; numV sixteen ]) + | None -> CaseV ("X", [ nullary "I16"; numV eight ]) ) in - [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); sh; op'; optV half; optV zero ] + [ CaseV ("X", [ nullary "I16"; numV eight ]); sh; op'; optV half; optV zero ] ) (al_of_int_vcvtop op) ) | V128.I32x4 op -> ( Option.map (fun (to_, op', half, zero) -> let sh = match to_ with Some sh -> sh | None -> ( match half with - | Some _ -> CaseV ("`%X%`", [ nullary "I16"; numV eight ]) - | None -> CaseV ("`%X%`", [ nullary "I32"; numV four ]) + | Some _ -> CaseV ("X", [ nullary "I16"; numV eight ]) + | None -> CaseV ("X", [ nullary "I32"; numV four ]) ) in - [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); sh; op'; optV half; optV zero ] + [ CaseV ("X", [ nullary "I32"; numV four ]); sh; op'; optV half; optV zero ] ) (al_of_int_vcvtop op) ) | V128.I64x2 op -> ( Option.map (fun (to_, op', half, zero) -> let sh = match to_ with Some sh -> sh | None -> ( match half with - | Some _ -> CaseV ("`%X%`", [ nullary "I32"; numV four ]) - | None -> CaseV ("`%X%`", [ nullary "I64"; numV two ]) + | Some _ -> CaseV ("X", [ nullary "I32"; numV four ]) + | None -> CaseV ("X", [ nullary "I64"; numV two ]) ) in - [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); sh; op'; optV half; optV zero ] + [ CaseV ("X", [ nullary "I64"; numV two ]); sh; op'; optV half; optV zero ] ) (al_of_int_vcvtop op) ) | V128.F32x4 op -> ( @@ -1545,29 +1545,29 @@ let al_of_vcvtop = function let sh = match to_ with Some sh -> sh | None -> ( match half with | Some _ -> error "al_of_vcvtop" empty - | None -> CaseV ("`%X%`", [ nullary "F32"; numV four ]) + | None -> CaseV ("X", [ nullary "F32"; numV four ]) ) in - [ CaseV ("`%X%`", [ nullary "F32"; numV four ]); sh; op'; optV half; optV zero ] + [ CaseV ("X", [ nullary "F32"; numV four ]); sh; op'; optV half; optV zero ] ) (al_of_float32_vcvtop op) ) | V128.F64x2 op -> ( Option.map (fun (to_, op', half, zero) -> let sh = match to_ with Some sh -> sh | None -> ( match half with - | Some _ -> CaseV ("`%X%`", [ nullary "F32"; numV four ]) - | None -> CaseV ("`%X%`", [ nullary "F64"; numV two ]) + | Some _ -> CaseV ("X", [ nullary "F32"; numV four ]) + | None -> CaseV ("X", [ nullary "F64"; numV two ]) ) in - [ CaseV ("`%X%`", [ nullary "F64"; numV two ]); sh; op'; optV half; optV zero ] + [ CaseV ("X", [ nullary "F64"; numV two ]); sh; op'; optV half; optV zero ] ) (al_of_float64_vcvtop op) ) ) let al_of_special_vcvtop = function - | V128 (V128.I16x8 (V128Op.ExtAddPairwiseS)) -> CaseV ("VEXTUNOP", [ CaseV ("`%X%`", [ nullary "I16"; numV eight]); CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); caseV ("EXTADD_PAIRWISE", [al_of_extension Pack.SX]) ]) - | V128 (V128.I16x8 (V128Op.ExtAddPairwiseU)) -> CaseV ("VEXTUNOP", [ CaseV ("`%X%`", [ nullary "I16"; numV eight]); CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); caseV ("EXTADD_PAIRWISE", [al_of_extension Pack.ZX]) ]) - | V128 (V128.I32x4 (V128Op.ExtAddPairwiseS)) -> CaseV ("VEXTUNOP", [ CaseV ("`%X%`", [ nullary "I32"; numV four]); CaseV ("`%X%`", [ nullary "I16"; numV eight ]); caseV ("EXTADD_PAIRWISE", [al_of_extension Pack.SX]) ]) - | V128 (V128.I32x4 (V128Op.ExtAddPairwiseU)) -> CaseV ("VEXTUNOP", [ CaseV ("`%X%`", [ nullary "I32"; numV four]); CaseV ("`%X%`", [ nullary "I16"; numV eight ]); caseV ("EXTADD_PAIRWISE", [al_of_extension Pack.ZX]) ]) + | V128 (V128.I16x8 (V128Op.ExtAddPairwiseS)) -> CaseV ("VEXTUNOP", [ CaseV ("X", [ nullary "I16"; numV eight]); CaseV ("X", [ nullary "I8"; numV sixteen ]); caseV ("EXTADD_PAIRWISE", [al_of_extension Pack.SX]) ]) + | V128 (V128.I16x8 (V128Op.ExtAddPairwiseU)) -> CaseV ("VEXTUNOP", [ CaseV ("X", [ nullary "I16"; numV eight]); CaseV ("X", [ nullary "I8"; numV sixteen ]); caseV ("EXTADD_PAIRWISE", [al_of_extension Pack.ZX]) ]) + | V128 (V128.I32x4 (V128Op.ExtAddPairwiseS)) -> CaseV ("VEXTUNOP", [ CaseV ("X", [ nullary "I32"; numV four]); CaseV ("X", [ nullary "I16"; numV eight ]); caseV ("EXTADD_PAIRWISE", [al_of_extension Pack.SX]) ]) + | V128 (V128.I32x4 (V128Op.ExtAddPairwiseU)) -> CaseV ("VEXTUNOP", [ CaseV ("X", [ nullary "I32"; numV four]); CaseV ("X", [ nullary "I16"; numV eight ]); caseV ("EXTADD_PAIRWISE", [al_of_extension Pack.ZX]) ]) | _ -> error "al_of_special_vcvtop" empty let al_of_int_vshiftop : V128Op.ishiftop -> value = function @@ -1609,12 +1609,12 @@ let al_of_vvternop : vec_vternop -> value list = function let al_of_vsplatop : vec_splatop -> value list = function | V128 vop -> ( match vop with - | V128.I8x16 _ -> [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]) ] - | V128.I16x8 _ -> [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]) ] - | V128.I32x4 _ -> [ CaseV ("`%X%`", [ nullary "I32"; numV four ]) ] - | V128.I64x2 _ -> [ CaseV ("`%X%`", [ nullary "I64"; numV two ]) ] - | V128.F32x4 _ -> [ CaseV ("`%X%`", [ nullary "F32"; numV four ]) ] - | V128.F64x2 _ -> [ CaseV ("`%X%`", [ nullary "F64"; numV two ]) ] + | V128.I8x16 _ -> [ CaseV ("X", [ nullary "I8"; numV sixteen ]) ] + | V128.I16x8 _ -> [ CaseV ("X", [ nullary "I16"; numV eight ]) ] + | V128.I32x4 _ -> [ CaseV ("X", [ nullary "I32"; numV four ]) ] + | V128.I64x2 _ -> [ CaseV ("X", [ nullary "I64"; numV two ]) ] + | V128.F32x4 _ -> [ CaseV ("X", [ nullary "F32"; numV four ]) ] + | V128.F64x2 _ -> [ CaseV ("X", [ nullary "F64"; numV two ]) ] ) let al_of_vextractop : vec_extractop -> value list = function @@ -1623,40 +1623,40 @@ let al_of_vextractop : vec_extractop -> value list = function | V128.I8x16 vop' -> ( match vop' with | Extract (n, ext) -> - [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); optV (Some (al_of_extension ext)); al_of_int n; ] + [ CaseV ("X", [ nullary "I8"; numV sixteen ]); optV (Some (al_of_extension ext)); al_of_int n; ] ) | V128.I16x8 vop' -> ( match vop' with | Extract (n, ext) -> - [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); optV (Some (al_of_extension ext)); al_of_int n; ] + [ CaseV ("X", [ nullary "I16"; numV eight ]); optV (Some (al_of_extension ext)); al_of_int n; ] ) | V128.I32x4 vop' -> ( match vop' with - | Extract (n, _) -> [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); optV None; al_of_int n ] + | Extract (n, _) -> [ CaseV ("X", [ nullary "I32"; numV four ]); optV None; al_of_int n ] ) | V128.I64x2 vop' -> ( match vop' with - | Extract (n, _) -> [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); optV None; al_of_int n ] + | Extract (n, _) -> [ CaseV ("X", [ nullary "I64"; numV two ]); optV None; al_of_int n ] ) | V128.F32x4 vop' -> ( match vop' with - | Extract (n, _) -> [ CaseV ("`%X%`", [ nullary "F32"; numV four ]); optV None; al_of_int n ] + | Extract (n, _) -> [ CaseV ("X", [ nullary "F32"; numV four ]); optV None; al_of_int n ] ) | V128.F64x2 vop' -> ( match vop' with - | Extract (n, _) -> [ CaseV ("`%X%`", [ nullary "F64"; numV two ]); optV None; al_of_int n ] + | Extract (n, _) -> [ CaseV ("X", [ nullary "F64"; numV two ]); optV None; al_of_int n ] ) ) let al_of_vreplaceop : vec_replaceop -> value list = function | V128 vop -> ( match vop with - | V128.I8x16 (Replace n) -> [ CaseV ("`%X%`", [ nullary "I8"; numV sixteen ]); al_of_int n ] - | V128.I16x8 (Replace n) -> [ CaseV ("`%X%`", [ nullary "I16"; numV eight ]); al_of_int n ] - | V128.I32x4 (Replace n) -> [ CaseV ("`%X%`", [ nullary "I32"; numV four ]); al_of_int n ] - | V128.I64x2 (Replace n) -> [ CaseV ("`%X%`", [ nullary "I64"; numV two ]); al_of_int n ] - | V128.F32x4 (Replace n) -> [ CaseV ("`%X%`", [ nullary "F32"; numV four ]); al_of_int n ] - | V128.F64x2 (Replace n) -> [ CaseV ("`%X%`", [ nullary "F64"; numV two ]); al_of_int n ] + | V128.I8x16 (Replace n) -> [ CaseV ("X", [ nullary "I8"; numV sixteen ]); al_of_int n ] + | V128.I16x8 (Replace n) -> [ CaseV ("X", [ nullary "I16"; numV eight ]); al_of_int n ] + | V128.I32x4 (Replace n) -> [ CaseV ("X", [ nullary "I32"; numV four ]); al_of_int n ] + | V128.I64x2 (Replace n) -> [ CaseV ("X", [ nullary "I64"; numV two ]); al_of_int n ] + | V128.F32x4 (Replace n) -> [ CaseV ("X", [ nullary "F32"; numV four ]); al_of_int n ] + | V128.F64x2 (Replace n) -> [ CaseV ("X", [ nullary "F64"; numV two ]); al_of_int n ] ) let al_of_pack_size = function diff --git a/spectec/src/backend-interpreter/interpreter.ml b/spectec/src/backend-interpreter/interpreter.ml index b39754d720..737000360b 100644 --- a/spectec/src/backend-interpreter/interpreter.ml +++ b/spectec/src/backend-interpreter/interpreter.ml @@ -277,7 +277,11 @@ and eval_expr env expr = | [] -> eval_expr env e2 in eval_expr env e1 |> replace ps | CaseE (tag, el) -> caseV (Print.string_of_atom tag, List.map (eval_expr env) el) - | CaseE2 (op, el) -> caseV (Print.string_of_mixop op, List.map (eval_expr env) el) + | CaseE2 (op, el) -> + (match (get_atom op) with + | Some a -> caseV (Print.string_of_atom a, List.map (eval_expr env) el) + | None -> fail_expr expr "inner mixop of caseE is empty" + ) | OptE opt -> Option.map (eval_expr env) opt |> optV | TupE el -> List.map (eval_expr env) el |> tupV (* Context *) @@ -460,9 +464,13 @@ and assign lhs rhs env = | CaseE (lhs_tag, lhs_s), CaseV (rhs_tag, rhs_s) when (Print.string_of_atom lhs_tag) = rhs_tag && List.length lhs_s = List.length rhs_s -> List.fold_right2 assign lhs_s rhs_s env - | CaseE2 (op, lhs_s), CaseV (rhs_tag, rhs_s) - when (Print.string_of_mixop op) = rhs_tag && List.length lhs_s = List.length rhs_s -> - List.fold_right2 assign lhs_s rhs_s env + | CaseE2 (op, lhs_s), CaseV (rhs_tag, rhs_s) when List.length lhs_s = List.length rhs_s -> + (match get_atom op with + | Some lhs_tag when (Print.string_of_atom lhs_tag) = rhs_tag -> + List.fold_right2 assign lhs_s rhs_s env + | _ -> fail_expr lhs + (sprintf "invalid assignment: cannot be an assignment target for %s" (string_of_value rhs)) + ) | OptE (Some lhs), OptV (Some rhs) -> assign lhs rhs env (* Assumption: e1 is the assign target *) | BinE (binop, e1, e2), NumV m -> diff --git a/spectec/src/backend-interpreter/manual.ml b/spectec/src/backend-interpreter/manual.ml index 6bf87ae589..fc6392e4b1 100644 --- a/spectec/src/backend-interpreter/manual.ml +++ b/spectec/src/backend-interpreter/manual.ml @@ -54,7 +54,7 @@ let module_ok = function |> Reference_interpreter.Valid.check_module; *) (* TODO: Moduletype *) - CaseV ("`%->%`", [listV_of_list []; listV_of_list []]) + CaseV ("->", [listV_of_list []; listV_of_list []]) | vs -> Numerics.error_values "$Module_ok" vs let manual_map = diff --git a/spectec/src/backend-interpreter/numerics.ml b/spectec/src/backend-interpreter/numerics.ml index 1ce6994aaf..509cda409c 100644 --- a/spectec/src/backend-interpreter/numerics.ml +++ b/spectec/src/backend-interpreter/numerics.ml @@ -1025,17 +1025,17 @@ let lanes : numerics = name = "lanes"; f = (function - | [ CaseV ("`%X%`", [ CaseV ("I8", []); NumV z ]); v ] when z = Z.of_int 16 -> + | [ CaseV ("X", [ CaseV ("I8", []); NumV z ]); v ] when z = Z.of_int 16 -> v |> al_to_vec128 |> V128.I8x16.to_lanes |> List.map al_of_int8 |> listV_of_list - | [ CaseV ("`%X%`", [ CaseV ("I16", []); NumV z ]); v ] when z = Z.of_int 8 -> + | [ CaseV ("X", [ CaseV ("I16", []); NumV z ]); v ] when z = Z.of_int 8 -> v |> al_to_vec128 |> V128.I16x8.to_lanes |> List.map al_of_int16 |> listV_of_list - | [ CaseV ("`%X%`", [ CaseV ("I32", []); NumV z ]); v ] when z = Z.of_int 4 -> + | [ CaseV ("X", [ CaseV ("I32", []); NumV z ]); v ] when z = Z.of_int 4 -> v |> al_to_vec128 |> V128.I32x4.to_lanes |> List.map al_of_int32 |> listV_of_list - | [ CaseV ("`%X%`", [ CaseV ("I64", []); NumV z ]); v ] when z = Z.of_int 2 -> + | [ CaseV ("X", [ CaseV ("I64", []); NumV z ]); v ] when z = Z.of_int 2 -> v |> al_to_vec128 |> V128.I64x2.to_lanes |> List.map al_of_int64 |> listV_of_list - | [ CaseV ("`%X%`", [ CaseV ("F32", []); NumV z ]); v ] when z = Z.of_int 4 -> + | [ CaseV ("X", [ CaseV ("F32", []); NumV z ]); v ] when z = Z.of_int 4 -> v |> al_to_vec128 |> V128.F32x4.to_lanes |> List.map al_of_float32 |> listV_of_list - | [ CaseV ("`%X%`", [ CaseV ("F64", []); NumV z ]); v ] when z = Z.of_int 2 -> + | [ CaseV ("X", [ CaseV ("F64", []); NumV z ]); v ] when z = Z.of_int 2 -> v |> al_to_vec128 |> V128.F64x2.to_lanes |> List.map al_of_float64 |> listV_of_list | vs -> error_values "lanes" vs ); @@ -1045,17 +1045,17 @@ let inverse_of_lanes : numerics = name = "inverse_of_lanes"; f = (function - | [ CaseV ("`%X%`",[ CaseV ("I8", []); NumV z ]); ListV lanes; ] when z = Z.of_int 16 && Array.length !lanes = 16 -> + | [ CaseV ("X",[ CaseV ("I8", []); NumV z ]); ListV lanes; ] when z = Z.of_int 16 && Array.length !lanes = 16 -> List.map al_to_int32 (!lanes |> Array.to_list) |> List.map i8_to_i32 |> V128.I8x16.of_lanes |> al_of_vec128 - | [ CaseV ("`%X%`",[ CaseV ("I16", []); NumV z ]); ListV lanes; ] when z = Z.of_int 8 && Array.length !lanes = 8 -> + | [ CaseV ("X",[ CaseV ("I16", []); NumV z ]); ListV lanes; ] when z = Z.of_int 8 && Array.length !lanes = 8 -> List.map al_to_int32 (!lanes |> Array.to_list) |> List.map i16_to_i32 |> V128.I16x8.of_lanes |> al_of_vec128 - | [ CaseV ("`%X%`",[ CaseV ("I32", []); NumV z ]); ListV lanes; ] when z = Z.of_int 4 && Array.length !lanes = 4 -> + | [ CaseV ("X",[ CaseV ("I32", []); NumV z ]); ListV lanes; ] when z = Z.of_int 4 && Array.length !lanes = 4 -> List.map al_to_int32 (!lanes |> Array.to_list) |> V128.I32x4.of_lanes |> al_of_vec128 - | [ CaseV ("`%X%`",[ CaseV ("I64", []); NumV z ]); ListV lanes; ] when z = Z.of_int 2 && Array.length !lanes = 2 -> + | [ CaseV ("X",[ CaseV ("I64", []); NumV z ]); ListV lanes; ] when z = Z.of_int 2 && Array.length !lanes = 2 -> List.map al_to_int64 (!lanes |> Array.to_list) |> V128.I64x2.of_lanes |> al_of_vec128 - | [ CaseV ("`%X%`",[ CaseV ("F32", []); NumV z ]); ListV lanes; ] when z = Z.of_int 4 && Array.length !lanes = 4 -> + | [ CaseV ("X",[ CaseV ("F32", []); NumV z ]); ListV lanes; ] when z = Z.of_int 4 && Array.length !lanes = 4 -> List.map al_to_float32 (!lanes |> Array.to_list) |> V128.F32x4.of_lanes |> al_of_vec128 - | [ CaseV ("`%X%`",[ CaseV ("F64", []); NumV z ]); ListV lanes; ] when z = Z.of_int 2 && Array.length !lanes = 2 -> + | [ CaseV ("X",[ CaseV ("F64", []); NumV z ]); ListV lanes; ] when z = Z.of_int 2 && Array.length !lanes = 2 -> List.map al_to_float64 (!lanes |> Array.to_list) |> V128.F64x2.of_lanes |> al_of_vec128 | vs -> error_values "inverse_of_lanes" vs ); diff --git a/spectec/src/il2al/translate.ml b/spectec/src/il2al/translate.ml index 03eaacefe8..d99e1ecd80 100644 --- a/spectec/src/il2al/translate.ml +++ b/spectec/src/il2al/translate.ml @@ -252,17 +252,17 @@ and translate_exp exp = | [ [ {it = Il.Atom "MUT"; _} ]; [ {it = Il.Quest; _} ]; [] ], [ { it = Il.IterE ({ it = Il.TupE []; _ }, (Il.Opt, [])); _}; t ] -> tupE [ iterE (varE "mut" ~note:Al.Al_util.no_note, ["mut"], Opt) ~note:Al.Al_util.no_note; translate_exp t ] ~at:at ~note:note - | [ []; [ {it = Il.Atom "PAGE"; _} as atom ] ], el -> - caseE (atom, List.map translate_exp el) ~at:at ~note:note - | [ [ {it = Il.Atom "NULL"; _} as atom ]; [ {it = Il.Quest; _} ] ], el -> - caseE (atom, List.map translate_exp el) ~at:at ~note:note - | [ {it = Il.Atom _; _} as atom ] :: ll, el + | [ []; [ {it = Il.Atom "PAGE"; _} ] ], el -> + caseE2 (op, List.map translate_exp el) ~at:at ~note:note + | [ [ {it = Il.Atom "NULL"; _} ]; [ {it = Il.Quest; _} ] ], el -> + caseE2 (op, List.map translate_exp el) ~at:at ~note:note + | [ {it = Il.Atom _; _} ] :: ll, el when List.for_all (function ([] | [ {it = (Il.Star | Il.Quest); _} ]) -> true | _ -> false) ll -> - caseE (atom, List.map translate_exp el) ~at:at ~note:note + caseE2 (op, List.map translate_exp el) ~at:at ~note:note | [ [{it = Il.LBrack; _}]; [{it = Il.Dot2; _}]; [{it = Il.RBrack; _}] ], [ e1; e2 ] -> tupE [ translate_exp e1; translate_exp e2 ] ~at:at ~note:note - | (({it = Il.Atom _; _} as atom)::_)::_, _ -> - caseE (atom, translate_argexp e) ~at:at ~note:note + | (({it = Il.Atom _; _} )::_)::_, _ -> + caseE2 (op, translate_argexp e) ~at:at ~note:note | [ []; [] ], [ e1 ] -> translate_exp e1 | [ []; []; [] ], [ e1; e2 ] -> tupE [ translate_exp e1; translate_exp e2 ] ~at:at ~note:note @@ -334,7 +334,7 @@ let assert_cond_of_pop_value e = let at = e.at in let bt = boolT in match e.it with - | CaseE ({ it = Atom ("CONST" | "VCONST"); _ }, [t; _]) -> + | CaseE2 ([ [{ it = Atom ("CONST" | "VCONST"); _ }]; _], [t; _]) -> topValueE (Some t) ~note:bt | GetCurFrameE -> topFrameE () ~at:at ~note:bt @@ -361,15 +361,16 @@ let post_process_of_pop i = (match i.it with | PopI const -> (match const.it with - | CaseE (name, [t; c]) when List.mem name.it [Atom "CONST"; Atom "VCONST"] -> - (match t.it with - | CallE _ -> - let var = if name.it = Atom "CONST" then "nt_0" else "vt_0" in - let t' = { t with it = VarE var } in - let const' = { const with it = CaseE (name, [t'; c]) } in - let i' = { i with it = PopI const' } in - [ letI (t', t) ], i' - | _ -> [], i) + | CaseE2 (op, [ { it = CallE _; _ } as t; c]) -> + (match (get_atom op) with + | Some a -> + let name = Il.Atom.name a in + let var = if name = "CONST" then "nt_0" else "vt_0" in + let t' = { t with it = VarE var } in + let const' = { const with it = CaseE2 (op, [t'; c]) } in + let i' = { i with it = PopI const' } in + [ letI (t', t) ], i' + | None -> [], i) | _ -> [], i) | _ -> [], i) in @@ -426,7 +427,7 @@ let rec translate_rhs exp = ) -> let exp1 = varE arity.it ~note:n1 in let exp2 = varE fid.it ~note:n2 in - let exp3 = caseE (atom, []) ~note:note in + let exp3 = caseE2 ([[atom]], []) ~note:note in let note' = listT note in [ letI (varE "F" ~note:callframeT, frameE (Some (exp1), exp2) ~note:callframeT) ~at:at; @@ -440,7 +441,7 @@ let rec translate_rhs exp = let at' = e2.at in let note' = e2.note in let exp' = labelE (translate_exp arity, translate_exp e1) ~at:at ~note:labelT in - let exp'' = listE ([caseE (atom, []) ~note:note]) ~at:at' ~note:note' in + let exp'' = listE ([caseE2 ([[atom]], []) ~note:note]) ~at:at' ~note:note' in match e2.it with | Il.CatE (ve, ie) -> [ @@ -763,7 +764,7 @@ and handle_special_lhs lhs rhs free_ids = [ letI (VarE s $$ lhs.at % lhs.note, rhs) ~at:at ], [] )] - (* Normal cases *) + (* Normal cases TODO *) | CaseE (tag, es) -> let bindings, es' = extract_non_names es in let rec inject_isCaseOf expr = @@ -778,6 +779,21 @@ and handle_special_lhs lhs rhs free_ids = :: translate_bindings free_ids bindings, [] )] + | CaseE2 (op, es) -> + let tag = get_atom op |> Option.get in + let bindings, es' = extract_non_names es in + let rec inject_isCaseOf expr = + match expr.it with + | IterE (inner_expr, ids, iter) -> + IterE (inject_isCaseOf inner_expr, ids, iter) $$ expr.at % boolT + | _ -> IsCaseOfE (expr, tag) $$ rhs.at % boolT + in + [ ifI ( + inject_isCaseOf rhs, + letI (caseE2 (op, es') ~at:lhs.at ~note:lhs.note, rhs) ~at:at + :: translate_bindings free_ids bindings, + [] + )] | ListE es -> let bindings, es' = extract_non_names es in if List.length es >= 2 then (* TODO: remove this. This is temporarily for a pure function returning stores *) From d5c17776abf83c504d9e37c3aa70dadfe343f45c Mon Sep 17 00:00:00 2001 From: presenthee Date: Wed, 14 Aug 2024 14:41:25 +0900 Subject: [PATCH 14/26] Implement prose rendering for caseE2 --- spectec/src/al/print.ml | 30 ++++++++++++++----- spectec/src/backend-prose/print.ml | 19 ++++++++++-- spectec/src/backend-prose/render.ml | 29 +++++++++++++++++-- spectec/src/il2al/manual.ml | 4 +-- spectec/src/il2al/translate.ml | 45 +++++++++++++++++------------ spectec/src/il2al/transpile.ml | 18 ++++++------ 6 files changed, 105 insertions(+), 40 deletions(-) diff --git a/spectec/src/al/print.ml b/spectec/src/al/print.ml index aa6c85dcd7..0187fcafd6 100644 --- a/spectec/src/al/print.ml +++ b/spectec/src/al/print.ml @@ -180,7 +180,23 @@ and string_of_expr expr = "(" ^ string_of_expr hd ^ ".CONST " ^ string_of_exprs " " tl ^ ")" | CaseE (a, []) -> string_of_atom a | CaseE (a, el) -> "(" ^ string_of_atom a ^ " " ^ string_of_exprs " " el ^ ")" - | CaseE2 (op, el) -> "(" ^ string_of_mixop op ^ "_" ^ string_of_exprs " " el ^ ")" + | CaseE2 ([{ it=Atom.Atom ("CONST" | "VCONST"); _ }]::_tl, hd::tl) -> + "(" ^ string_of_expr hd ^ ".CONST " ^ string_of_exprs " " tl ^ ")" + | CaseE2 ([[ atom ]], []) -> string_of_atom atom + | CaseE2 (op, el) -> + let op' = List.map (fun al -> String.concat "" (List.map string_of_atom al)) op in + (match op' with + | [] -> "()" + | hd::tl -> + let res = + List.fold_left2 ( + fun acc a e -> + let a' = if a = "" then "" else " " ^ a in + let acc' = if acc = "" then "" else acc ^ " " in + acc' ^ string_of_expr e ^ a' + ) hd tl el in + "(" ^ res ^ ")" + ) | OptE (Some e) -> "?(" ^ string_of_expr e ^ ")" | OptE None -> "?()" | ContextKindE (a, e) -> sprintf "%s == %s" (string_of_expr e) (string_of_atom a) @@ -286,7 +302,7 @@ let rec string_of_instr' depth instr = (string_of_instrs' (depth + 1) il2) (repeat indent depth) | OtherwiseI il -> - sprintf " Otherwise:%s" + sprintf " Otherwise:%s" (string_of_instrs' (depth + 1) il) | EitherI (il1, il2) -> sprintf " Either {%s\n%s }\n%s Or {%s\n %s}" @@ -308,12 +324,12 @@ let rec string_of_instr' depth instr = | LetI (e1, e2) -> sprintf " Let %s = %s" (string_of_expr e1) (string_of_expr e2) - | TrapI -> sprintf " Trap" - | NopI -> sprintf " Nop" - | ReturnI None -> sprintf " Return" + | TrapI -> sprintf " Trap" + | NopI -> sprintf " Nop" + | ReturnI None -> sprintf " Return" | ReturnI (Some e) -> sprintf " Return %s" (string_of_expr e) | EnterI (e1, e2, il) -> - sprintf " Enter (%s, %s) {%s \n%s }" + sprintf " Enter (%s, %s) {%s \n%s }" (string_of_expr e1) (string_of_expr e2) (string_of_instrs' (depth + 1) il) (repeat indent depth) | ExecuteI e -> sprintf " Execute %s" (string_of_expr e) @@ -327,7 +343,7 @@ let rec string_of_instr' depth instr = sprintf " %s%s := %s" (string_of_expr e1) (string_of_path p) (string_of_expr e2) | AppendI (e1, e2) -> - sprintf " %s :+ %s" + sprintf " %s :+ %s" (string_of_expr e2) (string_of_expr e1) | YetI s -> sprintf " YetI: %s." s diff --git a/spectec/src/backend-prose/print.ml b/spectec/src/backend-prose/print.ml index 0582743b42..0d52ad18ae 100644 --- a/spectec/src/backend-prose/print.ml +++ b/spectec/src/backend-prose/print.ml @@ -45,7 +45,6 @@ let rec extract_desc typ = match typ.it with let string_of_atom = El.Print.string_of_atom -let string_of_mixop = Il.Print.string_of_mixop let string_of_typ = Il.Print.string_of_typ (* Operators *) @@ -156,7 +155,23 @@ and string_of_expr expr = "(" ^ string_of_expr hd ^ ".CONST " ^ string_of_exprs " " tl ^ ")" | CaseE (a, []) -> string_of_atom a | CaseE (a, el) -> "(" ^ string_of_atom a ^ " " ^ string_of_exprs " " el ^ ")" - | CaseE2 (op, el) -> "(" ^ string_of_mixop op ^ "_" ^ string_of_exprs " " el ^ ")" + | CaseE2 ([{ it=El.Atom.Atom ("CONST" | "VCONST"); _ }]::_tl, hd::tl) -> + "(" ^ string_of_expr hd ^ ".CONST " ^ string_of_exprs " " tl ^ ")" + | CaseE2 ([[ atom ]], []) -> string_of_atom atom + | CaseE2 (op, el) -> + let op' = List.map (fun al -> String.concat "" (List.map string_of_atom al)) op in + (match op' with + | [] -> "()" + | hd::tl -> + let res = + List.fold_left2 ( + fun acc a e -> + let a' = if a = "" then "" else " " ^ a in + let acc' = if acc = "" then "" else acc ^ " " in + acc' ^ string_of_expr e ^ a' + ) hd tl el in + "(" ^ res ^ ")" + ) | OptE (Some e) -> "?(" ^ string_of_expr e ^ ")" | OptE None -> "?()" | ContextKindE (a, e) -> sprintf "%s is %s" (string_of_expr e) (string_of_atom a) diff --git a/spectec/src/backend-prose/render.ml b/spectec/src/backend-prose/render.ml index f25d7cc1aa..a3e1a91a99 100644 --- a/spectec/src/backend-prose/render.ml +++ b/spectec/src/backend-prose/render.ml @@ -240,7 +240,14 @@ and al_to_el_expr expr = let ele = El.Ast.SeqE ([ ela ] @ elel) in if List.length elel = 0 then Some ele else Some (El.Ast.ParenE (ele $ no_region, `Insig)) - | Al.Ast.CaseE2 (_op, _el) -> None (* TODO *) + | Al.Ast.CaseE2 (op, el) -> + let elal = mixop_to_el_exprs op in + let* elel = al_to_el_exprs el in + let ele = El.Ast.SeqE (case_to_el_exprs elal elel) in + (match elel with + | _::_ -> Some (El.Ast.ParenE (ele $ no_region, `Insig)) + | [] -> Some ele + ) | Al.Ast.OptE (Some e) -> let* ele = al_to_el_expr e in Some (ele.it) @@ -249,6 +256,23 @@ and al_to_el_expr expr = in Option.map (fun exp' -> exp' $ no_region) exp' +and case_to_el_exprs al el = + match al with + | [] -> error no_region "empty mixop in a AL case expr" + | hd::tl -> + List.fold_left2 (fun acc a e -> a::Some(e)::acc) [ hd ] tl el + |> List.filter_map (fun x -> x) + |> List.rev + +and mixop_to_el_exprs op = + List.map + (fun al -> + match al with + | [ a ] -> Some((El.Ast.AtomE a) $ no_region) + | _ -> None + ) + op + and al_to_el_exprs exprs = List.fold_left (fun exps e -> @@ -679,8 +703,9 @@ let render_atom_title env name params = | _ -> name.it in let name = name' $$ no_region % name.note in + let op = [name] :: List.init (List.length params) (fun _ -> []) in let params = List.filter_map (fun a -> match a.it with Al.Ast.ExpA e -> Some e | _ -> None) params in - let expr = Al.Al_util.caseE (name, params) ~at:no_region ~note:Al.Al_util.no_note in + let expr = Al.Al_util.caseE2 (op, params) ~at:no_region ~note:Al.Al_util.no_note in match al_to_el_expr expr with | Some ({ it = El.Ast.ParenE (exp, _); _ }) -> render_el_exp env exp | Some exp -> render_el_exp env exp diff --git a/spectec/src/il2al/manual.ml b/spectec/src/il2al/manual.ml index 912ffe5c24..97a0518f9c 100644 --- a/spectec/src/il2al/manual.ml +++ b/spectec/src/il2al/manual.ml @@ -42,7 +42,7 @@ let return_instrs_of_instantiate config = [ enterI ( frameE (Some (numE Z.zero ~note:natT), frame) ~note:callframeT, - listE ([ caseE (atom_of_name "FRAME_" "admininstr", []) ~note:admininstrT]) ~note:ty, + listE ([ caseE2 ([[atom_of_name "FRAME_" "admininstr"]], []) ~note:admininstrT]) ~note:ty, rhs ); returnI (Some (tupE [ @@ -64,7 +64,7 @@ let return_instrs_of_invoke config = letI (arity, len_expr); enterI ( frameE (Some (arity), frame) ~note:callframeT, - listE ([caseE (atom_of_name "FRAME_" "admininstr", []) ~note:admininstrT]) ~note:ty, + listE ([caseE2 ([[atom_of_name "FRAME_" "admininstr"]], []) ~note:admininstrT]) ~note:ty, rhs ); popI (iterE (value, ["val"], ListN (arity, None)) ~note:ty'); diff --git a/spectec/src/il2al/translate.ml b/spectec/src/il2al/translate.ml index d99e1ecd80..fb1af4b161 100644 --- a/spectec/src/il2al/translate.ml +++ b/spectec/src/il2al/translate.ml @@ -246,19 +246,19 @@ and translate_exp exp = (* Constructor *) (* TODO: Need a better way to convert these CaseE into ConstructE *) (* TODO: type *) - | [ [ {it = Il.Atom "MUT"; _} as atom ]; [ {it = Il.Quest; _} ]; [] ], - [ { it = Il.OptE (Some { it = Il.TupE []; _ }); _}; t ] -> - tupE [ caseE (atom, []) ~note:Al.Al_util.no_note; translate_exp t ] ~at:at ~note:note | [ [ {it = Il.Atom "MUT"; _} ]; [ {it = Il.Quest; _} ]; [] ], - [ { it = Il.IterE ({ it = Il.TupE []; _ }, (Il.Opt, [])); _}; t ] -> - tupE [ iterE (varE "mut" ~note:Al.Al_util.no_note, ["mut"], Opt) ~note:Al.Al_util.no_note; translate_exp t ] ~at:at ~note:note - | [ []; [ {it = Il.Atom "PAGE"; _} ] ], el -> - caseE2 (op, List.map translate_exp el) ~at:at ~note:note - | [ [ {it = Il.Atom "NULL"; _} ]; [ {it = Il.Quest; _} ] ], el -> - caseE2 (op, List.map translate_exp el) ~at:at ~note:note - | [ {it = Il.Atom _; _} ] :: ll, el + [ { it = Il.OptE (Some { it = Il.TupE []; _ }); _}; _t ] -> + caseE2(op, translate_argexp e) ~at:at ~note:note + | [ [ {it = Il.Atom "MUT"; _} ]; [ {it = Il.Quest; _} ]; [] ], + [ { it = Il.IterE ({ it = Il.TupE []; _ }, (Il.Opt, [])); _}; _t ] -> + caseE2 (op, translate_argexp e) ~at:at ~note:note + | [ []; [ {it = Il.Atom "PAGE"; _} ] ], _ -> + caseE2 (op, translate_argexp e) ~at:at ~note:note + | [ [ {it = Il.Atom "NULL"; _} ]; [ {it = Il.Quest; _} ] ], _ -> + caseE2 (op, translate_argexp e) ~at:at ~note:note + | [ {it = Il.Atom _; _} ] :: ll, _ when List.for_all (function ([] | [ {it = (Il.Star | Il.Quest); _} ]) -> true | _ -> false) ll -> - caseE2 (op, List.map translate_exp el) ~at:at ~note:note + caseE2 (op, translate_argexp e) ~at:at ~note:note | [ [{it = Il.LBrack; _}]; [{it = Il.Dot2; _}]; [{it = Il.RBrack; _}] ], [ e1; e2 ] -> tupE [ translate_exp e1; translate_exp e2 ] ~at:at ~note:note | (({it = Il.Atom _; _} )::_)::_, _ -> @@ -334,8 +334,12 @@ let assert_cond_of_pop_value e = let at = e.at in let bt = boolT in match e.it with - | CaseE2 ([ [{ it = Atom ("CONST" | "VCONST"); _ }]; _], [t; _]) -> - topValueE (Some t) ~note:bt + | CaseE2 (op, [t; _]) -> + (match get_atom op with + | Some {it = Il.Atom "CONST"; _} -> topValueE (Some t) ~note:bt + | Some {it = Il.Atom "VCONST"; _} -> topValueE (Some t) ~note:bt + | _ -> topValueE None ~note:bt + ) | GetCurFrameE -> topFrameE () ~at:at ~note:bt | GetCurLabelE -> @@ -788,12 +792,17 @@ and handle_special_lhs lhs rhs free_ids = IterE (inject_isCaseOf inner_expr, ids, iter) $$ expr.at % boolT | _ -> IsCaseOfE (expr, tag) $$ rhs.at % boolT in - [ ifI ( - inject_isCaseOf rhs, - letI (caseE2 (op, es') ~at:lhs.at ~note:lhs.note, rhs) ~at:at + (match tag with + | { it = Il.Atom _; _} -> + [ ifI ( + inject_isCaseOf rhs, + letI (caseE2 (op, es') ~at:lhs.at ~note:lhs.note, rhs) ~at:at :: translate_bindings free_ids bindings, - [] - )] + [] + )] + | _ -> + letI (caseE2 (op, es') ~at:lhs.at ~note:lhs.note, rhs) ~at:at + :: translate_bindings free_ids bindings) | ListE es -> let bindings, es' = extract_non_names es in if List.length es >= 2 then (* TODO: remove this. This is temporarily for a pure function returning stores *) diff --git a/spectec/src/il2al/transpile.ml b/spectec/src/il2al/transpile.ml index 825d34f3a5..bf6a66cce5 100644 --- a/spectec/src/il2al/transpile.ml +++ b/spectec/src/il2al/transpile.ml @@ -563,9 +563,9 @@ let get_state_arg_opt f = match Il.Env.find_def !Al.Valid.env id with | (params, _, _) -> let param_state = List.find_opt ( - fun param -> + fun param -> match param.it with - | Il.Ast.ExpP (id, ({ at = _ ; it = VarT ({ at = _ ; it = "state"; note = _ ;}, _); note = _ } as typ)) -> + | Il.Ast.ExpP (id, ({ at = _ ; it = VarT ({ at = _ ; it = "state"; note = _ ;}, _); note = _ } as typ)) -> arg := ExpA ((VarE "z") $$ id.at % typ); true | _ -> false @@ -576,7 +576,7 @@ let get_state_arg_opt f = ) else Option.none let recover_state algo = - + let recover_state_expr expr = match expr.it with | CallE (f, args) -> @@ -646,7 +646,7 @@ let insert_state_binding algo = answer ) else algo' - + (* Insert "Let f be the current frame" if necessary. *) let insert_frame_binding instrs = @@ -889,7 +889,7 @@ let remove_enter algo = match instr.it with | EnterI ( ({ it = FrameE (Some e_arity, _); _ } as e_frame), - { it = ListE ([ { it = CaseE ({ it = Atom.Atom "FRAME_"; _ }, []); _ } ]); _ }, + { it = ListE ([ { it = CaseE2 ([[{ it = Atom.Atom "FRAME_"; _ }]], []); _ } ]); _ }, il) -> begin match e_arity.it with | NumE z when Z.to_int z = 0 -> @@ -905,7 +905,7 @@ let remove_enter algo = end | EnterI ( ({ it = FrameE (None, _); _ } as e_frame), - { it = ListE ([ { it = CaseE ({ it = Atom.Atom "FRAME_"; _ }, []); _ } ]); _ }, + { it = ListE ([ { it = CaseE2 ([[{ it = Atom.Atom "FRAME_"; _ }]], []); _ } ]); _ }, il) -> pushI e_frame ~at:instr.at :: il @ [ popI e_frame ~at:instr.at ] | _ -> [ instr ] @@ -913,7 +913,7 @@ let remove_enter algo = let enter_frame_to_push instr = match instr.it with - | EnterI (e_frame, { it = ListE ([ { it = CaseE ({ it = Atom.Atom "FRAME_"; _ }, []); _ } ]); _ }, il) -> + | EnterI (e_frame, { it = ListE ([ { it = CaseE2 ([[{ it = Atom.Atom "FRAME_"; _ }]], []); _ } ]); _ }, il) -> pushI e_frame ~at:instr.at :: il | _ -> [ instr ] in @@ -922,12 +922,12 @@ let remove_enter algo = match instr.it with | EnterI ( e_label, - { it = CatE (e_instrs, { it = ListE ([ { it = CaseE ({ it = Atom.Atom "LABEL_"; _ }, []); _ } ]); _ }); note; _ }, + { it = CatE (e_instrs, { it = ListE ([ { it = CaseE2 ([[{ it = Atom.Atom "LABEL_"; _ }]], []); _ } ]); _ }); note; _ }, [ { it = PushI e_vals; _ } ]) -> enterI (e_label, catE (e_vals, e_instrs) ~note:note, []) ~at:instr.at | EnterI ( e_label, - { it = CatE (e_instrs, { it = ListE ([ { it = CaseE ({ it = Atom.Atom "LABEL_"; _ }, []); _ } ]); _ }); _ }, + { it = CatE (e_instrs, { it = ListE ([ { it = CaseE2 ([[{ it = Atom.Atom "LABEL_"; _ }]], []); _ } ]); _ }); _ }, []) -> enterI (e_label, e_instrs, []) ~at:instr.at | _ -> instr From e1d28a75cd29703b5bc1b8ce82be1967d93efff3 Mon Sep 17 00:00:00 2001 From: presenthee Date: Wed, 14 Aug 2024 15:29:57 +0900 Subject: [PATCH 15/26] remove unused match --- spectec/src/il2al/translate.ml | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/spectec/src/il2al/translate.ml b/spectec/src/il2al/translate.ml index fb1af4b161..e028424ee6 100644 --- a/spectec/src/il2al/translate.ml +++ b/spectec/src/il2al/translate.ml @@ -246,30 +246,14 @@ and translate_exp exp = (* Constructor *) (* TODO: Need a better way to convert these CaseE into ConstructE *) (* TODO: type *) - | [ [ {it = Il.Atom "MUT"; _} ]; [ {it = Il.Quest; _} ]; [] ], - [ { it = Il.OptE (Some { it = Il.TupE []; _ }); _}; _t ] -> - caseE2(op, translate_argexp e) ~at:at ~note:note - | [ [ {it = Il.Atom "MUT"; _} ]; [ {it = Il.Quest; _} ]; [] ], - [ { it = Il.IterE ({ it = Il.TupE []; _ }, (Il.Opt, [])); _}; _t ] -> - caseE2 (op, translate_argexp e) ~at:at ~note:note - | [ []; [ {it = Il.Atom "PAGE"; _} ] ], _ -> - caseE2 (op, translate_argexp e) ~at:at ~note:note - | [ [ {it = Il.Atom "NULL"; _} ]; [ {it = Il.Quest; _} ] ], _ -> - caseE2 (op, translate_argexp e) ~at:at ~note:note - | [ {it = Il.Atom _; _} ] :: ll, _ - when List.for_all (function ([] | [ {it = (Il.Star | Il.Quest); _} ]) -> true | _ -> false) ll -> - caseE2 (op, translate_argexp e) ~at:at ~note:note | [ [{it = Il.LBrack; _}]; [{it = Il.Dot2; _}]; [{it = Il.RBrack; _}] ], [ e1; e2 ] -> tupE [ translate_exp e1; translate_exp e2 ] ~at:at ~note:note - | (({it = Il.Atom _; _} )::_)::_, _ -> - caseE2 (op, translate_argexp e) ~at:at ~note:note | [ []; [] ], [ e1 ] -> translate_exp e1 | [ []; []; [] ], [ e1; e2 ] -> tupE [ translate_exp e1; translate_exp e2 ] ~at:at ~note:note | [ []; [{it = Il.Semicolon; _}]; [] ], [ e1; e2 ] -> tupE [ translate_exp e1; translate_exp e2 ] ~at:at ~note:note - | [ []; _atom; [] ], [ _; _ ] - | [ []; _atom; []; [] ], [ _; _; _ ] -> + | _, _ when List.length op = List.length exps + 1 -> caseE2 (op, translate_argexp e) ~at:at ~note:note | _ -> yetE (Il.Print.string_of_exp exp) ~at:at ~note:note ) From 4a5f01391d7b7c4b90c4a94c889e59ef672d4d0f Mon Sep 17 00:00:00 2001 From: presenthee Date: Wed, 14 Aug 2024 15:32:35 +0900 Subject: [PATCH 16/26] Make testpromote --- spectec/test-prose/TEST.md | 1866 ++++++++++++++++++------------------ 1 file changed, 933 insertions(+), 933 deletions(-) diff --git a/spectec/test-prose/TEST.md b/spectec/test-prose/TEST.md index 08fa2d1652..1cab38171a 100644 --- a/spectec/test-prose/TEST.md +++ b/spectec/test-prose/TEST.md @@ -25,10 +25,10 @@ watsup 0.4 generator * :math:`m` must be less than or equal to :math:`k`. -* :math:`{t_1^\ast} \rightarrow {t_2^?}` is valid. +* :math:`({t_1^\ast}~\rightarrow~{t_2^?})` is valid. -* :math:`((\mathsf{mut}~{()^?}), t)` is valid. +* :math:`((\mathsf{mut}~{()^?}~{}^?), t)` is valid. * :math:`{\mathit{limits}}` is valid if and only if: @@ -125,39 +125,39 @@ watsup 0.4 generator * :math:`{\mathit{mt}}_1` matches :math:`{\mathit{mt}}_2`. -* :math:`\mathsf{nop}` is valid with type :math:`\epsilon \rightarrow \epsilon`. +* :math:`\mathsf{nop}` is valid with type :math:`(\epsilon~\rightarrow~\epsilon)`. -* :math:`\mathsf{unreachable}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. +* :math:`\mathsf{unreachable}` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})`. -* :math:`\mathsf{drop}` is valid with type :math:`t \rightarrow \epsilon`. +* :math:`\mathsf{drop}` is valid with type :math:`(t~\rightarrow~\epsilon)`. -* :math:`\mathsf{select}` is valid with type :math:`t~t~\mathsf{i{\scriptstyle 32}} \rightarrow t`. +* :math:`\mathsf{select}` is valid with type :math:`(t~t~\mathsf{i{\scriptstyle 32}}~\rightarrow~t)`. -* :math:`(\mathsf{block}~{t^?}~{{\mathit{instr}}^\ast})` is valid with type :math:`\epsilon \rightarrow {t^?}` if and only if: +* :math:`(\mathsf{block}~{t^?}~{{\mathit{instr}}^\ast})` is valid with type :math:`(\epsilon~\rightarrow~{t^?})` if and only if: - * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t^?}]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`\epsilon \rightarrow {t^?}`. + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t^?}]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`(\epsilon~\rightarrow~{t^?})`. -* :math:`(\mathsf{loop}~{t^?}~{{\mathit{instr}}^\ast})` is valid with type :math:`\epsilon \rightarrow {t^?}` if and only if: +* :math:`(\mathsf{loop}~{t^?}~{{\mathit{instr}}^\ast})` is valid with type :math:`(\epsilon~\rightarrow~{t^?})` if and only if: - * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} \epsilon]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`\epsilon \rightarrow \epsilon`. + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} \epsilon]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`(\epsilon~\rightarrow~\epsilon)`. -* :math:`(\mathsf{if}~{t^?}~{{\mathit{instr}}_1^\ast}~{{\mathit{instr}}_2^\ast})` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow {t^?}` if and only if: +* :math:`(\mathsf{if}~{t^?}~{{\mathit{instr}}_1^\ast}~\mathsf{else}~{{\mathit{instr}}_2^\ast})` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\rightarrow~{t^?})` if and only if: - * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t^?}]`, :math:`{{\mathit{instr}}_1^\ast}` is valid with type :math:`\epsilon \rightarrow {t^?}`. + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t^?}]`, :math:`{{\mathit{instr}}_1^\ast}` is valid with type :math:`(\epsilon~\rightarrow~{t^?})`. - * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t^?}]`, :math:`{{\mathit{instr}}_2^\ast}` is valid with type :math:`\epsilon \rightarrow {t^?}`. + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t^?}]`, :math:`{{\mathit{instr}}_2^\ast}` is valid with type :math:`(\epsilon~\rightarrow~{t^?})`. -* :math:`(\mathsf{br}~l)` is valid with type :math:`{t_1^\ast}~{t^?} \rightarrow {t_2^\ast}` if and only if: +* :math:`(\mathsf{br}~l)` is valid with type :math:`({t_1^\ast}~{t^?}~\rightarrow~{t_2^\ast})` if and only if: * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. @@ -165,7 +165,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{labels}{}[l]` must be equal to :math:`{t^?}`. -* :math:`(\mathsf{br\_if}~l)` is valid with type :math:`{t^?}~\mathsf{i{\scriptstyle 32}} \rightarrow {t^?}` if and only if: +* :math:`(\mathsf{br\_if}~l)` is valid with type :math:`({t^?}~\mathsf{i{\scriptstyle 32}}~\rightarrow~{t^?})` if and only if: * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. @@ -173,7 +173,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{labels}{}[l]` must be equal to :math:`{t^?}`. -* :math:`(\mathsf{br\_table}~{l^\ast}~{l'})` is valid with type :math:`{t_1^\ast}~{t^?} \rightarrow {t_2^\ast}` if and only if: +* :math:`(\mathsf{br\_table}~{l^\ast}~{l'})` is valid with type :math:`({t_1^\ast}~{t^?}~\rightarrow~{t_2^\ast})` if and only if: * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`{l'}`. @@ -189,50 +189,50 @@ watsup 0.4 generator * :math:`{t^?}` must be equal to :math:`C{.}\mathsf{labels}{}[l]`. -* :math:`(\mathsf{call}~x)` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^?}` if and only if: +* :math:`(\mathsf{call}~x)` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^?})` if and only if: * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. - * :math:`C{.}\mathsf{funcs}{}[x]` must be equal to :math:`{t_1^\ast} \rightarrow {t_2^?}`. + * :math:`C{.}\mathsf{funcs}{}[x]` must be equal to :math:`({t_1^\ast}~\rightarrow~{t_2^?})`. -* :math:`(\mathsf{call\_indirect}~x)` is valid with type :math:`{t_1^\ast}~\mathsf{i{\scriptstyle 32}} \rightarrow {t_2^?}` if and only if: +* :math:`(\mathsf{call\_indirect}~x)` is valid with type :math:`({t_1^\ast}~\mathsf{i{\scriptstyle 32}}~\rightarrow~{t_2^?})` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. - * :math:`C{.}\mathsf{types}{}[x]` must be equal to :math:`{t_1^\ast} \rightarrow {t_2^?}`. + * :math:`C{.}\mathsf{types}{}[x]` must be equal to :math:`({t_1^\ast}~\rightarrow~{t_2^?})`. -* :math:`\mathsf{return}` is valid with type :math:`{t_1^\ast}~{t^?} \rightarrow {t_2^\ast}` if and only if: +* :math:`\mathsf{return}` is valid with type :math:`({t_1^\ast}~{t^?}~\rightarrow~{t_2^\ast})` if and only if: * :math:`C{.}\mathsf{return}` must be equal to :math:`{t^?}`. -* :math:`(t{.}\mathsf{const}~c_t)` is valid with type :math:`\epsilon \rightarrow t`. +* :math:`(t{.}\mathsf{const}~c_t)` is valid with type :math:`(\epsilon~\rightarrow~t)`. -* :math:`(t {.} {\mathit{unop}}_t)` is valid with type :math:`t \rightarrow t`. +* :math:`(t {.} {\mathit{unop}}_t)` is valid with type :math:`(t~\rightarrow~t)`. -* :math:`(t {.} {\mathit{binop}}_t)` is valid with type :math:`t~t \rightarrow t`. +* :math:`(t {.} {\mathit{binop}}_t)` is valid with type :math:`(t~t~\rightarrow~t)`. -* :math:`(t {.} {\mathit{testop}}_t)` is valid with type :math:`t \rightarrow \mathsf{i{\scriptstyle 32}}`. +* :math:`(t {.} {\mathit{testop}}_t)` is valid with type :math:`(t~\rightarrow~\mathsf{i{\scriptstyle 32}})`. -* :math:`(t {.} {\mathit{relop}}_t)` is valid with type :math:`t~t \rightarrow \mathsf{i{\scriptstyle 32}}`. +* :math:`(t {.} {\mathit{relop}}_t)` is valid with type :math:`(t~t~\rightarrow~\mathsf{i{\scriptstyle 32}})`. -* :math:`({\mathit{nt}}_1 {.} {\mathsf{reinterpret}}{\mathsf{\_}}{{\mathit{nt}}_2})` is valid with type :math:`{\mathit{nt}}_2 \rightarrow {\mathit{nt}}_1` if and only if: +* :math:`({\mathit{nt}}_1 {.} {\mathsf{reinterpret}}{\mathsf{\_}}{{\mathit{nt}}_2})` is valid with type :math:`({\mathit{nt}}_2~\rightarrow~{\mathit{nt}}_1)` if and only if: * :math:`{|{\mathit{nt}}_1|}` must be equal to :math:`{|{\mathit{nt}}_2|}`. -* :math:`(\mathsf{local{.}get}~x)` is valid with type :math:`\epsilon \rightarrow t` if and only if: +* :math:`(\mathsf{local{.}get}~x)` is valid with type :math:`(\epsilon~\rightarrow~t)` if and only if: * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. @@ -240,7 +240,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`t`. -* :math:`(\mathsf{local{.}set}~x)` is valid with type :math:`t \rightarrow \epsilon` if and only if: +* :math:`(\mathsf{local{.}set}~x)` is valid with type :math:`(t~\rightarrow~\epsilon)` if and only if: * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. @@ -248,7 +248,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`t`. -* :math:`(\mathsf{local{.}tee}~x)` is valid with type :math:`t \rightarrow t` if and only if: +* :math:`(\mathsf{local{.}tee}~x)` is valid with type :math:`(t~\rightarrow~t)` if and only if: * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. @@ -256,7 +256,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`t`. -* :math:`(\mathsf{global{.}get}~x)` is valid with type :math:`\epsilon \rightarrow t` if and only if: +* :math:`(\mathsf{global{.}get}~x)` is valid with type :math:`(\epsilon~\rightarrow~t)` if and only if: * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. @@ -264,15 +264,15 @@ watsup 0.4 generator * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`({\mathit{mut}}, t)`. -* :math:`(\mathsf{global{.}set}~x)` is valid with type :math:`t \rightarrow \epsilon` if and only if: +* :math:`(\mathsf{global{.}set}~x)` is valid with type :math:`(t~\rightarrow~\epsilon)` if and only if: * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. - * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`((\mathsf{mut}~()), t)`. + * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`((\mathsf{mut}~()~{}^?), t)`. -* :math:`\mathsf{memory{.}size}` is valid with type :math:`\epsilon \rightarrow \mathsf{i{\scriptstyle 32}}` if and only if: +* :math:`\mathsf{memory{.}size}` is valid with type :math:`(\epsilon~\rightarrow~\mathsf{i{\scriptstyle 32}})` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. @@ -280,7 +280,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. -* :math:`\mathsf{memory{.}grow}` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow \mathsf{i{\scriptstyle 32}}` if and only if: +* :math:`\mathsf{memory{.}grow}` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\rightarrow~\mathsf{i{\scriptstyle 32}})` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. @@ -288,7 +288,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. -* :math:`({\mathit{nt}}{.}\mathsf{load}~{(n, {\mathit{sx}})^?}~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow {\mathit{nt}}` if and only if: +* :math:`({{\mathit{nt}}{.}\mathsf{load}}{{(n, {\mathit{sx}})^?}}~{}^?~{\mathit{memarg}})` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\rightarrow~{\mathit{nt}})` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. @@ -310,7 +310,7 @@ watsup 0.4 generator * :math:`{\mathit{nt}}` must be equal to :math:`{\mathsf{i}}{n}`. -* :math:`({\mathit{nt}}{.}\mathsf{store}~{n^?}~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~{\mathit{nt}} \rightarrow \epsilon` if and only if: +* :math:`({\mathit{nt}}{.}\mathsf{store}~{n^?}~{\mathit{memarg}})` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~{\mathit{nt}}~\rightarrow~\epsilon)` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. @@ -330,7 +330,7 @@ watsup 0.4 generator * :math:`{\mathit{nt}}` must be equal to :math:`{\mathsf{i}}{n}`. -* :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is valid with type :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast} \rightarrow {{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` if and only if: +* :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is valid with type :math:`({{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}~\rightarrow~{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast})` if and only if: * Either: @@ -349,9 +349,9 @@ watsup 0.4 generator * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` must be equal to :math:`{t_3^\ast}`. - * :math:`{\mathit{instr}}_1` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + * :math:`{\mathit{instr}}_1` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})`. - * :math:`{\mathit{instr}}_2` is valid with type :math:`{t_2^\ast} \rightarrow {t_3^\ast}`. * Or: + * :math:`{\mathit{instr}}_2` is valid with type :math:`({t_2^\ast}~\rightarrow~{t_3^\ast})`. * Or: * :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`{{\mathit{instr}}^\ast}`. @@ -359,13 +359,13 @@ watsup 0.4 generator * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` must be equal to :math:`{t^\ast}~{t_2^\ast}`. - * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})`. * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t^?}` if and only if: - * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`\epsilon \rightarrow {t^?}`. + * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`(\epsilon~\rightarrow~{t^?})`. * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is const if and only if: @@ -381,7 +381,7 @@ watsup 0.4 generator * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. - * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`((\mathsf{mut}~\epsilon), t)`. + * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`((\mathsf{mut}~\epsilon~{}^?), t)`. * :math:`{{\mathit{instr}}^\ast}` is const if and only if: @@ -398,12 +398,12 @@ watsup 0.4 generator * :math:`{\mathit{ft}}` is valid. -* :math:`(\mathsf{func}~x~{(\mathsf{local}~t)^\ast}~{\mathit{expr}})` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^?}` if and only if: +* :math:`(\mathsf{func}~x~{(\mathsf{local}~t)^\ast}~{\mathit{expr}})` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^?})` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. - * :math:`C{.}\mathsf{types}{}[x]` must be equal to :math:`{t_1^\ast} \rightarrow {t_2^?}`. + * :math:`C{.}\mathsf{types}{}[x]` must be equal to :math:`({t_1^\ast}~\rightarrow~{t_2^?})`. * Under the context :math:`C{}[{.}\mathsf{locals} \mathrel{{=}{\oplus}} {t_1^\ast}~{t^\ast}]{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^?}]{}[{.}\mathsf{return} \mathrel{{=}{\oplus}} {t_2^?}]`, :math:`{\mathit{expr}}` is valid with type :math:`{t_2^?}`. @@ -471,7 +471,7 @@ watsup 0.4 generator * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. - * :math:`C{.}\mathsf{funcs}{}[x]` must be equal to :math:`\epsilon \rightarrow \epsilon`. + * :math:`C{.}\mathsf{funcs}{}[x]` must be equal to :math:`(\epsilon~\rightarrow~\epsilon)`. * :math:`(\mathsf{import}~{\mathit{name}}_1~{\mathit{name}}_2~{\mathit{xt}})` is valid with type :math:`{\mathit{xt}}` if and only if: @@ -2150,7 +2150,7 @@ watsup 0.4 generator #. Push the activation of :math:`f` to the stack. -#. Let :math:`{t_1^{n}} \rightarrow {t_2^\ast}` be :math:`z{.}\mathsf{funcs}{}[{\mathit{fa}}]{.}\mathsf{type}`. +#. Let :math:`({t_1^{n}}~\rightarrow~{t_2^\ast})` be :math:`z{.}\mathsf{funcs}{}[{\mathit{fa}}]{.}\mathsf{type}`. #. Pop the activation of :math:`f` from the stack. @@ -2555,7 +2555,7 @@ watsup 0.4 generator #. Assert: Due to validation, :math:`a` is less than :math:`{|z{.}\mathsf{funcs}|}`. -#. Let :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~{t_1^{k}} \rightarrow {t_2^{n}},\; \mathsf{module}~{\mathit{mm}},\; \mathsf{code}~{\mathit{func}} \}\end{array}` be :math:`z{.}\mathsf{funcs}{}[a]`. +#. Let :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~({t_1^{k}}~\rightarrow~{t_2^{n}}),\; \mathsf{module}~{\mathit{mm}},\; \mathsf{code}~{\mathit{func}} \}\end{array}` be :math:`z{.}\mathsf{funcs}{}[a]`. #. Assert: Due to validation, there are at least :math:`k` values on the top of the stack. @@ -2788,7 +2788,7 @@ Functype_ok - the function type (t_1* -> t_2?) is valid. Globaltype_ok -- the global type ((MUT ()?), t) is valid. +- the global type ((MUT ()? ?), t) is valid. Tabletype_ok - the table type limits is valid if and only if: @@ -2872,7 +2872,7 @@ Instr_ok/loop - Under the context C with .LABELS prepended by [?()], the instr sequence instr* is valid with the function type ([] -> []). Instr_ok/if -- the instr (IF t? instr_1* instr_2*) is valid with the function type ([I32] -> t?) if and only if: +- the instr (IF t? instr_1* ELSE instr_2*) is valid with the function type ([I32] -> t?) if and only if: - Under the context C with .LABELS prepended by [t?], the instr sequence instr_1* is valid with the function type ([] -> t?). - Under the context C with .LABELS prepended by [t?], the instr sequence instr_2* is valid with the function type ([] -> t?). @@ -2951,7 +2951,7 @@ Instr_ok/global.get Instr_ok/global.set - the instr (GLOBAL.SET x) is valid with the function type ([t] -> []) if and only if: - |C.GLOBALS| is greater than x. - - C.GLOBALS[x] is ((MUT ?(())), t). + - C.GLOBALS[x] is ((MUT ?(()) ?), t). Instr_ok/memory.size - the instr MEMORY.SIZE is valid with the function type ([] -> [I32]) if and only if: @@ -2964,7 +2964,7 @@ Instr_ok/memory.grow - C.MEMS[0] is mt. Instr_ok/load -- the instr (LOAD nt (n, sx)? memarg) is valid with the function type ([I32] -> [nt]) if and only if: +- the instr (LOAD nt (_) (n, sx)? ? memarg) is valid with the function type ([I32] -> [nt]) if and only if: - |C.MEMS| is greater than 0. - ((sx? is ?())) if and only if ((n? is ?())). - C.MEMS[0] is mt. @@ -3015,7 +3015,7 @@ Instr_const - Or: - instr_u0 is (GLOBAL.GET x). - |C.GLOBALS| is greater than x. - - C.GLOBALS[x] is ((MUT ?()), t). + - C.GLOBALS[x] is ((MUT ?() ?), t). Expr_const - the expression instr* is constant if and only if: @@ -4191,10 +4191,10 @@ watsup 0.4 generator * :math:`m` must be less than or equal to :math:`k`. -* :math:`{t_1^\ast} \rightarrow {t_2^\ast}` is valid. +* :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})` is valid. -* :math:`((\mathsf{mut}~{()^?}), t)` is valid. +* :math:`((\mathsf{mut}~{()^?}~{}^?), t)` is valid. * :math:`({\mathit{limits}}, {\mathit{reftype}})` is valid if and only if: @@ -4203,7 +4203,7 @@ watsup 0.4 generator * :math:`{\mathit{limits}}` is valid with type :math:`{2^{32}} - 1`. -* :math:`(\mathsf{page}~{\mathit{limits}})` is valid if and only if: +* :math:`({\mathit{limits}}~\mathsf{page})` is valid if and only if: * :math:`{\mathit{limits}}` is valid with type :math:`{2^{16}}`. @@ -4275,7 +4275,7 @@ watsup 0.4 generator * :math:`{\mathit{lim}}_1` matches :math:`{\mathit{lim}}_2`. -* :math:`(\mathsf{page}~{\mathit{lim}}_1)` matches :math:`(\mathsf{page}~{\mathit{lim}}_2)` if and only if: +* :math:`({\mathit{lim}}_1~\mathsf{page})` matches :math:`({\mathit{lim}}_2~\mathsf{page})` if and only if: * :math:`{\mathit{lim}}_1` matches :math:`{\mathit{lim}}_2`. @@ -4313,7 +4313,7 @@ watsup 0.4 generator * :math:`{\mathit{mt}}_1` matches :math:`{\mathit{mt}}_2`. -* :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid with type :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast} \rightarrow {{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` if and only if: +* :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid with type :math:`({{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}~\rightarrow~{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast})` if and only if: * Either: @@ -4334,48 +4334,48 @@ watsup 0.4 generator * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`{\mathit{typeidx}}`. - * :math:`C{.}\mathsf{types}{}[{\mathit{typeidx}}]` must be equal to :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + * :math:`C{.}\mathsf{types}{}[{\mathit{typeidx}}]` must be equal to :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})`. -* :math:`\mathsf{nop}` is valid with type :math:`\epsilon \rightarrow \epsilon`. +* :math:`\mathsf{nop}` is valid with type :math:`(\epsilon~\rightarrow~\epsilon)`. -* :math:`\mathsf{unreachable}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. +* :math:`\mathsf{unreachable}` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})`. -* :math:`\mathsf{drop}` is valid with type :math:`t \rightarrow \epsilon`. +* :math:`\mathsf{drop}` is valid with type :math:`(t~\rightarrow~\epsilon)`. -* :math:`(\mathsf{select}~t)` is valid with type :math:`t~t~\mathsf{i{\scriptstyle 32}} \rightarrow t`. +* :math:`(t~{}^?)` is valid with type :math:`(t~t~\mathsf{i{\scriptstyle 32}}~\rightarrow~t)`. -* :math:`(\mathsf{block}~{\mathit{bt}}~{{\mathit{instr}}^\ast})` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}` if and only if: +* :math:`(\mathsf{block}~{\mathit{bt}}~{{\mathit{instr}}^\ast})` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})` if and only if: - * :math:`{\mathit{bt}}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + * :math:`{\mathit{bt}}` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})`. - * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})`. -* :math:`(\mathsf{loop}~{\mathit{bt}}~{{\mathit{instr}}^\ast})` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}` if and only if: +* :math:`(\mathsf{loop}~{\mathit{bt}}~{{\mathit{instr}}^\ast})` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})` if and only if: - * :math:`{\mathit{bt}}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + * :math:`{\mathit{bt}}` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})`. - * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_1^\ast}]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_1^\ast}]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})`. -* :math:`(\mathsf{if}~{\mathit{bt}}~{{\mathit{instr}}_1^\ast}~{{\mathit{instr}}_2^\ast})` is valid with type :math:`{t_1^\ast}~\mathsf{i{\scriptstyle 32}} \rightarrow {t_2^\ast}` if and only if: +* :math:`(\mathsf{if}~{\mathit{bt}}~{{\mathit{instr}}_1^\ast}~\mathsf{else}~{{\mathit{instr}}_2^\ast})` is valid with type :math:`({t_1^\ast}~\mathsf{i{\scriptstyle 32}}~\rightarrow~{t_2^\ast})` if and only if: - * :math:`{\mathit{bt}}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + * :math:`{\mathit{bt}}` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})`. - * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}_1^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}_1^\ast}` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})`. - * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}_2^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}_2^\ast}` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})`. -* :math:`(\mathsf{br}~l)` is valid with type :math:`{t_1^\ast}~{t^\ast} \rightarrow {t_2^\ast}` if and only if: +* :math:`(\mathsf{br}~l)` is valid with type :math:`({t_1^\ast}~{t^\ast}~\rightarrow~{t_2^\ast})` if and only if: * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. @@ -4383,7 +4383,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{labels}{}[l]` must be equal to :math:`{t^\ast}`. -* :math:`(\mathsf{br\_if}~l)` is valid with type :math:`{t^\ast}~\mathsf{i{\scriptstyle 32}} \rightarrow {t^\ast}` if and only if: +* :math:`(\mathsf{br\_if}~l)` is valid with type :math:`({t^\ast}~\mathsf{i{\scriptstyle 32}}~\rightarrow~{t^\ast})` if and only if: * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. @@ -4391,7 +4391,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{labels}{}[l]` must be equal to :math:`{t^\ast}`. -* :math:`(\mathsf{br\_table}~{l^\ast}~{l'})` is valid with type :math:`{t_1^\ast}~{t^\ast} \rightarrow {t_2^\ast}` if and only if: +* :math:`(\mathsf{br\_table}~{l^\ast}~{l'})` is valid with type :math:`({t_1^\ast}~{t^\ast}~\rightarrow~{t_2^\ast})` if and only if: * For all :math:`l` in :math:`{l^\ast}`, @@ -4407,15 +4407,15 @@ watsup 0.4 generator * :math:`{t^\ast}` matches :math:`C{.}\mathsf{labels}{}[{l'}]`. -* :math:`(\mathsf{call}~x)` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}` if and only if: +* :math:`(\mathsf{call}~x)` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})` if and only if: * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. - * :math:`C{.}\mathsf{funcs}{}[x]` must be equal to :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + * :math:`C{.}\mathsf{funcs}{}[x]` must be equal to :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})`. -* :math:`(\mathsf{call\_indirect}~x~y)` is valid with type :math:`{t_1^\ast}~\mathsf{i{\scriptstyle 32}} \rightarrow {t_2^\ast}` if and only if: +* :math:`(\mathsf{call\_indirect}~x~y)` is valid with type :math:`({t_1^\ast}~\mathsf{i{\scriptstyle 32}}~\rightarrow~{t_2^\ast})` if and only if: * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. @@ -4424,40 +4424,40 @@ watsup 0.4 generator * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, \mathsf{funcref})`. - * :math:`C{.}\mathsf{types}{}[y]` must be equal to :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + * :math:`C{.}\mathsf{types}{}[y]` must be equal to :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})`. -* :math:`\mathsf{return}` is valid with type :math:`{t_1^\ast}~{t^\ast} \rightarrow {t_2^\ast}` if and only if: +* :math:`\mathsf{return}` is valid with type :math:`({t_1^\ast}~{t^\ast}~\rightarrow~{t_2^\ast})` if and only if: * :math:`C{.}\mathsf{return}` must be equal to :math:`{t^\ast}`. -* :math:`({\mathit{nt}}{.}\mathsf{const}~c_{\mathit{nt}})` is valid with type :math:`\epsilon \rightarrow {\mathit{nt}}`. +* :math:`({\mathit{nt}}{.}\mathsf{const}~c_{\mathit{nt}})` is valid with type :math:`(\epsilon~\rightarrow~{\mathit{nt}})`. -* :math:`({\mathit{nt}} {.} {\mathit{unop}}_{\mathit{nt}})` is valid with type :math:`{\mathit{nt}} \rightarrow {\mathit{nt}}`. +* :math:`({\mathit{nt}} {.} {\mathit{unop}}_{\mathit{nt}})` is valid with type :math:`({\mathit{nt}}~\rightarrow~{\mathit{nt}})`. -* :math:`({\mathit{nt}} {.} {\mathit{binop}}_{\mathit{nt}})` is valid with type :math:`{\mathit{nt}}~{\mathit{nt}} \rightarrow {\mathit{nt}}`. +* :math:`({\mathit{nt}} {.} {\mathit{binop}}_{\mathit{nt}})` is valid with type :math:`({\mathit{nt}}~{\mathit{nt}}~\rightarrow~{\mathit{nt}})`. -* :math:`({\mathit{nt}} {.} {\mathit{testop}}_{\mathit{nt}})` is valid with type :math:`{\mathit{nt}} \rightarrow \mathsf{i{\scriptstyle 32}}`. +* :math:`({\mathit{nt}} {.} {\mathit{testop}}_{\mathit{nt}})` is valid with type :math:`({\mathit{nt}}~\rightarrow~\mathsf{i{\scriptstyle 32}})`. -* :math:`({\mathit{nt}} {.} {\mathit{relop}}_{\mathit{nt}})` is valid with type :math:`{\mathit{nt}}~{\mathit{nt}} \rightarrow \mathsf{i{\scriptstyle 32}}`. +* :math:`({\mathit{nt}} {.} {\mathit{relop}}_{\mathit{nt}})` is valid with type :math:`({\mathit{nt}}~{\mathit{nt}}~\rightarrow~\mathsf{i{\scriptstyle 32}})`. -* :math:`({\mathit{nt}}_1 {.} {\mathsf{reinterpret}}{\mathsf{\_}}{{\mathit{nt}}_2})` is valid with type :math:`{\mathit{nt}}_2 \rightarrow {\mathit{nt}}_1` if and only if: +* :math:`({\mathit{nt}}_1 {.} {\mathsf{reinterpret}}{\mathsf{\_}}{{\mathit{nt}}_2})` is valid with type :math:`({\mathit{nt}}_2~\rightarrow~{\mathit{nt}}_1)` if and only if: * :math:`{|{\mathit{nt}}_1|}` must be equal to :math:`{|{\mathit{nt}}_2|}`. -* :math:`(\mathsf{ref{.}null}~{\mathit{rt}})` is valid with type :math:`\epsilon \rightarrow {\mathit{rt}}`. +* :math:`(\mathsf{ref{.}null}~{\mathit{rt}})` is valid with type :math:`(\epsilon~\rightarrow~{\mathit{rt}})`. -* :math:`(\mathsf{ref{.}func}~x)` is valid with type :math:`\epsilon \rightarrow \mathsf{funcref}` if and only if: +* :math:`(\mathsf{ref{.}func}~x)` is valid with type :math:`(\epsilon~\rightarrow~\mathsf{funcref})` if and only if: * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. @@ -4465,46 +4465,46 @@ watsup 0.4 generator * :math:`C{.}\mathsf{funcs}{}[x]` must be equal to :math:`{\mathit{ft}}`. -* :math:`\mathsf{ref{.}is\_null}` is valid with type :math:`{\mathit{rt}} \rightarrow \mathsf{i{\scriptstyle 32}}`. +* :math:`\mathsf{ref{.}is\_null}` is valid with type :math:`({\mathit{rt}}~\rightarrow~\mathsf{i{\scriptstyle 32}})`. -* :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c)` is valid with type :math:`\epsilon \rightarrow \mathsf{v{\scriptstyle 128}}`. +* :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c)` is valid with type :math:`(\epsilon~\rightarrow~\mathsf{v{\scriptstyle 128}})`. -* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvunop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. +* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvunop}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\rightarrow~\mathsf{v{\scriptstyle 128}})`. -* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvbinop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. +* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvbinop}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~\rightarrow~\mathsf{v{\scriptstyle 128}})`. -* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvternop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. +* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvternop}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~\rightarrow~\mathsf{v{\scriptstyle 128}})`. -* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvtestop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{i{\scriptstyle 32}}`. +* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvtestop}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\rightarrow~\mathsf{i{\scriptstyle 32}})`. -* :math:`({\mathit{sh}} {.} {\mathit{vunop}}_{\mathit{sh}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. +* :math:`({\mathit{sh}} {.} {\mathit{vunop}}_{\mathit{sh}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\rightarrow~\mathsf{v{\scriptstyle 128}})`. -* :math:`({\mathit{sh}} {.} {\mathit{vbinop}}_{\mathit{sh}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. +* :math:`({\mathit{sh}} {.} {\mathit{vbinop}}_{\mathit{sh}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~\rightarrow~\mathsf{v{\scriptstyle 128}})`. -* :math:`({\mathit{sh}} {.} {\mathit{vtestop}}_{\mathit{sh}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{i{\scriptstyle 32}}`. +* :math:`({\mathit{sh}} {.} {\mathit{vtestop}}_{\mathit{sh}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\rightarrow~\mathsf{i{\scriptstyle 32}})`. -* :math:`({\mathit{sh}} {.} {\mathit{vrelop}}_{\mathit{sh}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. +* :math:`({\mathit{sh}} {.} {\mathit{vrelop}}_{\mathit{sh}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~\rightarrow~\mathsf{v{\scriptstyle 128}})`. -* :math:`({\mathit{sh}} {.} {\mathit{vshiftop}}_{\mathit{sh}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{i{\scriptstyle 32}} \rightarrow \mathsf{v{\scriptstyle 128}}`. +* :math:`({\mathit{sh}} {.} {\mathit{vshiftop}}_{\mathit{sh}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\mathsf{i{\scriptstyle 32}}~\rightarrow~\mathsf{v{\scriptstyle 128}})`. -* :math:`({\mathit{sh}}{.}\mathsf{bitmask})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{i{\scriptstyle 32}}`. +* :math:`({\mathit{sh}}{.}\mathsf{bitmask})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\rightarrow~\mathsf{i{\scriptstyle 32}})`. -* :math:`({\mathit{sh}}{.}\mathsf{swizzle})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. +* :math:`({\mathit{sh}}{.}\mathsf{swizzle})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~\rightarrow~\mathsf{v{\scriptstyle 128}})`. -* :math:`({\mathit{sh}}{.}\mathsf{shuffle}~{i^\ast})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}` if and only if: +* :math:`({\mathit{sh}}{.}\mathsf{shuffle}~{i^\ast})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~\rightarrow~\mathsf{v{\scriptstyle 128}})` if and only if: * For all :math:`i` in :math:`{i^\ast}`, @@ -4512,34 +4512,34 @@ watsup 0.4 generator * :math:`i` must be less than :math:`2 \cdot {\mathrm{dim}}({\mathit{sh}})`. -* :math:`({\mathit{sh}}{.}\mathsf{splat})` is valid with type :math:`{\mathrm{unpack}}({\mathit{sh}}) \rightarrow \mathsf{v{\scriptstyle 128}}`. +* :math:`({\mathit{sh}}{.}\mathsf{splat})` is valid with type :math:`({\mathrm{unpack}}({\mathit{sh}})~\rightarrow~\mathsf{v{\scriptstyle 128}})`. -* :math:`({{\mathit{sh}}{.}\mathsf{extract\_lane}}{{{\mathit{sx}}^?}}~i)` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow {\mathrm{unpack}}({\mathit{sh}})` if and only if: +* :math:`({{\mathit{sh}}{.}\mathsf{extract\_lane}}{{{\mathit{sx}}^?}}~i)` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\rightarrow~{\mathrm{unpack}}({\mathit{sh}}))` if and only if: * :math:`i` must be less than :math:`{\mathrm{dim}}({\mathit{sh}})`. -* :math:`({\mathit{sh}}{.}\mathsf{replace\_lane}~i)` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~{\mathrm{unpack}}({\mathit{sh}}) \rightarrow \mathsf{v{\scriptstyle 128}}` if and only if: +* :math:`({\mathit{sh}}{.}\mathsf{replace\_lane}~i)` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~{\mathrm{unpack}}({\mathit{sh}})~\rightarrow~\mathsf{v{\scriptstyle 128}})` if and only if: * :math:`i` must be less than :math:`{\mathrm{dim}}({\mathit{sh}})`. -* :math:`(\mathsf{vextunop}~{\mathit{sh}}_1~{\mathit{sh}}_2~{\mathit{vextunop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. +* :math:`(\mathsf{vextunop}~{\mathit{sh}}_1~{\mathit{sh}}_2~{\mathit{vextunop}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\rightarrow~\mathsf{v{\scriptstyle 128}})`. -* :math:`(\mathsf{vextbinop}~{\mathit{sh}}_1~{\mathit{sh}}_2~{\mathit{vextbinop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. +* :math:`(\mathsf{vextbinop}~{\mathit{sh}}_1~{\mathit{sh}}_2~{\mathit{vextbinop}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~\rightarrow~\mathsf{v{\scriptstyle 128}})`. -* :math:`({{\mathit{sh}}_1{.}\mathsf{narrow}}{\mathsf{\_}}{{\mathit{sh}}_2}{\mathsf{\_}}{{\mathit{sx}}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. +* :math:`({{\mathit{sh}}_1{.}\mathsf{narrow}}{\mathsf{\_}}{{\mathit{sh}}_2}{\mathsf{\_}}{{\mathit{sx}}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~\rightarrow~\mathsf{v{\scriptstyle 128}})`. -* :math:`({\mathit{sh}}_1 {.} {{\mathit{sh}}_2}{\mathsf{\_}}{{\mathit{vcvtop}}}{\mathsf{\_}}{{{\mathit{hf}}^?}}{\mathsf{\_}}{{{\mathit{zero}}^?}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}`. +* :math:`({\mathit{sh}}_1 {.} {{\mathit{sh}}_2}{\mathsf{\_}}{{\mathit{vcvtop}}}{\mathsf{\_}}{{{\mathit{hf}}^?}}{\mathsf{\_}}{{{\mathit{zero}}^?}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\rightarrow~\mathsf{v{\scriptstyle 128}})`. -* :math:`(\mathsf{local{.}get}~x)` is valid with type :math:`\epsilon \rightarrow t` if and only if: +* :math:`(\mathsf{local{.}get}~x)` is valid with type :math:`(\epsilon~\rightarrow~t)` if and only if: * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. @@ -4547,7 +4547,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`t`. -* :math:`(\mathsf{local{.}set}~x)` is valid with type :math:`t \rightarrow \epsilon` if and only if: +* :math:`(\mathsf{local{.}set}~x)` is valid with type :math:`(t~\rightarrow~\epsilon)` if and only if: * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. @@ -4555,7 +4555,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`t`. -* :math:`(\mathsf{local{.}tee}~x)` is valid with type :math:`t \rightarrow t` if and only if: +* :math:`(\mathsf{local{.}tee}~x)` is valid with type :math:`(t~\rightarrow~t)` if and only if: * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. @@ -4563,7 +4563,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`t`. -* :math:`(\mathsf{global{.}get}~x)` is valid with type :math:`\epsilon \rightarrow t` if and only if: +* :math:`(\mathsf{global{.}get}~x)` is valid with type :math:`(\epsilon~\rightarrow~t)` if and only if: * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. @@ -4571,15 +4571,15 @@ watsup 0.4 generator * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`({\mathit{mut}}, t)`. -* :math:`(\mathsf{global{.}set}~x)` is valid with type :math:`t \rightarrow \epsilon` if and only if: +* :math:`(\mathsf{global{.}set}~x)` is valid with type :math:`(t~\rightarrow~\epsilon)` if and only if: * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. - * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`((\mathsf{mut}~()), t)`. + * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`((\mathsf{mut}~()~{}^?), t)`. -* :math:`(\mathsf{table{.}get}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow {\mathit{rt}}` if and only if: +* :math:`(\mathsf{table{.}get}~x)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\rightarrow~{\mathit{rt}})` if and only if: * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. @@ -4587,7 +4587,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. -* :math:`(\mathsf{table{.}set}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~{\mathit{rt}} \rightarrow \epsilon` if and only if: +* :math:`(\mathsf{table{.}set}~x)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~{\mathit{rt}}~\rightarrow~\epsilon)` if and only if: * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. @@ -4595,7 +4595,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. -* :math:`(\mathsf{table{.}size}~x)` is valid with type :math:`\epsilon \rightarrow \mathsf{i{\scriptstyle 32}}` if and only if: +* :math:`(\mathsf{table{.}size}~x)` is valid with type :math:`(\epsilon~\rightarrow~\mathsf{i{\scriptstyle 32}})` if and only if: * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. @@ -4603,7 +4603,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. -* :math:`(\mathsf{table{.}grow}~x)` is valid with type :math:`{\mathit{rt}}~\mathsf{i{\scriptstyle 32}} \rightarrow \mathsf{i{\scriptstyle 32}}` if and only if: +* :math:`(\mathsf{table{.}grow}~x)` is valid with type :math:`({\mathit{rt}}~\mathsf{i{\scriptstyle 32}}~\rightarrow~\mathsf{i{\scriptstyle 32}})` if and only if: * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. @@ -4611,7 +4611,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. -* :math:`(\mathsf{table{.}fill}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~{\mathit{rt}}~\mathsf{i{\scriptstyle 32}} \rightarrow \epsilon` if and only if: +* :math:`(\mathsf{table{.}fill}~x)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~{\mathit{rt}}~\mathsf{i{\scriptstyle 32}}~\rightarrow~\epsilon)` if and only if: * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. @@ -4619,7 +4619,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. -* :math:`(\mathsf{table{.}copy}~x_1~x_2)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow \epsilon` if and only if: +* :math:`(\mathsf{table{.}copy}~x_1~x_2)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\rightarrow~\epsilon)` if and only if: * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x_1`. @@ -4631,7 +4631,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{tables}{}[x_2]` must be equal to :math:`({\mathit{lim}}_2, {\mathit{rt}})`. -* :math:`(\mathsf{table{.}init}~x_1~x_2)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow \epsilon` if and only if: +* :math:`(\mathsf{table{.}init}~x_1~x_2)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\rightarrow~\epsilon)` if and only if: * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x_1`. @@ -4643,7 +4643,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{elems}{}[x_2]` must be equal to :math:`{\mathit{rt}}`. -* :math:`(\mathsf{elem{.}drop}~x)` is valid with type :math:`\epsilon \rightarrow \epsilon` if and only if: +* :math:`(\mathsf{elem{.}drop}~x)` is valid with type :math:`(\epsilon~\rightarrow~\epsilon)` if and only if: * :math:`{|C{.}\mathsf{elems}|}` must be greater than :math:`x`. @@ -4651,7 +4651,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{elems}{}[x]` must be equal to :math:`{\mathit{rt}}`. -* :math:`\mathsf{memory{.}size}` is valid with type :math:`\epsilon \rightarrow \mathsf{i{\scriptstyle 32}}` if and only if: +* :math:`\mathsf{memory{.}size}` is valid with type :math:`(\epsilon~\rightarrow~\mathsf{i{\scriptstyle 32}})` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. @@ -4659,7 +4659,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. -* :math:`\mathsf{memory{.}grow}` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow \mathsf{i{\scriptstyle 32}}` if and only if: +* :math:`\mathsf{memory{.}grow}` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\rightarrow~\mathsf{i{\scriptstyle 32}})` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. @@ -4667,7 +4667,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. -* :math:`\mathsf{memory{.}fill}` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow \epsilon` if and only if: +* :math:`\mathsf{memory{.}fill}` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\rightarrow~\epsilon)` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. @@ -4675,7 +4675,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. -* :math:`\mathsf{memory{.}copy}` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow \epsilon` if and only if: +* :math:`\mathsf{memory{.}copy}` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\rightarrow~\epsilon)` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. @@ -4683,7 +4683,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{mems}{}[0]` must be equal to :math:`{\mathit{mt}}`. -* :math:`(\mathsf{memory{.}init}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow \epsilon` if and only if: +* :math:`(\mathsf{memory{.}init}~x)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\rightarrow~\epsilon)` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. @@ -4695,7 +4695,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{datas}{}[x]` must be equal to :math:`\mathsf{ok}`. -* :math:`(\mathsf{data{.}drop}~x)` is valid with type :math:`\epsilon \rightarrow \epsilon` if and only if: +* :math:`(\mathsf{data{.}drop}~x)` is valid with type :math:`(\epsilon~\rightarrow~\epsilon)` if and only if: * :math:`{|C{.}\mathsf{datas}|}` must be greater than :math:`x`. @@ -4703,7 +4703,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{datas}{}[x]` must be equal to :math:`\mathsf{ok}`. -* :math:`({\mathit{nt}}{.}\mathsf{load}~{(n, {\mathit{sx}})^?}~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow {\mathit{nt}}` if and only if: +* :math:`({{\mathit{nt}}{.}\mathsf{load}}{{(n, {\mathit{sx}})^?}}~{}^?~{\mathit{memarg}})` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\rightarrow~{\mathit{nt}})` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. @@ -4725,7 +4725,7 @@ watsup 0.4 generator * :math:`{\mathit{nt}}` must be equal to :math:`{\mathsf{i}}{n}`. -* :math:`({\mathit{nt}}{.}\mathsf{store}~{n^?}~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~{\mathit{nt}} \rightarrow \epsilon` if and only if: +* :math:`({\mathit{nt}}{.}\mathsf{store}~{n^?}~{\mathit{memarg}})` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~{\mathit{nt}}~\rightarrow~\epsilon)` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. @@ -4745,7 +4745,7 @@ watsup 0.4 generator * :math:`{\mathit{nt}}` must be equal to :math:`{\mathsf{i}}{n}`. -* :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{load}~({M}{\mathsf{x}}{N}{\mathsf{\_}}{{\mathit{sx}}})~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow \mathsf{v{\scriptstyle 128}}` if and only if: +* :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{load}~({M}{\mathsf{x}}{\mathsf{x}}{\mathsf{\_}}{N})~{\mathit{memarg}})` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\rightarrow~\mathsf{v{\scriptstyle 128}})` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. @@ -4755,7 +4755,7 @@ watsup 0.4 generator * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`M / 8 \cdot N`. -* :math:`(\mathsf{vload\_lane}~\mathsf{v{\scriptstyle 128}}~n~{\mathit{memarg}}~{\mathit{laneidx}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{v{\scriptstyle 128}} \rightarrow \mathsf{v{\scriptstyle 128}}` if and only if: +* :math:`(\mathsf{vload\_lane}~\mathsf{v{\scriptstyle 128}}~n~{\mathit{memarg}}~{\mathit{laneidx}})` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\mathsf{v{\scriptstyle 128}}~\rightarrow~\mathsf{v{\scriptstyle 128}})` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. @@ -4767,7 +4767,7 @@ watsup 0.4 generator * :math:`{\mathit{laneidx}}` must be less than :math:`128 / n`. -* :math:`(\mathsf{vstore}~\mathsf{v{\scriptstyle 128}}~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{v{\scriptstyle 128}} \rightarrow \epsilon` if and only if: +* :math:`(\mathsf{vstore}~\mathsf{v{\scriptstyle 128}}~{\mathit{memarg}})` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\mathsf{v{\scriptstyle 128}}~\rightarrow~\epsilon)` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. @@ -4777,7 +4777,7 @@ watsup 0.4 generator * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`{|\mathsf{v{\scriptstyle 128}}|} / 8`. -* :math:`(\mathsf{vstore\_lane}~\mathsf{v{\scriptstyle 128}}~n~{\mathit{memarg}}~{\mathit{laneidx}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{v{\scriptstyle 128}} \rightarrow \epsilon` if and only if: +* :math:`(\mathsf{vstore\_lane}~\mathsf{v{\scriptstyle 128}}~n~{\mathit{memarg}}~{\mathit{laneidx}})` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\mathsf{v{\scriptstyle 128}}~\rightarrow~\epsilon)` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`0`. @@ -4789,7 +4789,7 @@ watsup 0.4 generator * :math:`{\mathit{laneidx}}` must be less than :math:`128 / n`. -* :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is valid with type :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast} \rightarrow {{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` if and only if: +* :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` is valid with type :math:`({{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}~\rightarrow~{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast})` if and only if: * Either: @@ -4808,9 +4808,9 @@ watsup 0.4 generator * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` must be equal to :math:`{t_3^\ast}`. - * :math:`{\mathit{instr}}_1` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + * :math:`{\mathit{instr}}_1` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})`. - * :math:`{\mathit{instr}}_2` is valid with type :math:`{t_2^\ast} \rightarrow {t_3^\ast}`. * Or: + * :math:`{\mathit{instr}}_2` is valid with type :math:`({t_2^\ast}~\rightarrow~{t_3^\ast})`. * Or: * :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`{{\mathit{instr}}^\ast}`. @@ -4818,7 +4818,7 @@ watsup 0.4 generator * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` must be equal to :math:`{{t'}_2^\ast}`. - * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})`. * :math:`{{t'}_1^\ast}` matches :math:`{t_1^\ast}`. @@ -4830,13 +4830,13 @@ watsup 0.4 generator * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` must be equal to :math:`{t^\ast}~{t_2^\ast}`. - * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})`. * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t^\ast}` if and only if: - * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`\epsilon \rightarrow {t^\ast}`. + * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`(\epsilon~\rightarrow~{t^\ast})`. * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is const if and only if: @@ -4858,7 +4858,7 @@ watsup 0.4 generator * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. - * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`((\mathsf{mut}~\epsilon), t)`. + * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`((\mathsf{mut}~\epsilon~{}^?), t)`. * :math:`{{\mathit{instr}}^\ast}` is const if and only if: @@ -4875,12 +4875,12 @@ watsup 0.4 generator * :math:`{\mathit{ft}}` is valid. -* :math:`(\mathsf{func}~x~{(\mathsf{local}~t)^\ast}~{\mathit{expr}})` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}` if and only if: +* :math:`(\mathsf{func}~x~{(\mathsf{local}~t)^\ast}~{\mathit{expr}})` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. - * :math:`C{.}\mathsf{types}{}[x]` must be equal to :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + * :math:`C{.}\mathsf{types}{}[x]` must be equal to :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})`. * Under the context :math:`C{}[{.}\mathsf{locals} \mathrel{{=}{\oplus}} {t_1^\ast}~{t^\ast}]{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]{}[{.}\mathsf{return} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{\mathit{expr}}` is valid with type :math:`{t_2^\ast}`. @@ -4974,7 +4974,7 @@ watsup 0.4 generator * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. - * :math:`C{.}\mathsf{funcs}{}[x]` must be equal to :math:`\epsilon \rightarrow \epsilon`. + * :math:`C{.}\mathsf{funcs}{}[x]` must be equal to :math:`(\epsilon~\rightarrow~\epsilon)`. * :math:`(\mathsf{import}~{\mathit{name}}_1~{\mathit{name}}_2~{\mathit{xt}})` is valid with type :math:`{\mathit{xt}}` if and only if: @@ -5349,8 +5349,8 @@ watsup 0.4 generator #. Return :math:`{|{\mathit{packtype}}|}`. -:math:`{\mathrm{lanetype}}({{\mathsf{i}}{n}}{\mathsf{x}}{N})` -............................................................. +:math:`{\mathrm{lanetype}}(({{\mathsf{i}}{n}}{\mathsf{x}}{N}))` +............................................................... 1. Return :math:`{\mathsf{i}}{n}`. @@ -5413,15 +5413,15 @@ watsup 0.4 generator #. Return :math:`{+0}`. -:math:`{\mathrm{dim}}({{\mathsf{i}}{n}}{\mathsf{x}}{N})` -........................................................ +:math:`{\mathrm{dim}}(({{\mathsf{i}}{n}}{\mathsf{x}}{N}))` +.......................................................... 1. Return :math:`N`. -:math:`{|{{\mathsf{i}}{n}}{\mathsf{x}}{N}|}` -............................................ +:math:`{|({{\mathsf{i}}{n}}{\mathsf{x}}{N})|}` +.............................................. 1. Return :math:`{|{\mathsf{i}}{n}|} \cdot N`. @@ -5455,8 +5455,8 @@ watsup 0.4 generator #. Return :math:`\mathsf{i{\scriptstyle 32}}`. -:math:`{\mathrm{unpack}}({{\mathsf{i}}{n}}{\mathsf{x}}{N})` -........................................................... +:math:`{\mathrm{unpack}}(({{\mathsf{i}}{n}}{\mathsf{x}}{N}))` +............................................................. 1. Return :math:`{\mathrm{unpack}}({\mathsf{i}}{n})`. @@ -6292,17 +6292,17 @@ watsup 0.4 generator 1. Return :math:`{{\mathrm{ibitselect}}}_{{|\mathsf{v{\scriptstyle 128}}|}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_2, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_3)`. -:math:`{{\mathit{vunop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{{{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}{\mathsf{x}}{M}}}{({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)}` -.......................................................................................................................................................................................... +:math:`{{\mathit{vunop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{({{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}{\mathsf{x}}{M})}}{({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)}` +............................................................................................................................................................................................ 1. If :math:`{\mathit{vunop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{abs}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{\mathrm{iabs}}}_{N}({\mathit{lane}}_1)^\ast})`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{{\mathrm{iabs}}}_{N}({\mathit{lane}}_1)^\ast})`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6310,9 +6310,9 @@ watsup 0.4 generator a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{\mathrm{ineg}}}_{N}({\mathit{lane}}_1)^\ast})`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{{\mathrm{ineg}}}_{N}({\mathit{lane}}_1)^\ast})`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6320,9 +6320,9 @@ watsup 0.4 generator a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{\mathrm{ipopcnt}}}_{N}({\mathit{lane}}_1)^\ast})`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{{\mathrm{ipopcnt}}}_{N}({\mathit{lane}}_1)^\ast})`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6330,11 +6330,11 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fabs}}}_{N}({\mathit{lane}}_1)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}^\ast})^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -6342,11 +6342,11 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fneg}}}_{N}({\mathit{lane}}_1)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}^\ast})^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -6354,11 +6354,11 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fsqrt}}}_{N}({\mathit{lane}}_1)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}^\ast})^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -6366,11 +6366,11 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fceil}}}_{N}({\mathit{lane}}_1)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}^\ast})^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -6378,11 +6378,11 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{ffloor}}}_{N}({\mathit{lane}}_1)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}^\ast})^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -6390,11 +6390,11 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{ftrunc}}}_{N}({\mathit{lane}}_1)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}^\ast})^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -6404,28 +6404,28 @@ watsup 0.4 generator #. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. -#. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. +#. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fnearest}}}_{N}({\mathit{lane}}_1)^\ast}`. -#. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. +#. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}^\ast})^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. -:math:`{{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{{{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}{\mathsf{x}}{M}}}{({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)}` -........................................................................................................................................................................................................................................ +:math:`{{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{({{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}{\mathsf{x}}{M})}}{({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)}` +.......................................................................................................................................................................................................................................... 1. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{add}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{\mathrm{iadd}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{{\mathrm{iadd}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6433,11 +6433,11 @@ watsup 0.4 generator a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{\mathrm{isub}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{{\mathrm{isub}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6449,11 +6449,11 @@ watsup 0.4 generator 1) Let :math:`({\mathsf{min}}{\mathsf{\_}}{{\mathit{sx}}})` be :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}`. - #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. - #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{\mathrm{imin}}}_{N}({\mathit{sx}}, {\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})`. + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{{\mathrm{imin}}}_{N}({\mathit{sx}}, {\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})`. #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6461,11 +6461,11 @@ watsup 0.4 generator 1) Let :math:`({\mathsf{max}}{\mathsf{\_}}{{\mathit{sx}}})` be :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}`. - #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. - #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{\mathrm{imax}}}_{N}({\mathit{sx}}, {\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})`. + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{{\mathrm{imax}}}_{N}({\mathit{sx}}, {\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})`. #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6473,11 +6473,11 @@ watsup 0.4 generator 1) Let :math:`({\mathsf{add\_sat}}{\mathsf{\_}}{{\mathit{sx}}})` be :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}`. - #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. - #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{{{\mathrm{iadd\_sat}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})`. + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{{{{\mathrm{iadd\_sat}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})`. #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6485,11 +6485,11 @@ watsup 0.4 generator 1) Let :math:`({\mathsf{sub\_sat}}{\mathsf{\_}}{{\mathit{sx}}})` be :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}`. - #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. - #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{{{\mathrm{isub\_sat}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})`. + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{{{{\mathrm{isub\_sat}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})`. #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6497,35 +6497,35 @@ watsup 0.4 generator a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{\mathrm{imul}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{{\mathrm{imul}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. -#. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{avgr}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: +#. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{{{\mathrm{iavgr}}}_{N}^{\mathsf{u}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{{{{\mathrm{iavgr}}}_{N}^{\mathsf{u}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. -#. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{q{\scriptstyle 15}mulr\_sat}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: +#. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{{{{\mathrm{iq{\kern-0.1em\scriptstyle 15\kern-0.1em}mulr\_sat}}}_{N}^{\mathsf{s}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{{{{\mathrm{iq{\kern-0.1em\scriptstyle 15\kern-0.1em}mulr\_sat}}}_{N}^{\mathsf{s}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6533,13 +6533,13 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fadd}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}^\ast})^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -6547,13 +6547,13 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fsub}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}^\ast})^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -6561,13 +6561,13 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fmul}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}^\ast})^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -6575,13 +6575,13 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fdiv}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}^\ast})^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -6589,13 +6589,13 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fmin}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}^\ast})^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -6603,13 +6603,13 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fmax}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}^\ast})^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -6617,13 +6617,13 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fpmin}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}^\ast})^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -6633,32 +6633,32 @@ watsup 0.4 generator #. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. -#. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. +#. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. -#. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. +#. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fpmax}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. -#. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}^\ast})^\ast}`. +#. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{\mathrm{invlanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}^\ast})^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. -:math:`{{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{{{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}{\mathsf{x}}{M}}}{({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)}` -........................................................................................................................................................................................................................................ +:math:`{{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{({{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}{\mathsf{x}}{M})}}{({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)}` +.......................................................................................................................................................................................................................................... 1. If :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{eq}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{ieq}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}_3^\ast})`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6666,13 +6666,13 @@ watsup 0.4 generator a. Let :math:`{\mathsf{i}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{ine}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}_3^\ast})`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6684,13 +6684,13 @@ watsup 0.4 generator 1) Let :math:`(\mathsf{lt}~{\mathit{sx}})` be :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}`. - #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #) Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{{{\mathrm{ilt}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)})}^\ast}`. - #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}_3^\ast})`. #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6698,13 +6698,13 @@ watsup 0.4 generator 1) Let :math:`(\mathsf{gt}~{\mathit{sx}})` be :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}`. - #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #) Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{{{\mathrm{igt}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)})}^\ast}`. - #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}_3^\ast})`. #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6712,13 +6712,13 @@ watsup 0.4 generator 1) Let :math:`(\mathsf{le}~{\mathit{sx}})` be :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}`. - #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #) Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{{{\mathrm{ile}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)})}^\ast}`. - #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}_3^\ast})`. #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6726,13 +6726,13 @@ watsup 0.4 generator 1) Let :math:`(\mathsf{ge}~{\mathit{sx}})` be :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}`. - #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #) Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{{{\mathrm{ige}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)})}^\ast}`. - #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}_3^\ast})`. #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6740,15 +6740,15 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{\mathsf{i}}{n}` be the result for which :math:`{|{\mathsf{i}}{n}|}` :math:`=` :math:`{|{\mathsf{f}}{n}|}`. #. Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{feq}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}_3^\ast})`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6756,15 +6756,15 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{\mathsf{i}}{n}` be the result for which :math:`{|{\mathsf{i}}{n}|}` :math:`=` :math:`{|{\mathsf{f}}{n}|}`. #. Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{fne}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}_3^\ast})`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6772,15 +6772,15 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{\mathsf{i}}{n}` be the result for which :math:`{|{\mathsf{i}}{n}|}` :math:`=` :math:`{|{\mathsf{f}}{n}|}`. #. Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{flt}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}_3^\ast})`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6788,15 +6788,15 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{\mathsf{i}}{n}` be the result for which :math:`{|{\mathsf{i}}{n}|}` :math:`=` :math:`{|{\mathsf{f}}{n}|}`. #. Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{fgt}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}_3^\ast})`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6804,15 +6804,15 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{\mathsf{i}}{n}` be the result for which :math:`{|{\mathsf{i}}{n}|}` :math:`=` :math:`{|{\mathsf{f}}{n}|}`. #. Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{fle}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}_3^\ast})`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -6822,21 +6822,21 @@ watsup 0.4 generator #. Let :math:`{\mathsf{f}}{n}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. -#. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. +#. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. -#. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{n}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. +#. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{n}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{\mathsf{i}}{n}` be the result for which :math:`{|{\mathsf{i}}{n}|}` :math:`=` :math:`{|{\mathsf{f}}{n}|}`. #. Let :math:`{{\mathit{lane}}_3^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{fge}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. -#. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}({{\mathit{lane}}_3^\ast})`. +#. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}({{\mathit{lane}}_3^\ast})`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. -:math:`{{\mathrm{vcvtop}}}_{{{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}}{\mathsf{x}}{M_1}, {{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}{\mathsf{x}}{M_2}}({\mathit{vcvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}, {\mathit{lane\_u{\kern-0.1em\scriptstyle 4}}})` -...................................................................................................................................................................................................................................................................................................... +:math:`{{\mathrm{vcvtop}}}_{({{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}}{\mathsf{x}}{M_1}), ({{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}{\mathsf{x}}{M_2})}({\mathit{vcvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}, {\mathit{lane\_u{\kern-0.1em\scriptstyle 4}}})` +.......................................................................................................................................................................................................................................................................................................... 1. If the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}` is Jnn, then: @@ -6924,50 +6924,50 @@ watsup 0.4 generator #. Return :math:`{{\mathit{fN}}_2^\ast}`. -:math:`{{\mathrm{vextunop}}}_{{{{\mathsf{i}}{n}}_1}{\mathsf{x}}{M_1}, {{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2}}((\mathsf{extadd\_pairwise}~{\mathit{sx}}), c_1)` -.............................................................................................................................................................. +:math:`{{\mathrm{vextunop}}}_{({{{\mathsf{i}}{n}}_1}{\mathsf{x}}{M_1}), ({{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2})}((\mathsf{extadd\_pairwise}~{\mathit{sx}}), c_1)` +.................................................................................................................................................................. -1. Let :math:`{{\mathit{ci}}^\ast}` be :math:`{{\mathrm{lanes}}}_{{{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2}}(c_1)`. +1. Let :math:`{{\mathit{ci}}^\ast}` be :math:`{{\mathrm{lanes}}}_{({{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2})}(c_1)`. #. Let :math:`{{\mathit{cj}}_1~{\mathit{cj}}_2^\ast}` be the result for which :math:`{\mathrm{concat}}({{\mathit{cj}}_1~{\mathit{cj}}_2^\ast})` :math:`=` :math:`{{{{{\mathrm{extend}}}_{N_2, N_1}^{{\mathit{sx}}}}}{({\mathit{ci}})}^\ast}`. -#. Let :math:`c` be :math:`{{\mathrm{invlanes}}}_{{{{\mathsf{i}}{n}}_1}{\mathsf{x}}{M_1}}({{{\mathrm{iadd}}}_{N_1}({\mathit{cj}}_1, {\mathit{cj}}_2)^\ast})`. +#. Let :math:`c` be :math:`{{\mathrm{invlanes}}}_{({{{\mathsf{i}}{n}}_1}{\mathsf{x}}{M_1})}({{{\mathrm{iadd}}}_{N_1}({\mathit{cj}}_1, {\mathit{cj}}_2)^\ast})`. #. Return :math:`c`. -:math:`{{\mathrm{vextbinop}}}_{{{{\mathsf{i}}{n}}_1}{\mathsf{x}}{M_1}, {{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2}}({\mathit{vextbinop\_u{\kern-0.1em\scriptstyle 0}}}, c_1, c_2)` -............................................................................................................................................................................. +:math:`{{\mathrm{vextbinop}}}_{({{{\mathsf{i}}{n}}_1}{\mathsf{x}}{M_1}), ({{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2})}({\mathit{vextbinop\_u{\kern-0.1em\scriptstyle 0}}}, c_1, c_2)` +................................................................................................................................................................................. 1. If :math:`{\mathit{vextbinop\_u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{extmul}`, then: a. Let :math:`({\mathsf{extmul}}{\mathsf{\_}}{{\mathit{sx}}})` be :math:`{\mathit{vextbinop\_u{\kern-0.1em\scriptstyle 0}}}`. - #. Let :math:`{{\mathit{ci}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2}}(c_1){}[{\mathrm{half}}({\mathit{hf}}, 0, M_1) : M_1]`. + #. Let :math:`{{\mathit{ci}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2})}(c_1){}[{\mathrm{half}}({\mathit{hf}}, 0, M_1) : M_1]`. - #. Let :math:`{{\mathit{ci}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2}}(c_2){}[{\mathrm{half}}({\mathit{hf}}, 0, M_1) : M_1]`. + #. Let :math:`{{\mathit{ci}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2})}(c_2){}[{\mathrm{half}}({\mathit{hf}}, 0, M_1) : M_1]`. - #. Let :math:`c` be :math:`{{\mathrm{invlanes}}}_{{{{\mathsf{i}}{n}}_1}{\mathsf{x}}{M_1}}({{{\mathrm{imul}}}_{N_1}({{{{\mathrm{extend}}}_{N_2, N_1}^{{\mathit{sx}}}}}{({\mathit{ci}}_1)}, {{{{\mathrm{extend}}}_{N_2, N_1}^{{\mathit{sx}}}}}{({\mathit{ci}}_2)})^\ast})`. + #. Let :math:`c` be :math:`{{\mathrm{invlanes}}}_{({{{\mathsf{i}}{n}}_1}{\mathsf{x}}{M_1})}({{{\mathrm{imul}}}_{N_1}({{{{\mathrm{extend}}}_{N_2, N_1}^{{\mathit{sx}}}}}{({\mathit{ci}}_1)}, {{{{\mathrm{extend}}}_{N_2, N_1}^{{\mathit{sx}}}}}{({\mathit{ci}}_2)})^\ast})`. #. Return :math:`c`. -#. Assert: Due to validation, :math:`{\mathit{vextbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{dot}`. +#. Assert: Due to validation, :math:`{\mathit{vextbinop\_u{\kern-0.1em\scriptstyle 0}}}` is . -#. Let :math:`{{\mathit{ci}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2}}(c_1)`. +#. Let :math:`{{\mathit{ci}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2})}(c_1)`. -#. Let :math:`{{\mathit{ci}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2}}(c_2)`. +#. Let :math:`{{\mathit{ci}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{{\mathsf{i}}{n}}_2}{\mathsf{x}}{M_2})}(c_2)`. #. Let :math:`{{\mathit{cj}}_1~{\mathit{cj}}_2^\ast}` be the result for which :math:`{\mathrm{concat}}({{\mathit{cj}}_1~{\mathit{cj}}_2^\ast})` :math:`=` :math:`{{{\mathrm{imul}}}_{N_1}({{{{\mathrm{extend}}}_{N_2, N_1}^{\mathsf{s}}}}{({\mathit{ci}}_1)}, {{{{\mathrm{extend}}}_{N_2, N_1}^{\mathsf{s}}}}{({\mathit{ci}}_2)})^\ast}`. -#. Let :math:`c` be :math:`{{\mathrm{invlanes}}}_{{{{\mathsf{i}}{n}}_1}{\mathsf{x}}{M_1}}({{{\mathrm{iadd}}}_{N_1}({\mathit{cj}}_1, {\mathit{cj}}_2)^\ast})`. +#. Let :math:`c` be :math:`{{\mathrm{invlanes}}}_{({{{\mathsf{i}}{n}}_1}{\mathsf{x}}{M_1})}({{{\mathrm{iadd}}}_{N_1}({\mathit{cj}}_1, {\mathit{cj}}_2)^\ast})`. #. Return :math:`c`. -:math:`{{{\mathit{vshiftop\_u{\kern-0.1em\scriptstyle 0}}}}{\mathsf{\_}}~{{\mathsf{i}}{n}}{\mathsf{x}}{M}}{({\mathit{lane}}, n)}` -................................................................................................................................. +:math:`{{{\mathit{vshiftop\_u{\kern-0.1em\scriptstyle 0}}}}{\mathsf{\_}}~({{\mathsf{i}}{n}}{\mathsf{x}}{M})}{({\mathit{lane}}, n)}` +................................................................................................................................... 1. If :math:`{\mathit{vshiftop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{shl}`, then: @@ -7337,13 +7337,13 @@ watsup 0.4 generator ............................................... -1. Let :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~(\mathsf{page}~(i, j)),\; \mathsf{bytes}~{b^\ast} \}\end{array}` be :math:`{\mathit{mi}}`. +1. Let :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~((i, j)~\mathsf{page}),\; \mathsf{bytes}~{b^\ast} \}\end{array}` be :math:`{\mathit{mi}}`. #. Let :math:`{i'}` be :math:`{|{b^\ast}|} / 64 \, {\mathrm{Ki}} + n`. #. If :math:`{i'}` is less than or equal to :math:`j`, then: - a. Let :math:`{\mathit{mi}'}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~(\mathsf{page}~({i'}, j)),\; \mathsf{bytes}~{b^\ast}~{0^{n \cdot 64 \, {\mathrm{Ki}}}} \}\end{array}`. + a. Let :math:`{\mathit{mi}'}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~(({i'}, j)~\mathsf{page}),\; \mathsf{bytes}~{b^\ast}~{0^{n \cdot 64 \, {\mathrm{Ki}}}} \}\end{array}`. #. Return :math:`{\mathit{mi}'}`. @@ -7354,7 +7354,7 @@ watsup 0.4 generator 1. If :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is :math:`\epsilon`, then: - a. Return :math:`\epsilon \rightarrow \epsilon`. + a. Return :math:`(\epsilon~\rightarrow~\epsilon)`. #. If :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is of the case , then: @@ -7364,7 +7364,7 @@ watsup 0.4 generator 1) Let :math:`t` be :math:`{\mathit{valtype}}_0`. - #) Return :math:`\epsilon \rightarrow t`. + #) Return :math:`(\epsilon~\rightarrow~t)`. #. Assert: Due to validation, :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is of the case . @@ -7559,11 +7559,11 @@ watsup 0.4 generator #. Return :math:`{\mathit{ta}}~{{\mathit{ta}'}^\ast}`. -:math:`{\mathrm{allocmem}}((\mathsf{page}~(i, j)))` +:math:`{\mathrm{allocmem}}(((i, j)~\mathsf{page}))` ................................................... -1. Let :math:`{\mathit{mi}}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~(\mathsf{page}~(i, j)),\; \mathsf{bytes}~{0^{i \cdot 64 \, {\mathrm{Ki}}}} \}\end{array}`. +1. Let :math:`{\mathit{mi}}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~((i, j)~\mathsf{page}),\; \mathsf{bytes}~{0^{i \cdot 64 \, {\mathrm{Ki}}}} \}\end{array}`. #. Let :math:`a` be :math:`{|s{.}\mathsf{mems}|}`. @@ -7888,7 +7888,7 @@ watsup 0.4 generator #. Push the activation of :math:`f` to the stack. -#. Let :math:`{t_1^{n}} \rightarrow {t_2^\ast}` be :math:`z{.}\mathsf{funcs}{}[{\mathit{fa}}]{.}\mathsf{type}`. +#. Let :math:`({t_1^{n}}~\rightarrow~{t_2^\ast})` be :math:`z{.}\mathsf{funcs}{}[{\mathit{fa}}]{.}\mathsf{type}`. #. Pop the activation of :math:`f` from the stack. @@ -8321,15 +8321,15 @@ watsup 0.4 generator #. Push the value :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c)` to the stack. -:math:`{{\mathsf{i}}{n}}{\mathsf{x}}{N} {.} \mathsf{all\_true}` -............................................................... +:math:`({{\mathsf{i}}{n}}{\mathsf{x}}{N}) {.} \mathsf{all\_true}` +................................................................. 1. Assert: Due to validation, a value of value type :math:`\mathsf{v{\scriptstyle 128}}` is on the top of the stack. #. Pop the value :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c)` from the stack. -#. Let :math:`{{\mathit{ci}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{N}}(c)`. +#. Let :math:`{{\mathit{ci}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{N})}(c)`. #. If for all :math:`{({\mathit{ci}}_1)^\ast}`, :math:`{\mathit{ci}}_1` is not :math:`0`, then: @@ -8357,8 +8357,8 @@ watsup 0.4 generator #. Push the value :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c)` to the stack. -:math:`{{\mathsf{i}}{n}}{\mathsf{x}}{N} {.} {\mathit{vshiftop}}` -................................................................ +:math:`({{\mathsf{i}}{n}}{\mathsf{x}}{N}) {.} {\mathit{vshiftop}}` +.................................................................. 1. Assert: Due to validation, a value of value type :math:`\mathsf{i{\scriptstyle 32}}` is on the top of the stack. @@ -8369,30 +8369,30 @@ watsup 0.4 generator #. Pop the value :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c_1)` from the stack. -#. Let :math:`{{c'}^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{N}}(c_1)`. +#. Let :math:`{{c'}^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{N})}(c_1)`. -#. Let :math:`c` be :math:`{{\mathrm{invlanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{N}}({{{{\mathit{vshiftop}}}{\mathsf{\_}}~{{\mathsf{i}}{n}}{\mathsf{x}}{N}}{({c'}, n)}^\ast})`. +#. Let :math:`c` be :math:`{{\mathrm{invlanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{N})}({{{{\mathit{vshiftop}}}{\mathsf{\_}}~({{\mathsf{i}}{n}}{\mathsf{x}}{N})}{({c'}, n)}^\ast})`. #. Push the value :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c)` to the stack. -:math:`{{\mathsf{i}}{n}}{\mathsf{x}}{N}{.}\mathsf{bitmask}` -........................................................... +:math:`({{\mathsf{i}}{n}}{\mathsf{x}}{N}){.}\mathsf{bitmask}` +............................................................. 1. Assert: Due to validation, a value of value type :math:`\mathsf{v{\scriptstyle 128}}` is on the top of the stack. #. Pop the value :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c)` from the stack. -#. Let :math:`{{\mathit{ci}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{N}}(c)`. +#. Let :math:`{{\mathit{ci}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{N})}(c)`. #. Let :math:`{\mathit{ci}}` be the result for which :math:`{{\mathrm{bits}}}_{{\mathsf{i}}{32}}({\mathit{ci}})` :math:`=` :math:`{{{{{\mathrm{ilt}}}_{{|{\mathsf{i}}{n}|}}^{\mathsf{s}}}}{({\mathit{ci}}_1, 0)}^\ast}`. #. Push the value :math:`(\mathsf{i{\scriptstyle 32}}{.}\mathsf{const}~{\mathit{ci}})` to the stack. -:math:`{{\mathsf{i}}{n}}{\mathsf{x}}{M}{.}\mathsf{swizzle}` -........................................................... +:math:`({{\mathsf{i}}{n}}{\mathsf{x}}{M}){.}\mathsf{swizzle}` +............................................................. 1. Assert: Due to validation, a value of value type :math:`\mathsf{v{\scriptstyle 128}}` is on the top of the stack. @@ -8403,21 +8403,21 @@ watsup 0.4 generator #. Pop the value :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c_1)` from the stack. -#. Let :math:`{{c'}^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}(c_1)~{0^{256 - M}}`. +#. Let :math:`{{c'}^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}(c_1)~{0^{256 - M}}`. -#. Let :math:`{{\mathit{ci}}^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{n}}{\mathsf{x}}{M}}(c_2)`. +#. Let :math:`{{\mathit{ci}}^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{n}}{\mathsf{x}}{M})}(c_2)`. #. Assert: Due to validation, for all :math:`{(k)^{k t_2*) is valid. Globaltype_ok -- the global type ((MUT ()?), t) is valid. +- the global type ((MUT ()? ?), t) is valid. Tabletype_ok - the table type (limits, reftype) is valid if and only if: - the limits limits is valid with the nat ((2 ^ 32) - 1). Memtype_ok -- the memory type (PAGE limits) is valid if and only if: +- the memory type (limits PAGE) is valid if and only if: - the limits limits is valid with the nat (2 ^ 16). Externtype_ok @@ -9603,7 +9603,7 @@ Tabletype_sub - the limits lim_1 matches the limits lim_2. Memtype_sub -- the memory type (PAGE lim_1) matches the memory type (PAGE lim_2) if and only if: +- the memory type (lim_1 PAGE) matches the memory type (lim_2 PAGE) if and only if: - the limits lim_1 matches the limits lim_2. Externtype_sub @@ -9648,7 +9648,7 @@ Instr_ok/drop - the instr DROP is valid with the function type ([t] -> []). Instr_ok/select -- the instr (SELECT ?([t])) is valid with the function type ([t, t, I32] -> [t]). +- the instr (SELECT() ?([t]) ?) is valid with the function type ([t, t, I32] -> [t]). Instr_ok/block - the instr (BLOCK bt instr*) is valid with the function type (t_1* -> t_2*) if and only if: @@ -9661,7 +9661,7 @@ Instr_ok/loop - Under the context C with .LABELS prepended by [t_1*], the instr sequence instr* is valid with the function type (t_1* -> t_2*). Instr_ok/if -- the instr (IF bt instr_1* instr_2*) is valid with the function type (t_1* ++ [I32] -> t_2*) if and only if: +- the instr (IF bt instr_1* ELSE instr_2*) is valid with the function type (t_1* ++ [I32] -> t_2*) if and only if: - the block type bt is valid with the function type (t_1* -> t_2*). - Under the context C with .LABELS prepended by [t_2*], the instr sequence instr_1* is valid with the function type (t_1* -> t_2*). - Under the context C with .LABELS prepended by [t_2*], the instr sequence instr_2* is valid with the function type (t_1* -> t_2*). @@ -9818,7 +9818,7 @@ Instr_ok/global.get Instr_ok/global.set - the instr (GLOBAL.SET x) is valid with the function type ([t] -> []) if and only if: - |C.GLOBALS| is greater than x. - - C.GLOBALS[x] is ((MUT ?(())), t). + - C.GLOBALS[x] is ((MUT ?(()) ?), t). Instr_ok/table.get - the instr (TABLE.GET x) is valid with the function type ([I32] -> [rt]) if and only if: @@ -9897,7 +9897,7 @@ Instr_ok/data.drop - C.DATAS[x] is OK. Instr_ok/load -- the instr (LOAD nt (n, sx)? memarg) is valid with the function type ([I32] -> [nt]) if and only if: +- the instr (LOAD nt (_) (n, sx)? ? memarg) is valid with the function type ([I32] -> [nt]) if and only if: - |C.MEMS| is greater than 0. - ((sx? is ?())) if and only if ((n? is ?())). - C.MEMS[0] is mt. @@ -9920,7 +9920,7 @@ Instr_ok/store - nt is Inn. Instr_ok/vload -- the instr (VLOAD V128 ?((SHAPE M N sx)) memarg) is valid with the function type ([I32] -> [V128]) if and only if: +- the instr (VLOAD V128 ?((SHAPE M X N sx)) memarg) is valid with the function type ([I32] -> [V128]) if and only if: - |C.MEMS| is greater than 0. - C.MEMS[0] is mt. - (2 ^ memarg.ALIGN) is less than or equal to ((M / 8) · N). @@ -9987,7 +9987,7 @@ Instr_const - Or: - instr_u0 is (GLOBAL.GET x). - |C.GLOBALS| is greater than x. - - C.GLOBALS[x] is ((MUT ?()), t). + - C.GLOBALS[x] is ((MUT ?() ?), t). Expr_const - the expression instr* is constant if and only if: @@ -10798,13 +10798,13 @@ vbinop_ (lanetype_u1 X M) vbinop__u0 v128_1 v128_2 c. Let lane_2* be $lanes_((Jnn X M), v128_2). d. Let v128 be $invlanes_((Jnn X M), $imul_($lsizenn(Jnn), lane_1, lane_2)*). e. Return [v128]. -5. If ((vbinop__u0 is AVGR) and the type of lanetype_u1 is Jnn), then: +5. If ((vbinop__u0 is (AVGRU)) and the type of lanetype_u1 is Jnn), then: a. Let Jnn be lanetype_u1. b. Let lane_1* be $lanes_((Jnn X M), v128_1). c. Let lane_2* be $lanes_((Jnn X M), v128_2). d. Let v128 be $invlanes_((Jnn X M), $iavgr_($lsizenn(Jnn), U, lane_1, lane_2)*). e. Return [v128]. -6. If ((vbinop__u0 is Q15MULR_SAT) and the type of lanetype_u1 is Jnn), then: +6. If ((vbinop__u0 is (Q15MULR_SATS)) and the type of lanetype_u1 is Jnn), then: a. Let Jnn be lanetype_u1. b. Let lane_1* be $lanes_((Jnn X M), v128_1). c. Let lane_2* be $lanes_((Jnn X M), v128_2). @@ -11020,7 +11020,7 @@ vextbinop__ (Inn_1 X M_1) (Inn_2 X M_2) vextbinop__u0 c_1 c_2 c. Let ci_2* be $lanes_((Inn_2 X M_2), c_2)[$half(hf, 0, M_1) : M_1]. d. Let c be $invlanes_((Inn_1 X M_1), $imul_($lsizenn1(Inn_1), $extend__($lsizenn2(Inn_2), $lsizenn1(Inn_1), sx, ci_1), $extend__($lsizenn2(Inn_2), $lsizenn1(Inn_1), sx, ci_2))*). e. Return c. -2. Assert: Due to validation, (vextbinop__u0 is DOT). +2. Assert: Due to validation, (vextbinop__u0 is (DOTS)). 3. Let ci_1* be $lanes_((Inn_2 X M_2), c_1). 4. Let ci_2* be $lanes_((Inn_2 X M_2), c_2). 5. Let [cj_1, cj_2]* be $concat__1^-1(iN($lsizenn1((Inn_1 : Inn <: lanetype))), $imul_($lsizenn1(Inn_1), $extend__($lsizenn2(Inn_2), $lsizenn1(Inn_1), S, ci_1), $extend__($lsizenn2(Inn_2), $lsizenn1(Inn_1), S, ci_2))*). @@ -11195,10 +11195,10 @@ growtable ti n r b. Return ti'. growmemory mi n -1. Let { TYPE: (PAGE (i, j)); BYTES: b*; } be mi. +1. Let { TYPE: ((i, j) PAGE); BYTES: b*; } be mi. 2. Let i' be ((|b*| / (64 · $Ki())) + n). 3. If (i' ≤ j), then: - a. Let mi' be { TYPE: (PAGE (i', j)); BYTES: b* ++ 0^(n · (64 · $Ki())); }. + a. Let mi' be { TYPE: ((i', j) PAGE); BYTES: b* ++ 0^(n · (64 · $Ki())); }. b. Return mi'. blocktype z blocktype_u1 @@ -11301,8 +11301,8 @@ alloctables tabletype_u0* 4. Let ta'* be $alloctables(tabletype'*). 5. Return [ta] ++ ta'*. -allocmem (PAGE (i, j)) -1. Let mi be { TYPE: (PAGE (i, j)); BYTES: 0^(i · (64 · $Ki())); }. +allocmem ((i, j) PAGE) +1. Let mi be { TYPE: ((i, j) PAGE); BYTES: 0^(i · (64 · $Ki())); }. 2. Let a be |s.MEMS|. 3. Append mi to the s.MEMS. 4. Return a. @@ -12013,7 +12013,7 @@ Step_read/vload V128 vloadop_u0? ao 5. Else: a. Let ?(vloadop_0) be vloadop_u0?. b. If vloadop_0 is of the case SHAPE, then: - 1) Let (SHAPE M N sx) be vloadop_0. + 1) Let (SHAPE M X N sx) be vloadop_0. 2) If (((i + ao.OFFSET) + ((M · N) / 8)) > |$mem(z, 0).BYTES|), then: a) Trap. 3) If the type of $lsize^-1((M · 2)) is Jnn, then: @@ -12098,14 +12098,14 @@ Step_read/memory.copy a. If (j ≤ i), then: 1) Push the value (I32.CONST j) to the stack. 2) Push the value (I32.CONST i) to the stack. - 3) Execute the instruction (LOAD I32 ?((8, U)) $memarg0()). + 3) Execute the instruction (LOAD I32 (_) ?((8, U)) ? $memarg0()). 4) Execute the instruction (STORE I32 ?(8) $memarg0()). 5) Push the value (I32.CONST (j + 1)) to the stack. 6) Push the value (I32.CONST (i + 1)) to the stack. b. Else: 1) Push the value (I32.CONST ((j + n) - 1)) to the stack. 2) Push the value (I32.CONST ((i + n) - 1)) to the stack. - 3) Execute the instruction (LOAD I32 ?((8, U)) $memarg0()). + 3) Execute the instruction (LOAD I32 (_) ?((8, U)) ? $memarg0()). 4) Execute the instruction (STORE I32 ?(8) $memarg0()). 5) Push the value (I32.CONST j) to the stack. 6) Push the value (I32.CONST i) to the stack. @@ -12289,7 +12289,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{recs}{}[i]` must be equal to :math:`{\mathit{st}}`. -* :math:`(\mathsf{ref}~(\mathsf{null}~{()^?})~{\mathit{heaptype}})` is valid if and only if: +* :math:`(\mathsf{ref}~(\mathsf{null}~{()^?}~{}^?)~{\mathit{heaptype}})` is valid if and only if: * :math:`{\mathit{heaptype}}` is valid. @@ -12325,7 +12325,7 @@ watsup 0.4 generator * :math:`t` is valid. -* :math:`{t_1^\ast} \rightarrow_{{x^\ast}} {t_2^\ast}` is valid if and only if: +* :math:`({t_1^\ast}~{\rightarrow}_{{x^\ast}}\,{t_2^\ast})` is valid if and only if: * :math:`{|{x^\ast}|}` must be equal to :math:`{|{{{\mathit{lt}}}^\ast}|}`. @@ -12362,13 +12362,13 @@ watsup 0.4 generator * :math:`{\mathit{packtype}}` is valid. -* :math:`((\mathsf{mut}~{()^?}), {\mathit{storagetype}})` is valid if and only if: +* :math:`((\mathsf{mut}~{()^?}~{}^?), {\mathit{storagetype}})` is valid if and only if: * :math:`{\mathit{storagetype}}` is valid. -* :math:`{t_1^\ast} \rightarrow {t_2^\ast}` is valid if and only if: +* :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})` is valid if and only if: * :math:`{t_1^\ast}` is valid. @@ -12530,7 +12530,7 @@ watsup 0.4 generator * :math:`{\mathit{heaptype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` must be equal to :math:`{\mathit{heaptype}}`. -* :math:`(\mathsf{ref}~(\mathsf{null}~{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?})~{\mathit{ht}}_1)` matches :math:`(\mathsf{ref}~(\mathsf{null}~{{\mathit{u{\kern-0.1em\scriptstyle 1}}}^?})~{\mathit{ht}}_2)` if and only if: +* :math:`(\mathsf{ref}~(\mathsf{null}~{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}~{}^?)~{\mathit{ht}}_1)` matches :math:`(\mathsf{ref}~(\mathsf{null}~{{\mathit{u{\kern-0.1em\scriptstyle 1}}}^?}~{}^?)~{\mathit{ht}}_2)` if and only if: * Either: @@ -12603,7 +12603,7 @@ watsup 0.4 generator * :math:`{\mathit{packtype}}_1` matches :math:`{\mathit{packtype}}_2`. -* :math:`((\mathsf{mut}~{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}), {\mathit{zt}}_1)` matches :math:`((\mathsf{mut}~{{\mathit{u{\kern-0.1em\scriptstyle 1}}}^?}), {\mathit{zt}}_2)` if and only if: +* :math:`((\mathsf{mut}~{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}~{}^?), {\mathit{zt}}_1)` matches :math:`((\mathsf{mut}~{{\mathit{u{\kern-0.1em\scriptstyle 1}}}^?}~{}^?), {\mathit{zt}}_2)` if and only if: * Either: @@ -12635,7 +12635,7 @@ watsup 0.4 generator * :math:`t_1` matches :math:`t_2`. -* :math:`{t_{11}^\ast} \rightarrow {t_{12}^\ast}` matches :math:`{t_{21}^\ast} \rightarrow {t_{22}^\ast}` if and only if: +* :math:`({t_{11}^\ast}~\rightarrow~{t_{12}^\ast})` matches :math:`({t_{21}^\ast}~\rightarrow~{t_{22}^\ast})` if and only if: * :math:`{t_{21}^\ast}` matches :math:`{t_{11}^\ast}`. @@ -12673,7 +12673,7 @@ watsup 0.4 generator * :math:`{\mathit{ft}}_1` matches :math:`{\mathit{ft}}_2`. -* :math:`(\mathsf{sub}~(\mathsf{final}~{()^?})~{{\mathit{typeidx}}^\ast}~{\mathit{comptype}})` is valid with type :math:`({\mathsf{ok}}{x_0})` if and only if: +* :math:`(\mathsf{sub}~(\mathsf{final}~{()^?}~{}^?)~{{\mathit{typeidx}}^\ast}~{\mathit{comptype}})` is valid with type :math:`({\mathsf{ok}}{x_0})` if and only if: * :math:`{|{x^\ast}|}` must be equal to :math:`{|{{\mathit{comptype}'}^\ast}|}`. @@ -12692,7 +12692,7 @@ watsup 0.4 generator * For all :math:`{\mathit{comptype}'}` in :math:`{{\mathit{comptype}'}^\ast}` and :math:`x` in :math:`{x^\ast}` and :math:`{x'}` in :math:`{{x'}^\ast}`, - * :math:`{\mathrm{unroll}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{sub}~(\mathsf{final}~\epsilon)~{{x'}^\ast}~{\mathit{comptype}'})`. + * :math:`{\mathrm{unroll}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{sub}~(\mathsf{final}~\epsilon~{}^?)~{{x'}^\ast}~{\mathit{comptype}'})`. * :math:`{\mathit{comptype}}` is valid. @@ -12701,7 +12701,7 @@ watsup 0.4 generator * :math:`{\mathit{comptype}}` matches :math:`{\mathit{comptype}'}`. -* :math:`(\mathsf{sub}~(\mathsf{final}~{()^?})~{{\mathit{typeuse}}^\ast}~{\mathit{compttype}})` is valid with type :math:`({\mathsf{ok}}{(x, i)})` if and only if: +* :math:`(\mathsf{sub}~(\mathsf{final}~{()^?}~{}^?)~{{\mathit{typeuse}}^\ast}~{\mathit{compttype}})` is valid with type :math:`({\mathsf{ok}}{(x, i)})` if and only if: * :math:`{|{{\mathit{typeuse}}^\ast}|}` must be equal to :math:`{|{{\mathit{comptype}'}^\ast}|}`. @@ -12716,7 +12716,7 @@ watsup 0.4 generator * For all :math:`{\mathit{comptype}'}` in :math:`{{\mathit{comptype}'}^\ast}` and :math:`{\mathit{typeuse}}` in :math:`{{\mathit{typeuse}}^\ast}` and :math:`{\mathit{typeuse}'}` in :math:`{{\mathit{typeuse}'}^\ast}`, - * :math:`{{\mathrm{unroll}}}_{C}({\mathit{typeuse}})` must be equal to :math:`(\mathsf{sub}~(\mathsf{final}~\epsilon)~{{\mathit{typeuse}'}^\ast}~{\mathit{comptype}'})`. + * :math:`{{\mathrm{unroll}}}_{C}({\mathit{typeuse}})` must be equal to :math:`(\mathsf{sub}~(\mathsf{final}~\epsilon~{}^?)~{{\mathit{typeuse}'}^\ast}~{\mathit{comptype}'})`. * :math:`{\mathit{comptype}}` is valid. @@ -12779,7 +12779,7 @@ watsup 0.4 generator * :math:`m` must be less than or equal to :math:`k`. -* :math:`((\mathsf{mut}~{()^?}), t)` is valid if and only if: +* :math:`((\mathsf{mut}~{()^?}~{}^?), t)` is valid if and only if: * :math:`t` is valid. @@ -12793,7 +12793,7 @@ watsup 0.4 generator * :math:`{\mathit{reftype}}` is valid. -* :math:`(\mathsf{page}~{\mathit{limits}})` is valid if and only if: +* :math:`({\mathit{limits}}~\mathsf{page})` is valid if and only if: * :math:`{\mathit{limits}}` is valid with type :math:`{2^{16}}`. @@ -12825,7 +12825,7 @@ watsup 0.4 generator * :math:`{\mathit{memtype}}` is valid. -* :math:`{t_{11}^\ast} \rightarrow_{{x_1^\ast}} {t_{12}^\ast}` matches :math:`{t_{21}^\ast} \rightarrow_{{x_2^\ast}} {t_{22}^\ast}` if and only if: +* :math:`({t_{11}^\ast}~{\rightarrow}_{{x_1^\ast}}\,{t_{12}^\ast})` matches :math:`({t_{21}^\ast}~{\rightarrow}_{{x_2^\ast}}\,{t_{22}^\ast})` if and only if: * :math:`{|{x^\ast}|}` must be equal to :math:`{|{t^\ast}|}`. @@ -12853,7 +12853,7 @@ watsup 0.4 generator * :math:`m_1` must be less than or equal to :math:`m_2`. -* :math:`((\mathsf{mut}~{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}), {\mathit{valtype}}_1)` matches :math:`((\mathsf{mut}~{{\mathit{u{\kern-0.1em\scriptstyle 1}}}^?}), {\mathit{valtype}}_2)` if and only if: +* :math:`((\mathsf{mut}~{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}~{}^?), {\mathit{valtype}}_1)` matches :math:`((\mathsf{mut}~{{\mathit{u{\kern-0.1em\scriptstyle 1}}}^?}~{}^?), {\mathit{valtype}}_2)` if and only if: * Either: @@ -12885,7 +12885,7 @@ watsup 0.4 generator * :math:`{\mathit{reftype}}_2` matches :math:`{\mathit{reftype}}_1`. -* :math:`(\mathsf{page}~{\mathit{limits}}_1)` matches :math:`(\mathsf{page}~{\mathit{limits}}_2)` if and only if: +* :math:`({\mathit{limits}}_1~\mathsf{page})` matches :math:`({\mathit{limits}}_2~\mathsf{page})` if and only if: * :math:`{\mathit{limits}}_1` matches :math:`{\mathit{limits}}_2`. @@ -12923,7 +12923,7 @@ watsup 0.4 generator * :math:`{\mathit{memtype}}_1` matches :math:`{\mathit{memtype}}_2`. -* :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid with type :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast} \rightarrow_{\epsilon} {{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast}` if and only if: +* :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid with type :math:`({{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}~{\rightarrow}_{\epsilon}\,{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}^\ast})` if and only if: * Either: @@ -12948,67 +12948,67 @@ watsup 0.4 generator * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`{\mathit{typeidx}}`. - * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[{\mathit{typeidx}}])` must be equal to :math:`(\mathsf{func}~{t_1^\ast} \rightarrow {t_2^\ast})`. + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[{\mathit{typeidx}}])` must be equal to :math:`(\mathsf{func}~({t_1^\ast}~\rightarrow~{t_2^\ast}))`. -* :math:`\mathsf{nop}` is valid with type :math:`\epsilon \rightarrow_{\epsilon} \epsilon`. +* :math:`\mathsf{nop}` is valid with type :math:`(\epsilon~{\rightarrow}_{\epsilon}\,\epsilon)`. -* :math:`\mathsf{unreachable}` is valid with type :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}` if and only if: +* :math:`\mathsf{unreachable}` is valid with type :math:`({t_1^\ast}~{\rightarrow}_{\epsilon}\,{t_2^\ast})` if and only if: - * :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}` is valid. + * :math:`({t_1^\ast}~{\rightarrow}_{\epsilon}\,{t_2^\ast})` is valid. -* :math:`\mathsf{drop}` is valid with type :math:`t \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`\mathsf{drop}` is valid with type :math:`(t~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`t` is valid. -* :math:`(\mathsf{select}~t)` is valid with type :math:`t~t~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} t` if and only if: +* :math:`(t~{}^?)` is valid with type :math:`(t~t~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,t)` if and only if: * :math:`t` is valid. -* :math:`(\mathsf{block}~{\mathit{bt}}~{{\mathit{instr}}^\ast})` is valid with type :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}` if and only if: +* :math:`(\mathsf{block}~{\mathit{bt}}~{{\mathit{instr}}^\ast})` is valid with type :math:`({t_1^\ast}~{\rightarrow}_{\epsilon}\,{t_2^\ast})` if and only if: - * :math:`{\mathit{bt}}` is valid with type :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}`. + * :math:`{\mathit{bt}}` is valid with type :math:`({t_1^\ast}~{\rightarrow}_{\epsilon}\,{t_2^\ast})`. - * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow_{{x^\ast}} {t_2^\ast}`. + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`({t_1^\ast}~{\rightarrow}_{{x^\ast}}\,{t_2^\ast})`. -* :math:`(\mathsf{loop}~{\mathit{bt}}~{{\mathit{instr}}^\ast})` is valid with type :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}` if and only if: +* :math:`(\mathsf{loop}~{\mathit{bt}}~{{\mathit{instr}}^\ast})` is valid with type :math:`({t_1^\ast}~{\rightarrow}_{\epsilon}\,{t_2^\ast})` if and only if: - * :math:`{\mathit{bt}}` is valid with type :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}`. + * :math:`{\mathit{bt}}` is valid with type :math:`({t_1^\ast}~{\rightarrow}_{\epsilon}\,{t_2^\ast})`. - * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_1^\ast}]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow_{{x^\ast}} {t_2^\ast}`. + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_1^\ast}]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`({t_1^\ast}~{\rightarrow}_{{x^\ast}}\,{t_2^\ast})`. -* :math:`(\mathsf{if}~{\mathit{bt}}~{{\mathit{instr}}_1^\ast}~{{\mathit{instr}}_2^\ast})` is valid with type :math:`{t_1^\ast}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} {t_2^\ast}` if and only if: +* :math:`(\mathsf{if}~{\mathit{bt}}~{{\mathit{instr}}_1^\ast}~\mathsf{else}~{{\mathit{instr}}_2^\ast})` is valid with type :math:`({t_1^\ast}~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,{t_2^\ast})` if and only if: - * :math:`{\mathit{bt}}` is valid with type :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}`. + * :math:`{\mathit{bt}}` is valid with type :math:`({t_1^\ast}~{\rightarrow}_{\epsilon}\,{t_2^\ast})`. - * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}_1^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow_{{x_1^\ast}} {t_2^\ast}`. + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}_1^\ast}` is valid with type :math:`({t_1^\ast}~{\rightarrow}_{{x_1^\ast}}\,{t_2^\ast})`. - * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}_2^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow_{{x_2^\ast}} {t_2^\ast}`. + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}_2^\ast}` is valid with type :math:`({t_1^\ast}~{\rightarrow}_{{x_2^\ast}}\,{t_2^\ast})`. -* :math:`(\mathsf{br}~l)` is valid with type :math:`{t_1^\ast}~{t^\ast} \rightarrow_{\epsilon} {t_2^\ast}` if and only if: +* :math:`(\mathsf{br}~l)` is valid with type :math:`({t_1^\ast}~{t^\ast}~{\rightarrow}_{\epsilon}\,{t_2^\ast})` if and only if: * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. * :math:`C{.}\mathsf{labels}{}[l]` must be equal to :math:`{t^\ast}`. - * :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}` is valid. + * :math:`({t_1^\ast}~{\rightarrow}_{\epsilon}\,{t_2^\ast})` is valid. -* :math:`(\mathsf{br\_if}~l)` is valid with type :math:`{t^\ast}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} {t^\ast}` if and only if: +* :math:`(\mathsf{br\_if}~l)` is valid with type :math:`({t^\ast}~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,{t^\ast})` if and only if: * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. @@ -13016,7 +13016,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{labels}{}[l]` must be equal to :math:`{t^\ast}`. -* :math:`(\mathsf{br\_table}~{l^\ast}~{l'})` is valid with type :math:`{t_1^\ast}~{t^\ast} \rightarrow_{\epsilon} {t_2^\ast}` if and only if: +* :math:`(\mathsf{br\_table}~{l^\ast}~{l'})` is valid with type :math:`({t_1^\ast}~{t^\ast}~{\rightarrow}_{\epsilon}\,{t_2^\ast})` if and only if: * For all :math:`l` in :math:`{l^\ast}`, @@ -13031,10 +13031,10 @@ watsup 0.4 generator * :math:`{t^\ast}` matches :math:`C{.}\mathsf{labels}{}[{l'}]`. - * :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}` is valid. + * :math:`({t_1^\ast}~{\rightarrow}_{\epsilon}\,{t_2^\ast})` is valid. -* :math:`(\mathsf{br\_on\_null}~l)` is valid with type :math:`{t^\ast}~(\mathsf{ref}~(\mathsf{null}~())~{\mathit{ht}}) \rightarrow_{\epsilon} {t^\ast}~(\mathsf{ref}~(\mathsf{null}~\epsilon)~{\mathit{ht}})` if and only if: +* :math:`(\mathsf{br\_on\_null}~l)` is valid with type :math:`({t^\ast}~(\mathsf{ref}~(\mathsf{null}~()~{}^?)~{\mathit{ht}})~{\rightarrow}_{\epsilon}\,{t^\ast}~(\mathsf{ref}~(\mathsf{null}~\epsilon~{}^?)~{\mathit{ht}}))` if and only if: * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. @@ -13044,15 +13044,15 @@ watsup 0.4 generator * :math:`{\mathit{ht}}` is valid. -* :math:`(\mathsf{br\_on\_non\_null}~l)` is valid with type :math:`{t^\ast}~(\mathsf{ref}~(\mathsf{null}~())~{\mathit{ht}}) \rightarrow_{\epsilon} {t^\ast}` if and only if: +* :math:`(\mathsf{br\_on\_non\_null}~l)` is valid with type :math:`({t^\ast}~(\mathsf{ref}~(\mathsf{null}~()~{}^?)~{\mathit{ht}})~{\rightarrow}_{\epsilon}\,{t^\ast})` if and only if: * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. - * :math:`C{.}\mathsf{labels}{}[l]` must be equal to :math:`{t^\ast}~(\mathsf{ref}~(\mathsf{null}~\epsilon)~{\mathit{ht}})`. + * :math:`C{.}\mathsf{labels}{}[l]` must be equal to :math:`{t^\ast}~(\mathsf{ref}~(\mathsf{null}~\epsilon~{}^?)~{\mathit{ht}})`. -* :math:`(\mathsf{br\_on\_cast}~l~{\mathit{rt}}_1~{\mathit{rt}}_2)` is valid with type :math:`{t^\ast}~{\mathit{rt}}_1 \rightarrow_{\epsilon} {t^\ast}~{\mathit{rt}}_1 \setminus {\mathit{rt}}_2` if and only if: +* :math:`(\mathsf{br\_on\_cast}~l~{\mathit{rt}}_1~{\mathit{rt}}_2)` is valid with type :math:`({t^\ast}~{\mathit{rt}}_1~{\rightarrow}_{\epsilon}\,{t^\ast}~{\mathit{rt}}_1 \setminus {\mathit{rt}}_2)` if and only if: * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. @@ -13068,7 +13068,7 @@ watsup 0.4 generator * :math:`{\mathit{rt}}_2` matches :math:`{\mathit{rt}}`. -* :math:`(\mathsf{br\_on\_cast\_fail}~l~{\mathit{rt}}_1~{\mathit{rt}}_2)` is valid with type :math:`{t^\ast}~{\mathit{rt}}_1 \rightarrow_{\epsilon} {t^\ast}~{\mathit{rt}}_2` if and only if: +* :math:`(\mathsf{br\_on\_cast\_fail}~l~{\mathit{rt}}_1~{\mathit{rt}}_2)` is valid with type :math:`({t^\ast}~{\mathit{rt}}_1~{\rightarrow}_{\epsilon}\,{t^\ast}~{\mathit{rt}}_2)` if and only if: * :math:`{|C{.}\mathsf{labels}|}` must be greater than :math:`l`. @@ -13084,23 +13084,23 @@ watsup 0.4 generator * :math:`{\mathit{rt}}_1 \setminus {\mathit{rt}}_2` matches :math:`{\mathit{rt}}`. -* :math:`(\mathsf{call}~x)` is valid with type :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}` if and only if: +* :math:`(\mathsf{call}~x)` is valid with type :math:`({t_1^\ast}~{\rightarrow}_{\epsilon}\,{t_2^\ast})` if and only if: * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. - * :math:`{\mathrm{expand}}(C{.}\mathsf{funcs}{}[x])` must be equal to :math:`(\mathsf{func}~{t_1^\ast} \rightarrow {t_2^\ast})`. + * :math:`{\mathrm{expand}}(C{.}\mathsf{funcs}{}[x])` must be equal to :math:`(\mathsf{func}~({t_1^\ast}~\rightarrow~{t_2^\ast}))`. -* :math:`(\mathsf{call\_ref}~x)` is valid with type :math:`{t_1^\ast}~(\mathsf{ref}~(\mathsf{null}~())~x) \rightarrow_{\epsilon} {t_2^\ast}` if and only if: +* :math:`(\mathsf{call\_ref}~x)` is valid with type :math:`({t_1^\ast}~(\mathsf{ref}~(\mathsf{null}~()~{}^?)~x)~{\rightarrow}_{\epsilon}\,{t_2^\ast})` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. - * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{func}~{t_1^\ast} \rightarrow {t_2^\ast})`. + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{func}~({t_1^\ast}~\rightarrow~{t_2^\ast}))`. -* :math:`(\mathsf{call\_indirect}~x~y)` is valid with type :math:`{t_1^\ast}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} {t_2^\ast}` if and only if: +* :math:`(\mathsf{call\_indirect}~x~y)` is valid with type :math:`({t_1^\ast}~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,{t_2^\ast})` if and only if: * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. @@ -13109,48 +13109,48 @@ watsup 0.4 generator * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. - * :math:`{\mathit{rt}}` matches :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{func})`. + * :math:`{\mathit{rt}}` matches :math:`(\mathsf{ref}~(\mathsf{null}~()~{}^?)~\mathsf{func})`. - * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[y])` must be equal to :math:`(\mathsf{func}~{t_1^\ast} \rightarrow {t_2^\ast})`. + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[y])` must be equal to :math:`(\mathsf{func}~({t_1^\ast}~\rightarrow~{t_2^\ast}))`. -* :math:`\mathsf{return}` is valid with type :math:`{t_1^\ast}~{t^\ast} \rightarrow_{\epsilon} {t_2^\ast}` if and only if: +* :math:`\mathsf{return}` is valid with type :math:`({t_1^\ast}~{t^\ast}~{\rightarrow}_{\epsilon}\,{t_2^\ast})` if and only if: * :math:`C{.}\mathsf{return}` must be equal to :math:`{t^\ast}`. - * :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}` is valid. + * :math:`({t_1^\ast}~{\rightarrow}_{\epsilon}\,{t_2^\ast})` is valid. -* :math:`(\mathsf{return\_call}~x)` is valid with type :math:`{t_3^\ast}~{t_1^\ast} \rightarrow_{\epsilon} {t_4^\ast}` if and only if: +* :math:`(\mathsf{return\_call}~x)` is valid with type :math:`({t_3^\ast}~{t_1^\ast}~{\rightarrow}_{\epsilon}\,{t_4^\ast})` if and only if: * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. - * :math:`{\mathrm{expand}}(C{.}\mathsf{funcs}{}[x])` must be equal to :math:`(\mathsf{func}~{t_1^\ast} \rightarrow {t_2^\ast})`. + * :math:`{\mathrm{expand}}(C{.}\mathsf{funcs}{}[x])` must be equal to :math:`(\mathsf{func}~({t_1^\ast}~\rightarrow~{t_2^\ast}))`. * :math:`C{.}\mathsf{return}` must be equal to :math:`{{t'}_2^\ast}`. * :math:`{t_2^\ast}` matches :math:`{{t'}_2^\ast}`. - * :math:`{t_3^\ast} \rightarrow_{\epsilon} {t_4^\ast}` is valid. + * :math:`({t_3^\ast}~{\rightarrow}_{\epsilon}\,{t_4^\ast})` is valid. -* :math:`(\mathsf{return\_call\_ref}~x)` is valid with type :math:`{t_3^\ast}~{t_1^\ast}~(\mathsf{ref}~(\mathsf{null}~())~x) \rightarrow_{\epsilon} {t_4^\ast}` if and only if: +* :math:`(\mathsf{return\_call\_ref}~x)` is valid with type :math:`({t_3^\ast}~{t_1^\ast}~(\mathsf{ref}~(\mathsf{null}~()~{}^?)~x)~{\rightarrow}_{\epsilon}\,{t_4^\ast})` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. - * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{func}~{t_1^\ast} \rightarrow {t_2^\ast})`. + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{func}~({t_1^\ast}~\rightarrow~{t_2^\ast}))`. * :math:`C{.}\mathsf{return}` must be equal to :math:`{{t'}_2^\ast}`. * :math:`{t_2^\ast}` matches :math:`{{t'}_2^\ast}`. - * :math:`{t_3^\ast} \rightarrow_{\epsilon} {t_4^\ast}` is valid. + * :math:`({t_3^\ast}~{\rightarrow}_{\epsilon}\,{t_4^\ast})` is valid. -* :math:`(\mathsf{return\_call\_indirect}~x~y)` is valid with type :math:`{t_3^\ast}~{t_1^\ast}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} {t_4^\ast}` if and only if: +* :math:`(\mathsf{return\_call\_indirect}~x~y)` is valid with type :math:`({t_3^\ast}~{t_1^\ast}~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,{t_4^\ast})` if and only if: * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. @@ -13159,42 +13159,42 @@ watsup 0.4 generator * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. - * :math:`{\mathit{rt}}` matches :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{func})`. + * :math:`{\mathit{rt}}` matches :math:`(\mathsf{ref}~(\mathsf{null}~()~{}^?)~\mathsf{func})`. - * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[y])` must be equal to :math:`(\mathsf{func}~{t_1^\ast} \rightarrow {t_2^\ast})`. + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[y])` must be equal to :math:`(\mathsf{func}~({t_1^\ast}~\rightarrow~{t_2^\ast}))`. * :math:`C{.}\mathsf{return}` must be equal to :math:`{{t'}_2^\ast}`. * :math:`{t_2^\ast}` matches :math:`{{t'}_2^\ast}`. - * :math:`{t_3^\ast} \rightarrow_{\epsilon} {t_4^\ast}` is valid. + * :math:`({t_3^\ast}~{\rightarrow}_{\epsilon}\,{t_4^\ast})` is valid. -* :math:`({\mathit{nt}}{.}\mathsf{const}~c_{\mathit{nt}})` is valid with type :math:`\epsilon \rightarrow_{\epsilon} {\mathit{nt}}`. +* :math:`({\mathit{nt}}{.}\mathsf{const}~c_{\mathit{nt}})` is valid with type :math:`(\epsilon~{\rightarrow}_{\epsilon}\,{\mathit{nt}})`. -* :math:`({\mathit{nt}} {.} {\mathit{unop}}_{\mathit{nt}})` is valid with type :math:`{\mathit{nt}} \rightarrow_{\epsilon} {\mathit{nt}}`. +* :math:`({\mathit{nt}} {.} {\mathit{unop}}_{\mathit{nt}})` is valid with type :math:`({\mathit{nt}}~{\rightarrow}_{\epsilon}\,{\mathit{nt}})`. -* :math:`({\mathit{nt}} {.} {\mathit{binop}}_{\mathit{nt}})` is valid with type :math:`{\mathit{nt}}~{\mathit{nt}} \rightarrow_{\epsilon} {\mathit{nt}}`. +* :math:`({\mathit{nt}} {.} {\mathit{binop}}_{\mathit{nt}})` is valid with type :math:`({\mathit{nt}}~{\mathit{nt}}~{\rightarrow}_{\epsilon}\,{\mathit{nt}})`. -* :math:`({\mathit{nt}} {.} {\mathit{testop}}_{\mathit{nt}})` is valid with type :math:`{\mathit{nt}} \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}`. +* :math:`({\mathit{nt}} {.} {\mathit{testop}}_{\mathit{nt}})` is valid with type :math:`({\mathit{nt}}~{\rightarrow}_{\epsilon}\,\mathsf{i{\scriptstyle 32}})`. -* :math:`({\mathit{nt}} {.} {\mathit{relop}}_{\mathit{nt}})` is valid with type :math:`{\mathit{nt}}~{\mathit{nt}} \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}`. +* :math:`({\mathit{nt}} {.} {\mathit{relop}}_{\mathit{nt}})` is valid with type :math:`({\mathit{nt}}~{\mathit{nt}}~{\rightarrow}_{\epsilon}\,\mathsf{i{\scriptstyle 32}})`. -* :math:`({\mathit{nt}}_1 {.} {{\mathit{cvtop}}}{\mathsf{\_}}{{\mathit{nt}}_2})` is valid with type :math:`{\mathit{nt}}_2 \rightarrow_{\epsilon} {\mathit{nt}}_1`. +* :math:`({\mathit{nt}}_1 {.} {{\mathit{cvtop}}}{\mathsf{\_}}{{\mathit{nt}}_2})` is valid with type :math:`({\mathit{nt}}_2~{\rightarrow}_{\epsilon}\,{\mathit{nt}}_1)`. -* :math:`(\mathsf{ref{.}null}~{\mathit{ht}})` is valid with type :math:`\epsilon \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~())~{\mathit{ht}})` if and only if: +* :math:`(\mathsf{ref{.}null}~{\mathit{ht}})` is valid with type :math:`(\epsilon~{\rightarrow}_{\epsilon}\,(\mathsf{ref}~(\mathsf{null}~()~{}^?)~{\mathit{ht}}))` if and only if: * :math:`{\mathit{ht}}` is valid. -* :math:`(\mathsf{ref{.}func}~x)` is valid with type :math:`\epsilon \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~{\mathit{dt}})` if and only if: +* :math:`(\mathsf{ref{.}func}~x)` is valid with type :math:`(\epsilon~{\rightarrow}_{\epsilon}\,(\mathsf{ref}~(\mathsf{null}~\epsilon~{}^?)~{\mathit{dt}}))` if and only if: * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. @@ -13206,25 +13206,25 @@ watsup 0.4 generator * :math:`x` must be contained in :math:`C{.}\mathsf{refs}`. -* :math:`\mathsf{ref{.}i{\scriptstyle 31}}` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~\mathsf{i{\scriptstyle 31}})`. +* :math:`\mathsf{ref{.}i{\scriptstyle 31}}` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,(\mathsf{ref}~(\mathsf{null}~\epsilon~{}^?)~\mathsf{i{\scriptstyle 31}}))`. -* :math:`\mathsf{ref{.}is\_null}` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~{\mathit{ht}}) \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}` if and only if: +* :math:`\mathsf{ref{.}is\_null}` is valid with type :math:`((\mathsf{ref}~(\mathsf{null}~()~{}^?)~{\mathit{ht}})~{\rightarrow}_{\epsilon}\,\mathsf{i{\scriptstyle 32}})` if and only if: * :math:`{\mathit{ht}}` is valid. -* :math:`\mathsf{ref{.}as\_non\_null}` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~{\mathit{ht}}) \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~{\mathit{ht}})` if and only if: +* :math:`\mathsf{ref{.}as\_non\_null}` is valid with type :math:`((\mathsf{ref}~(\mathsf{null}~()~{}^?)~{\mathit{ht}})~{\rightarrow}_{\epsilon}\,(\mathsf{ref}~(\mathsf{null}~\epsilon~{}^?)~{\mathit{ht}}))` if and only if: * :math:`{\mathit{ht}}` is valid. -* :math:`\mathsf{ref{.}eq}` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{eq})~(\mathsf{ref}~(\mathsf{null}~())~\mathsf{eq}) \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}`. +* :math:`\mathsf{ref{.}eq}` is valid with type :math:`((\mathsf{ref}~(\mathsf{null}~()~{}^?)~\mathsf{eq})~(\mathsf{ref}~(\mathsf{null}~()~{}^?)~\mathsf{eq})~{\rightarrow}_{\epsilon}\,\mathsf{i{\scriptstyle 32}})`. -* :math:`(\mathsf{ref{.}test}~{\mathit{rt}})` is valid with type :math:`{\mathit{rt}'} \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}` if and only if: +* :math:`(\mathsf{ref{.}test}~{\mathit{rt}})` is valid with type :math:`({\mathit{rt}'}~{\rightarrow}_{\epsilon}\,\mathsf{i{\scriptstyle 32}})` if and only if: * :math:`{\mathit{rt}}` is valid. @@ -13234,7 +13234,7 @@ watsup 0.4 generator * :math:`{\mathit{rt}}` matches :math:`{\mathit{rt}'}`. -* :math:`(\mathsf{ref{.}cast}~{\mathit{rt}})` is valid with type :math:`{\mathit{rt}'} \rightarrow_{\epsilon} {\mathit{rt}}` if and only if: +* :math:`(\mathsf{ref{.}cast}~{\mathit{rt}})` is valid with type :math:`({\mathit{rt}'}~{\rightarrow}_{\epsilon}\,{\mathit{rt}})` if and only if: * :math:`{\mathit{rt}}` is valid. @@ -13244,10 +13244,10 @@ watsup 0.4 generator * :math:`{\mathit{rt}}` matches :math:`{\mathit{rt}'}`. -* :math:`({\mathsf{i{\scriptstyle 31}{.}get}}{\mathsf{\_}}{{\mathit{sx}}})` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{i{\scriptstyle 31}}) \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}`. +* :math:`({\mathsf{i{\scriptstyle 31}{.}get}}{\mathsf{\_}}{{\mathit{sx}}})` is valid with type :math:`((\mathsf{ref}~(\mathsf{null}~()~{}^?)~\mathsf{i{\scriptstyle 31}})~{\rightarrow}_{\epsilon}\,\mathsf{i{\scriptstyle 32}})`. -* :math:`(\mathsf{struct{.}new}~x)` is valid with type :math:`{{\mathrm{unpack}}({\mathit{zt}})^\ast} \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~x)` if and only if: +* :math:`(\mathsf{struct{.}new}~x)` is valid with type :math:`({{\mathrm{unpack}}({\mathit{zt}})^\ast}~{\rightarrow}_{\epsilon}\,(\mathsf{ref}~(\mathsf{null}~\epsilon~{}^?)~x))` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. @@ -13257,7 +13257,7 @@ watsup 0.4 generator * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{struct}~{({\mathsf{mut}^?}, {\mathit{zt}})^\ast})`. -* :math:`(\mathsf{struct{.}new\_default}~x)` is valid with type :math:`\epsilon \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~x)` if and only if: +* :math:`(\mathsf{struct{.}new\_default}~x)` is valid with type :math:`(\epsilon~{\rightarrow}_{\epsilon}\,(\mathsf{ref}~(\mathsf{null}~\epsilon~{}^?)~x))` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. @@ -13273,7 +13273,7 @@ watsup 0.4 generator * :math:`{{\mathrm{default}}}_{{\mathrm{unpack}}({\mathit{zt}})}` must be equal to :math:`{\mathit{val}}`. -* :math:`({\mathsf{struct{.}get}}{\mathsf{\_}}{{{\mathit{sx}}^?}}~x~i)` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~x) \rightarrow_{\epsilon} {\mathrm{unpack}}({\mathit{zt}})` if and only if: +* :math:`({\mathsf{struct{.}get}}{\mathsf{\_}}{{{\mathit{sx}}^?}}~x~i)` is valid with type :math:`((\mathsf{ref}~(\mathsf{null}~()~{}^?)~x)~{\rightarrow}_{\epsilon}\,{\mathrm{unpack}}({\mathit{zt}}))` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. @@ -13287,7 +13287,7 @@ watsup 0.4 generator * :math:`{{\mathit{sx}}^?}` is :math:`\epsilon` if and only if :math:`{\mathit{zt}}` is :math:`{\mathrm{unpack}}({\mathit{zt}})`. -* :math:`(\mathsf{struct{.}set}~x~i)` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~x)~{\mathrm{unpack}}({\mathit{zt}}) \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`(\mathsf{struct{.}set}~x~i)` is valid with type :math:`((\mathsf{ref}~(\mathsf{null}~()~{}^?)~x)~{\mathrm{unpack}}({\mathit{zt}})~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. @@ -13296,10 +13296,10 @@ watsup 0.4 generator * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{struct}~{{\mathit{yt}}^\ast})`. - * :math:`{{\mathit{yt}}^\ast}{}[i]` must be equal to :math:`((\mathsf{mut}~()), {\mathit{zt}})`. + * :math:`{{\mathit{yt}}^\ast}{}[i]` must be equal to :math:`((\mathsf{mut}~()~{}^?), {\mathit{zt}})`. -* :math:`(\mathsf{array{.}new}~x)` is valid with type :math:`{\mathrm{unpack}}({\mathit{zt}})~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~x)` if and only if: +* :math:`(\mathsf{array{.}new}~x)` is valid with type :math:`({\mathrm{unpack}}({\mathit{zt}})~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,(\mathsf{ref}~(\mathsf{null}~\epsilon~{}^?)~x))` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. @@ -13307,7 +13307,7 @@ watsup 0.4 generator * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~({\mathsf{mut}^?}, {\mathit{zt}}))`. -* :math:`(\mathsf{array{.}new\_default}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~x)` if and only if: +* :math:`(\mathsf{array{.}new\_default}~x)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,(\mathsf{ref}~(\mathsf{null}~\epsilon~{}^?)~x))` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. @@ -13317,7 +13317,7 @@ watsup 0.4 generator * :math:`{{\mathrm{default}}}_{{\mathrm{unpack}}({\mathit{zt}})}` must be equal to :math:`{\mathit{val}}`. -* :math:`(\mathsf{array{.}new\_fixed}~x~n)` is valid with type :math:`{{\mathrm{unpack}}({\mathit{zt}})^{n}} \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~x)` if and only if: +* :math:`(\mathsf{array{.}new\_fixed}~x~n)` is valid with type :math:`({{\mathrm{unpack}}({\mathit{zt}})^{n}}~{\rightarrow}_{\epsilon}\,(\mathsf{ref}~(\mathsf{null}~\epsilon~{}^?)~x))` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. @@ -13325,7 +13325,7 @@ watsup 0.4 generator * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~({\mathsf{mut}^?}, {\mathit{zt}}))`. -* :math:`(\mathsf{array{.}new\_elem}~x~y)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~x)` if and only if: +* :math:`(\mathsf{array{.}new\_elem}~x~y)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,(\mathsf{ref}~(\mathsf{null}~\epsilon~{}^?)~x))` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. @@ -13337,7 +13337,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{elems}{}[y]` matches :math:`{\mathit{rt}}`. -* :math:`(\mathsf{array{.}new\_data}~x~y)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} (\mathsf{ref}~(\mathsf{null}~\epsilon)~x)` if and only if: +* :math:`(\mathsf{array{.}new\_data}~x~y)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,(\mathsf{ref}~(\mathsf{null}~\epsilon~{}^?)~x))` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. @@ -13351,7 +13351,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{datas}{}[y]` must be equal to :math:`\mathsf{ok}`. -* :math:`({\mathsf{array{.}get}}{\mathsf{\_}}{{{\mathit{sx}}^?}}~x)` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~x)~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} {\mathrm{unpack}}({\mathit{zt}})` if and only if: +* :math:`({\mathsf{array{.}get}}{\mathsf{\_}}{{{\mathit{sx}}^?}}~x)` is valid with type :math:`((\mathsf{ref}~(\mathsf{null}~()~{}^?)~x)~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,{\mathrm{unpack}}({\mathit{zt}}))` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. @@ -13361,113 +13361,113 @@ watsup 0.4 generator * :math:`{{\mathit{sx}}^?}` is :math:`\epsilon` if and only if :math:`{\mathit{zt}}` is :math:`{\mathrm{unpack}}({\mathit{zt}})`. -* :math:`(\mathsf{array{.}set}~x)` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~x)~\mathsf{i{\scriptstyle 32}}~{\mathrm{unpack}}({\mathit{zt}}) \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`(\mathsf{array{.}set}~x)` is valid with type :math:`((\mathsf{ref}~(\mathsf{null}~()~{}^?)~x)~\mathsf{i{\scriptstyle 32}}~{\mathrm{unpack}}({\mathit{zt}})~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. - * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~((\mathsf{mut}~()), {\mathit{zt}}))`. + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~((\mathsf{mut}~()~{}^?), {\mathit{zt}}))`. -* :math:`\mathsf{array{.}len}` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{array}) \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}` if and only if: +* :math:`\mathsf{array{.}len}` is valid with type :math:`((\mathsf{ref}~(\mathsf{null}~()~{}^?)~\mathsf{array})~{\rightarrow}_{\epsilon}\,\mathsf{i{\scriptstyle 32}})` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. - * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~((\mathsf{mut}~()), {\mathit{zt}}))`. + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~((\mathsf{mut}~()~{}^?), {\mathit{zt}}))`. -* :math:`(\mathsf{array{.}fill}~x)` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~x)~\mathsf{i{\scriptstyle 32}}~{\mathrm{unpack}}({\mathit{zt}})~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`(\mathsf{array{.}fill}~x)` is valid with type :math:`((\mathsf{ref}~(\mathsf{null}~()~{}^?)~x)~\mathsf{i{\scriptstyle 32}}~{\mathrm{unpack}}({\mathit{zt}})~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. - * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~((\mathsf{mut}~()), {\mathit{zt}}))`. + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~((\mathsf{mut}~()~{}^?), {\mathit{zt}}))`. -* :math:`(\mathsf{array{.}copy}~x_1~x_2)` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~x_1)~\mathsf{i{\scriptstyle 32}}~(\mathsf{ref}~(\mathsf{null}~())~x_2)~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`(\mathsf{array{.}copy}~x_1~x_2)` is valid with type :math:`((\mathsf{ref}~(\mathsf{null}~()~{}^?)~x_1)~\mathsf{i{\scriptstyle 32}}~(\mathsf{ref}~(\mathsf{null}~()~{}^?)~x_2)~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x_1`. * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x_2`. - * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x_1])` must be equal to :math:`(\mathsf{array}~((\mathsf{mut}~()), {\mathit{zt}}_1))`. + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x_1])` must be equal to :math:`(\mathsf{array}~((\mathsf{mut}~()~{}^?), {\mathit{zt}}_1))`. * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x_2])` must be equal to :math:`(\mathsf{array}~({\mathsf{mut}^?}, {\mathit{zt}}_2))`. * :math:`{\mathit{zt}}_2` matches :math:`{\mathit{zt}}_1`. -* :math:`(\mathsf{array{.}init\_elem}~x~y)` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~x)~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`(\mathsf{array{.}init\_elem}~x~y)` is valid with type :math:`((\mathsf{ref}~(\mathsf{null}~()~{}^?)~x)~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. * :math:`{|C{.}\mathsf{elems}|}` must be greater than :math:`y`. - * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~((\mathsf{mut}~()), {\mathit{zt}}))`. + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~((\mathsf{mut}~()~{}^?), {\mathit{zt}}))`. * :math:`C{.}\mathsf{elems}{}[y]` matches :math:`{\mathit{zt}}`. -* :math:`(\mathsf{array{.}init\_data}~x~y)` is valid with type :math:`(\mathsf{ref}~(\mathsf{null}~())~x)~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`(\mathsf{array{.}init\_data}~x~y)` is valid with type :math:`((\mathsf{ref}~(\mathsf{null}~()~{}^?)~x)~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{types}|}` must be greater than :math:`x`. * :math:`{|C{.}\mathsf{datas}|}` must be greater than :math:`y`. - * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~((\mathsf{mut}~()), {\mathit{zt}}))`. + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{array}~((\mathsf{mut}~()~{}^?), {\mathit{zt}}))`. * YetI: (($unpack(zt) = (numtype : numtype <: valtype)) \/ ($unpack(zt) = (vectype : vectype <: valtype))). * :math:`C{.}\mathsf{datas}{}[y]` must be equal to :math:`\mathsf{ok}`. -* :math:`\mathsf{extern{.}convert\_any}` is valid with type :math:`(\mathsf{ref}~{\mathsf{null}^?}~\mathsf{any}) \rightarrow_{\epsilon} (\mathsf{ref}~{\mathsf{null}^?}~\mathsf{extern})`. +* :math:`\mathsf{extern{.}convert\_any}` is valid with type :math:`((\mathsf{ref}~{\mathsf{null}^?}~\mathsf{any})~{\rightarrow}_{\epsilon}\,(\mathsf{ref}~{\mathsf{null}^?}~\mathsf{extern}))`. -* :math:`\mathsf{any{.}convert\_extern}` is valid with type :math:`(\mathsf{ref}~{\mathsf{null}^?}~\mathsf{extern}) \rightarrow_{\epsilon} (\mathsf{ref}~{\mathsf{null}^?}~\mathsf{any})`. +* :math:`\mathsf{any{.}convert\_extern}` is valid with type :math:`((\mathsf{ref}~{\mathsf{null}^?}~\mathsf{extern})~{\rightarrow}_{\epsilon}\,(\mathsf{ref}~{\mathsf{null}^?}~\mathsf{any}))`. -* :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c)` is valid with type :math:`\epsilon \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. +* :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c)` is valid with type :math:`(\epsilon~{\rightarrow}_{\epsilon}\,\mathsf{v{\scriptstyle 128}})`. -* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvunop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. +* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvunop}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~{\rightarrow}_{\epsilon}\,\mathsf{v{\scriptstyle 128}})`. -* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvbinop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. +* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvbinop}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~{\rightarrow}_{\epsilon}\,\mathsf{v{\scriptstyle 128}})`. -* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvternop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. +* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvternop}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~{\rightarrow}_{\epsilon}\,\mathsf{v{\scriptstyle 128}})`. -* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvtestop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}`. +* :math:`(\mathsf{v{\scriptstyle 128}} {.} {\mathit{vvtestop}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~{\rightarrow}_{\epsilon}\,\mathsf{i{\scriptstyle 32}})`. -* :math:`({\mathit{sh}} {.} {\mathit{vunop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. +* :math:`({\mathit{sh}} {.} {\mathit{vunop}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~{\rightarrow}_{\epsilon}\,\mathsf{v{\scriptstyle 128}})`. -* :math:`({\mathit{sh}} {.} {\mathit{vbinop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. +* :math:`({\mathit{sh}} {.} {\mathit{vbinop}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~{\rightarrow}_{\epsilon}\,\mathsf{v{\scriptstyle 128}})`. -* :math:`({\mathit{sh}} {.} {\mathit{vtestop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}`. +* :math:`({\mathit{sh}} {.} {\mathit{vtestop}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~{\rightarrow}_{\epsilon}\,\mathsf{i{\scriptstyle 32}})`. -* :math:`({\mathit{sh}} {.} {\mathit{vrelop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. +* :math:`({\mathit{sh}} {.} {\mathit{vrelop}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~{\rightarrow}_{\epsilon}\,\mathsf{v{\scriptstyle 128}})`. -* :math:`({\mathit{sh}} {.} {\mathit{vshiftop}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. +* :math:`({\mathit{sh}} {.} {\mathit{vshiftop}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,\mathsf{v{\scriptstyle 128}})`. -* :math:`({\mathit{sh}}{.}\mathsf{bitmask})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}`. +* :math:`({\mathit{sh}}{.}\mathsf{bitmask})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~{\rightarrow}_{\epsilon}\,\mathsf{i{\scriptstyle 32}})`. -* :math:`({\mathit{sh}}{.}\mathsf{swizzle})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. +* :math:`({\mathit{sh}}{.}\mathsf{swizzle})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~{\rightarrow}_{\epsilon}\,\mathsf{v{\scriptstyle 128}})`. -* :math:`({\mathit{sh}}{.}\mathsf{shuffle}~{i^\ast})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}` if and only if: +* :math:`({\mathit{sh}}{.}\mathsf{shuffle}~{i^\ast})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~{\rightarrow}_{\epsilon}\,\mathsf{v{\scriptstyle 128}})` if and only if: * For all :math:`i` in :math:`{i^\ast}`, @@ -13475,34 +13475,34 @@ watsup 0.4 generator * :math:`i` must be less than :math:`2 \cdot {\mathrm{dim}}({\mathit{sh}})`. -* :math:`({\mathit{sh}}{.}\mathsf{splat})` is valid with type :math:`{\mathrm{unpack}}({\mathit{sh}}) \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. +* :math:`({\mathit{sh}}{.}\mathsf{splat})` is valid with type :math:`({\mathrm{unpack}}({\mathit{sh}})~{\rightarrow}_{\epsilon}\,\mathsf{v{\scriptstyle 128}})`. -* :math:`({{\mathit{sh}}{.}\mathsf{extract\_lane}}{\mathsf{\_}}{{{\mathit{sx}}^?}}~i)` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} {\mathrm{unpack}}({\mathit{sh}})` if and only if: +* :math:`({{\mathit{sh}}{.}\mathsf{extract\_lane}}{\mathsf{\_}}{{{\mathit{sx}}^?}}~i)` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~{\rightarrow}_{\epsilon}\,{\mathrm{unpack}}({\mathit{sh}}))` if and only if: * :math:`i` must be less than :math:`{\mathrm{dim}}({\mathit{sh}})`. -* :math:`({\mathit{sh}}{.}\mathsf{replace\_lane}~i)` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~{\mathrm{unpack}}({\mathit{sh}}) \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}` if and only if: +* :math:`({\mathit{sh}}{.}\mathsf{replace\_lane}~i)` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~{\mathrm{unpack}}({\mathit{sh}})~{\rightarrow}_{\epsilon}\,\mathsf{v{\scriptstyle 128}})` if and only if: * :math:`i` must be less than :math:`{\mathrm{dim}}({\mathit{sh}})`. -* :math:`({\mathit{sh}}_1 {.} {{\mathit{vextunop}}}{\mathsf{\_}}{{\mathit{sh}}_2})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. +* :math:`({\mathit{sh}}_1 {.} {{\mathit{vextunop}}}{\mathsf{\_}}{{\mathit{sh}}_2})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~{\rightarrow}_{\epsilon}\,\mathsf{v{\scriptstyle 128}})`. -* :math:`({\mathit{sh}}_1 {.} {{\mathit{vextbinop}}}{\mathsf{\_}}{{\mathit{sh}}_2})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. +* :math:`({\mathit{sh}}_1 {.} {{\mathit{vextbinop}}}{\mathsf{\_}}{{\mathit{sh}}_2})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~{\rightarrow}_{\epsilon}\,\mathsf{v{\scriptstyle 128}})`. -* :math:`({{\mathit{sh}}_1{.}\mathsf{narrow}}{\mathsf{\_}}{{\mathit{sh}}_2}{\mathsf{\_}}{{\mathit{sx}}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. +* :math:`({{\mathit{sh}}_1{.}\mathsf{narrow}}{\mathsf{\_}}{{\mathit{sh}}_2}{\mathsf{\_}}{{\mathit{sx}}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~\mathsf{v{\scriptstyle 128}}~{\rightarrow}_{\epsilon}\,\mathsf{v{\scriptstyle 128}})`. -* :math:`({\mathit{sh}}_1 {.} {{\mathit{vcvtop}}}{\mathsf{\_}}{{{\mathit{zero}}^?}}{\mathsf{\_}}{{\mathit{sh}}_2}{\mathsf{\_}}{{{\mathit{half}}^?}})` is valid with type :math:`\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}`. +* :math:`({\mathit{sh}}_1 {.} {{\mathit{vcvtop}}}{\mathsf{\_}}{{{\mathit{zero}}^?}}{\mathsf{\_}}{{\mathit{sh}}_2}{\mathsf{\_}}{{{\mathit{half}}^?}})` is valid with type :math:`(\mathsf{v{\scriptstyle 128}}~{\rightarrow}_{\epsilon}\,\mathsf{v{\scriptstyle 128}})`. -* :math:`(\mathsf{local{.}get}~x)` is valid with type :math:`\epsilon \rightarrow_{\epsilon} t` if and only if: +* :math:`(\mathsf{local{.}get}~x)` is valid with type :math:`(\epsilon~{\rightarrow}_{\epsilon}\,t)` if and only if: * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. @@ -13510,7 +13510,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`(\mathsf{set}, t)`. -* :math:`(\mathsf{local{.}set}~x)` is valid with type :math:`t \rightarrow_{x} \epsilon` if and only if: +* :math:`(\mathsf{local{.}set}~x)` is valid with type :math:`(t~{\rightarrow}_{x}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. @@ -13518,7 +13518,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`({\mathit{init}}, t)`. -* :math:`(\mathsf{local{.}tee}~x)` is valid with type :math:`t \rightarrow_{x} t` if and only if: +* :math:`(\mathsf{local{.}tee}~x)` is valid with type :math:`(t~{\rightarrow}_{x}\,t)` if and only if: * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x`. @@ -13526,7 +13526,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{locals}{}[x]` must be equal to :math:`({\mathit{init}}, t)`. -* :math:`(\mathsf{global{.}get}~x)` is valid with type :math:`\epsilon \rightarrow_{\epsilon} t` if and only if: +* :math:`(\mathsf{global{.}get}~x)` is valid with type :math:`(\epsilon~{\rightarrow}_{\epsilon}\,t)` if and only if: * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. @@ -13534,15 +13534,15 @@ watsup 0.4 generator * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`({\mathsf{mut}^?}, t)`. -* :math:`(\mathsf{global{.}set}~x)` is valid with type :math:`t \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`(\mathsf{global{.}set}~x)` is valid with type :math:`(t~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. - * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`((\mathsf{mut}~()), t)`. + * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`((\mathsf{mut}~()~{}^?), t)`. -* :math:`(\mathsf{table{.}get}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} {\mathit{rt}}` if and only if: +* :math:`(\mathsf{table{.}get}~x)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,{\mathit{rt}})` if and only if: * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. @@ -13550,7 +13550,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. -* :math:`(\mathsf{table{.}set}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~{\mathit{rt}} \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`(\mathsf{table{.}set}~x)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~{\mathit{rt}}~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. @@ -13558,7 +13558,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. -* :math:`(\mathsf{table{.}size}~x)` is valid with type :math:`\epsilon \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}` if and only if: +* :math:`(\mathsf{table{.}size}~x)` is valid with type :math:`(\epsilon~{\rightarrow}_{\epsilon}\,\mathsf{i{\scriptstyle 32}})` if and only if: * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. @@ -13566,7 +13566,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. -* :math:`(\mathsf{table{.}grow}~x)` is valid with type :math:`{\mathit{rt}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}` if and only if: +* :math:`(\mathsf{table{.}grow}~x)` is valid with type :math:`({\mathit{rt}}~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,\mathsf{i{\scriptstyle 32}})` if and only if: * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. @@ -13574,7 +13574,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. -* :math:`(\mathsf{table{.}fill}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~{\mathit{rt}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`(\mathsf{table{.}fill}~x)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~{\mathit{rt}}~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. @@ -13582,7 +13582,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{tables}{}[x]` must be equal to :math:`({\mathit{lim}}, {\mathit{rt}})`. -* :math:`(\mathsf{table{.}copy}~x_1~x_2)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`(\mathsf{table{.}copy}~x_1~x_2)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x_1`. @@ -13596,7 +13596,7 @@ watsup 0.4 generator * :math:`{\mathit{rt}}_2` matches :math:`{\mathit{rt}}_1`. -* :math:`(\mathsf{table{.}init}~x~y)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`(\mathsf{table{.}init}~x~y)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{tables}|}` must be greater than :math:`x`. @@ -13610,7 +13610,7 @@ watsup 0.4 generator * :math:`{\mathit{rt}}_2` matches :math:`{\mathit{rt}}_1`. -* :math:`(\mathsf{elem{.}drop}~x)` is valid with type :math:`\epsilon \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`(\mathsf{elem{.}drop}~x)` is valid with type :math:`(\epsilon~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{elems}|}` must be greater than :math:`x`. @@ -13618,7 +13618,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{elems}{}[x]` must be equal to :math:`{\mathit{rt}}`. -* :math:`(\mathsf{memory{.}size}~x)` is valid with type :math:`\epsilon \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}` if and only if: +* :math:`(\mathsf{memory{.}size}~x)` is valid with type :math:`(\epsilon~{\rightarrow}_{\epsilon}\,\mathsf{i{\scriptstyle 32}})` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. @@ -13626,7 +13626,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{mems}{}[x]` must be equal to :math:`{\mathit{mt}}`. -* :math:`(\mathsf{memory{.}grow}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \mathsf{i{\scriptstyle 32}}` if and only if: +* :math:`(\mathsf{memory{.}grow}~x)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,\mathsf{i{\scriptstyle 32}})` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. @@ -13634,7 +13634,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{mems}{}[x]` must be equal to :math:`{\mathit{mt}}`. -* :math:`(\mathsf{memory{.}fill}~x)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`(\mathsf{memory{.}fill}~x)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. @@ -13642,7 +13642,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{mems}{}[x]` must be equal to :math:`{\mathit{mt}}`. -* :math:`(\mathsf{memory{.}copy}~x_1~x_2)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`(\mathsf{memory{.}copy}~x_1~x_2)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x_1`. @@ -13654,7 +13654,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{mems}{}[x_2]` must be equal to :math:`{\mathit{mt}}_2`. -* :math:`(\mathsf{memory{.}init}~x~y)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`(\mathsf{memory{.}init}~x~y)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. @@ -13666,7 +13666,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{datas}{}[y]` must be equal to :math:`\mathsf{ok}`. -* :math:`(\mathsf{data{.}drop}~x)` is valid with type :math:`\epsilon \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`(\mathsf{data{.}drop}~x)` is valid with type :math:`(\epsilon~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{datas}|}` must be greater than :math:`x`. @@ -13674,7 +13674,7 @@ watsup 0.4 generator * :math:`C{.}\mathsf{datas}{}[x]` must be equal to :math:`\mathsf{ok}`. -* :math:`({{\mathit{nt}}{.}\mathsf{load}}{\epsilon}~x~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} {\mathit{nt}}` if and only if: +* :math:`({{\mathit{nt}}{.}\mathsf{load}}{\epsilon}~x~{\mathit{memarg}})` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,{\mathit{nt}})` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. @@ -13684,7 +13684,7 @@ watsup 0.4 generator * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`{|{\mathit{nt}}|} / 8`. -* :math:`({{\mathit{nt}}{.}\mathsf{store}}{\epsilon}~x~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~{\mathit{nt}} \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`({{\mathit{nt}}{.}\mathsf{store}}{\epsilon}~x~{\mathit{memarg}})` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~{\mathit{nt}}~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. @@ -13694,7 +13694,7 @@ watsup 0.4 generator * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`{|{\mathit{nt}}|} / 8`. -* :math:`({\mathsf{v{\scriptstyle 128}}{.}\mathsf{load}}{\epsilon}~x~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}` if and only if: +* :math:`({\mathsf{v{\scriptstyle 128}}{.}\mathsf{load}}{\epsilon}~x~{\mathit{memarg}})` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~{\rightarrow}_{\epsilon}\,\mathsf{v{\scriptstyle 128}})` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. @@ -13704,7 +13704,7 @@ watsup 0.4 generator * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`{|\mathsf{v{\scriptstyle 128}}|} / 8`. -* :math:`({\mathsf{v{\scriptstyle 128}}{.}\mathsf{load}}{N}{\mathsf{\_}}{\mathsf{lane}}~x~{\mathit{memarg}}~i)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \mathsf{v{\scriptstyle 128}}` if and only if: +* :math:`({\mathsf{v{\scriptstyle 128}}{.}\mathsf{load}}{N}{\mathsf{\_}}{\mathsf{lane}}~x~{\mathit{memarg}}~i)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\mathsf{v{\scriptstyle 128}}~{\rightarrow}_{\epsilon}\,\mathsf{v{\scriptstyle 128}})` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. @@ -13716,7 +13716,7 @@ watsup 0.4 generator * :math:`i` must be less than :math:`128 / N`. -* :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{store}~x~{\mathit{memarg}})` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{store}~x~{\mathit{memarg}})` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\mathsf{v{\scriptstyle 128}}~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. @@ -13726,7 +13726,7 @@ watsup 0.4 generator * :math:`{2^{{\mathit{memarg}}{.}\mathsf{align}}}` must be less than or equal to :math:`{|\mathsf{v{\scriptstyle 128}}|} / 8`. -* :math:`({\mathsf{v{\scriptstyle 128}}{.}\mathsf{store}}{N}{\mathsf{\_}}{\mathsf{lane}}~x~{\mathit{memarg}}~i)` is valid with type :math:`\mathsf{i{\scriptstyle 32}}~\mathsf{v{\scriptstyle 128}} \rightarrow_{\epsilon} \epsilon` if and only if: +* :math:`({\mathsf{v{\scriptstyle 128}}{.}\mathsf{store}}{N}{\mathsf{\_}}{\mathsf{lane}}~x~{\mathit{memarg}}~i)` is valid with type :math:`(\mathsf{i{\scriptstyle 32}}~\mathsf{v{\scriptstyle 128}}~{\rightarrow}_{\epsilon}\,\epsilon)` if and only if: * :math:`{|C{.}\mathsf{mems}|}` must be greater than :math:`x`. @@ -13745,13 +13745,13 @@ watsup 0.4 generator * :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`\epsilon`. - * :math:`{\mathit{instrtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}` must be equal to :math:`\epsilon \rightarrow_{\epsilon} \epsilon`. + * :math:`{\mathit{instrtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}` must be equal to :math:`(\epsilon~{\rightarrow}_{\epsilon}\,\epsilon)`. * Or: * :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`{\mathit{instr}}_1~{{\mathit{instr}}_2^\ast}`. - * :math:`{\mathit{instrtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}` must be equal to :math:`{t_1^\ast} \rightarrow_{{x_1^\ast}~{x_2^\ast}} {t_3^\ast}`. + * :math:`{\mathit{instrtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}` must be equal to :math:`({t_1^\ast}~{\rightarrow}_{{x_1^\ast}~{x_2^\ast}}\,{t_3^\ast})`. * :math:`{|{t^\ast}|}` must be equal to :math:`{|{{\mathit{init}}^\ast}|}`. @@ -13761,13 +13761,13 @@ watsup 0.4 generator * :math:`{|C{.}\mathsf{locals}|}` must be greater than :math:`x_1`. - * :math:`{\mathit{instr}}_1` is valid with type :math:`{t_1^\ast} \rightarrow_{{x_1^\ast}} {t_2^\ast}`. + * :math:`{\mathit{instr}}_1` is valid with type :math:`({t_1^\ast}~{\rightarrow}_{{x_1^\ast}}\,{t_2^\ast})`. * For all :math:`{\mathit{init}}` in :math:`{{\mathit{init}}^\ast}` and :math:`t` in :math:`{t^\ast}` and :math:`x_1` in :math:`{x_1^\ast}`, * :math:`C{.}\mathsf{locals}{}[x_1]` must be equal to :math:`({\mathit{init}}, t)`. - * Under the context :math:`C{}[{.}\mathsf{local}{}[{x_1^\ast}] = {(\mathsf{set}, t)^\ast}]`, :math:`{{\mathit{instr}}_2^\ast}` is valid with type :math:`{t_2^\ast} \rightarrow_{{x_2^\ast}} {t_3^\ast}`. * Or: + * Under the context :math:`C{}[{.}\mathsf{local}{}[{x_1^\ast}] = {(\mathsf{set}, t)^\ast}]`, :math:`{{\mathit{instr}}_2^\ast}` is valid with type :math:`({t_2^\ast}~{\rightarrow}_{{x_2^\ast}}\,{t_3^\ast})`. * Or: * :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`{{\mathit{instr}}^\ast}`. @@ -13781,9 +13781,9 @@ watsup 0.4 generator * :math:`{{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast}` must be equal to :math:`{{\mathit{instr}}^\ast}`. - * :math:`{\mathit{instrtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}` must be equal to :math:`{t^\ast}~{t_1^\ast} \rightarrow_{{x^\ast}} {t^\ast}~{t_2^\ast}`. + * :math:`{\mathit{instrtype}}_{\mathit{u{\kern-0.1em\scriptstyle 4}}}` must be equal to :math:`({t^\ast}~{t_1^\ast}~{\rightarrow}_{{x^\ast}}\,{t^\ast}~{t_2^\ast})`. - * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow_{{x^\ast}} {t_2^\ast}`. + * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`({t_1^\ast}~{\rightarrow}_{{x^\ast}}\,{t_2^\ast})`. * :math:`{t^\ast}` is valid. @@ -13791,7 +13791,7 @@ watsup 0.4 generator * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t^\ast}` if and only if: - * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`\epsilon \rightarrow_{\epsilon} {t^\ast}`. + * :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`(\epsilon~{\rightarrow}_{\epsilon}\,{t^\ast})`. * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is const if and only if: @@ -13829,7 +13829,7 @@ watsup 0.4 generator * :math:`{|C{.}\mathsf{globals}|}` must be greater than :math:`x`. - * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`((\mathsf{mut}~\epsilon), t)`. * Or: + * :math:`C{.}\mathsf{globals}{}[x]` must be equal to :math:`((\mathsf{mut}~\epsilon~{}^?), t)`. * Or: * :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` must be equal to :math:`({\mathsf{i}}{N} {.} {\mathit{binop}})`. @@ -13883,7 +13883,7 @@ watsup 0.4 generator * :math:`{|{{\mathit{local}}^\ast}|}` must be equal to :math:`{|{{{\mathit{lt}}}^\ast}|}`. - * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{func}~{t_1^\ast} \rightarrow {t_2^\ast})`. + * :math:`{\mathrm{expand}}(C{.}\mathsf{types}{}[x])` must be equal to :math:`(\mathsf{func}~({t_1^\ast}~\rightarrow~{t_2^\ast}))`. * For all :math:`{{\mathit{lt}}}` in :math:`{{{\mathit{lt}}}^\ast}` and :math:`{\mathit{local}}` in :math:`{{\mathit{local}}^\ast}`, @@ -13991,7 +13991,7 @@ watsup 0.4 generator * :math:`{|C{.}\mathsf{funcs}|}` must be greater than :math:`x`. - * :math:`{\mathrm{expand}}(C{.}\mathsf{funcs}{}[x])` must be equal to :math:`(\mathsf{func}~\epsilon \rightarrow \epsilon)`. + * :math:`{\mathrm{expand}}(C{.}\mathsf{funcs}{}[x])` must be equal to :math:`(\mathsf{func}~(\epsilon~\rightarrow~\epsilon))`. * :math:`(\mathsf{import}~{\mathit{name}}_1~{\mathit{name}}_2~{\mathit{xt}})` is valid with type :math:`{\mathit{xt}}` if and only if: @@ -14086,7 +14086,7 @@ watsup 0.4 generator * Under the context :math:`C{}[{.}\mathsf{types} \mathrel{{=}{\oplus}} {{\mathit{dt}}_1^\ast}]`, :math:`{{\mathit{type}}^\ast}` is valid with type :math:`{{\mathit{dt}}^\ast}`. -* :math:`(\mathsf{module}~{{\mathit{type}}^\ast}~{{\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})` is valid with type :math:`{{\mathrm{clos}}}_{C}({{\mathit{xt}}_{\mathsf{i}}^\ast} \rightarrow {{\mathit{xt}}_{\mathsf{e}}^\ast})` if and only if: +* :math:`(\mathsf{module}~{{\mathit{type}}^\ast}~{{\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})` is valid with type :math:`{{\mathrm{clos}}}_{C}(({{\mathit{xt}}_{\mathsf{i}}^\ast}~\rightarrow~{{\mathit{xt}}_{\mathsf{e}}^\ast}))` if and only if: * :math:`{|{{\mathit{xt}}_{\mathsf{i}}^\ast}|}` must be equal to :math:`{|{{\mathit{import}}^\ast}|}`. @@ -14147,7 +14147,7 @@ watsup 0.4 generator * :math:`{C'}` must be equal to :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{types}~{{\mathit{dt}'}^\ast},\; \mathsf{recs}~\epsilon,\; \mathsf{funcs}~{{\mathit{dt}}_{\mathsf{i}}^\ast}~{{\mathit{dt}}^\ast},\; \mathsf{globals}~{{\mathit{gt}}_{\mathsf{i}}^\ast},\; \mathsf{tables}~\epsilon,\; \mathsf{mems}~\epsilon,\; \mathsf{elems}~\epsilon,\; \mathsf{datas}~\epsilon,\; \mathsf{locals}~\epsilon,\; \mathsf{labels}~\epsilon,\; \mathsf{return}~\epsilon,\; \mathsf{refs}~{x^\ast} \}\end{array}`. - * :math:`{x^\ast}` must be equal to `$funcidx_nonfuncs(YetE (`%%%%%`_nonfuncs(global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data*{data : data})))`. + * :math:`{x^\ast}` must be equal to :math:`{\mathrm{funcidx}}(({{\mathit{global}}^\ast}~{{\mathit{table}}^\ast}~{{\mathit{mem}}^\ast}~{{\mathit{elem}}^\ast}~{{\mathit{data}}^\ast}))`. * :math:`{{\mathit{dt}}_{\mathsf{i}}^\ast}` must be equal to :math:`{\mathrm{funcs}}({{\mathit{xt}}_{\mathsf{i}}^\ast})`. @@ -14158,7 +14158,7 @@ watsup 0.4 generator * :math:`{{\mathit{mt}}_{\mathsf{i}}^\ast}` must be equal to :math:`{\mathrm{mems}}({{\mathit{xt}}_{\mathsf{i}}^\ast})`. -* :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid with type :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast} \rightarrow {{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 3}}}^\ast}` if and only if: +* :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is valid with type :math:`({{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}^\ast}~\rightarrow~{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 3}}}^\ast})` if and only if: * Either: @@ -14187,9 +14187,9 @@ watsup 0.4 generator * :math:`{{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 3}}}^\ast}` must be equal to :math:`{t_2^\ast}`. - * :math:`{\mathit{blocktype}}` is valid with type :math:`{t_1^\ast} \rightarrow_{\epsilon} {t_2^\ast}`. + * :math:`{\mathit{blocktype}}` is valid with type :math:`({t_1^\ast}~{\rightarrow}_{\epsilon}\,{t_2^\ast})`. - * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`{t_1^\ast} \rightarrow {t_2^\ast}`. + * Under the context :math:`C{}[{.}\mathsf{labels} \mathrel{{=}{\oplus}} {t_2^\ast}]`, :math:`{{\mathit{instr}}^\ast}` is valid with type :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})`. :math:`{\mathrm{Ki}}` @@ -14449,70 +14449,70 @@ watsup 0.4 generator ....................... -1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{any})`. +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~()~{}^?)~\mathsf{any})`. :math:`\mathsf{eqref}` ...................... -1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{eq})`. +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~()~{}^?)~\mathsf{eq})`. :math:`\mathsf{i{\scriptstyle 31}ref}` ...................................... -1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{i{\scriptstyle 31}})`. +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~()~{}^?)~\mathsf{i{\scriptstyle 31}})`. :math:`\mathsf{structref}` .......................... -1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{struct})`. +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~()~{}^?)~\mathsf{struct})`. :math:`\mathsf{arrayref}` ......................... -1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{array})`. +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~()~{}^?)~\mathsf{array})`. :math:`\mathsf{funcref}` ........................ -1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{func})`. +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~()~{}^?)~\mathsf{func})`. :math:`\mathsf{externref}` .......................... -1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{extern})`. +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~()~{}^?)~\mathsf{extern})`. :math:`\mathsf{nullref}` ........................ -1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{none})`. +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~()~{}^?)~\mathsf{none})`. :math:`\mathsf{nullfuncref}` ............................ -1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{nofunc})`. +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~()~{}^?)~\mathsf{nofunc})`. :math:`\mathsf{nullexternref}` .............................. -1. Return :math:`(\mathsf{ref}~(\mathsf{null}~())~\mathsf{noextern})`. +1. Return :math:`(\mathsf{ref}~(\mathsf{null}~()~{}^?)~\mathsf{noextern})`. :math:`{|{\mathit{numtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}|}` @@ -14596,8 +14596,8 @@ watsup 0.4 generator #. Return :math:`{|{\mathit{packtype}}|}`. -:math:`{\mathrm{lanetype}}({{\mathsf{i}}{N}}{\mathsf{x}}{N})` -............................................................. +:math:`{\mathrm{lanetype}}(({{\mathsf{i}}{N}}{\mathsf{x}}{N}))` +............................................................... 1. Return :math:`{\mathsf{i}}{N}`. @@ -14667,15 +14667,15 @@ watsup 0.4 generator #. Return :math:`{+0}`. -:math:`{\mathrm{dim}}({{\mathsf{i}}{N}}{\mathsf{x}}{N})` -........................................................ +:math:`{\mathrm{dim}}(({{\mathsf{i}}{N}}{\mathsf{x}}{N}))` +.......................................................... 1. Return :math:`N`. -:math:`{|{{\mathsf{i}}{N}}{\mathsf{x}}{N}|}` -............................................ +:math:`{|({{\mathsf{i}}{N}}{\mathsf{x}}{N})|}` +.............................................. 1. Return :math:`{|{\mathsf{i}}{N}|} \cdot N`. @@ -14831,20 +14831,20 @@ watsup 0.4 generator #. Return :math:`({\mathit{vectype}}{.}\mathsf{const}~c)`. -:math:`{\mathrm{unpack}}({{\mathsf{i}}{N}}{\mathsf{x}}{N})` -........................................................... +:math:`{\mathrm{unpack}}(({{\mathsf{i}}{N}}{\mathsf{x}}{N}))` +............................................................. 1. Return :math:`{\mathrm{unpack}}({\mathsf{i}}{N})`. -:math:`(\mathsf{ref}~{\mathsf{null}}{{{}_{1}^?}}~{\mathit{ht}}_1) \setminus (\mathsf{ref}~(\mathsf{null}~{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?})~{\mathit{ht}}_2)` -....................................................................................................................................................................... +:math:`(\mathsf{ref}~{\mathsf{null}}{{{}_{1}^?}}~{\mathit{ht}}_1) \setminus (\mathsf{ref}~(\mathsf{null}~{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}~{}^?)~{\mathit{ht}}_2)` +............................................................................................................................................................................ 1. If :math:`{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}` is :math:`()`, then: - a. Return :math:`(\mathsf{ref}~(\mathsf{null}~\epsilon)~{\mathit{ht}}_1)`. + a. Return :math:`(\mathsf{ref}~(\mathsf{null}~\epsilon~{}^?)~{\mathit{ht}}_1)`. #. Assert: Due to validation, :math:`{{\mathit{u{\kern-0.1em\scriptstyle 0}}}^?}` is not defined. @@ -15153,8 +15153,8 @@ watsup 0.4 generator 1. Return :math:`{\mathrm{free}}_{\mathit{storagetype}}({\mathit{storagetype}})`. -:math:`{\mathrm{free}}_{\mathit{functype}}({\mathit{resulttype}}_1 \rightarrow {\mathit{resulttype}}_2)` -........................................................................................................ +:math:`{\mathrm{free}}_{\mathit{functype}}(({\mathit{resulttype}}_1~\rightarrow~{\mathit{resulttype}}_2))` +.......................................................................................................... 1. Return `YetE ($free_resulttype(resulttype_1) ++ $free_resulttype(resulttype_2))`. @@ -15218,7 +15218,7 @@ watsup 0.4 generator 1. Return :math:`{\mathrm{free}}_{\mathit{reftype}}({\mathit{reftype}})`. -:math:`{\mathrm{free}}_{\mathit{memtype}}((\mathsf{page}~{\mathit{limits}}))` +:math:`{\mathrm{free}}_{\mathit{memtype}}(({\mathit{limits}}~\mathsf{page}))` ............................................................................. @@ -15268,8 +15268,8 @@ watsup 0.4 generator #. Return :math:`{\mathrm{free}}_{\mathit{memtype}}({\mathit{memtype}})`. -:math:`{\mathrm{free}}_{\mathit{moduletype}}({{\mathit{externtype}}_1^\ast} \rightarrow {{\mathit{externtype}}_2^\ast})` -........................................................................................................................ +:math:`{\mathrm{free}}_{\mathit{moduletype}}(({{\mathit{externtype}}_1^\ast}~\rightarrow~{{\mathit{externtype}}_2^\ast}))` +.......................................................................................................................... 1. Return `YetE ($free_list($free_externtype(externtype_1)*{externtype_1 : externtype}) ++ $free_list($free_externtype(externtype_2)*{externtype_2 : externtype}))`. @@ -15292,8 +15292,8 @@ watsup 0.4 generator #. Return :math:`{\mathrm{free}}_{\mathit{funcidx}}({\mathit{funcidx}})`. -:math:`{\mathrm{free}}_{\mathit{shape}}({{\mathit{lanetype}}}{\mathsf{x}}{{\mathit{dim}}})` -........................................................................................... +:math:`{\mathrm{free}}_{\mathit{shape}}(({{\mathit{lanetype}}}{\mathsf{x}}{{\mathit{dim}}}))` +............................................................................................. 1. Return :math:`{\mathrm{free}}_{\mathit{lanetype}}({\mathit{lanetype}})`. @@ -15345,7 +15345,7 @@ watsup 0.4 generator #. If :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{select}`, then: - a. Let :math:`(\mathsf{select}~{({{\mathit{valtype}}^\ast})^?})` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. + a. Let :math:`({({{\mathit{valtype}}^\ast})^?}~{}^?)` be :math:`{\mathit{instr}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. #. Return :math:`{\mathrm{free}}_{\mathit{opt}}({{\mathrm{free}}_{\mathit{list}}({{\mathrm{free}}_{\mathit{valtype}}({\mathit{valtype}})^\ast})^?})`. @@ -16173,11 +16173,11 @@ watsup 0.4 generator 1. Return :math:`({{\mathit{qt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]} {.} i)`. -:math:`{{t_1^\ast} \rightarrow {t_2^\ast}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` -............................................................................................... +:math:`{({t_1^\ast}~\rightarrow~{t_2^\ast})}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +................................................................................................. -1. Return :math:`{{t_1}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}^\ast} \rightarrow {{t_2}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}^\ast}`. +1. Return :math:`({{t_1}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}^\ast}~\rightarrow~{{t_2}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}^\ast})`. :math:`{({\mathsf{mut}^?}, t)}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` @@ -16194,11 +16194,11 @@ watsup 0.4 generator 1. Return :math:`({\mathit{lim}}, {{\mathit{rt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]})`. -:math:`{(\mathsf{page}~{\mathit{lim}})}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +:math:`{({\mathit{lim}}~\mathsf{page})}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` ............................................................................................ -1. Return :math:`(\mathsf{page}~{\mathit{lim}})`. +1. Return :math:`({\mathit{lim}}~\mathsf{page})`. :math:`{{\mathit{externtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` @@ -16230,11 +16230,11 @@ watsup 0.4 generator #. Return :math:`(\mathsf{mem}~{{\mathit{mt}}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]})`. -:math:`{{{\mathit{xt}}_1^\ast} \rightarrow {{\mathit{xt}}_2^\ast}}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` -....................................................................................................................... +:math:`{({{\mathit{xt}}_1^\ast}~\rightarrow~{{\mathit{xt}}_2^\ast})}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}` +......................................................................................................................... -1. Return :math:`{{{\mathit{xt}}_1}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}^\ast} \rightarrow {{{\mathit{xt}}_2}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}^\ast}`. +1. Return :math:`({{{\mathit{xt}}_1}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}^\ast}~\rightarrow~{{{\mathit{xt}}_2}{{}[ {{\mathit{tv}}^\ast} := {{\mathit{tu}}^\ast} ]}^\ast})`. :math:`{t}{{}[ {:=}\, {{\mathit{tu}}^{n}} ]}` @@ -17224,17 +17224,17 @@ watsup 0.4 generator 1. Return :math:`{{\mathrm{ibitselect}}}_{{|\mathsf{v{\scriptstyle 128}}|}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_2, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_3)`. -:math:`{{\mathit{vunop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{{{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)}` -........................................................................................................................................................................................ +:math:`{{\mathit{vunop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{({{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)}` +.......................................................................................................................................................................................... 1. If :math:`{\mathit{vunop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{abs}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: a. Let :math:`{\mathsf{i}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{{\mathrm{iabs}}}_{N}({\mathit{lane}}_1)^\ast})}`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{{\mathrm{iabs}}}_{N}({\mathit{lane}}_1)^\ast})}`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17242,9 +17242,9 @@ watsup 0.4 generator a. Let :math:`{\mathsf{i}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{{\mathrm{ineg}}}_{N}({\mathit{lane}}_1)^\ast})}`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{{\mathrm{ineg}}}_{N}({\mathit{lane}}_1)^\ast})}`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17252,9 +17252,9 @@ watsup 0.4 generator a. Let :math:`{\mathsf{i}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{{\mathrm{ipopcnt}}}_{N}({\mathit{lane}}_1)^\ast})}`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{{\mathrm{ipopcnt}}}_{N}({\mathit{lane}}_1)^\ast})}`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17262,11 +17262,11 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fabs}}}_{N}({\mathit{lane}}_1)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -17274,11 +17274,11 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fneg}}}_{N}({\mathit{lane}}_1)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -17286,11 +17286,11 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fsqrt}}}_{N}({\mathit{lane}}_1)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -17298,11 +17298,11 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fceil}}}_{N}({\mathit{lane}}_1)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -17310,11 +17310,11 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{ffloor}}}_{N}({\mathit{lane}}_1)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -17322,11 +17322,11 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{ftrunc}}}_{N}({\mathit{lane}}_1)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -17336,28 +17336,28 @@ watsup 0.4 generator #. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. -#. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. +#. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fnearest}}}_{N}({\mathit{lane}}_1)^\ast}`. -#. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. +#. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. -:math:`{{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{{{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)}` -...................................................................................................................................................................................................................................... +:math:`{{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{({{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)}` +........................................................................................................................................................................................................................................ 1. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{add}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: a. Let :math:`{\mathsf{i}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{{\mathrm{iadd}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})}`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{{\mathrm{iadd}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})}`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17365,11 +17365,11 @@ watsup 0.4 generator a. Let :math:`{\mathsf{i}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{{\mathrm{isub}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})}`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{{\mathrm{isub}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})}`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17381,11 +17381,11 @@ watsup 0.4 generator 1) Let :math:`({\mathsf{min}}{\mathsf{\_}}{{\mathit{sx}}})` be :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}`. - #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. - #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{{\mathrm{imin}}}_{N}({\mathit{sx}}, {\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})}`. + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{{\mathrm{imin}}}_{N}({\mathit{sx}}, {\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})}`. #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17393,11 +17393,11 @@ watsup 0.4 generator 1) Let :math:`({\mathsf{max}}{\mathsf{\_}}{{\mathit{sx}}})` be :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}`. - #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. - #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{{\mathrm{imax}}}_{N}({\mathit{sx}}, {\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})}`. + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{{\mathrm{imax}}}_{N}({\mathit{sx}}, {\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})}`. #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17405,11 +17405,11 @@ watsup 0.4 generator 1) Let :math:`({\mathsf{add\_sat}}{\mathsf{\_}}{{\mathit{sx}}})` be :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}`. - #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. - #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{{{{\mathrm{iadd\_sat}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})}`. + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{{{{\mathrm{iadd\_sat}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})}`. #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17417,11 +17417,11 @@ watsup 0.4 generator 1) Let :math:`({\mathsf{sub\_sat}}{\mathsf{\_}}{{\mathit{sx}}})` be :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}`. - #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. - #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{{{{\mathrm{isub\_sat}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})}`. + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{{{{\mathrm{isub\_sat}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})}`. #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17429,35 +17429,35 @@ watsup 0.4 generator a. Let :math:`{\mathsf{i}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{{\mathrm{imul}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})}`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{{\mathrm{imul}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast})}`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. -#. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{avgr}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: +#. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: a. Let :math:`{\mathsf{i}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{{{{\mathrm{iavgr}}}_{N}^{\mathsf{u}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})}`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{{{{\mathrm{iavgr}}}_{N}^{\mathsf{u}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})}`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. -#. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{q{\scriptstyle 15}mulr\_sat}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: +#. If :math:`{\mathit{vbinop\_u{\kern-0.1em\scriptstyle 0}}}` is and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: a. Let :math:`{\mathsf{i}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{{{{\mathrm{iq{\kern-0.1em\scriptstyle 15\kern-0.1em}mulr\_sat}}}_{N}^{\mathsf{s}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})}`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{{{{\mathrm{iq{\kern-0.1em\scriptstyle 15\kern-0.1em}mulr\_sat}}}_{N}^{\mathsf{s}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)}^\ast})}`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17465,13 +17465,13 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fadd}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -17479,13 +17479,13 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fsub}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -17493,13 +17493,13 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fmul}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -17507,13 +17507,13 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fdiv}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -17521,13 +17521,13 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fmin}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -17535,13 +17535,13 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fmax}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -17549,13 +17549,13 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fpmin}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. - #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. + #. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. @@ -17565,32 +17565,32 @@ watsup 0.4 generator #. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. -#. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. +#. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. -#. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. +#. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{{\mathit{lane}}^\ast}^\ast}` be :math:`\Large\times~{{{\mathrm{fpmax}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2)^\ast}`. -#. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. +#. Let :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}` be :math:`{{{{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}^\ast}`. #. Return :math:`{{\mathit{v{\kern-0.1em\scriptstyle 128}}}^\ast}`. -:math:`{{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{{{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)}` -...................................................................................................................................................................................................................................... +:math:`{{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{({{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1, {\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)}` +........................................................................................................................................................................................................................................ 1. If :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{eq}` and the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}` is Jnn, then: a. Let :math:`{\mathsf{i}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{\mathit{lane}}^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{ieq}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17598,13 +17598,13 @@ watsup 0.4 generator a. Let :math:`{\mathsf{i}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{{\mathit{lane}}^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{ine}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17616,13 +17616,13 @@ watsup 0.4 generator 1) Let :math:`({\mathsf{lt}}{\mathsf{\_}}{{\mathit{sx}}})` be :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}`. - #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #) Let :math:`{{\mathit{lane}}^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{{{\mathrm{ilt}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)})}^\ast}`. - #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17630,13 +17630,13 @@ watsup 0.4 generator 1) Let :math:`({\mathsf{gt}}{\mathsf{\_}}{{\mathit{sx}}})` be :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}`. - #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #) Let :math:`{{\mathit{lane}}^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{{{\mathrm{igt}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)})}^\ast}`. - #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17644,13 +17644,13 @@ watsup 0.4 generator 1) Let :math:`({\mathsf{le}}{\mathsf{\_}}{{\mathit{sx}}})` be :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}`. - #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #) Let :math:`{{\mathit{lane}}^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{{{\mathrm{ile}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)})}^\ast}`. - #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17658,13 +17658,13 @@ watsup 0.4 generator 1) Let :math:`({\mathsf{ge}}{\mathsf{\_}}{{\mathit{sx}}})` be :math:`{\mathit{vrelop\_u{\kern-0.1em\scriptstyle 0}}}`. - #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #) Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #) Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #) Let :math:`{{\mathit{lane}}^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{{{\mathrm{ige}}}_{N}^{{\mathit{sx}}}}}{({\mathit{lane}}_1, {\mathit{lane}}_2)})}^\ast}`. - #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17672,9 +17672,9 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. If the type of :math:`{\mathit{fresh}}` for which :math:`{|{\mathit{fresh}}|}` :math:`=` :math:`{|{\mathsf{f}}{N}|}` is Inn, then: @@ -17682,7 +17682,7 @@ watsup 0.4 generator #) Let :math:`{{\mathit{lane}}^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{feq}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. - #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. + #) Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. #) Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17690,15 +17690,15 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{\mathsf{i}}{N}` be the result for which :math:`{|{\mathsf{i}}{N}|}` :math:`=` :math:`{|{\mathsf{f}}{N}|}`. #. Let :math:`{{\mathit{lane}}^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{fne}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17706,15 +17706,15 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{\mathsf{i}}{N}` be the result for which :math:`{|{\mathsf{i}}{N}|}` :math:`=` :math:`{|{\mathsf{f}}{N}|}`. #. Let :math:`{{\mathit{lane}}^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{flt}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17722,15 +17722,15 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{\mathsf{i}}{N}` be the result for which :math:`{|{\mathsf{i}}{N}|}` :math:`=` :math:`{|{\mathsf{f}}{N}|}`. #. Let :math:`{{\mathit{lane}}^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{fgt}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17738,15 +17738,15 @@ watsup 0.4 generator a. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. - #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. + #. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. - #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. + #. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{\mathsf{i}}{N}` be the result for which :math:`{|{\mathsf{i}}{N}|}` :math:`=` :math:`{|{\mathsf{f}}{N}|}`. #. Let :math:`{{\mathit{lane}}^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{fle}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. - #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. + #. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. @@ -17756,21 +17756,21 @@ watsup 0.4 generator #. Let :math:`{\mathsf{f}}{N}` be :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 1}}}`. -#. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. +#. Let :math:`{{\mathit{lane}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_1)`. -#. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{f}}{N}}{\mathsf{x}}{M}}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. +#. Let :math:`{{\mathit{lane}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{f}}{N}}{\mathsf{x}}{M})}({\mathit{v{\kern-0.1em\scriptstyle 128}}}_2)`. #. Let :math:`{\mathsf{i}}{N}` be the result for which :math:`{|{\mathsf{i}}{N}|}` :math:`=` :math:`{|{\mathsf{f}}{N}|}`. #. Let :math:`{{\mathit{lane}}^\ast}` be :math:`{{{{{\mathrm{extend}}}_{1, N}^{\mathsf{s}}}}{({{\mathrm{fge}}}_{N}({\mathit{lane}}_1, {\mathit{lane}}_2))}^\ast}`. -#. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. +#. Let :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{\mathit{lane}}^\ast})}`. #. Return :math:`{\mathit{v{\kern-0.1em\scriptstyle 128}}}`. -:math:`{{\mathrm{vcvtop}}}_{{{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 3}}}}{\mathsf{x}}{M_1}, {{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}{\mathsf{x}}{M_2}}({\mathit{vcvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}, {\mathit{lane\_u{\kern-0.1em\scriptstyle 5}}})` -...................................................................................................................................................................................................................................................................................................... +:math:`{{\mathrm{vcvtop}}}_{({{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 3}}}}{\mathsf{x}}{M_1}), ({{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}{\mathsf{x}}{M_2})}({\mathit{vcvtop}}_{\mathit{u{\kern-0.1em\scriptstyle 2}}}, {\mathit{lane\_u{\kern-0.1em\scriptstyle 5}}})` +.......................................................................................................................................................................................................................................................................................................... 1. If the type of :math:`{\mathit{lanetype}}_{\mathit{u{\kern-0.1em\scriptstyle 3}}}` is Jnn, then: @@ -17858,50 +17858,50 @@ watsup 0.4 generator #. Return :math:`{{\mathit{fN}}_2^\ast}`. -:math:`{({\mathsf{extadd\_pairwise}}{\mathsf{\_}}{{\mathit{sx}}})}{{}_{{{{\mathsf{i}}{N}}_1}{\mathsf{x}}{M_1}, {{{\mathsf{i}}{N}}_2}{\mathsf{x}}{M_2}}(c_1)}` -............................................................................................................................................................. +:math:`{({\mathsf{extadd\_pairwise}}{\mathsf{\_}}{{\mathit{sx}}})}{{}_{({{{\mathsf{i}}{N}}_1}{\mathsf{x}}{M_1}), ({{{\mathsf{i}}{N}}_2}{\mathsf{x}}{M_2})}(c_1)}` +................................................................................................................................................................. -1. Let :math:`{{\mathit{ci}}^\ast}` be :math:`{{\mathrm{lanes}}}_{{{{\mathsf{i}}{N}}_1}{\mathsf{x}}{M_1}}(c_1)`. +1. Let :math:`{{\mathit{ci}}^\ast}` be :math:`{{\mathrm{lanes}}}_{({{{\mathsf{i}}{N}}_1}{\mathsf{x}}{M_1})}(c_1)`. #. Let :math:`{{\mathit{cj}}_1~{\mathit{cj}}_2^\ast}` be the result for which :math:`{\bigoplus}\, {{\mathit{cj}}_1~{\mathit{cj}}_2^\ast}` :math:`=` :math:`{{{{{\mathrm{extend}}}_{N_1, N_2}^{{\mathit{sx}}}}}{({\mathit{ci}})}^\ast}`. -#. Let :math:`c` be :math:`{{{{\mathrm{lanes}}}_{{{{\mathsf{i}}{N}}_2}{\mathsf{x}}{M_2}}^{{-1}}}}{({{{\mathrm{iadd}}}_{N_2}({\mathit{cj}}_1, {\mathit{cj}}_2)^\ast})}`. +#. Let :math:`c` be :math:`{{{{\mathrm{lanes}}}_{({{{\mathsf{i}}{N}}_2}{\mathsf{x}}{M_2})}^{{-1}}}}{({{{\mathrm{iadd}}}_{N_2}({\mathit{cj}}_1, {\mathit{cj}}_2)^\ast})}`. #. Return :math:`c`. -:math:`{{\mathit{vextbinop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}{{}_{{{{\mathsf{i}}{N}}_1}{\mathsf{x}}{M_1}, {{{\mathsf{i}}{N}}_2}{\mathsf{x}}{M_2}}(c_1, c_2)}` -..................................................................................................................................................................... +:math:`{{\mathit{vextbinop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}}{{}_{({{{\mathsf{i}}{N}}_1}{\mathsf{x}}{M_1}), ({{{\mathsf{i}}{N}}_2}{\mathsf{x}}{M_2})}(c_1, c_2)}` +......................................................................................................................................................................... 1. If :math:`{\mathit{vextbinop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is of the case :math:`\mathsf{extmul}`, then: a. Let :math:`({\mathsf{extmul}}{\mathsf{\_}}{{\mathit{sx}}}{\mathsf{\_}}{{\mathit{half}}})` be :math:`{\mathit{vextbinop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. - #. Let :math:`{{\mathit{ci}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{{\mathsf{i}}{N}}_1}{\mathsf{x}}{M_1}}(c_1){}[{\mathrm{half}}({\mathit{half}}, 0, M_2) : M_2]`. + #. Let :math:`{{\mathit{ci}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{{\mathsf{i}}{N}}_1}{\mathsf{x}}{M_1})}(c_1){}[{\mathrm{half}}({\mathit{half}}, 0, M_2) : M_2]`. - #. Let :math:`{{\mathit{ci}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{{\mathsf{i}}{N}}_1}{\mathsf{x}}{M_1}}(c_2){}[{\mathrm{half}}({\mathit{half}}, 0, M_2) : M_2]`. + #. Let :math:`{{\mathit{ci}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{{\mathsf{i}}{N}}_1}{\mathsf{x}}{M_1})}(c_2){}[{\mathrm{half}}({\mathit{half}}, 0, M_2) : M_2]`. - #. Let :math:`c` be :math:`{{{{\mathrm{lanes}}}_{{{{\mathsf{i}}{N}}_2}{\mathsf{x}}{M_2}}^{{-1}}}}{({{{\mathrm{imul}}}_{N_2}({{{{\mathrm{extend}}}_{N_1, N_2}^{{\mathit{sx}}}}}{({\mathit{ci}}_1)}, {{{{\mathrm{extend}}}_{N_1, N_2}^{{\mathit{sx}}}}}{({\mathit{ci}}_2)})^\ast})}`. + #. Let :math:`c` be :math:`{{{{\mathrm{lanes}}}_{({{{\mathsf{i}}{N}}_2}{\mathsf{x}}{M_2})}^{{-1}}}}{({{{\mathrm{imul}}}_{N_2}({{{{\mathrm{extend}}}_{N_1, N_2}^{{\mathit{sx}}}}}{({\mathit{ci}}_1)}, {{{{\mathrm{extend}}}_{N_1, N_2}^{{\mathit{sx}}}}}{({\mathit{ci}}_2)})^\ast})}`. #. Return :math:`c`. -#. Assert: Due to validation, :math:`{\mathit{vextbinop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{dot}`. +#. Assert: Due to validation, :math:`{\mathit{vextbinop}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}` is . -#. Let :math:`{{\mathit{ci}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{{\mathsf{i}}{N}}_1}{\mathsf{x}}{M_1}}(c_1)`. +#. Let :math:`{{\mathit{ci}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{{\mathsf{i}}{N}}_1}{\mathsf{x}}{M_1})}(c_1)`. -#. Let :math:`{{\mathit{ci}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{{{{\mathsf{i}}{N}}_1}{\mathsf{x}}{M_1}}(c_2)`. +#. Let :math:`{{\mathit{ci}}_2^\ast}` be :math:`{{\mathrm{lanes}}}_{({{{\mathsf{i}}{N}}_1}{\mathsf{x}}{M_1})}(c_2)`. #. Let :math:`{{\mathit{cj}}_1~{\mathit{cj}}_2^\ast}` be the result for which :math:`{\bigoplus}\, {{\mathit{cj}}_1~{\mathit{cj}}_2^\ast}` :math:`=` :math:`{{{\mathrm{imul}}}_{N_2}({{{{\mathrm{extend}}}_{N_1, N_2}^{\mathsf{s}}}}{({\mathit{ci}}_1)}, {{{{\mathrm{extend}}}_{N_1, N_2}^{\mathsf{s}}}}{({\mathit{ci}}_2)})^\ast}`. -#. Let :math:`c` be :math:`{{{{\mathrm{lanes}}}_{{{{\mathsf{i}}{N}}_2}{\mathsf{x}}{M_2}}^{{-1}}}}{({{{\mathrm{iadd}}}_{N_2}({\mathit{cj}}_1, {\mathit{cj}}_2)^\ast})}`. +#. Let :math:`c` be :math:`{{{{\mathrm{lanes}}}_{({{{\mathsf{i}}{N}}_2}{\mathsf{x}}{M_2})}^{{-1}}}}{({{{\mathrm{iadd}}}_{N_2}({\mathit{cj}}_1, {\mathit{cj}}_2)^\ast})}`. #. Return :math:`c`. -:math:`{{\mathit{vshiftop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}}{({\mathit{lane}}, n)}` -........................................................................................................................ +:math:`{{\mathit{vshiftop\_u{\kern-0.1em\scriptstyle 0}}}}{{}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}}{({\mathit{lane}}, n)}` +.......................................................................................................................... 1. If :math:`{\mathit{vshiftop\_u{\kern-0.1em\scriptstyle 0}}}` is :math:`\mathsf{shl}`, then: @@ -17959,11 +17959,11 @@ watsup 0.4 generator #. Let :math:`(\mathsf{ref}~{{\mathsf{null}^?}}_0~{\mathit{ht}})` be :math:`{\mathit{valtype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. -#. If :math:`{{\mathsf{null}^?}}_0` is :math:`(\mathsf{null}~())`, then: +#. If :math:`{{\mathsf{null}^?}}_0` is :math:`(\mathsf{null}~()~{}^?)`, then: a. Return :math:`(\mathsf{ref{.}null}~{\mathit{ht}})`. -#. Assert: Due to validation, :math:`{{\mathsf{null}^?}}_0` is :math:`(\mathsf{null}~\epsilon)`. +#. Assert: Due to validation, :math:`{{\mathsf{null}^?}}_0` is :math:`(\mathsf{null}~\epsilon~{}^?)`. #. Return :math:`\epsilon`. @@ -18374,13 +18374,13 @@ watsup 0.4 generator ................................................. -1. Let :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~(\mathsf{page}~(i, j)),\; \mathsf{bytes}~{b^\ast} \}\end{array}` be :math:`{\mathit{meminst}}`. +1. Let :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~((i, j)~\mathsf{page}),\; \mathsf{bytes}~{b^\ast} \}\end{array}` be :math:`{\mathit{meminst}}`. #. If :math:`{|{b^\ast}|} / 64 \, {\mathrm{Ki}} + n` is less than or equal to :math:`j`, then: a. Let :math:`{i'}` be :math:`{|{b^\ast}|} / 64 \, {\mathrm{Ki}} + n`. - #. Let :math:`{\mathit{meminst}'}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~(\mathsf{page}~({i'}, j)),\; \mathsf{bytes}~{b^\ast}~{0^{n \cdot 64 \, {\mathrm{Ki}}}} \}\end{array}`. + #. Let :math:`{\mathit{meminst}'}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~(({i'}, j)~\mathsf{page}),\; \mathsf{bytes}~{b^\ast}~{0^{n \cdot 64 \, {\mathrm{Ki}}}} \}\end{array}`. #. Return :math:`{\mathit{meminst}'}`. @@ -18403,7 +18403,7 @@ watsup 0.4 generator #. Let :math:`{t^?}` be :math:`{\mathit{blocktype}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}`. -#. Return :math:`\epsilon \rightarrow {t^?}`. +#. Return :math:`(\epsilon~\rightarrow~{t^?})`. :math:`{{{\mathrm{alloctype}}^\ast}}{({{\mathit{type}}_{\mathit{u{\kern-0.1em\scriptstyle 0}}}^\ast})}` @@ -18547,11 +18547,11 @@ watsup 0.4 generator #. Return :math:`{\mathit{ta}}~{{\mathit{ta}'}^\ast}`. -:math:`{\mathrm{allocmem}}((\mathsf{page}~(i, j)))` +:math:`{\mathrm{allocmem}}(((i, j)~\mathsf{page}))` ................................................... -1. Let :math:`{\mathit{meminst}}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~(\mathsf{page}~(i, j)),\; \mathsf{bytes}~{0^{i \cdot 64 \, {\mathrm{Ki}}}} \}\end{array}`. +1. Let :math:`{\mathit{meminst}}` be :math:`\{ \begin{array}[t]{@{}l@{}}\mathsf{type}~((i, j)~\mathsf{page}),\; \mathsf{bytes}~{0^{i \cdot 64 \, {\mathrm{Ki}}}} \}\end{array}`. #. Let :math:`a` be :math:`{|s{.}\mathsf{mems}|}`. @@ -18839,7 +18839,7 @@ watsup 0.4 generator ................................................................................. -1. Let :math:`{{\mathit{xt}}_{\mathsf{i}}^\ast} \rightarrow {{\mathit{xt}}_{\mathsf{e}}^\ast}` be :math:`{\mathrm{Module}}_{\mathit{ok}}({\mathit{module}})`. +1. Let :math:`({{\mathit{xt}}_{\mathsf{i}}^\ast}~\rightarrow~{{\mathit{xt}}_{\mathsf{e}}^\ast})` be :math:`{\mathrm{Module}}_{\mathit{ok}}({\mathit{module}})`. #. Assert: Due to validation, :math:`{\mathit{module}}` is of the case :math:`\mathsf{module}`. @@ -18924,7 +18924,7 @@ watsup 0.4 generator #. Let :math:`(\mathsf{func}~{\mathit{functype}}_0)` be :math:`{\mathrm{expand}}(s{.}\mathsf{funcs}{}[{\mathit{funcaddr}}]{.}\mathsf{type})`. -#. Let :math:`{t_1^\ast} \rightarrow {t_2^\ast}` be :math:`{\mathit{functype}}_0`. +#. Let :math:`({t_1^\ast}~\rightarrow~{t_2^\ast})` be :math:`{\mathit{functype}}_0`. #. Assert: Due to validation, for all :math:`{(t_1, {\mathit{val}})^\ast}`, :math:`{\mathrm{Val}}_{\mathit{type}}({\mathit{val}})` is :math:`t_1`. @@ -19174,7 +19174,7 @@ watsup 0.4 generator 1. Execute the instruction :math:`(\mathsf{table{.}get}~x)`. -#. Execute the instruction :math:`(\mathsf{ref{.}cast}~(\mathsf{ref}~(\mathsf{null}~())~y))`. +#. Execute the instruction :math:`(\mathsf{ref{.}cast}~(\mathsf{ref}~(\mathsf{null}~()~{}^?)~y))`. #. Execute the instruction :math:`(\mathsf{call\_ref}~y)`. @@ -19185,7 +19185,7 @@ watsup 0.4 generator 1. Execute the instruction :math:`(\mathsf{table{.}get}~x)`. -#. Execute the instruction :math:`(\mathsf{ref{.}cast}~(\mathsf{ref}~(\mathsf{null}~())~y))`. +#. Execute the instruction :math:`(\mathsf{ref{.}cast}~(\mathsf{ref}~(\mathsf{null}~()~{}^?)~y))`. #. Execute the instruction :math:`(\mathsf{return\_call\_ref}~y)`. @@ -19588,7 +19588,7 @@ watsup 0.4 generator #. Pop the value :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c)` from the stack. -#. Let :math:`{{\mathit{ci}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}(c)`. +#. Let :math:`{{\mathit{ci}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}(c)`. #. If for all :math:`{({\mathit{ci}}_1)^\ast}`, :math:`{\mathit{ci}}_1` is not :math:`0`, then: @@ -19628,9 +19628,9 @@ watsup 0.4 generator #. Pop the value :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c_1)` from the stack. -#. Let :math:`{{c'}^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}(c_1)`. +#. Let :math:`{{c'}^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}(c_1)`. -#. Let :math:`c` be :math:`{{{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}^{{-1}}}}{({{{\mathit{vshiftop}}}{{}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}}{({c'}, n)}^\ast})}`. +#. Let :math:`c` be :math:`{{{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}^{{-1}}}}{({{{\mathit{vshiftop}}}{{}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}}{({c'}, n)}^\ast})}`. #. Push the value :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c)` to the stack. @@ -19643,7 +19643,7 @@ watsup 0.4 generator #. Pop the value :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c)` from the stack. -#. Let :math:`{{\mathit{ci}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}(c)`. +#. Let :math:`{{\mathit{ci}}_1^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}(c)`. #. Let :math:`{\mathit{ci}}` be the result for which :math:`{{\mathrm{bits}}}_{{\mathsf{i}}{32}}({\mathit{ci}})` :math:`=` :math:`{{{{{\mathrm{ilt}}}_{{|{\mathsf{i}}{N}|}}^{\mathsf{s}}}}{({\mathit{ci}}_1, 0)}^\ast}`. @@ -19662,15 +19662,15 @@ watsup 0.4 generator #. Pop the value :math:`(\mathsf{v{\scriptstyle 128}}{.}\mathsf{const}~c_1)` from the stack. -#. Let :math:`{{c'}^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}(c_1)~{0^{256 - M}}`. +#. Let :math:`{{c'}^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}(c_1)~{0^{256 - M}}`. -#. Let :math:`{{\mathit{ci}}^\ast}` be :math:`{{\mathrm{lanes}}}_{{{\mathsf{i}}{N}}{\mathsf{x}}{M}}(c_2)`. +#. Let :math:`{{\mathit{ci}}^\ast}` be :math:`{{\mathrm{lanes}}}_{({{\mathsf{i}}{N}}{\mathsf{x}}{M})}(c_2)`. #. Assert: Due to validation, for all :math:`{(k)^{k_ x* ++ t_2*) is valid if and only if: +- the instruction type (t_1* ->_ x* t_2*) is valid if and only if: - |x*| is |lct*|. - For all x in x*, - |C.LOCALS| is greater than x. @@ -21693,7 +21693,7 @@ Storagetype_ok - the packed type packtype is valid. Fieldtype_ok -- the field type ((MUT ()?), storagetype) is valid if and only if: +- the field type ((MUT ()? ?), storagetype) is valid if and only if: - the storage type storagetype is valid. Functype_ok @@ -21801,7 +21801,7 @@ Heaptype_sub - heaptype_u1 is heaptype. Reftype_sub -- the reference type (REF (NULL _u0?) ht_1) matches the reference type (REF (NULL _u1?) ht_2) if and only if: +- the reference type (REF (NULL _u0? ?) ht_1) matches the reference type (REF (NULL _u1? ?) ht_2) if and only if: - Either: - _u0? is ?(). - _u1? is ?(). @@ -21844,7 +21844,7 @@ Storagetype_sub - the packed type packtype_1 matches the packed type packtype_2. Fieldtype_sub -- the field type ((MUT _u0?), zt_1) matches the field type ((MUT _u1?), zt_2) if and only if: +- the field type ((MUT _u0? ?), zt_1) matches the field type ((MUT _u1? ?), zt_2) if and only if: - Either: - _u0? is ?(). - _u1? is ?(). @@ -21884,7 +21884,7 @@ Comptype_sub - the function type ft_1 matches the function type ft_2. Subtype_ok -- the sub type (SUB (FINAL ()?) $idx(typeidx)* comptype) is valid with the oktypeidx (OK x_0) if and only if: +- the sub type (SUB (FINAL ()? ?) $idx(typeidx)* comptype) is valid with the oktypeidx (OK x_0) if and only if: - |x*| is |comptype'*|. - |x'**| is |comptype'*|. - For all x in x*, @@ -21893,20 +21893,20 @@ Subtype_ok - For all x in x*, - x is less than x_0. - For all comptype' in comptype'* and x in x* and x' in x'*, - - $unrolldt(C.TYPES[x]) is (SUB (FINAL ?()) $idx(x')* comptype'). + - $unrolldt(C.TYPES[x]) is (SUB (FINAL ?() ?) $idx(x')* comptype'). - the composite type comptype is valid. - For all comptype' in comptype'*, - the composite type comptype matches the composite type comptype'. Subtype_ok2 -- the sub type (SUB (FINAL ()?) typeuse* compttype) is valid with the oktypeidxnat (OK x i) if and only if: +- the sub type (SUB (FINAL ()? ?) typeuse* compttype) is valid with the oktypeidxnat (OK x i) if and only if: - |typeuse*| is |comptype'*|. - |typeuse'**| is |comptype'*|. - |typeuse*| is less than or equal to 1. - For all typeuse in typeuse*, - Yet: $before(typeuse, x, i) - For all comptype' in comptype'* and typeuse in typeuse* and typeuse' in typeuse'*, - - $unrollht(C, typeuse) is (SUB (FINAL ?()) typeuse'* comptype'). + - $unrollht(C, typeuse) is (SUB (FINAL ?() ?) typeuse'* comptype'). - the composite type comptype is valid. - For all comptype' in comptype'*, - the composite type comptype matches the composite type comptype'. @@ -21944,7 +21944,7 @@ Limits_ok - m is less than or equal to k. Globaltype_ok -- the global type ((MUT ()?), t) is valid if and only if: +- the global type ((MUT ()? ?), t) is valid if and only if: - the value type t is valid. Tabletype_ok @@ -21953,7 +21953,7 @@ Tabletype_ok - the reference type reftype is valid. Memtype_ok -- the memory type (PAGE limits) is valid if and only if: +- the memory type (limits PAGE) is valid if and only if: - the limits limits is valid with the nat (2 ^ 16). Externtype_ok @@ -21973,7 +21973,7 @@ Externtype_ok - the memory type memtype is valid. Instrtype_sub -- the instruction type (t_11* ->_ x_1* ++ t_12*) matches the instruction type (t_21* ->_ x_2* ++ t_22*) if and only if: +- the instruction type (t_11* ->_ x_1* t_12*) matches the instruction type (t_21* ->_ x_2* t_22*) if and only if: - |x*| is |t*|. - For all x in x*, - |C.LOCALS| is greater than x. @@ -21989,7 +21989,7 @@ Limits_sub - m_1 is less than or equal to m_2. Globaltype_sub -- the global type ((MUT _u0?), valtype_1) matches the global type ((MUT _u1?), valtype_2) if and only if: +- the global type ((MUT _u0? ?), valtype_1) matches the global type ((MUT _u1? ?), valtype_2) if and only if: - Either: - _u0? is ?(). - _u1? is ?(). @@ -22007,7 +22007,7 @@ Tabletype_sub - the reference type reftype_2 matches the reference type reftype_1. Memtype_sub -- the memory type (PAGE limits_1) matches the memory type (PAGE limits_2) if and only if: +- the memory type (limits_1 PAGE) matches the memory type (limits_2 PAGE) if and only if: - the limits limits_1 matches the limits limits_2. Externtype_sub @@ -22030,7 +22030,7 @@ Externtype_sub - the memory type memtype_1 matches the memory type memtype_2. Blocktype_ok -- the block type blocktype_u0 is valid with the instruction type (valtype_u1* ->_ [] ++ valtype_u2*) if and only if: +- the block type blocktype_u0 is valid with the instruction type (valtype_u1* ->_ [] valtype_u2*) if and only if: - Either: - blocktype_u0 is (_RESULT valtype?). - valtype_u1* is []. @@ -22045,70 +22045,70 @@ Blocktype_ok - $expanddt(C.TYPES[typeidx]) is (FUNC (t_1* -> t_2*)). Instr_ok/nop -- the instr NOP is valid with the instruction type ([] ->_ [] ++ []). +- the instr NOP is valid with the instruction type ([] ->_ [] []). Instr_ok/unreachable -- the instr UNREACHABLE is valid with the instruction type (t_1* ->_ [] ++ t_2*) if and only if: - - the instruction type (t_1* ->_ [] ++ t_2*) is valid. +- the instr UNREACHABLE is valid with the instruction type (t_1* ->_ [] t_2*) if and only if: + - the instruction type (t_1* ->_ [] t_2*) is valid. Instr_ok/drop -- the instr DROP is valid with the instruction type ([t] ->_ [] ++ []) if and only if: +- the instr DROP is valid with the instruction type ([t] ->_ [] []) if and only if: - the value type t is valid. Instr_ok/select -- the instr (SELECT ?([t])) is valid with the instruction type ([t, t, I32] ->_ [] ++ [t]) if and only if: +- the instr (SELECT() ?([t]) ?) is valid with the instruction type ([t, t, I32] ->_ [] [t]) if and only if: - the value type t is valid. Instr_ok/block -- the instr (BLOCK bt instr*) is valid with the instruction type (t_1* ->_ [] ++ t_2*) if and only if: - - the block type bt is valid with the instruction type (t_1* ->_ [] ++ t_2*). - - Under the context C with .LABELS prepended by [t_2*], the instr sequence instr* is valid with the instruction type (t_1* ->_ x* ++ t_2*). +- the instr (BLOCK bt instr*) is valid with the instruction type (t_1* ->_ [] t_2*) if and only if: + - the block type bt is valid with the instruction type (t_1* ->_ [] t_2*). + - Under the context C with .LABELS prepended by [t_2*], the instr sequence instr* is valid with the instruction type (t_1* ->_ x* t_2*). Instr_ok/loop -- the instr (LOOP bt instr*) is valid with the instruction type (t_1* ->_ [] ++ t_2*) if and only if: - - the block type bt is valid with the instruction type (t_1* ->_ [] ++ t_2*). - - Under the context C with .LABELS prepended by [t_1*], the instr sequence instr* is valid with the instruction type (t_1* ->_ x* ++ t_2*). +- the instr (LOOP bt instr*) is valid with the instruction type (t_1* ->_ [] t_2*) if and only if: + - the block type bt is valid with the instruction type (t_1* ->_ [] t_2*). + - Under the context C with .LABELS prepended by [t_1*], the instr sequence instr* is valid with the instruction type (t_1* ->_ x* t_2*). Instr_ok/if -- the instr (IF bt instr_1* instr_2*) is valid with the instruction type (t_1* ++ [I32] ->_ [] ++ t_2*) if and only if: - - the block type bt is valid with the instruction type (t_1* ->_ [] ++ t_2*). - - Under the context C with .LABELS prepended by [t_2*], the instr sequence instr_1* is valid with the instruction type (t_1* ->_ x_1* ++ t_2*). - - Under the context C with .LABELS prepended by [t_2*], the instr sequence instr_2* is valid with the instruction type (t_1* ->_ x_2* ++ t_2*). +- the instr (IF bt instr_1* ELSE instr_2*) is valid with the instruction type (t_1* ++ [I32] ->_ [] t_2*) if and only if: + - the block type bt is valid with the instruction type (t_1* ->_ [] t_2*). + - Under the context C with .LABELS prepended by [t_2*], the instr sequence instr_1* is valid with the instruction type (t_1* ->_ x_1* t_2*). + - Under the context C with .LABELS prepended by [t_2*], the instr sequence instr_2* is valid with the instruction type (t_1* ->_ x_2* t_2*). Instr_ok/br -- the instr (BR l) is valid with the instruction type (t_1* ++ t* ->_ [] ++ t_2*) if and only if: +- the instr (BR l) is valid with the instruction type (t_1* ++ t* ->_ [] t_2*) if and only if: - |C.LABELS| is greater than l. - C.LABELS[l] is t*. - - the instruction type (t_1* ->_ [] ++ t_2*) is valid. + - the instruction type (t_1* ->_ [] t_2*) is valid. Instr_ok/br_if -- the instr (BR_IF l) is valid with the instruction type (t* ++ [I32] ->_ [] ++ t*) if and only if: +- the instr (BR_IF l) is valid with the instruction type (t* ++ [I32] ->_ [] t*) if and only if: - |C.LABELS| is greater than l. - C.LABELS[l] is t*. Instr_ok/br_table -- the instr (BR_TABLE l* l') is valid with the instruction type (t_1* ++ t* ->_ [] ++ t_2*) if and only if: +- the instr (BR_TABLE l* l') is valid with the instruction type (t_1* ++ t* ->_ [] t_2*) if and only if: - For all l in l*, - |C.LABELS| is greater than l. - |C.LABELS| is greater than l'. - For all l in l*, - the value type sequence t* matches the result type C.LABELS[l]. - the value type sequence t* matches the result type C.LABELS[l']. - - the instruction type (t_1* ->_ [] ++ t_2*) is valid. + - the instruction type (t_1* ->_ [] t_2*) is valid. Instr_ok/br_on_null -- the instr (BR_ON_NULL l) is valid with the instruction type (t* ++ [(REF (NULL ?(())) ht)] ->_ [] ++ t* ++ [(REF (NULL ?()) ht)]) if and only if: +- the instr (BR_ON_NULL l) is valid with the instruction type (t* ++ [(REF (NULL ?(()) ?) ht)] ->_ [] t* ++ [(REF (NULL ?() ?) ht)]) if and only if: - |C.LABELS| is greater than l. - C.LABELS[l] is t*. - the heap type ht is valid. Instr_ok/br_on_non_null -- the instr (BR_ON_NON_NULL l) is valid with the instruction type (t* ++ [(REF (NULL ?(())) ht)] ->_ [] ++ t*) if and only if: +- the instr (BR_ON_NON_NULL l) is valid with the instruction type (t* ++ [(REF (NULL ?(()) ?) ht)] ->_ [] t*) if and only if: - |C.LABELS| is greater than l. - - C.LABELS[l] is t* ++ [(REF (NULL ?()) ht)]. + - C.LABELS[l] is t* ++ [(REF (NULL ?() ?) ht)]. Instr_ok/br_on_cast -- the instr (BR_ON_CAST l rt_1 rt_2) is valid with the instruction type (t* ++ [rt_1] ->_ [] ++ t* ++ [$diffrt(rt_1, rt_2)]) if and only if: +- the instr (BR_ON_CAST l rt_1 rt_2) is valid with the instruction type (t* ++ [rt_1] ->_ [] t* ++ [$diffrt(rt_1, rt_2)]) if and only if: - |C.LABELS| is greater than l. - C.LABELS[l] is t* ++ [rt]. - the reference type rt_1 is valid. @@ -22117,7 +22117,7 @@ Instr_ok/br_on_cast - the reference type rt_2 matches the reference type rt. Instr_ok/br_on_cast_fail -- the instr (BR_ON_CAST_FAIL l rt_1 rt_2) is valid with the instruction type (t* ++ [rt_1] ->_ [] ++ t* ++ [rt_2]) if and only if: +- the instr (BR_ON_CAST_FAIL l rt_1 rt_2) is valid with the instruction type (t* ++ [rt_1] ->_ [] t* ++ [rt_2]) if and only if: - |C.LABELS| is greater than l. - C.LABELS[l] is t* ++ [rt]. - the reference type rt_1 is valid. @@ -22126,121 +22126,121 @@ Instr_ok/br_on_cast_fail - the reference type $diffrt(rt_1, rt_2) matches the reference type rt. Instr_ok/call -- the instr (CALL x) is valid with the instruction type (t_1* ->_ [] ++ t_2*) if and only if: +- the instr (CALL x) is valid with the instruction type (t_1* ->_ [] t_2*) if and only if: - |C.FUNCS| is greater than x. - $expanddt(C.FUNCS[x]) is (FUNC (t_1* -> t_2*)). Instr_ok/call_ref -- the instr (CALL_REF $idx(x)) is valid with the instruction type (t_1* ++ [(REF (NULL ?(())) $idx(x))] ->_ [] ++ t_2*) if and only if: +- the instr (CALL_REF $idx(x)) is valid with the instruction type (t_1* ++ [(REF (NULL ?(()) ?) $idx(x))] ->_ [] t_2*) if and only if: - |C.TYPES| is greater than x. - $expanddt(C.TYPES[x]) is (FUNC (t_1* -> t_2*)). Instr_ok/call_indirect -- the instr (CALL_INDIRECT x $idx(y)) is valid with the instruction type (t_1* ++ [I32] ->_ [] ++ t_2*) if and only if: +- the instr (CALL_INDIRECT x $idx(y)) is valid with the instruction type (t_1* ++ [I32] ->_ [] t_2*) if and only if: - |C.TABLES| is greater than x. - |C.TYPES| is greater than y. - C.TABLES[x] is (lim, rt). - - the reference type rt matches the reference type (REF (NULL ?(())) FUNC). + - the reference type rt matches the reference type (REF (NULL ?(()) ?) FUNC). - $expanddt(C.TYPES[y]) is (FUNC (t_1* -> t_2*)). Instr_ok/return -- the instr RETURN is valid with the instruction type (t_1* ++ t* ->_ [] ++ t_2*) if and only if: +- the instr RETURN is valid with the instruction type (t_1* ++ t* ->_ [] t_2*) if and only if: - C.RETURN is ?(t*). - - the instruction type (t_1* ->_ [] ++ t_2*) is valid. + - the instruction type (t_1* ->_ [] t_2*) is valid. Instr_ok/return_call -- the instr (RETURN_CALL x) is valid with the instruction type (t_3* ++ t_1* ->_ [] ++ t_4*) if and only if: +- the instr (RETURN_CALL x) is valid with the instruction type (t_3* ++ t_1* ->_ [] t_4*) if and only if: - |C.FUNCS| is greater than x. - $expanddt(C.FUNCS[x]) is (FUNC (t_1* -> t_2*)). - C.RETURN is ?(t'_2*). - the value type sequence t_2* matches the value type sequence t'_2*. - - the instruction type (t_3* ->_ [] ++ t_4*) is valid. + - the instruction type (t_3* ->_ [] t_4*) is valid. Instr_ok/return_call_ref -- the instr (RETURN_CALL_REF $idx(x)) is valid with the instruction type (t_3* ++ t_1* ++ [(REF (NULL ?(())) $idx(x))] ->_ [] ++ t_4*) if and only if: +- the instr (RETURN_CALL_REF $idx(x)) is valid with the instruction type (t_3* ++ t_1* ++ [(REF (NULL ?(()) ?) $idx(x))] ->_ [] t_4*) if and only if: - |C.TYPES| is greater than x. - $expanddt(C.TYPES[x]) is (FUNC (t_1* -> t_2*)). - C.RETURN is ?(t'_2*). - the value type sequence t_2* matches the value type sequence t'_2*. - - the instruction type (t_3* ->_ [] ++ t_4*) is valid. + - the instruction type (t_3* ->_ [] t_4*) is valid. Instr_ok/return_call_indirect -- the instr (RETURN_CALL_INDIRECT x $idx(y)) is valid with the instruction type (t_3* ++ t_1* ++ [I32] ->_ [] ++ t_4*) if and only if: +- the instr (RETURN_CALL_INDIRECT x $idx(y)) is valid with the instruction type (t_3* ++ t_1* ++ [I32] ->_ [] t_4*) if and only if: - |C.TABLES| is greater than x. - |C.TYPES| is greater than y. - C.TABLES[x] is (lim, rt). - - the reference type rt matches the reference type (REF (NULL ?(())) FUNC). + - the reference type rt matches the reference type (REF (NULL ?(()) ?) FUNC). - $expanddt(C.TYPES[y]) is (FUNC (t_1* -> t_2*)). - C.RETURN is ?(t'_2*). - the value type sequence t_2* matches the value type sequence t'_2*. - - the instruction type (t_3* ->_ [] ++ t_4*) is valid. + - the instruction type (t_3* ->_ [] t_4*) is valid. Instr_ok/const -- the instr (nt.CONST c_nt) is valid with the instruction type ([] ->_ [] ++ [nt]). +- the instr (nt.CONST c_nt) is valid with the instruction type ([] ->_ [] [nt]). Instr_ok/unop -- the instr (UNOP nt unop_nt) is valid with the instruction type ([nt] ->_ [] ++ [nt]). +- the instr (UNOP nt unop_nt) is valid with the instruction type ([nt] ->_ [] [nt]). Instr_ok/binop -- the instr (BINOP nt binop_nt) is valid with the instruction type ([nt, nt] ->_ [] ++ [nt]). +- the instr (BINOP nt binop_nt) is valid with the instruction type ([nt, nt] ->_ [] [nt]). Instr_ok/testop -- the instr (TESTOP nt testop_nt) is valid with the instruction type ([nt] ->_ [] ++ [I32]). +- the instr (TESTOP nt testop_nt) is valid with the instruction type ([nt] ->_ [] [I32]). Instr_ok/relop -- the instr (RELOP nt relop_nt) is valid with the instruction type ([nt, nt] ->_ [] ++ [I32]). +- the instr (RELOP nt relop_nt) is valid with the instruction type ([nt, nt] ->_ [] [I32]). Instr_ok/cvtop -- the instr (CVTOP nt_1 nt_2 cvtop) is valid with the instruction type ([nt_2] ->_ [] ++ [nt_1]). +- the instr (CVTOP nt_1 nt_2 cvtop) is valid with the instruction type ([nt_2] ->_ [] [nt_1]). Instr_ok/ref.null -- the instr (REF.NULL ht) is valid with the instruction type ([] ->_ [] ++ [(REF (NULL ?(())) ht)]) if and only if: +- the instr (REF.NULL ht) is valid with the instruction type ([] ->_ [] [(REF (NULL ?(()) ?) ht)]) if and only if: - the heap type ht is valid. Instr_ok/ref.func -- the instr (REF.FUNC x) is valid with the instruction type ([] ->_ [] ++ [(REF (NULL ?()) dt)]) if and only if: +- the instr (REF.FUNC x) is valid with the instruction type ([] ->_ [] [(REF (NULL ?() ?) dt)]) if and only if: - |C.FUNCS| is greater than x. - |C.REFS| is greater than 0. - C.FUNCS[x] is dt. - x is contained in C.REFS. Instr_ok/ref.i31 -- the instr REF.I31 is valid with the instruction type ([I32] ->_ [] ++ [(REF (NULL ?()) I31)]). +- the instr REF.I31 is valid with the instruction type ([I32] ->_ [] [(REF (NULL ?() ?) I31)]). Instr_ok/ref.is_null -- the instr REF.IS_NULL is valid with the instruction type ([(REF (NULL ?(())) ht)] ->_ [] ++ [I32]) if and only if: +- the instr REF.IS_NULL is valid with the instruction type ([(REF (NULL ?(()) ?) ht)] ->_ [] [I32]) if and only if: - the heap type ht is valid. Instr_ok/ref.as_non_null -- the instr REF.AS_NON_NULL is valid with the instruction type ([(REF (NULL ?(())) ht)] ->_ [] ++ [(REF (NULL ?()) ht)]) if and only if: +- the instr REF.AS_NON_NULL is valid with the instruction type ([(REF (NULL ?(()) ?) ht)] ->_ [] [(REF (NULL ?() ?) ht)]) if and only if: - the heap type ht is valid. Instr_ok/ref.eq -- the instr REF.EQ is valid with the instruction type ([(REF (NULL ?(())) EQ), (REF (NULL ?(())) EQ)] ->_ [] ++ [I32]). +- the instr REF.EQ is valid with the instruction type ([(REF (NULL ?(()) ?) EQ), (REF (NULL ?(()) ?) EQ)] ->_ [] [I32]). Instr_ok/ref.test -- the instr (REF.TEST rt) is valid with the instruction type ([rt'] ->_ [] ++ [I32]) if and only if: +- the instr (REF.TEST rt) is valid with the instruction type ([rt'] ->_ [] [I32]) if and only if: - the reference type rt is valid. - the reference type rt' is valid. - the reference type rt matches the reference type rt'. Instr_ok/ref.cast -- the instr (REF.CAST rt) is valid with the instruction type ([rt'] ->_ [] ++ [rt]) if and only if: +- the instr (REF.CAST rt) is valid with the instruction type ([rt'] ->_ [] [rt]) if and only if: - the reference type rt is valid. - the reference type rt' is valid. - the reference type rt matches the reference type rt'. Instr_ok/i31.get -- the instr (I31.GET sx) is valid with the instruction type ([(REF (NULL ?(())) I31)] ->_ [] ++ [I32]). +- the instr (I31.GET sx) is valid with the instruction type ([(REF (NULL ?(()) ?) I31)] ->_ [] [I32]). Instr_ok/struct.new -- the instr (STRUCT.NEW x) is valid with the instruction type ($unpack(zt)* ->_ [] ++ [(REF (NULL ?()) $idx(x))]) if and only if: +- the instr (STRUCT.NEW x) is valid with the instruction type ($unpack(zt)* ->_ [] [(REF (NULL ?() ?) $idx(x))]) if and only if: - |C.TYPES| is greater than x. - |zt*| is |mut*|. - $expanddt(C.TYPES[x]) is (STRUCT (mut, zt)*). Instr_ok/struct.new_default -- the instr (STRUCT.NEW_DEFAULT x) is valid with the instruction type ([] ->_ [] ++ [(REF (NULL ?()) $idx(x))]) if and only if: +- the instr (STRUCT.NEW_DEFAULT x) is valid with the instruction type ([] ->_ [] [(REF (NULL ?() ?) $idx(x))]) if and only if: - |C.TYPES| is greater than x. - |zt*| is |mut*|. - |zt*| is |val*|. @@ -22249,7 +22249,7 @@ Instr_ok/struct.new_default - $default_($unpack(zt)) is ?(val). Instr_ok/struct.get -- the instr (STRUCT.GET sx? x i) is valid with the instruction type ([(REF (NULL ?(())) $idx(x))] ->_ [] ++ [$unpack(zt)]) if and only if: +- the instr (STRUCT.GET sx? x i) is valid with the instruction type ([(REF (NULL ?(()) ?) $idx(x))] ->_ [] [$unpack(zt)]) if and only if: - |C.TYPES| is greater than x. - |yt*| is greater than i. - $expanddt(C.TYPES[x]) is (STRUCT yt*). @@ -22257,37 +22257,37 @@ Instr_ok/struct.get - ((zt is $unpack(zt))) if and only if ((sx? is ?())). Instr_ok/struct.set -- the instr (STRUCT.SET x i) is valid with the instruction type ([(REF (NULL ?(())) $idx(x)), $unpack(zt)] ->_ [] ++ []) if and only if: +- the instr (STRUCT.SET x i) is valid with the instruction type ([(REF (NULL ?(()) ?) $idx(x)), $unpack(zt)] ->_ [] []) if and only if: - |C.TYPES| is greater than x. - |yt*| is greater than i. - $expanddt(C.TYPES[x]) is (STRUCT yt*). - - yt*[i] is ((MUT ?(())), zt). + - yt*[i] is ((MUT ?(()) ?), zt). Instr_ok/array.new -- the instr (ARRAY.NEW x) is valid with the instruction type ([$unpack(zt), I32] ->_ [] ++ [(REF (NULL ?()) $idx(x))]) if and only if: +- the instr (ARRAY.NEW x) is valid with the instruction type ([$unpack(zt), I32] ->_ [] [(REF (NULL ?() ?) $idx(x))]) if and only if: - |C.TYPES| is greater than x. - $expanddt(C.TYPES[x]) is (ARRAY (mut, zt)). Instr_ok/array.new_default -- the instr (ARRAY.NEW_DEFAULT x) is valid with the instruction type ([I32] ->_ [] ++ [(REF (NULL ?()) $idx(x))]) if and only if: +- the instr (ARRAY.NEW_DEFAULT x) is valid with the instruction type ([I32] ->_ [] [(REF (NULL ?() ?) $idx(x))]) if and only if: - |C.TYPES| is greater than x. - $expanddt(C.TYPES[x]) is (ARRAY (mut, zt)). - $default_($unpack(zt)) is ?(val). Instr_ok/array.new_fixed -- the instr (ARRAY.NEW_FIXED x n) is valid with the instruction type ($unpack(zt)^n ->_ [] ++ [(REF (NULL ?()) $idx(x))]) if and only if: +- the instr (ARRAY.NEW_FIXED x n) is valid with the instruction type ($unpack(zt)^n ->_ [] [(REF (NULL ?() ?) $idx(x))]) if and only if: - |C.TYPES| is greater than x. - $expanddt(C.TYPES[x]) is (ARRAY (mut, zt)). Instr_ok/array.new_elem -- the instr (ARRAY.NEW_ELEM x y) is valid with the instruction type ([I32, I32] ->_ [] ++ [(REF (NULL ?()) $idx(x))]) if and only if: +- the instr (ARRAY.NEW_ELEM x y) is valid with the instruction type ([I32, I32] ->_ [] [(REF (NULL ?() ?) $idx(x))]) if and only if: - |C.TYPES| is greater than x. - |C.ELEMS| is greater than y. - $expanddt(C.TYPES[x]) is (ARRAY (mut, rt)). - the reference type C.ELEMS[y] matches the reference type rt. Instr_ok/array.new_data -- the instr (ARRAY.NEW_DATA x y) is valid with the instruction type ([I32, I32] ->_ [] ++ [(REF (NULL ?()) $idx(x))]) if and only if: +- the instr (ARRAY.NEW_DATA x y) is valid with the instruction type ([I32, I32] ->_ [] [(REF (NULL ?() ?) $idx(x))]) if and only if: - |C.TYPES| is greater than x. - |C.DATAS| is greater than y. - $expanddt(C.TYPES[x]) is (ARRAY (mut, zt)). @@ -22295,171 +22295,171 @@ Instr_ok/array.new_data - C.DATAS[y] is OK. Instr_ok/array.get -- the instr (ARRAY.GET sx? x) is valid with the instruction type ([(REF (NULL ?(())) $idx(x)), I32] ->_ [] ++ [$unpack(zt)]) if and only if: +- the instr (ARRAY.GET sx? x) is valid with the instruction type ([(REF (NULL ?(()) ?) $idx(x)), I32] ->_ [] [$unpack(zt)]) if and only if: - |C.TYPES| is greater than x. - $expanddt(C.TYPES[x]) is (ARRAY (mut, zt)). - ((zt is $unpack(zt))) if and only if ((sx? is ?())). Instr_ok/array.set -- the instr (ARRAY.SET x) is valid with the instruction type ([(REF (NULL ?(())) $idx(x)), I32, $unpack(zt)] ->_ [] ++ []) if and only if: +- the instr (ARRAY.SET x) is valid with the instruction type ([(REF (NULL ?(()) ?) $idx(x)), I32, $unpack(zt)] ->_ [] []) if and only if: - |C.TYPES| is greater than x. - - $expanddt(C.TYPES[x]) is (ARRAY ((MUT ?(())), zt)). + - $expanddt(C.TYPES[x]) is (ARRAY ((MUT ?(()) ?), zt)). Instr_ok/array.len -- the instr ARRAY.LEN is valid with the instruction type ([(REF (NULL ?(())) ARRAY)] ->_ [] ++ [I32]) if and only if: +- the instr ARRAY.LEN is valid with the instruction type ([(REF (NULL ?(()) ?) ARRAY)] ->_ [] [I32]) if and only if: - |C.TYPES| is greater than x. - - $expanddt(C.TYPES[x]) is (ARRAY ((MUT ?(())), zt)). + - $expanddt(C.TYPES[x]) is (ARRAY ((MUT ?(()) ?), zt)). Instr_ok/array.fill -- the instr (ARRAY.FILL x) is valid with the instruction type ([(REF (NULL ?(())) $idx(x)), I32, $unpack(zt), I32] ->_ [] ++ []) if and only if: +- the instr (ARRAY.FILL x) is valid with the instruction type ([(REF (NULL ?(()) ?) $idx(x)), I32, $unpack(zt), I32] ->_ [] []) if and only if: - |C.TYPES| is greater than x. - - $expanddt(C.TYPES[x]) is (ARRAY ((MUT ?(())), zt)). + - $expanddt(C.TYPES[x]) is (ARRAY ((MUT ?(()) ?), zt)). Instr_ok/array.copy -- the instr (ARRAY.COPY x_1 x_2) is valid with the instruction type ([(REF (NULL ?(())) $idx(x_1)), I32, (REF (NULL ?(())) $idx(x_2)), I32, I32] ->_ [] ++ []) if and only if: +- the instr (ARRAY.COPY x_1 x_2) is valid with the instruction type ([(REF (NULL ?(()) ?) $idx(x_1)), I32, (REF (NULL ?(()) ?) $idx(x_2)), I32, I32] ->_ [] []) if and only if: - |C.TYPES| is greater than x_1. - |C.TYPES| is greater than x_2. - - $expanddt(C.TYPES[x_1]) is (ARRAY ((MUT ?(())), zt_1)). + - $expanddt(C.TYPES[x_1]) is (ARRAY ((MUT ?(()) ?), zt_1)). - $expanddt(C.TYPES[x_2]) is (ARRAY (mut, zt_2)). - the storage type zt_2 matches the storage type zt_1. Instr_ok/array.init_elem -- the instr (ARRAY.INIT_ELEM x y) is valid with the instruction type ([(REF (NULL ?(())) $idx(x)), I32, I32, I32] ->_ [] ++ []) if and only if: +- the instr (ARRAY.INIT_ELEM x y) is valid with the instruction type ([(REF (NULL ?(()) ?) $idx(x)), I32, I32, I32] ->_ [] []) if and only if: - |C.TYPES| is greater than x. - |C.ELEMS| is greater than y. - - $expanddt(C.TYPES[x]) is (ARRAY ((MUT ?(())), zt)). + - $expanddt(C.TYPES[x]) is (ARRAY ((MUT ?(()) ?), zt)). - the element type C.ELEMS[y] matches the storage type zt. Instr_ok/array.init_data -- the instr (ARRAY.INIT_DATA x y) is valid with the instruction type ([(REF (NULL ?(())) $idx(x)), I32, I32, I32] ->_ [] ++ []) if and only if: +- the instr (ARRAY.INIT_DATA x y) is valid with the instruction type ([(REF (NULL ?(()) ?) $idx(x)), I32, I32, I32] ->_ [] []) if and only if: - |C.TYPES| is greater than x. - |C.DATAS| is greater than y. - - $expanddt(C.TYPES[x]) is (ARRAY ((MUT ?(())), zt)). + - $expanddt(C.TYPES[x]) is (ARRAY ((MUT ?(()) ?), zt)). - Yet: (($unpack(zt) = (numtype : numtype <: valtype)) \/ ($unpack(zt) = (vectype : vectype <: valtype))) - C.DATAS[y] is OK. Instr_ok/extern.convert_any -- the instr EXTERN.CONVERT_ANY is valid with the instruction type ([(REF nul ANY)] ->_ [] ++ [(REF nul EXTERN)]). +- the instr EXTERN.CONVERT_ANY is valid with the instruction type ([(REF nul ANY)] ->_ [] [(REF nul EXTERN)]). Instr_ok/any.convert_extern -- the instr ANY.CONVERT_EXTERN is valid with the instruction type ([(REF nul EXTERN)] ->_ [] ++ [(REF nul ANY)]). +- the instr ANY.CONVERT_EXTERN is valid with the instruction type ([(REF nul EXTERN)] ->_ [] [(REF nul ANY)]). Instr_ok/vconst -- the instr (V128.CONST c) is valid with the instruction type ([] ->_ [] ++ [V128]). +- the instr (V128.CONST c) is valid with the instruction type ([] ->_ [] [V128]). Instr_ok/vvunop -- the instr (VVUNOP V128 vvunop) is valid with the instruction type ([V128] ->_ [] ++ [V128]). +- the instr (VVUNOP V128 vvunop) is valid with the instruction type ([V128] ->_ [] [V128]). Instr_ok/vvbinop -- the instr (VVBINOP V128 vvbinop) is valid with the instruction type ([V128, V128] ->_ [] ++ [V128]). +- the instr (VVBINOP V128 vvbinop) is valid with the instruction type ([V128, V128] ->_ [] [V128]). Instr_ok/vvternop -- the instr (VVTERNOP V128 vvternop) is valid with the instruction type ([V128, V128, V128] ->_ [] ++ [V128]). +- the instr (VVTERNOP V128 vvternop) is valid with the instruction type ([V128, V128, V128] ->_ [] [V128]). Instr_ok/vvtestop -- the instr (VVTESTOP V128 vvtestop) is valid with the instruction type ([V128] ->_ [] ++ [I32]). +- the instr (VVTESTOP V128 vvtestop) is valid with the instruction type ([V128] ->_ [] [I32]). Instr_ok/vunop -- the instr (VUNOP sh vunop) is valid with the instruction type ([V128] ->_ [] ++ [V128]). +- the instr (VUNOP sh vunop) is valid with the instruction type ([V128] ->_ [] [V128]). Instr_ok/vbinop -- the instr (VBINOP sh vbinop) is valid with the instruction type ([V128, V128] ->_ [] ++ [V128]). +- the instr (VBINOP sh vbinop) is valid with the instruction type ([V128, V128] ->_ [] [V128]). Instr_ok/vtestop -- the instr (VTESTOP sh vtestop) is valid with the instruction type ([V128] ->_ [] ++ [I32]). +- the instr (VTESTOP sh vtestop) is valid with the instruction type ([V128] ->_ [] [I32]). Instr_ok/vrelop -- the instr (VRELOP sh vrelop) is valid with the instruction type ([V128, V128] ->_ [] ++ [V128]). +- the instr (VRELOP sh vrelop) is valid with the instruction type ([V128, V128] ->_ [] [V128]). Instr_ok/vshiftop -- the instr (VSHIFTOP sh vshiftop) is valid with the instruction type ([V128, I32] ->_ [] ++ [V128]). +- the instr (VSHIFTOP sh vshiftop) is valid with the instruction type ([V128, I32] ->_ [] [V128]). Instr_ok/vbitmask -- the instr (VBITMASK sh) is valid with the instruction type ([V128] ->_ [] ++ [I32]). +- the instr (VBITMASK sh) is valid with the instruction type ([V128] ->_ [] [I32]). Instr_ok/vswizzle -- the instr (VSWIZZLE sh) is valid with the instruction type ([V128, V128] ->_ [] ++ [V128]). +- the instr (VSWIZZLE sh) is valid with the instruction type ([V128, V128] ->_ [] [V128]). Instr_ok/vshuffle -- the instr (VSHUFFLE sh i*) is valid with the instruction type ([V128, V128] ->_ [] ++ [V128]) if and only if: +- the instr (VSHUFFLE sh i*) is valid with the instruction type ([V128, V128] ->_ [] [V128]) if and only if: - For all i in i*, - i is less than (2 · $dim(sh)). Instr_ok/vsplat -- the instr (VSPLAT sh) is valid with the instruction type ([$unpackshape(sh)] ->_ [] ++ [V128]). +- the instr (VSPLAT sh) is valid with the instruction type ([$unpackshape(sh)] ->_ [] [V128]). Instr_ok/vextract_lane -- the instr (VEXTRACT_LANE sh sx? i) is valid with the instruction type ([V128] ->_ [] ++ [$unpackshape(sh)]) if and only if: +- the instr (VEXTRACT_LANE sh sx? i) is valid with the instruction type ([V128] ->_ [] [$unpackshape(sh)]) if and only if: - i is less than $dim(sh). Instr_ok/vreplace_lane -- the instr (VREPLACE_LANE sh i) is valid with the instruction type ([V128, $unpackshape(sh)] ->_ [] ++ [V128]) if and only if: +- the instr (VREPLACE_LANE sh i) is valid with the instruction type ([V128, $unpackshape(sh)] ->_ [] [V128]) if and only if: - i is less than $dim(sh). Instr_ok/vextunop -- the instr (VEXTUNOP sh_1 sh_2 vextunop) is valid with the instruction type ([V128] ->_ [] ++ [V128]). +- the instr (VEXTUNOP sh_1 sh_2 vextunop) is valid with the instruction type ([V128] ->_ [] [V128]). Instr_ok/vextbinop -- the instr (VEXTBINOP sh_1 sh_2 vextbinop) is valid with the instruction type ([V128, V128] ->_ [] ++ [V128]). +- the instr (VEXTBINOP sh_1 sh_2 vextbinop) is valid with the instruction type ([V128, V128] ->_ [] [V128]). Instr_ok/vnarrow -- the instr (VNARROW sh_1 sh_2 sx) is valid with the instruction type ([V128, V128] ->_ [] ++ [V128]). +- the instr (VNARROW sh_1 sh_2 sx) is valid with the instruction type ([V128, V128] ->_ [] [V128]). Instr_ok/vcvtop -- the instr (VCVTOP sh_1 sh_2 vcvtop half? zero?) is valid with the instruction type ([V128] ->_ [] ++ [V128]). +- the instr (VCVTOP sh_1 sh_2 vcvtop half? zero?) is valid with the instruction type ([V128] ->_ [] [V128]). Instr_ok/local.get -- the instr (LOCAL.GET x) is valid with the instruction type ([] ->_ [] ++ [t]) if and only if: +- the instr (LOCAL.GET x) is valid with the instruction type ([] ->_ [] [t]) if and only if: - |C.LOCALS| is greater than x. - C.LOCALS[x] is (SET, t). Instr_ok/local.set -- the instr (LOCAL.SET x) is valid with the instruction type ([t] ->_ [x] ++ []) if and only if: +- the instr (LOCAL.SET x) is valid with the instruction type ([t] ->_ [x] []) if and only if: - |C.LOCALS| is greater than x. - C.LOCALS[x] is (init, t). Instr_ok/local.tee -- the instr (LOCAL.TEE x) is valid with the instruction type ([t] ->_ [x] ++ [t]) if and only if: +- the instr (LOCAL.TEE x) is valid with the instruction type ([t] ->_ [x] [t]) if and only if: - |C.LOCALS| is greater than x. - C.LOCALS[x] is (init, t). Instr_ok/global.get -- the instr (GLOBAL.GET x) is valid with the instruction type ([] ->_ [] ++ [t]) if and only if: +- the instr (GLOBAL.GET x) is valid with the instruction type ([] ->_ [] [t]) if and only if: - |C.GLOBALS| is greater than x. - C.GLOBALS[x] is (mut, t). Instr_ok/global.set -- the instr (GLOBAL.SET x) is valid with the instruction type ([t] ->_ [] ++ []) if and only if: +- the instr (GLOBAL.SET x) is valid with the instruction type ([t] ->_ [] []) if and only if: - |C.GLOBALS| is greater than x. - - C.GLOBALS[x] is ((MUT ?(())), t). + - C.GLOBALS[x] is ((MUT ?(()) ?), t). Instr_ok/table.get -- the instr (TABLE.GET x) is valid with the instruction type ([I32] ->_ [] ++ [rt]) if and only if: +- the instr (TABLE.GET x) is valid with the instruction type ([I32] ->_ [] [rt]) if and only if: - |C.TABLES| is greater than x. - C.TABLES[x] is (lim, rt). Instr_ok/table.set -- the instr (TABLE.SET x) is valid with the instruction type ([I32, rt] ->_ [] ++ []) if and only if: +- the instr (TABLE.SET x) is valid with the instruction type ([I32, rt] ->_ [] []) if and only if: - |C.TABLES| is greater than x. - C.TABLES[x] is (lim, rt). Instr_ok/table.size -- the instr (TABLE.SIZE x) is valid with the instruction type ([] ->_ [] ++ [I32]) if and only if: +- the instr (TABLE.SIZE x) is valid with the instruction type ([] ->_ [] [I32]) if and only if: - |C.TABLES| is greater than x. - C.TABLES[x] is (lim, rt). Instr_ok/table.grow -- the instr (TABLE.GROW x) is valid with the instruction type ([rt, I32] ->_ [] ++ [I32]) if and only if: +- the instr (TABLE.GROW x) is valid with the instruction type ([rt, I32] ->_ [] [I32]) if and only if: - |C.TABLES| is greater than x. - C.TABLES[x] is (lim, rt). Instr_ok/table.fill -- the instr (TABLE.FILL x) is valid with the instruction type ([I32, rt, I32] ->_ [] ++ []) if and only if: +- the instr (TABLE.FILL x) is valid with the instruction type ([I32, rt, I32] ->_ [] []) if and only if: - |C.TABLES| is greater than x. - C.TABLES[x] is (lim, rt). Instr_ok/table.copy -- the instr (TABLE.COPY x_1 x_2) is valid with the instruction type ([I32, I32, I32] ->_ [] ++ []) if and only if: +- the instr (TABLE.COPY x_1 x_2) is valid with the instruction type ([I32, I32, I32] ->_ [] []) if and only if: - |C.TABLES| is greater than x_1. - |C.TABLES| is greater than x_2. - C.TABLES[x_1] is (lim_1, rt_1). @@ -22467,7 +22467,7 @@ Instr_ok/table.copy - the reference type rt_2 matches the reference type rt_1. Instr_ok/table.init -- the instr (TABLE.INIT x y) is valid with the instruction type ([I32, I32, I32] ->_ [] ++ []) if and only if: +- the instr (TABLE.INIT x y) is valid with the instruction type ([I32, I32, I32] ->_ [] []) if and only if: - |C.TABLES| is greater than x. - |C.ELEMS| is greater than y. - C.TABLES[x] is (lim, rt_1). @@ -22475,77 +22475,77 @@ Instr_ok/table.init - the reference type rt_2 matches the reference type rt_1. Instr_ok/elem.drop -- the instr (ELEM.DROP x) is valid with the instruction type ([] ->_ [] ++ []) if and only if: +- the instr (ELEM.DROP x) is valid with the instruction type ([] ->_ [] []) if and only if: - |C.ELEMS| is greater than x. - C.ELEMS[x] is rt. Instr_ok/memory.size -- the instr (MEMORY.SIZE x) is valid with the instruction type ([] ->_ [] ++ [I32]) if and only if: +- the instr (MEMORY.SIZE x) is valid with the instruction type ([] ->_ [] [I32]) if and only if: - |C.MEMS| is greater than x. - C.MEMS[x] is mt. Instr_ok/memory.grow -- the instr (MEMORY.GROW x) is valid with the instruction type ([I32] ->_ [] ++ [I32]) if and only if: +- the instr (MEMORY.GROW x) is valid with the instruction type ([I32] ->_ [] [I32]) if and only if: - |C.MEMS| is greater than x. - C.MEMS[x] is mt. Instr_ok/memory.fill -- the instr (MEMORY.FILL x) is valid with the instruction type ([I32, I32, I32] ->_ [] ++ []) if and only if: +- the instr (MEMORY.FILL x) is valid with the instruction type ([I32, I32, I32] ->_ [] []) if and only if: - |C.MEMS| is greater than x. - C.MEMS[x] is mt. Instr_ok/memory.copy -- the instr (MEMORY.COPY x_1 x_2) is valid with the instruction type ([I32, I32, I32] ->_ [] ++ []) if and only if: +- the instr (MEMORY.COPY x_1 x_2) is valid with the instruction type ([I32, I32, I32] ->_ [] []) if and only if: - |C.MEMS| is greater than x_1. - |C.MEMS| is greater than x_2. - C.MEMS[x_1] is mt_1. - C.MEMS[x_2] is mt_2. Instr_ok/memory.init -- the instr (MEMORY.INIT x y) is valid with the instruction type ([I32, I32, I32] ->_ [] ++ []) if and only if: +- the instr (MEMORY.INIT x y) is valid with the instruction type ([I32, I32, I32] ->_ [] []) if and only if: - |C.MEMS| is greater than x. - |C.DATAS| is greater than y. - C.MEMS[x] is mt. - C.DATAS[y] is OK. Instr_ok/data.drop -- the instr (DATA.DROP x) is valid with the instruction type ([] ->_ [] ++ []) if and only if: +- the instr (DATA.DROP x) is valid with the instruction type ([] ->_ [] []) if and only if: - |C.DATAS| is greater than x. - C.DATAS[x] is OK. Instr_ok/load -- the instr (LOAD nt ?() x memarg) is valid with the instruction type ([I32] ->_ [] ++ [nt]) if and only if: +- the instr (LOAD nt ?() x memarg) is valid with the instruction type ([I32] ->_ [] [nt]) if and only if: - |C.MEMS| is greater than x. - C.MEMS[x] is mt. - (2 ^ memarg.ALIGN) is less than or equal to ($size(nt) / 8). Instr_ok/store -- the instr (STORE nt ?() x memarg) is valid with the instruction type ([I32, nt] ->_ [] ++ []) if and only if: +- the instr (STORE nt ?() x memarg) is valid with the instruction type ([I32, nt] ->_ [] []) if and only if: - |C.MEMS| is greater than x. - C.MEMS[x] is mt. - (2 ^ memarg.ALIGN) is less than or equal to ($size(nt) / 8). Instr_ok/vload -- the instr (VLOAD V128 ?() x memarg) is valid with the instruction type ([I32] ->_ [] ++ [V128]) if and only if: +- the instr (VLOAD V128 ?() x memarg) is valid with the instruction type ([I32] ->_ [] [V128]) if and only if: - |C.MEMS| is greater than x. - C.MEMS[x] is mt. - (2 ^ memarg.ALIGN) is less than or equal to ($vsize(V128) / 8). Instr_ok/vload_lane -- the instr (VLOAD_LANE V128 N x memarg i) is valid with the instruction type ([I32, V128] ->_ [] ++ [V128]) if and only if: +- the instr (VLOAD_LANE V128 N x memarg i) is valid with the instruction type ([I32, V128] ->_ [] [V128]) if and only if: - |C.MEMS| is greater than x. - C.MEMS[x] is mt. - (2 ^ memarg.ALIGN) is less than or equal to (N / 8). - i is less than (128 / N). Instr_ok/vstore -- the instr (VSTORE V128 x memarg) is valid with the instruction type ([I32, V128] ->_ [] ++ []) if and only if: +- the instr (VSTORE V128 x memarg) is valid with the instruction type ([I32, V128] ->_ [] []) if and only if: - |C.MEMS| is greater than x. - C.MEMS[x] is mt. - (2 ^ memarg.ALIGN) is less than or equal to ($vsize(V128) / 8). Instr_ok/vstore_lane -- the instr (VSTORE_LANE V128 N x memarg i) is valid with the instruction type ([I32, V128] ->_ [] ++ []) if and only if: +- the instr (VSTORE_LANE V128 N x memarg i) is valid with the instruction type ([I32, V128] ->_ [] []) if and only if: - |C.MEMS| is greater than x. - C.MEMS[x] is mt. - (2 ^ memarg.ALIGN) is less than or equal to (N / 8). @@ -22555,18 +22555,18 @@ Instrs_ok - the instr sequence instr_u0* is valid with the instruction type instrtype_u4 if and only if: - Either: - instr_u0* is []. - - instrtype_u4 is ([] ->_ [] ++ []). + - instrtype_u4 is ([] ->_ [] []). - Or: - instr_u0* is [instr_1] ++ instr_2*. - - instrtype_u4 is (t_1* ->_ x_1* ++ x_2* ++ t_3*). + - instrtype_u4 is (t_1* ->_ x_1* ++ x_2* t_3*). - |t*| is |init*|. - |x_1*| is |init*|. - For all x_1 in x_1*, - |C.LOCALS| is greater than x_1. - - the instr instr_1 is valid with the instruction type (t_1* ->_ x_1* ++ t_2*). + - the instr instr_1 is valid with the instruction type (t_1* ->_ x_1* t_2*). - For all init in init* and t in t* and x_1 in x_1*, - C.LOCALS[x_1] is (init, t). - - Under the context $with_locals(C, x_1*, (SET, t)*), the instr sequence instr_2* is valid with the instruction type (t_2* ->_ x_2* ++ t_3*). + - Under the context $with_locals(C, x_1*, (SET, t)*), the instr sequence instr_2* is valid with the instruction type (t_2* ->_ x_2* t_3*). - Or: - instr_u0* is instr*. - instrtype_u4 is it'. @@ -22575,13 +22575,13 @@ Instrs_ok - the instruction type it' is valid. - Or: - instr_u0* is instr*. - - instrtype_u4 is (t* ++ t_1* ->_ x* ++ t* ++ t_2*). - - the instr sequence instr* is valid with the instruction type (t_1* ->_ x* ++ t_2*). + - instrtype_u4 is (t* ++ t_1* ->_ x* t* ++ t_2*). + - the instr sequence instr* is valid with the instruction type (t_1* ->_ x* t_2*). - the value type sequence t* is valid. Expr_ok - the expression instr* is valid with the value type sequence t* if and only if: - - the instr sequence instr* is valid with the instruction type ([] ->_ [] ++ t*). + - the instr sequence instr* is valid with the instruction type ([] ->_ [] t*). Instr_const - the instr instr_u0 is constant if and only if: @@ -22612,7 +22612,7 @@ Instr_const - Or: - instr_u0 is (GLOBAL.GET x). - |C.GLOBALS| is greater than x. - - C.GLOBALS[x] is ((MUT ?()), t). + - C.GLOBALS[x] is ((MUT ?() ?), t). - Or: - instr_u0 is (BINOP Inn binop). - |[I32, I64]| is greater than 0. @@ -22793,7 +22793,7 @@ Module_ok - Yet: $disjoint_(syntax name, nm*{nm : name}) - C is { TYPES: dt'*; RECS: []; FUNCS: dt_I* ++ dt*; GLOBALS: gt_I* ++ gt*; TABLES: tt_I* ++ tt*; MEMS: mt_I* ++ mt*; ELEMS: rt*; DATAS: ok*; LOCALS: []; LABELS: []; RETURN: ?(); REFS: x*; }. - C' is { TYPES: dt'*; RECS: []; FUNCS: dt_I* ++ dt*; GLOBALS: gt_I*; TABLES: []; MEMS: []; ELEMS: []; DATAS: []; LOCALS: []; LABELS: []; RETURN: ?(); REFS: x*; }. - - x* is $funcidx_nonfuncs(YetE (`%%%%%`_nonfuncs(global*{global : global}, table*{table : table}, mem*{mem : mem}, elem*{elem : elem}, data*{data : data}))). + - x* is $funcidx_nonfuncs((global* table* mem* elem* data*)). - dt_I* is $funcsxt(xt_I*). - gt_I* is $globalsxt(xt_I*). - tt_I* is $tablesxt(xt_I*). @@ -22815,7 +22815,7 @@ NotationTypingInstrScheme - instr_u0 is (BLOCK blocktype instr*). - valtype_u1* is t_1*. - valtype_u3* is t_2*. - - the block type blocktype is valid with the instruction type (t_1* ->_ [] ++ t_2*). + - the block type blocktype is valid with the instruction type (t_1* ->_ [] t_2*). - Under the context C with .LABELS prepended by [t_2*], the instr sequence instr* is valid with the function type (t_1* -> t_2*). Ki @@ -22935,34 +22935,34 @@ cont b 3. Return (b - 128). ANYREF -1. Return (REF (NULL ?(())) ANY). +1. Return (REF (NULL ?(()) ?) ANY). EQREF -1. Return (REF (NULL ?(())) EQ). +1. Return (REF (NULL ?(()) ?) EQ). I31REF -1. Return (REF (NULL ?(())) I31). +1. Return (REF (NULL ?(()) ?) I31). STRUCTREF -1. Return (REF (NULL ?(())) STRUCT). +1. Return (REF (NULL ?(()) ?) STRUCT). ARRAYREF -1. Return (REF (NULL ?(())) ARRAY). +1. Return (REF (NULL ?(()) ?) ARRAY). FUNCREF -1. Return (REF (NULL ?(())) FUNC). +1. Return (REF (NULL ?(()) ?) FUNC). EXTERNREF -1. Return (REF (NULL ?(())) EXTERN). +1. Return (REF (NULL ?(()) ?) EXTERN). NULLREF -1. Return (REF (NULL ?(())) NONE). +1. Return (REF (NULL ?(()) ?) NONE). NULLFUNCREF -1. Return (REF (NULL ?(())) NOFUNC). +1. Return (REF (NULL ?(()) ?) NOFUNC). NULLEXTERNREF -1. Return (REF (NULL ?(())) NOEXTERN). +1. Return (REF (NULL ?(()) ?) NOEXTERN). size numtype_u0 1. If (numtype_u0 is I32), then: @@ -23112,9 +23112,9 @@ const consttype_u0 c unpackshape (Lnn X N) 1. Return $lunpack(Lnn). -diffrt (REF nul1 ht_1) (REF (NULL _u0?) ht_2) +diffrt (REF nul1 ht_1) (REF (NULL _u0? ?) ht_2) 1. If (_u0? is ?(())), then: - a. Return (REF (NULL ?()) ht_1). + a. Return (REF (NULL ?() ?) ht_1). 2. Assert: Due to validation, _u0? is not defined. 3. Return (REF nul1 ht_1). @@ -23284,7 +23284,7 @@ free_globaltype (mut, valtype) free_tabletype (limits, reftype) 1. Return $free_reftype(reftype). -free_memtype (PAGE limits) +free_memtype (limits PAGE) 1. Return { TYPES: []; FUNCS: []; GLOBALS: []; TABLES: []; MEMS: []; ELEMS: []; DATAS: []; LOCALS: []; LABELS: []; }. free_elemtype reftype @@ -23342,7 +23342,7 @@ free_instr instr_u0 3. If (instr_u0 is DROP), then: a. Return { TYPES: []; FUNCS: []; GLOBALS: []; TABLES: []; MEMS: []; ELEMS: []; DATAS: []; LOCALS: []; LABELS: []; }. 4. If instr_u0 is of the case SELECT, then: - a. Let (SELECT valtype*?) be instr_u0. + a. Let (SELECT() valtype*? ?) be instr_u0. b. Return $free_opt($free_list($free_valtype(valtype)*)?). 5. If instr_u0 is of the case BLOCK, then: a. Return YetE ($free_blocktype(blocktype) ++ $free_block(instr*{instr : instr})). @@ -23750,8 +23750,8 @@ subst_globaltype (mut, t) tv* tu* subst_tabletype (lim, rt) tv* tu* 1. Return (lim, $subst_reftype(rt, tv*, tu*)). -subst_memtype (PAGE lim) tv* tu* -1. Return (PAGE lim). +subst_memtype (lim PAGE) tv* tu* +1. Return (lim PAGE). subst_externtype externtype_u0 tv* tu* 1. If externtype_u0 is of the case FUNC, then: @@ -24350,13 +24350,13 @@ vbinop_ (lanetype_u1 X M) vbinop__u0 v128_1 v128_2 c. Let lane_2* be $lanes_((Jnn X M), v128_2). d. Let v128 be $invlanes_((Jnn X M), $imul_($lsizenn(Jnn), lane_1, lane_2)*). e. Return [v128]. -5. If ((vbinop__u0 is AVGR) and the type of lanetype_u1 is Jnn), then: +5. If ((vbinop__u0 is (AVGRU)) and the type of lanetype_u1 is Jnn), then: a. Let Jnn be lanetype_u1. b. Let lane_1* be $lanes_((Jnn X M), v128_1). c. Let lane_2* be $lanes_((Jnn X M), v128_2). d. Let v128 be $invlanes_((Jnn X M), $iavgr_($lsizenn(Jnn), U, lane_1, lane_2)*). e. Return [v128]. -6. If ((vbinop__u0 is Q15MULR_SAT) and the type of lanetype_u1 is Jnn), then: +6. If ((vbinop__u0 is (Q15MULR_SATS)) and the type of lanetype_u1 is Jnn), then: a. Let Jnn be lanetype_u1. b. Let lane_1* be $lanes_((Jnn X M), v128_1). c. Let lane_2* be $lanes_((Jnn X M), v128_2). @@ -24573,7 +24573,7 @@ vextbinop__ (Jnn_1 X M_1) (Jnn_2 X M_2) vextbinop___u0 c_1 c_2 c. Let ci_2* be $lanes_((Jnn_1 X M_1), c_2)[$half__((Jnn_1 X M_1), (Jnn_2 X M_2), half, 0, M_2) : M_2]. d. Let c be $invlanes_((Jnn_2 X M_2), $imul_($lsizenn2(Jnn_2), $extend__($lsizenn1(Jnn_1), $lsizenn2(Jnn_2), sx, ci_1), $extend__($lsizenn1(Jnn_1), $lsizenn2(Jnn_2), sx, ci_2))*). e. Return c. -2. Assert: Due to validation, (vextbinop___u0 is DOT). +2. Assert: Due to validation, (vextbinop___u0 is (DOTS)). 3. Let ci_1* be $lanes_((Jnn_1 X M_1), c_1). 4. Let ci_2* be $lanes_((Jnn_1 X M_1), c_2). 5. Let [cj_1, cj_2]* be $concat__1^-1(iN($lsizenn2((Jnn_2 : Jnn <: lanetype))), $imul_($lsizenn2(Jnn_2), $extend__($lsizenn1(Jnn_1), $lsizenn2(Jnn_2), S, ci_1), $extend__($lsizenn1(Jnn_1), $lsizenn2(Jnn_2), S, ci_2))*). @@ -24607,9 +24607,9 @@ default_ valtype_u0 b. Return ?((Vnn.CONST 0)). 4. Assert: Due to validation, valtype_u0 is of the case REF. 5. Let (REF nul_0 ht) be valtype_u0. -6. If (nul_0 is (NULL ?(()))), then: +6. If (nul_0 is (NULL ?(()) ?)), then: a. Return ?((REF.NULL ht)). -7. Assert: Due to validation, (nul_0 is (NULL ?())). +7. Assert: Due to validation, (nul_0 is (NULL ?() ?)). 8. Return ?(). packfield_ storagetype_u0 val_u1 @@ -24795,10 +24795,10 @@ growtable tableinst n r c. Return tableinst'. growmem meminst n -1. Let { TYPE: (PAGE (i, j)); BYTES: b*; } be meminst. +1. Let { TYPE: ((i, j) PAGE); BYTES: b*; } be meminst. 2. If (((|b*| / (64 · $Ki())) + n) ≤ j), then: a. Let i' be ((|b*| / (64 · $Ki())) + n). - b. Let meminst' be { TYPE: (PAGE (i', j)); BYTES: b* ++ 0^(n · (64 · $Ki())); }. + b. Let meminst' be { TYPE: ((i', j) PAGE); BYTES: b* ++ 0^(n · (64 · $Ki())); }. c. Return meminst'. blocktype_ z blocktype_u0 @@ -24878,8 +24878,8 @@ alloctables tabletype_u0* ref_u1* 7. Let ta'* be $alloctables(tabletype'*, ref'*). 8. Return [ta] ++ ta'*. -allocmem (PAGE (i, j)) -1. Let meminst be { TYPE: (PAGE (i, j)); BYTES: 0^(i · (64 · $Ki())); }. +allocmem ((i, j) PAGE) +1. Let meminst be { TYPE: ((i, j) PAGE); BYTES: 0^(i · (64 · $Ki())); }. 2. Let a be |s.MEMS|. 3. Append meminst to the s.MEMS. 4. Return a. @@ -25177,12 +25177,12 @@ Step_pure/br_on_non_null l Step_pure/call_indirect x yy 1. Execute the instruction (TABLE.GET x). -2. Execute the instruction (REF.CAST (REF (NULL ?(())) yy)). +2. Execute the instruction (REF.CAST (REF (NULL ?(()) ?) yy)). 3. Execute the instruction (CALL_REF yy). Step_pure/return_call_indirect x yy 1. Execute the instruction (TABLE.GET x). -2. Execute the instruction (REF.CAST (REF (NULL ?(())) yy)). +2. Execute the instruction (REF.CAST (REF (NULL ?(()) ?) yy)). 3. Execute the instruction (RETURN_CALL_REF yy). Step_pure/frame @@ -26062,7 +26062,7 @@ Step_read/vload V128 vloadop__u0? x ao 5. Else: a. Let ?(vloadop__0) be vloadop__u0?. b. If vloadop__0 is of the case SHAPE, then: - 1) Let (SHAPE M K sx) be vloadop__0. + 1) Let (SHAPE M X K sx) be vloadop__0. 2) If (((i + ao.OFFSET) + ((M · K) / 8)) > |$mem(z, x).BYTES|), then: a) Trap. 3) If the type of $lsizenn^-1((M · 2)) is Jnn, then: From 172991f235cd5847f44934924d3d972bcb2c4397 Mon Sep 17 00:00:00 2001 From: presenthee Date: Wed, 14 Aug 2024 15:47:32 +0900 Subject: [PATCH 17/26] Remove InfixE in AL --- spectec/src/al/al_util.ml | 1 - spectec/src/al/ast.ml | 1 - spectec/src/al/eq.ml | 2 -- spectec/src/al/free.ml | 1 - spectec/src/al/print.ml | 9 --------- spectec/src/al/valid.ml | 1 - spectec/src/al/walk.ml | 4 +--- spectec/src/backend-prose/print.ml | 1 - spectec/src/backend-prose/render.ml | 4 ---- 9 files changed, 1 insertion(+), 23 deletions(-) diff --git a/spectec/src/al/al_util.ml b/spectec/src/al/al_util.ml index d27514f6cd..ac100d0328 100644 --- a/spectec/src/al/al_util.ml +++ b/spectec/src/al/al_util.ml @@ -59,7 +59,6 @@ let invCallE ?(at = no) ~note (id, il, el) = InvCallE (id, il, el) |> mk_expr at let iterE ?(at = no) ~note (e, idl, it) = IterE (e, idl, it) |> mk_expr at note let optE ?(at = no) ~note e_opt = OptE e_opt |> mk_expr at note let listE ?(at = no) ~note el = ListE el |> mk_expr at note -let infixE ?(at = no) ~note (e1, infix, e2) = InfixE (e1, infix, e2) |> mk_expr at note let arityE ?(at = no) ~note e = ArityE e |> mk_expr at note let frameE ?(at = no) ~note (e_opt, e) = FrameE (e_opt, e) |> mk_expr at note let labelE ?(at = no) ~note (e1, e2) = LabelE (e1, e2) |> mk_expr at note diff --git a/spectec/src/al/ast.ml b/spectec/src/al/ast.ml index a345ebca75..aa1869cd2c 100644 --- a/spectec/src/al/ast.ml +++ b/spectec/src/al/ast.ml @@ -99,7 +99,6 @@ and expr' = | IterE of expr * id list * iter (* expr (`{` id* `}`)* *) | OptE of expr option (* expr? *) | ListE of expr list (* `[` expr* `]` *) - | InfixE of expr * atom * expr (* "expr infix expr" *) (* TODO: Remove InfixE using hint *) | ArityE of expr (* "the arity of expr" *) | FrameE of expr option * expr (* "the activation of expr (with arity expr)?" *) | LabelE of expr * expr (* "the label whose arity is expr and whose continuation is expr" *) diff --git a/spectec/src/al/eq.ml b/spectec/src/al/eq.ml index 6e5e10d3d6..10c54e4e36 100644 --- a/spectec/src/al/eq.ml +++ b/spectec/src/al/eq.ml @@ -32,8 +32,6 @@ let rec eq_expr e1 e2 = eq_expr e1 e2 && il1 = il2 && it1 = it2 | OptE eo1, OptE eo2 -> eq_expr_opt eo1 eo2 | ListE el1, ListE el2 -> eq_exprs el1 el2 - | InfixE (e11, a1, e12), InfixE (e21, a2, e22) -> - eq_expr e11 e21 && El.Atom.eq a1 a2 && eq_expr e12 e22 | ArityE e1, ArityE e2 -> eq_expr e1 e2 | FrameE (eo1, e1), FrameE (eo2, e2) -> eq_expr_opt eo1 eo2 && eq_expr e1 e2 diff --git a/spectec/src/al/free.ml b/spectec/src/al/free.ml index f1882fde4e..73ed2708d1 100644 --- a/spectec/src/al/free.ml +++ b/spectec/src/al/free.ml @@ -30,7 +30,6 @@ let rec free_expr expr = | BinE (_, e1, e2) | CatE (e1, e2) | MemE (e1, e2) - | InfixE (e1, _, e2) | LabelE (e1, e2) -> free_expr e1 @ free_expr e2 | FrameE (e_opt, e) -> free_opt free_expr e_opt @ free_expr e | CallE (_, al) diff --git a/spectec/src/al/print.ml b/spectec/src/al/print.ml index 0187fcafd6..e71eeb276d 100644 --- a/spectec/src/al/print.ml +++ b/spectec/src/al/print.ml @@ -175,7 +175,6 @@ and string_of_expr expr = | VarE id -> id | SubE (id, _) -> id | IterE (e, _, iter) -> string_of_expr e ^ string_of_iter iter - | InfixE (e1, a, e2) -> "(" ^ string_of_expr e1 ^ " " ^ string_of_atom a ^ " " ^ string_of_expr e2 ^ ")" | CaseE ({ it=Atom.Atom ("CONST" | "VCONST"); _ }, hd::tl) -> "(" ^ string_of_expr hd ^ ".CONST " ^ string_of_exprs " " tl ^ ")" | CaseE (a, []) -> string_of_atom a @@ -508,14 +507,6 @@ and structured_string_of_expr expr = ^ ", " ^ string_of_iter iter ^ ")" - | InfixE (e1, a, e2) -> - "InfixE (" - ^ structured_string_of_expr e1 - ^ ", " - ^ string_of_atom a - ^ ", " - ^ structured_string_of_expr e2 - ^ ")" | CaseE (a, el) -> "CaseE (" ^ string_of_atom a ^ ", [" ^ structured_string_of_exprs el ^ "])" diff --git a/spectec/src/al/valid.ml b/spectec/src/al/valid.ml index d781eb2ba4..0e058efb4b 100644 --- a/spectec/src/al/valid.ml +++ b/spectec/src/al/valid.ml @@ -403,7 +403,6 @@ let valid_expr (walker: unit_walker) (expr: expr) : unit = t |> List.map note |> List.iter (check_match source h.note) - | InfixE _ -> () (* TODO: `InfixE` will be merged into CaseE *) | ArityE expr1 -> check_num source expr.note; check_context source expr1.note | FrameE (expr_opt, expr1) -> diff --git a/spectec/src/al/walk.ml b/spectec/src/al/walk.ml index d53594824b..4b974a4e9d 100644 --- a/spectec/src/al/walk.ml +++ b/spectec/src/al/walk.ml @@ -42,7 +42,7 @@ let walk_expr (walker: unit_walker) (expr: expr) : unit = | TopValueE (Some e) | TopValuesE e | ChooseE e -> walker.walk_expr walker e | BinE (_, e1, e2) | CatE (e1, e2) | MemE (e1, e2) - | InfixE (e1, _, e2) | LabelE (e1, e2) | MatchE (e1, e2) -> + | LabelE (e1, e2) | MatchE (e1, e2) -> walker.walk_expr walker e1; walker.walk_expr walker e2 | FrameE (e_opt, e) -> Option.iter (walker.walk_expr walker) e_opt; walker.walk_expr walker e @@ -148,7 +148,6 @@ let walk_expr (walker: walker) (expr: expr) : expr = | CaseE2 (a, el) -> CaseE2 (a, List.map walk_expr el) | OptE e -> OptE (Option.map walk_expr e) | TupE el -> TupE (List.map walk_expr el) - | InfixE (e1, a, e2) -> InfixE (walk_expr e1, a, walk_expr e2) | ArityE e -> ArityE (walk_expr e) | FrameE (e1_opt, e2) -> FrameE (Option.map walk_expr e1_opt, walk_expr e2) | LabelE (e1, e2) -> LabelE (walk_expr e1, walk_expr e2) @@ -268,7 +267,6 @@ let rec walk_expr f e = | CaseE2 (a, el) -> CaseE2 (a, List.map new_ el) | OptE e -> OptE (Option.map new_ e) | TupE el -> TupE (List.map new_ el) - | InfixE (e1, a, e2) -> InfixE (new_ e1, a, new_ e2) | ArityE e' -> ArityE (new_ e') | FrameE (e1_opt, e2) -> FrameE (Option.map new_ e1_opt, new_ e2) | LabelE (e1, e2) -> LabelE (new_ e1, new_ e2) diff --git a/spectec/src/backend-prose/print.ml b/spectec/src/backend-prose/print.ml index 0d52ad18ae..88691837a0 100644 --- a/spectec/src/backend-prose/print.ml +++ b/spectec/src/backend-prose/print.ml @@ -150,7 +150,6 @@ and string_of_expr expr = | VarE id -> id | SubE (id, _) -> id | IterE (e, _, iter) -> string_of_expr e ^ string_of_iter iter - | InfixE (e1, a, e2) -> "(" ^ string_of_expr e1 ^ " " ^ string_of_atom a ^ " " ^ string_of_expr e2 ^ ")" | CaseE ({ it=El.Atom.Atom ("CONST" | "VCONST"); _ }, hd::tl) -> "(" ^ string_of_expr hd ^ ".CONST " ^ string_of_exprs " " tl ^ ")" | CaseE (a, []) -> string_of_atom a diff --git a/spectec/src/backend-prose/render.ml b/spectec/src/backend-prose/render.ml index a3e1a91a99..a10b569460 100644 --- a/spectec/src/backend-prose/render.ml +++ b/spectec/src/backend-prose/render.ml @@ -230,10 +230,6 @@ and al_to_el_expr expr = | _ -> ele in Some (El.Ast.IterE (ele, eliter)) - | Al.Ast.InfixE (e1, op, e2) -> - let* ele1 = al_to_el_expr e1 in - let* ele2 = al_to_el_expr e2 in - Some (El.Ast.InfixE (ele1, op, ele2)) | Al.Ast.CaseE (a, el) -> let ela = (El.Ast.AtomE a) $ no_region in let* elel = al_to_el_exprs el in From e22effb18b81f42fbbf3f2383d4db170f66684f2 Mon Sep 17 00:00:00 2001 From: presenthee Date: Wed, 14 Aug 2024 15:54:59 +0900 Subject: [PATCH 18/26] Remove CaseE in AL --- spectec/src/al/al_util.ml | 1 - spectec/src/al/ast.ml | 1 - spectec/src/al/eq.ml | 1 - spectec/src/al/free.ml | 1 - spectec/src/al/print.ml | 7 ------- spectec/src/al/valid.ml | 2 +- spectec/src/al/walk.ml | 4 +--- spectec/src/backend-interpreter/interpreter.ml | 4 ---- spectec/src/backend-prose/print.ml | 4 ---- spectec/src/backend-prose/render.ml | 6 ------ spectec/src/il2al/translate.ml | 16 +--------------- 11 files changed, 3 insertions(+), 44 deletions(-) diff --git a/spectec/src/al/al_util.ml b/spectec/src/al/al_util.ml index ac100d0328..e65c1ef851 100644 --- a/spectec/src/al/al_util.ml +++ b/spectec/src/al/al_util.ml @@ -52,7 +52,6 @@ let catE ?(at = no) ~note (e1, e2) = CatE (e1, e2) |> mk_expr at note let memE ?(at = no) ~note (e1, e2) = MemE (e1, e2) |> mk_expr at note let lenE ?(at = no) ~note e = LenE e |> mk_expr at note let tupE ?(at = no) ~note el = TupE el |> mk_expr at note -let caseE ?(at = no) ~note (a, el) = CaseE (a, el) |> mk_expr at note let caseE2 ?(at = no) ~note (op, el) = CaseE2 (op, el) |> mk_expr at note let callE ?(at = no) ~note (id, el) = CallE (id, el) |> mk_expr at note let invCallE ?(at = no) ~note (id, il, el) = InvCallE (id, il, el) |> mk_expr at note diff --git a/spectec/src/al/ast.ml b/spectec/src/al/ast.ml index aa1869cd2c..fddf91657d 100644 --- a/spectec/src/al/ast.ml +++ b/spectec/src/al/ast.ml @@ -92,7 +92,6 @@ and expr' = | MemE of expr * expr (* expr `<-` expr *) | LenE of expr (* `|` expr `|` *) | TupE of expr list (* `(` (expr `,`)* `)` *) - | CaseE of atom * expr list (* atom `(` expr* `)` -- MixE/CaseE *) | CaseE2 of mixop * expr list (* mixop `(` expr* `)` -- CaseE *) (* TODO: Migrate CaseE to CaseE2*) | CallE of id * arg list (* id `(` expr* `)` *) | InvCallE of id * int option list * arg list (* id`_`int*`^-1(` expr* `)` *) diff --git a/spectec/src/al/eq.ml b/spectec/src/al/eq.ml index 10c54e4e36..21dc7fc329 100644 --- a/spectec/src/al/eq.ml +++ b/spectec/src/al/eq.ml @@ -23,7 +23,6 @@ let rec eq_expr e1 e2 = | MemE (e11, e12), MemE (e21, e22) -> eq_expr e11 e21 && eq_expr e12 e22 | LenE e1, LenE e2 -> eq_expr e1 e2 | TupE el1, TupE el2 -> eq_exprs el1 el2 - | CaseE (a1, el1), CaseE (a2, el2) -> El.Atom.eq a1 a2 && eq_exprs el1 el2 | CaseE2 (op1, el1), CaseE2 (op2, el2) -> Il.Mixop.eq op1 op2 && eq_exprs el1 el2 | CallE (i1, al1), CallE (i2, al2) -> i1 = i2 && eq_args al1 al2 | InvCallE (i1, nl1, al1), InvCallE (i2, nl2, al2) -> diff --git a/spectec/src/al/free.ml b/spectec/src/al/free.ml index 73ed2708d1..09f896b1a2 100644 --- a/spectec/src/al/free.ml +++ b/spectec/src/al/free.ml @@ -36,7 +36,6 @@ let rec free_expr expr = | InvCallE (_, _, al) -> free_list free_arg al | TupE el | ListE el - | CaseE (_, el) -> free_list free_expr el | CaseE2 (_, el) -> free_list free_expr el | StrE r -> free_list (fun (_, e) -> free_expr !e) r | AccE (e, p) -> free_expr e @ free_path p diff --git a/spectec/src/al/print.ml b/spectec/src/al/print.ml index e71eeb276d..8e2c4273f4 100644 --- a/spectec/src/al/print.ml +++ b/spectec/src/al/print.ml @@ -175,10 +175,6 @@ and string_of_expr expr = | VarE id -> id | SubE (id, _) -> id | IterE (e, _, iter) -> string_of_expr e ^ string_of_iter iter - | CaseE ({ it=Atom.Atom ("CONST" | "VCONST"); _ }, hd::tl) -> - "(" ^ string_of_expr hd ^ ".CONST " ^ string_of_exprs " " tl ^ ")" - | CaseE (a, []) -> string_of_atom a - | CaseE (a, el) -> "(" ^ string_of_atom a ^ " " ^ string_of_exprs " " el ^ ")" | CaseE2 ([{ it=Atom.Atom ("CONST" | "VCONST"); _ }]::_tl, hd::tl) -> "(" ^ string_of_expr hd ^ ".CONST " ^ string_of_exprs " " tl ^ ")" | CaseE2 ([[ atom ]], []) -> string_of_atom atom @@ -507,9 +503,6 @@ and structured_string_of_expr expr = ^ ", " ^ string_of_iter iter ^ ")" - | CaseE (a, el) -> - "CaseE (" ^ string_of_atom a - ^ ", [" ^ structured_string_of_exprs el ^ "])" | CaseE2 (op, el) -> "CaseE2 (" ^ string_of_mixop op ^ ", [" ^ structured_string_of_exprs el ^ "])" diff --git a/spectec/src/al/valid.ml b/spectec/src/al/valid.ml index 0e058efb4b..9368318502 100644 --- a/spectec/src/al/valid.ml +++ b/spectec/src/al/valid.ml @@ -376,7 +376,7 @@ let valid_expr (walker: unit_walker) (expr: expr) : unit = | LenE expr' -> check_list source expr'.note; check_num source expr.note | TupE exprs -> check_tuple source exprs expr.note - | CaseE _ | CaseE2 _ -> () (* TODO *) + | CaseE2 _ -> () (* TODO *) | CallE (id, args) -> check_call source id args expr.note | InvCallE (id, indices, args) -> check_inv_call source id indices args expr.note; | IterE (expr1, _, iter) -> diff --git a/spectec/src/al/walk.ml b/spectec/src/al/walk.ml index 4b974a4e9d..ed2ddf5dbe 100644 --- a/spectec/src/al/walk.ml +++ b/spectec/src/al/walk.ml @@ -48,7 +48,7 @@ let walk_expr (walker: unit_walker) (expr: expr) : unit = Option.iter (walker.walk_expr walker) e_opt; walker.walk_expr walker e | CallE (_, al) | InvCallE (_, _, al) -> List.iter (walker.walk_arg walker) al - | TupE el | ListE el | CaseE (_, el) | CaseE2 (_, el) -> + | TupE el | ListE el | CaseE2 (_, el) -> List.iter (walker.walk_expr walker) el | StrE r -> List.iter (fun (_, e) -> walker.walk_expr walker !e) r | AccE (e, p) -> walker.walk_expr walker e; walk_path walker p @@ -144,7 +144,6 @@ let walk_expr (walker: walker) (expr: expr) : expr = | ExtE (e1, ps, e2, dir) -> ExtE (walk_expr e1, List.map walk_path ps, walk_expr e2, dir) | UpdE (e1, ps, e2) -> UpdE (walk_expr e1, List.map walk_path ps, walk_expr e2) - | CaseE (a, el) -> CaseE (a, List.map walk_expr el) | CaseE2 (a, el) -> CaseE2 (a, List.map walk_expr el) | OptE e -> OptE (Option.map walk_expr e) | TupE el -> TupE (List.map walk_expr el) @@ -263,7 +262,6 @@ let rec walk_expr f e = | AccE (e, p) -> AccE (new_ e, walk_path f p) | ExtE (e1, ps, e2, dir) -> ExtE (new_ e1, List.map (walk_path f) ps, new_ e2, dir) | UpdE (e1, ps, e2) -> UpdE (new_ e1, List.map (walk_path f) ps, new_ e2) - | CaseE (a, el) -> CaseE (a, List.map new_ el) | CaseE2 (a, el) -> CaseE2 (a, List.map new_ el) | OptE e -> OptE (Option.map new_ e) | TupE el -> TupE (List.map new_ el) diff --git a/spectec/src/backend-interpreter/interpreter.ml b/spectec/src/backend-interpreter/interpreter.ml index 737000360b..4609305b2f 100644 --- a/spectec/src/backend-interpreter/interpreter.ml +++ b/spectec/src/backend-interpreter/interpreter.ml @@ -276,7 +276,6 @@ and eval_expr env expr = | path :: rest -> access_path env base path |> replace rest |> replace_path env base path | [] -> eval_expr env e2 in eval_expr env e1 |> replace ps - | CaseE (tag, el) -> caseV (Print.string_of_atom tag, List.map (eval_expr env) el) | CaseE2 (op, el) -> (match (get_atom op) with | Some a -> caseV (Print.string_of_atom a, List.map (eval_expr env) el) @@ -461,9 +460,6 @@ and assign lhs rhs env = | ListE lhs_s, ListV rhs_s when List.length lhs_s = Array.length !rhs_s -> List.fold_right2 assign lhs_s (Array.to_list !rhs_s) env - | CaseE (lhs_tag, lhs_s), CaseV (rhs_tag, rhs_s) - when (Print.string_of_atom lhs_tag) = rhs_tag && List.length lhs_s = List.length rhs_s -> - List.fold_right2 assign lhs_s rhs_s env | CaseE2 (op, lhs_s), CaseV (rhs_tag, rhs_s) when List.length lhs_s = List.length rhs_s -> (match get_atom op with | Some lhs_tag when (Print.string_of_atom lhs_tag) = rhs_tag -> diff --git a/spectec/src/backend-prose/print.ml b/spectec/src/backend-prose/print.ml index 88691837a0..8047430b10 100644 --- a/spectec/src/backend-prose/print.ml +++ b/spectec/src/backend-prose/print.ml @@ -150,10 +150,6 @@ and string_of_expr expr = | VarE id -> id | SubE (id, _) -> id | IterE (e, _, iter) -> string_of_expr e ^ string_of_iter iter - | CaseE ({ it=El.Atom.Atom ("CONST" | "VCONST"); _ }, hd::tl) -> - "(" ^ string_of_expr hd ^ ".CONST " ^ string_of_exprs " " tl ^ ")" - | CaseE (a, []) -> string_of_atom a - | CaseE (a, el) -> "(" ^ string_of_atom a ^ " " ^ string_of_exprs " " el ^ ")" | CaseE2 ([{ it=El.Atom.Atom ("CONST" | "VCONST"); _ }]::_tl, hd::tl) -> "(" ^ string_of_expr hd ^ ".CONST " ^ string_of_exprs " " tl ^ ")" | CaseE2 ([[ atom ]], []) -> string_of_atom atom diff --git a/spectec/src/backend-prose/render.ml b/spectec/src/backend-prose/render.ml index a10b569460..006a46c8cd 100644 --- a/spectec/src/backend-prose/render.ml +++ b/spectec/src/backend-prose/render.ml @@ -230,12 +230,6 @@ and al_to_el_expr expr = | _ -> ele in Some (El.Ast.IterE (ele, eliter)) - | Al.Ast.CaseE (a, el) -> - let ela = (El.Ast.AtomE a) $ no_region in - let* elel = al_to_el_exprs el in - let ele = El.Ast.SeqE ([ ela ] @ elel) in - if List.length elel = 0 then Some ele - else Some (El.Ast.ParenE (ele $ no_region, `Insig)) | Al.Ast.CaseE2 (op, el) -> let elal = mixop_to_el_exprs op in let* elel = al_to_el_exprs el in diff --git a/spectec/src/il2al/translate.ml b/spectec/src/il2al/translate.ml index e028424ee6..0b4ed04762 100644 --- a/spectec/src/il2al/translate.ml +++ b/spectec/src/il2al/translate.ml @@ -752,21 +752,7 @@ and handle_special_lhs lhs rhs free_ids = [ letI (VarE s $$ lhs.at % lhs.note, rhs) ~at:at ], [] )] - (* Normal cases TODO *) - | CaseE (tag, es) -> - let bindings, es' = extract_non_names es in - let rec inject_isCaseOf expr = - match expr.it with - | IterE (inner_expr, ids, iter) -> - IterE (inject_isCaseOf inner_expr, ids, iter) $$ expr.at % boolT - | _ -> IsCaseOfE (expr, tag) $$ rhs.at % boolT - in - [ ifI ( - inject_isCaseOf rhs, - letI (caseE (tag, es') ~at:lhs.at ~note:lhs.note, rhs) ~at:at - :: translate_bindings free_ids bindings, - [] - )] + (* Normal cases *) | CaseE2 (op, es) -> let tag = get_atom op |> Option.get in let bindings, es' = extract_non_names es in From f5f13e7f5ede3c24d3462d3969b3e412eacef97f Mon Sep 17 00:00:00 2001 From: presenthee Date: Wed, 14 Aug 2024 16:04:35 +0900 Subject: [PATCH 19/26] Rename CaseE2 --- spectec/src/al/al_util.ml | 2 +- spectec/src/al/ast.ml | 2 +- spectec/src/al/eq.ml | 2 +- spectec/src/al/free.ml | 2 +- spectec/src/al/print.ml | 10 +++++----- spectec/src/al/valid.ml | 2 +- spectec/src/al/walk.ml | 6 +++--- spectec/src/backend-interpreter/interpreter.ml | 4 ++-- spectec/src/backend-prose/print.ml | 6 +++--- spectec/src/backend-prose/render.ml | 4 ++-- spectec/src/il2al/manual.ml | 4 ++-- spectec/src/il2al/translate.ml | 18 +++++++++--------- spectec/src/il2al/transpile.ml | 10 +++++----- 13 files changed, 36 insertions(+), 36 deletions(-) diff --git a/spectec/src/al/al_util.ml b/spectec/src/al/al_util.ml index e65c1ef851..fd4c5bece5 100644 --- a/spectec/src/al/al_util.ml +++ b/spectec/src/al/al_util.ml @@ -52,7 +52,7 @@ let catE ?(at = no) ~note (e1, e2) = CatE (e1, e2) |> mk_expr at note let memE ?(at = no) ~note (e1, e2) = MemE (e1, e2) |> mk_expr at note let lenE ?(at = no) ~note e = LenE e |> mk_expr at note let tupE ?(at = no) ~note el = TupE el |> mk_expr at note -let caseE2 ?(at = no) ~note (op, el) = CaseE2 (op, el) |> mk_expr at note +let caseE ?(at = no) ~note (op, el) = CaseE (op, el) |> mk_expr at note let callE ?(at = no) ~note (id, el) = CallE (id, el) |> mk_expr at note let invCallE ?(at = no) ~note (id, il, el) = InvCallE (id, il, el) |> mk_expr at note let iterE ?(at = no) ~note (e, idl, it) = IterE (e, idl, it) |> mk_expr at note diff --git a/spectec/src/al/ast.ml b/spectec/src/al/ast.ml index fddf91657d..41e596df68 100644 --- a/spectec/src/al/ast.ml +++ b/spectec/src/al/ast.ml @@ -92,7 +92,7 @@ and expr' = | MemE of expr * expr (* expr `<-` expr *) | LenE of expr (* `|` expr `|` *) | TupE of expr list (* `(` (expr `,`)* `)` *) - | CaseE2 of mixop * expr list (* mixop `(` expr* `)` -- CaseE *) (* TODO: Migrate CaseE to CaseE2*) + | CaseE of mixop * expr list (* mixop `(` expr* `)` -- CaseE *) | CallE of id * arg list (* id `(` expr* `)` *) | InvCallE of id * int option list * arg list (* id`_`int*`^-1(` expr* `)` *) | IterE of expr * id list * iter (* expr (`{` id* `}`)* *) diff --git a/spectec/src/al/eq.ml b/spectec/src/al/eq.ml index 21dc7fc329..d0f38db959 100644 --- a/spectec/src/al/eq.ml +++ b/spectec/src/al/eq.ml @@ -23,7 +23,7 @@ let rec eq_expr e1 e2 = | MemE (e11, e12), MemE (e21, e22) -> eq_expr e11 e21 && eq_expr e12 e22 | LenE e1, LenE e2 -> eq_expr e1 e2 | TupE el1, TupE el2 -> eq_exprs el1 el2 - | CaseE2 (op1, el1), CaseE2 (op2, el2) -> Il.Mixop.eq op1 op2 && eq_exprs el1 el2 + | CaseE (op1, el1), CaseE (op2, el2) -> Il.Mixop.eq op1 op2 && eq_exprs el1 el2 | CallE (i1, al1), CallE (i2, al2) -> i1 = i2 && eq_args al1 al2 | InvCallE (i1, nl1, al1), InvCallE (i2, nl2, al2) -> i1 = i2 && List.for_all2 (=) nl1 nl2 && eq_args al1 al2 diff --git a/spectec/src/al/free.ml b/spectec/src/al/free.ml index 09f896b1a2..fac07f6708 100644 --- a/spectec/src/al/free.ml +++ b/spectec/src/al/free.ml @@ -36,7 +36,7 @@ let rec free_expr expr = | InvCallE (_, _, al) -> free_list free_arg al | TupE el | ListE el - | CaseE2 (_, el) -> free_list free_expr el + | CaseE (_, el) -> free_list free_expr el | StrE r -> free_list (fun (_, e) -> free_expr !e) r | AccE (e, p) -> free_expr e @ free_path p | ExtE (e1, ps, e2, _) diff --git a/spectec/src/al/print.ml b/spectec/src/al/print.ml index 8e2c4273f4..8c3b0068e2 100644 --- a/spectec/src/al/print.ml +++ b/spectec/src/al/print.ml @@ -175,10 +175,10 @@ and string_of_expr expr = | VarE id -> id | SubE (id, _) -> id | IterE (e, _, iter) -> string_of_expr e ^ string_of_iter iter - | CaseE2 ([{ it=Atom.Atom ("CONST" | "VCONST"); _ }]::_tl, hd::tl) -> + | CaseE ([{ it=Atom.Atom ("CONST" | "VCONST"); _ }]::_tl, hd::tl) -> "(" ^ string_of_expr hd ^ ".CONST " ^ string_of_exprs " " tl ^ ")" - | CaseE2 ([[ atom ]], []) -> string_of_atom atom - | CaseE2 (op, el) -> + | CaseE ([[ atom ]], []) -> string_of_atom atom + | CaseE (op, el) -> let op' = List.map (fun al -> String.concat "" (List.map string_of_atom al)) op in (match op' with | [] -> "()" @@ -503,8 +503,8 @@ and structured_string_of_expr expr = ^ ", " ^ string_of_iter iter ^ ")" - | CaseE2 (op, el) -> - "CaseE2 (" ^ string_of_mixop op + | CaseE (op, el) -> + "CaseE (" ^ string_of_mixop op ^ ", [" ^ structured_string_of_exprs el ^ "])" | OptE None -> "OptE" | OptE (Some e) -> "OptE (" ^ structured_string_of_expr e ^ ")" diff --git a/spectec/src/al/valid.ml b/spectec/src/al/valid.ml index 9368318502..70ac3bb124 100644 --- a/spectec/src/al/valid.ml +++ b/spectec/src/al/valid.ml @@ -376,7 +376,7 @@ let valid_expr (walker: unit_walker) (expr: expr) : unit = | LenE expr' -> check_list source expr'.note; check_num source expr.note | TupE exprs -> check_tuple source exprs expr.note - | CaseE2 _ -> () (* TODO *) + | CaseE _ -> () (* TODO *) | CallE (id, args) -> check_call source id args expr.note | InvCallE (id, indices, args) -> check_inv_call source id indices args expr.note; | IterE (expr1, _, iter) -> diff --git a/spectec/src/al/walk.ml b/spectec/src/al/walk.ml index ed2ddf5dbe..401c143153 100644 --- a/spectec/src/al/walk.ml +++ b/spectec/src/al/walk.ml @@ -48,7 +48,7 @@ let walk_expr (walker: unit_walker) (expr: expr) : unit = Option.iter (walker.walk_expr walker) e_opt; walker.walk_expr walker e | CallE (_, al) | InvCallE (_, _, al) -> List.iter (walker.walk_arg walker) al - | TupE el | ListE el | CaseE2 (_, el) -> + | TupE el | ListE el | CaseE (_, el) -> List.iter (walker.walk_expr walker) el | StrE r -> List.iter (fun (_, e) -> walker.walk_expr walker !e) r | AccE (e, p) -> walker.walk_expr walker e; walk_path walker p @@ -144,7 +144,7 @@ let walk_expr (walker: walker) (expr: expr) : expr = | ExtE (e1, ps, e2, dir) -> ExtE (walk_expr e1, List.map walk_path ps, walk_expr e2, dir) | UpdE (e1, ps, e2) -> UpdE (walk_expr e1, List.map walk_path ps, walk_expr e2) - | CaseE2 (a, el) -> CaseE2 (a, List.map walk_expr el) + | CaseE (a, el) -> CaseE (a, List.map walk_expr el) | OptE e -> OptE (Option.map walk_expr e) | TupE el -> TupE (List.map walk_expr el) | ArityE e -> ArityE (walk_expr e) @@ -262,7 +262,7 @@ let rec walk_expr f e = | AccE (e, p) -> AccE (new_ e, walk_path f p) | ExtE (e1, ps, e2, dir) -> ExtE (new_ e1, List.map (walk_path f) ps, new_ e2, dir) | UpdE (e1, ps, e2) -> UpdE (new_ e1, List.map (walk_path f) ps, new_ e2) - | CaseE2 (a, el) -> CaseE2 (a, List.map new_ el) + | CaseE (a, el) -> CaseE (a, List.map new_ el) | OptE e -> OptE (Option.map new_ e) | TupE el -> TupE (List.map new_ el) | ArityE e' -> ArityE (new_ e') diff --git a/spectec/src/backend-interpreter/interpreter.ml b/spectec/src/backend-interpreter/interpreter.ml index 4609305b2f..6c2675ec10 100644 --- a/spectec/src/backend-interpreter/interpreter.ml +++ b/spectec/src/backend-interpreter/interpreter.ml @@ -276,7 +276,7 @@ and eval_expr env expr = | path :: rest -> access_path env base path |> replace rest |> replace_path env base path | [] -> eval_expr env e2 in eval_expr env e1 |> replace ps - | CaseE2 (op, el) -> + | CaseE (op, el) -> (match (get_atom op) with | Some a -> caseV (Print.string_of_atom a, List.map (eval_expr env) el) | None -> fail_expr expr "inner mixop of caseE is empty" @@ -460,7 +460,7 @@ and assign lhs rhs env = | ListE lhs_s, ListV rhs_s when List.length lhs_s = Array.length !rhs_s -> List.fold_right2 assign lhs_s (Array.to_list !rhs_s) env - | CaseE2 (op, lhs_s), CaseV (rhs_tag, rhs_s) when List.length lhs_s = List.length rhs_s -> + | CaseE (op, lhs_s), CaseV (rhs_tag, rhs_s) when List.length lhs_s = List.length rhs_s -> (match get_atom op with | Some lhs_tag when (Print.string_of_atom lhs_tag) = rhs_tag -> List.fold_right2 assign lhs_s rhs_s env diff --git a/spectec/src/backend-prose/print.ml b/spectec/src/backend-prose/print.ml index 8047430b10..5089df7fad 100644 --- a/spectec/src/backend-prose/print.ml +++ b/spectec/src/backend-prose/print.ml @@ -150,10 +150,10 @@ and string_of_expr expr = | VarE id -> id | SubE (id, _) -> id | IterE (e, _, iter) -> string_of_expr e ^ string_of_iter iter - | CaseE2 ([{ it=El.Atom.Atom ("CONST" | "VCONST"); _ }]::_tl, hd::tl) -> + | CaseE ([{ it=El.Atom.Atom ("CONST" | "VCONST"); _ }]::_tl, hd::tl) -> "(" ^ string_of_expr hd ^ ".CONST " ^ string_of_exprs " " tl ^ ")" - | CaseE2 ([[ atom ]], []) -> string_of_atom atom - | CaseE2 (op, el) -> + | CaseE ([[ atom ]], []) -> string_of_atom atom + | CaseE (op, el) -> let op' = List.map (fun al -> String.concat "" (List.map string_of_atom al)) op in (match op' with | [] -> "()" diff --git a/spectec/src/backend-prose/render.ml b/spectec/src/backend-prose/render.ml index 006a46c8cd..0ceeaadbfe 100644 --- a/spectec/src/backend-prose/render.ml +++ b/spectec/src/backend-prose/render.ml @@ -230,7 +230,7 @@ and al_to_el_expr expr = | _ -> ele in Some (El.Ast.IterE (ele, eliter)) - | Al.Ast.CaseE2 (op, el) -> + | Al.Ast.CaseE (op, el) -> let elal = mixop_to_el_exprs op in let* elel = al_to_el_exprs el in let ele = El.Ast.SeqE (case_to_el_exprs elal elel) in @@ -695,7 +695,7 @@ let render_atom_title env name params = let name = name' $$ no_region % name.note in let op = [name] :: List.init (List.length params) (fun _ -> []) in let params = List.filter_map (fun a -> match a.it with Al.Ast.ExpA e -> Some e | _ -> None) params in - let expr = Al.Al_util.caseE2 (op, params) ~at:no_region ~note:Al.Al_util.no_note in + let expr = Al.Al_util.caseE (op, params) ~at:no_region ~note:Al.Al_util.no_note in match al_to_el_expr expr with | Some ({ it = El.Ast.ParenE (exp, _); _ }) -> render_el_exp env exp | Some exp -> render_el_exp env exp diff --git a/spectec/src/il2al/manual.ml b/spectec/src/il2al/manual.ml index 97a0518f9c..3d430140d0 100644 --- a/spectec/src/il2al/manual.ml +++ b/spectec/src/il2al/manual.ml @@ -42,7 +42,7 @@ let return_instrs_of_instantiate config = [ enterI ( frameE (Some (numE Z.zero ~note:natT), frame) ~note:callframeT, - listE ([ caseE2 ([[atom_of_name "FRAME_" "admininstr"]], []) ~note:admininstrT]) ~note:ty, + listE ([ caseE ([[atom_of_name "FRAME_" "admininstr"]], []) ~note:admininstrT]) ~note:ty, rhs ); returnI (Some (tupE [ @@ -64,7 +64,7 @@ let return_instrs_of_invoke config = letI (arity, len_expr); enterI ( frameE (Some (arity), frame) ~note:callframeT, - listE ([caseE2 ([[atom_of_name "FRAME_" "admininstr"]], []) ~note:admininstrT]) ~note:ty, + listE ([caseE ([[atom_of_name "FRAME_" "admininstr"]], []) ~note:admininstrT]) ~note:ty, rhs ); popI (iterE (value, ["val"], ListN (arity, None)) ~note:ty'); diff --git a/spectec/src/il2al/translate.ml b/spectec/src/il2al/translate.ml index 0b4ed04762..b48066cb55 100644 --- a/spectec/src/il2al/translate.ml +++ b/spectec/src/il2al/translate.ml @@ -254,7 +254,7 @@ and translate_exp exp = | [ []; [{it = Il.Semicolon; _}]; [] ], [ e1; e2 ] -> tupE [ translate_exp e1; translate_exp e2 ] ~at:at ~note:note | _, _ when List.length op = List.length exps + 1 -> - caseE2 (op, translate_argexp e) ~at:at ~note:note + caseE (op, translate_argexp e) ~at:at ~note:note | _ -> yetE (Il.Print.string_of_exp exp) ~at:at ~note:note ) | Il.UncaseE (e, op) -> @@ -318,7 +318,7 @@ let assert_cond_of_pop_value e = let at = e.at in let bt = boolT in match e.it with - | CaseE2 (op, [t; _]) -> + | CaseE (op, [t; _]) -> (match get_atom op with | Some {it = Il.Atom "CONST"; _} -> topValueE (Some t) ~note:bt | Some {it = Il.Atom "VCONST"; _} -> topValueE (Some t) ~note:bt @@ -349,13 +349,13 @@ let post_process_of_pop i = (match i.it with | PopI const -> (match const.it with - | CaseE2 (op, [ { it = CallE _; _ } as t; c]) -> + | CaseE (op, [ { it = CallE _; _ } as t; c]) -> (match (get_atom op) with | Some a -> let name = Il.Atom.name a in let var = if name = "CONST" then "nt_0" else "vt_0" in let t' = { t with it = VarE var } in - let const' = { const with it = CaseE2 (op, [t'; c]) } in + let const' = { const with it = CaseE (op, [t'; c]) } in let i' = { i with it = PopI const' } in [ letI (t', t) ], i' | None -> [], i) @@ -415,7 +415,7 @@ let rec translate_rhs exp = ) -> let exp1 = varE arity.it ~note:n1 in let exp2 = varE fid.it ~note:n2 in - let exp3 = caseE2 ([[atom]], []) ~note:note in + let exp3 = caseE ([[atom]], []) ~note:note in let note' = listT note in [ letI (varE "F" ~note:callframeT, frameE (Some (exp1), exp2) ~note:callframeT) ~at:at; @@ -429,7 +429,7 @@ let rec translate_rhs exp = let at' = e2.at in let note' = e2.note in let exp' = labelE (translate_exp arity, translate_exp e1) ~at:at ~note:labelT in - let exp'' = listE ([caseE2 ([[atom]], []) ~note:note]) ~at:at' ~note:note' in + let exp'' = listE ([caseE ([[atom]], []) ~note:note]) ~at:at' ~note:note' in match e2.it with | Il.CatE (ve, ie) -> [ @@ -753,7 +753,7 @@ and handle_special_lhs lhs rhs free_ids = [] )] (* Normal cases *) - | CaseE2 (op, es) -> + | CaseE (op, es) -> let tag = get_atom op |> Option.get in let bindings, es' = extract_non_names es in let rec inject_isCaseOf expr = @@ -766,12 +766,12 @@ and handle_special_lhs lhs rhs free_ids = | { it = Il.Atom _; _} -> [ ifI ( inject_isCaseOf rhs, - letI (caseE2 (op, es') ~at:lhs.at ~note:lhs.note, rhs) ~at:at + letI (caseE (op, es') ~at:lhs.at ~note:lhs.note, rhs) ~at:at :: translate_bindings free_ids bindings, [] )] | _ -> - letI (caseE2 (op, es') ~at:lhs.at ~note:lhs.note, rhs) ~at:at + letI (caseE (op, es') ~at:lhs.at ~note:lhs.note, rhs) ~at:at :: translate_bindings free_ids bindings) | ListE es -> let bindings, es' = extract_non_names es in diff --git a/spectec/src/il2al/transpile.ml b/spectec/src/il2al/transpile.ml index bf6a66cce5..3b6a0e1e8b 100644 --- a/spectec/src/il2al/transpile.ml +++ b/spectec/src/il2al/transpile.ml @@ -889,7 +889,7 @@ let remove_enter algo = match instr.it with | EnterI ( ({ it = FrameE (Some e_arity, _); _ } as e_frame), - { it = ListE ([ { it = CaseE2 ([[{ it = Atom.Atom "FRAME_"; _ }]], []); _ } ]); _ }, + { it = ListE ([ { it = CaseE ([[{ it = Atom.Atom "FRAME_"; _ }]], []); _ } ]); _ }, il) -> begin match e_arity.it with | NumE z when Z.to_int z = 0 -> @@ -905,7 +905,7 @@ let remove_enter algo = end | EnterI ( ({ it = FrameE (None, _); _ } as e_frame), - { it = ListE ([ { it = CaseE2 ([[{ it = Atom.Atom "FRAME_"; _ }]], []); _ } ]); _ }, + { it = ListE ([ { it = CaseE ([[{ it = Atom.Atom "FRAME_"; _ }]], []); _ } ]); _ }, il) -> pushI e_frame ~at:instr.at :: il @ [ popI e_frame ~at:instr.at ] | _ -> [ instr ] @@ -913,7 +913,7 @@ let remove_enter algo = let enter_frame_to_push instr = match instr.it with - | EnterI (e_frame, { it = ListE ([ { it = CaseE2 ([[{ it = Atom.Atom "FRAME_"; _ }]], []); _ } ]); _ }, il) -> + | EnterI (e_frame, { it = ListE ([ { it = CaseE ([[{ it = Atom.Atom "FRAME_"; _ }]], []); _ } ]); _ }, il) -> pushI e_frame ~at:instr.at :: il | _ -> [ instr ] in @@ -922,12 +922,12 @@ let remove_enter algo = match instr.it with | EnterI ( e_label, - { it = CatE (e_instrs, { it = ListE ([ { it = CaseE2 ([[{ it = Atom.Atom "LABEL_"; _ }]], []); _ } ]); _ }); note; _ }, + { it = CatE (e_instrs, { it = ListE ([ { it = CaseE ([[{ it = Atom.Atom "LABEL_"; _ }]], []); _ } ]); _ }); note; _ }, [ { it = PushI e_vals; _ } ]) -> enterI (e_label, catE (e_vals, e_instrs) ~note:note, []) ~at:instr.at | EnterI ( e_label, - { it = CatE (e_instrs, { it = ListE ([ { it = CaseE2 ([[{ it = Atom.Atom "LABEL_"; _ }]], []); _ } ]); _ }); _ }, + { it = CatE (e_instrs, { it = ListE ([ { it = CaseE ([[{ it = Atom.Atom "LABEL_"; _ }]], []); _ } ]); _ }); _ }, []) -> enterI (e_label, e_instrs, []) ~at:instr.at | _ -> instr From 0d152aab29d6d737997e375e619d962225c9ceee Mon Sep 17 00:00:00 2001 From: 702fbtngus <702fbtngus@kaist.ac.kr> Date: Fri, 16 Aug 2024 18:19:23 +0900 Subject: [PATCH 20/26] Fix check_inv_call function --- spectec/src/al/valid.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spectec/src/al/valid.ml b/spectec/src/al/valid.ml index 70ac3bb124..463285ec56 100644 --- a/spectec/src/al/valid.ml +++ b/spectec/src/al/valid.ml @@ -302,10 +302,12 @@ let check_inv_call source id indices args result_typ = let merge_args args idx = let free_args, bound_args, merged_args = args in if Option.is_some idx then - let new_free_args, first_free_arg = Lib.List.split_last free_args in + ( + let first_free_arg, new_free_args = Lib.List.split_hd free_args in (new_free_args, bound_args, first_free_arg :: merged_args) + ) else - let new_bound_args,first_bound_arg = Lib.List.split_last free_args in + let first_bound_arg, new_bound_args = Lib.List.split_hd bound_args in (free_args, new_bound_args, first_bound_arg :: merged_args) in let _, _, merged_args = List.fold_left merge_args (free_args, bound_args, []) indices in From 1727a1ad119ab350a892877d5ef192d64849e030 Mon Sep 17 00:00:00 2001 From: 702fbtngus <702fbtngus@kaist.ac.kr> Date: Fri, 16 Aug 2024 18:33:26 +0900 Subject: [PATCH 21/26] Fix check_inv_call function again --- spectec/src/al/valid.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spectec/src/al/valid.ml b/spectec/src/al/valid.ml index 463285ec56..1ff0e3f434 100644 --- a/spectec/src/al/valid.ml +++ b/spectec/src/al/valid.ml @@ -304,11 +304,11 @@ let check_inv_call source id indices args result_typ = if Option.is_some idx then ( let first_free_arg, new_free_args = Lib.List.split_hd free_args in - (new_free_args, bound_args, first_free_arg :: merged_args) + (new_free_args, bound_args, merged_args @ [first_free_arg]) ) else let first_bound_arg, new_bound_args = Lib.List.split_hd bound_args in - (free_args, new_bound_args, first_bound_arg :: merged_args) + (free_args, new_bound_args, merged_args @ [first_bound_arg]) in let _, _, merged_args = List.fold_left merge_args (free_args, bound_args, []) indices in From 487d7d76006dc39b2a0b611191acd44a0986e5ae Mon Sep 17 00:00:00 2001 From: Wonho Date: Mon, 19 Aug 2024 11:15:08 +0900 Subject: [PATCH 22/26] Minor refactor --- spectec/src/al/valid.ml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/spectec/src/al/valid.ml b/spectec/src/al/valid.ml index 1ff0e3f434..84ea5077f9 100644 --- a/spectec/src/al/valid.ml +++ b/spectec/src/al/valid.ml @@ -296,24 +296,28 @@ let check_inv_call source id indices args result_typ = let free_args = List.map typ2arg typs in (* Pop last arg from args *) + (* TODO: Not just last argument *) let bound_args, last_arg = Lib.List.split_last args in (* Merge free args and bound args *) - let merge_args args idx = + let merge_args idx args = let free_args, bound_args, merged_args = args in if Option.is_some idx then - ( - let first_free_arg, new_free_args = Lib.List.split_hd free_args in - (new_free_args, bound_args, merged_args @ [first_free_arg]) - ) + let new_free_args, last_free_arg = Lib.List.split_last free_args in + new_free_args, bound_args, last_free_arg :: merged_args else - let first_bound_arg, new_bound_args = Lib.List.split_hd bound_args in - (free_args, new_bound_args, merged_args @ [first_bound_arg]) + let new_bound_args, last_bound_arg = Lib.List.split_last bound_args in + free_args, new_bound_args, last_bound_arg :: merged_args + in + let free_args', _, merged_args = + List.fold_right merge_args indices (free_args, bound_args, []) in - let _, _, merged_args = List.fold_left merge_args (free_args, bound_args, []) indices in + (* TODO: Use error function *) + assert (List.length free_args' = 0); (* Set new result typ as the last element of args *) - let new_result_typ = match last_arg.it with + let new_result_typ = + match last_arg.it with | ExpA exp -> exp.note | a -> error_valid (Printf.sprintf "wrong free argument: %s" (Print.string_of_arg (a $ no_region))) source "" in From 37478086ef8c40c11d2bbc1015f57e8bff1ed412 Mon Sep 17 00:00:00 2001 From: Wonho Date: Mon, 19 Aug 2024 13:41:38 +0900 Subject: [PATCH 23/26] Use typ in AL expression --- spectec/src/al/ast.ml | 4 ++-- spectec/src/al/eq.ml | 4 ++-- spectec/src/al/print.ml | 7 ++++--- spectec/src/al/print.mli | 1 + spectec/src/backend-interpreter/interpreter.ml | 4 ++-- spectec/src/backend-prose/print.ml | 2 +- spectec/src/backend-prose/render.ml | 2 +- spectec/src/il2al/translate.ml | 4 ++-- 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/spectec/src/al/ast.ml b/spectec/src/al/ast.ml index 41e596df68..9ee294c79b 100644 --- a/spectec/src/al/ast.ml +++ b/spectec/src/al/ast.ml @@ -114,7 +114,7 @@ and expr' = | IsDefinedE of expr (* expr is defined *) | MatchE of expr * expr (* expr matches expr *) (* TODO: use typ *) - | HasTypeE of expr * string (* the type of expr is ty *) + | HasTypeE of expr * typ (* the type of expr is ty *) | TopFrameE (* "a frame is now on the top of the stack" *) | TopLabelE (* "a label is now on the top of the stack" *) (* Conditions used in assertions *) @@ -122,7 +122,7 @@ and expr' = | TopValuesE of expr (* "at least expr number of values on the top of the stack" *) (* Administrative Instructions *) (* TODO: use typ *) - | SubE of id * string (* varid, with specific type *) + | SubE of id * typ (* varid, with specific type *) | YetE of string (* for future not yet implemented feature *) and path = path' phrase diff --git a/spectec/src/al/eq.ml b/spectec/src/al/eq.ml index d0f38db959..00e5340a57 100644 --- a/spectec/src/al/eq.ml +++ b/spectec/src/al/eq.ml @@ -47,12 +47,12 @@ let rec eq_expr e1 e2 = | ContextKindE (a1, e1), ContextKindE (a2, e2) -> El.Atom.eq a1 a2 && eq_expr e1 e2 | IsDefinedE e1, IsDefinedE e2 -> eq_expr e1 e2 | MatchE (e11, e12), MatchE (e21, e22) -> eq_expr e11 e21 && eq_expr e12 e22 - | HasTypeE (e1, t1), HasTypeE (e2, t2) -> eq_expr e1 e2 && t1 = t2 + | HasTypeE (e1, t1), HasTypeE (e2, t2) -> eq_expr e1 e2 && Il.Eq.eq_typ t1 t2 | TopLabelE, TopLabelE | TopFrameE, TopFrameE -> true | TopValueE eo1, TopValueE eo2 -> eq_expr_opt eo1 eo2 | TopValuesE e1, TopValuesE e2 -> eq_expr e1 e2 - | SubE (i1, t1), SubE (i2, t2) -> i1 = i2 && t1 = t2 + | SubE (i1, t1), SubE (i2, t2) -> i1 = i2 && Il.Eq.eq_typ t1 t2 | YetE s1, YetE s2 -> s1 = s2 | _ -> false diff --git a/spectec/src/al/print.ml b/spectec/src/al/print.ml index 8c3b0068e2..a444afc1f2 100644 --- a/spectec/src/al/print.ml +++ b/spectec/src/al/print.ml @@ -197,7 +197,7 @@ and string_of_expr expr = | ContextKindE (a, e) -> sprintf "%s == %s" (string_of_expr e) (string_of_atom a) | IsDefinedE e -> sprintf "%s != None" (string_of_expr e) | IsCaseOfE (e, a) -> sprintf "case(%s) == %s" (string_of_expr e) (string_of_atom a) - | HasTypeE (e, t) -> sprintf "type(%s) == %s" (string_of_expr e) t + | HasTypeE (e, t) -> sprintf "type(%s) == %s" (string_of_expr e) (string_of_typ t) | IsValidE e -> sprintf "valid(%s)" (string_of_expr e) | TopLabelE -> "top_label()" (* TODO: "type(top()) == label"*) @@ -494,7 +494,7 @@ and structured_string_of_expr expr = ^ structured_string_of_expr e2 ^ ")" | VarE id -> "VarE (" ^ id ^ ")" - | SubE (id, t) -> "SubE (" ^ id ^ "," ^ t ^ ")" + | SubE (id, t) -> sprintf "SubE (%s, %s)" id (string_of_typ t) | IterE (e, ids, iter) -> "IterE (" ^ structured_string_of_expr e @@ -511,7 +511,8 @@ and structured_string_of_expr expr = | ContextKindE (a, e) -> sprintf "ContextKindE (%s, %s)" (string_of_atom a) (structured_string_of_expr e) | IsDefinedE e -> "DefinedE (" ^ structured_string_of_expr e ^ ")" | IsCaseOfE (e, a) -> "CaseOfE (" ^ structured_string_of_expr e ^ ", " ^ string_of_atom a ^ ")" - | HasTypeE (e, t) -> "HasTypeE (" ^ structured_string_of_expr e ^ ", " ^ t ^ ")" + | HasTypeE (e, t) -> + sprintf "HasTypeE (%s, %s)" (structured_string_of_expr e) (string_of_typ t) | IsValidE e -> "IsValidE (" ^ structured_string_of_expr e ^ ")" | TopLabelE -> "TopLabelE" | TopFrameE -> "TopFrameE" diff --git a/spectec/src/al/print.mli b/spectec/src/al/print.mli index 2472f272f9..834fb56a4f 100644 --- a/spectec/src/al/print.mli +++ b/spectec/src/al/print.mli @@ -7,6 +7,7 @@ val string_of_value : value -> string val string_of_values : string -> value list -> string val string_of_iter : iter -> string val string_of_iters : iter list -> string +val string_of_typ : typ -> string val string_of_expr : expr -> string val string_of_path : path -> string val string_of_arg : arg -> string diff --git a/spectec/src/backend-interpreter/interpreter.ml b/spectec/src/backend-interpreter/interpreter.ml index 6c2675ec10..22b8c17779 100644 --- a/spectec/src/backend-interpreter/interpreter.ml +++ b/spectec/src/backend-interpreter/interpreter.ml @@ -379,11 +379,11 @@ and eval_expr env expr = | _ -> fail_expr expr "TODO: deferring validation to reference interpreter" ) - | HasTypeE (e, s) -> + | HasTypeE (e, t) -> (* TODO: This shouldn't be hardcoded *) (* check type *) let v = eval_expr env e in - check_type s v expr + check_type (string_of_typ t) v expr | MatchE (e1, e2) -> (* Deferred to reference interpreter *) let rt1 = e1 |> eval_expr env |> Construct.al_to_ref_type in diff --git a/spectec/src/backend-prose/print.ml b/spectec/src/backend-prose/print.ml index 5089df7fad..f55cc336a9 100644 --- a/spectec/src/backend-prose/print.ml +++ b/spectec/src/backend-prose/print.ml @@ -172,7 +172,7 @@ and string_of_expr expr = | ContextKindE (a, e) -> sprintf "%s is %s" (string_of_expr e) (string_of_atom a) | IsDefinedE e -> sprintf "%s is defined" (string_of_expr e) | IsCaseOfE (e, a) -> sprintf "%s is of the case %s" (string_of_expr e) (string_of_atom a) - | HasTypeE (e, t) -> sprintf "the type of %s is %s" (string_of_expr e) t + | HasTypeE (e, t) -> sprintf "the type of %s is %s" (string_of_expr e) (string_of_typ t) | IsValidE e -> sprintf "%s is valid" (string_of_expr e) | TopLabelE -> "a label is now on the top of the stack" | TopFrameE -> "a frame is now on the top of the stack" diff --git a/spectec/src/backend-prose/render.ml b/spectec/src/backend-prose/render.ml index 0ceeaadbfe..7d94b7f64b 100644 --- a/spectec/src/backend-prose/render.ml +++ b/spectec/src/backend-prose/render.ml @@ -444,7 +444,7 @@ and render_expr' env expr = sprintf "%s is of the case %s" se sa | Al.Ast.HasTypeE (e, t) -> let se = render_expr env e in - sprintf "the type of %s is %s" se t + sprintf "the type of %s is %s" se (Il.Print.string_of_typ t) | Al.Ast.IsValidE e -> let se = render_expr env e in sprintf "%s is valid" se diff --git a/spectec/src/il2al/translate.ml b/spectec/src/il2al/translate.ml index b48066cb55..5cec871927 100644 --- a/spectec/src/il2al/translate.ml +++ b/spectec/src/il2al/translate.ml @@ -133,7 +133,7 @@ and translate_exp exp = | Il.CatE (exp1, exp2) -> catE (translate_exp exp1, translate_exp exp2) ~at:at ~note:note (* Variable *) | Il.VarE id -> varE id.it ~at:at ~note:note - | Il.SubE ({ it = Il.VarE id; _}, { it = VarT (t, _); _ }, _) -> subE (id.it, t.it) ~at:at ~note:note + | Il.SubE ({ it = Il.VarE id; _}, t, _) -> subE (id.it, t) ~at:at ~note:note | Il.SubE (inner_exp, _, _) -> translate_exp inner_exp | Il.IterE (inner_exp, (iter, ids)) -> let names = List.map (fun (id, _) -> id.it) ids in @@ -1109,7 +1109,7 @@ let translate_context_winstr winstr = let translate_context ctx vs = let at = ctx.at in let ty = listT valT in - let e_vals = iterE (subE ("val", "val") ~note:valT, [ "val" ], List) ~note:ty in + let e_vals = iterE (subE ("val", valT) ~note:valT, [ "val" ], List) ~note:ty in let vs = List.rev vs in let instr_popall = popallI e_vals in let instr_pop_context = From 4c1a83160e9150b54f63707d50a5dcd80663480b Mon Sep 17 00:00:00 2001 From: 702fbtngus <702fbtngus@kaist.ac.kr> Date: Mon, 19 Aug 2024 15:41:56 +0900 Subject: [PATCH 24/26] Minor refactor --- spectec/src/al/valid.ml | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/spectec/src/al/valid.ml b/spectec/src/al/valid.ml index 84ea5077f9..23b2bfabe7 100644 --- a/spectec/src/al/valid.ml +++ b/spectec/src/al/valid.ml @@ -295,31 +295,37 @@ let check_inv_call source id indices args result_typ = let typ2arg typ = ExpA (VarE "" $$ no_region % typ) $ no_region in let free_args = List.map typ2arg typs in - (* Pop last arg from args *) - (* TODO: Not just last argument *) - let bound_args, last_arg = Lib.List.split_last args in - (* Merge free args and bound args *) - let merge_args idx args = + let merge_args args idx = let free_args, bound_args, merged_args = args in if Option.is_some idx then - let new_free_args, last_free_arg = Lib.List.split_last free_args in - new_free_args, bound_args, last_free_arg :: merged_args + let first_free_arg, new_free_args = Lib.List.split_hd free_args in + new_free_args, bound_args, merged_args @ [first_free_arg] else - let new_bound_args, last_bound_arg = Lib.List.split_last bound_args in - free_args, new_bound_args, last_bound_arg :: merged_args + let first_bound_arg, new_bound_args = Lib.List.split_hd bound_args in + free_args, new_bound_args, merged_args @ [first_bound_arg] in - let free_args', _, merged_args = - List.fold_right merge_args indices (free_args, bound_args, []) + let free_args', result_args, merged_args = + List.fold_left merge_args (free_args, args, []) indices in (* TODO: Use error function *) assert (List.length free_args' = 0); - (* Set new result typ as the last element of args *) + (* Set new result typ from the last elements of args *) let new_result_typ = - match last_arg.it with + match result_args with + | [arg] -> ( + match arg.it with | ExpA exp -> exp.note - | a -> error_valid (Printf.sprintf "wrong free argument: %s" (Print.string_of_arg (a $ no_region))) source "" + | a -> error_valid (Printf.sprintf "wrong result argument: %s" (Print.string_of_arg (a $ no_region))) source "" + ) + | _ -> + let arg2typ arg = ( + match arg.it with + | ExpA exp -> (Il.Ast.VarE ("" $ no_region) $$ no_region % exp.note, exp.note) + | a -> error_valid (Printf.sprintf "wrong result argument: %s" (Print.string_of_arg (a $ no_region))) source "" + ) in + TupT (List.map arg2typ result_args) $ no_region in check_call source id merged_args new_result_typ From d3ec1a707935363472ed0d2e85db277ccc91d5c8 Mon Sep 17 00:00:00 2001 From: presenthee Date: Tue, 20 Aug 2024 13:49:21 +0900 Subject: [PATCH 25/26] Minor change --- spectec/src/il2al/translate.ml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spectec/src/il2al/translate.ml b/spectec/src/il2al/translate.ml index 5cec871927..8a2fc6e3a5 100644 --- a/spectec/src/il2al/translate.ml +++ b/spectec/src/il2al/translate.ml @@ -246,11 +246,9 @@ and translate_exp exp = (* Constructor *) (* TODO: Need a better way to convert these CaseE into ConstructE *) (* TODO: type *) - | [ [{it = Il.LBrack; _}]; [{it = Il.Dot2; _}]; [{it = Il.RBrack; _}] ], [ e1; e2 ] -> - tupE [ translate_exp e1; translate_exp e2 ] ~at:at ~note:note | [ []; [] ], [ e1 ] -> translate_exp e1 - | [ []; []; [] ], [ e1; e2 ] -> - tupE [ translate_exp e1; translate_exp e2 ] ~at:at ~note:note + | [ []; []; [] ], [ e1; e2 ] + | [ [{it = Il.LBrack; _}]; [{it = Il.Dot2; _}]; [{it = Il.RBrack; _}] ], [ e1; e2 ] | [ []; [{it = Il.Semicolon; _}]; [] ], [ e1; e2 ] -> tupE [ translate_exp e1; translate_exp e2 ] ~at:at ~note:note | _, _ when List.length op = List.length exps + 1 -> From 690e379f9588cc59cefa37eec422d09e4c25197a Mon Sep 17 00:00:00 2001 From: Wonho Date: Tue, 20 Aug 2024 13:52:47 +0900 Subject: [PATCH 26/26] Fix al validation --- spectec/src/al/valid.ml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/spectec/src/al/valid.ml b/spectec/src/al/valid.ml index 23b2bfabe7..ca8361ffab 100644 --- a/spectec/src/al/valid.ml +++ b/spectec/src/al/valid.ml @@ -405,16 +405,15 @@ let valid_expr (walker: unit_walker) (expr: expr) : unit = ) | OptE expr_opt -> check_opt source expr.note; - (match expr_opt with - | Some expr' -> check_match source expr.note (iterT expr'.note Opt) - | None -> () - ) - | ListE [] -> check_list source expr.note - | ListE (h :: t) -> + Option.iter + (fun expr' -> check_match source expr.note (iterT expr'.note Opt)) + expr_opt + | ListE l -> check_list source expr.note; - t + let elem_typ = unwrap_iter_typ expr.note in + l |> List.map note - |> List.iter (check_match source h.note) + |> List.iter (check_match source elem_typ) | ArityE expr1 -> check_num source expr.note; check_context source expr1.note | FrameE (expr_opt, expr1) ->